Version 2.12.0-267.0.dev

Merge commit '10abe4edab923105fe71081dc4e518fa48a1f97e' into 'dev'
diff --git a/runtime/tests/vm/dart/sdk_hash_test.dart b/runtime/tests/vm/dart/sdk_hash_test.dart
index 0ad4dba..a795208 100644
--- a/runtime/tests/vm/dart/sdk_hash_test.dart
+++ b/runtime/tests/vm/dart/sdk_hash_test.dart
@@ -31,11 +31,12 @@
       final result = await Process.run(dart, [
         '--snapshot-kind=kernel',
         '--snapshot=$dillPath',
+        '--verbosity=warning',
         sourcePath,
       ]);
       Expect.equals('', result.stderr);
       Expect.equals(0, result.exitCode);
-      Expect.equals('$unsoundNullSafetyMessage\n', result.stdout);
+      Expect.equals('', result.stdout);
     }
 
     {
diff --git a/runtime/tests/vm/dart/snapshot_test_helper.dart b/runtime/tests/vm/dart/snapshot_test_helper.dart
index 28e5c47..80dcb77 100644
--- a/runtime/tests/vm/dart/snapshot_test_helper.dart
+++ b/runtime/tests/vm/dart/snapshot_test_helper.dart
@@ -130,12 +130,6 @@
     final snapshot1Path = p.join(temp, 'snapshot1');
     final snapshot2Path = p.join(temp, 'snapshot2');
 
-    if (expectedStdout.isEmpty) {
-      expectedStdout = nullSafetyMessage;
-    } else {
-      expectedStdout = '$nullSafetyMessage\n$expectedStdout';
-    }
-
     print("Version ${Platform.version}");
 
     final generate1Result = await runDart('GENERATE SNAPSHOT 1', [
@@ -144,6 +138,7 @@
       '--trace_type_finalization',
       '--trace_compiler',
       '--verbose_gc',
+      '--verbosity=warning',
       '--snapshot=$snapshot1Path',
       '--snapshot-kind=$snapshotKind',
       Platform.script.toFilePath(),
@@ -157,6 +152,7 @@
       '--trace_type_finalization',
       '--trace_compiler',
       '--verbose_gc',
+      '--verbosity=warning',
       '--snapshot=$snapshot2Path',
       '--snapshot-kind=$snapshotKind',
       Platform.script.toFilePath(),
@@ -189,18 +185,12 @@
     final trainingResult = await runDart('TRAINING RUN', [
       '--snapshot=$snapshotPath',
       '--snapshot-kind=app-jit',
+      '--verbosity=warning',
       testPath,
       '--train'
     ]);
-    expectOutput("$nullSafetyMessage\nOK(Trained)", trainingResult);
+    expectOutput("OK(Trained)", trainingResult);
     final runResult = await runSnapshot!(snapshotPath);
     expectOutput("OK(Run)", runResult);
   });
 }
-
-final String nullSafetyMessage =
-    hasSoundNullSafety ? soundNullSafetyMessage : unsoundNullSafetyMessage;
-
-const String soundNullSafetyMessage = 'Info: Compiling with sound null safety';
-const String unsoundNullSafetyMessage =
-    'Info: Compiling without sound null safety';
diff --git a/runtime/tests/vm/dart_2/sdk_hash_test.dart b/runtime/tests/vm/dart_2/sdk_hash_test.dart
index 40f245d..5030445 100644
--- a/runtime/tests/vm/dart_2/sdk_hash_test.dart
+++ b/runtime/tests/vm/dart_2/sdk_hash_test.dart
@@ -29,13 +29,14 @@
 
     {
       final result = await Process.run(dart, [
+        '--verbosity=warning',
         '--snapshot-kind=kernel',
         '--snapshot=$dillPath',
         sourcePath,
       ]);
       Expect.equals('', result.stderr);
       Expect.equals(0, result.exitCode);
-      Expect.equals('$unsoundNullSafetyMessage\n', result.stdout);
+      Expect.equals('', result.stdout);
     }
 
     {
diff --git a/runtime/tests/vm/dart_2/snapshot_test_helper.dart b/runtime/tests/vm/dart_2/snapshot_test_helper.dart
index ae68005..de92dad 100644
--- a/runtime/tests/vm/dart_2/snapshot_test_helper.dart
+++ b/runtime/tests/vm/dart_2/snapshot_test_helper.dart
@@ -130,12 +130,6 @@
     final snapshot1Path = p.join(temp, 'snapshot1');
     final snapshot2Path = p.join(temp, 'snapshot2');
 
-    if (expectedStdout.isEmpty) {
-      expectedStdout = unsoundNullSafetyMessage;
-    } else {
-      expectedStdout = '$unsoundNullSafetyMessage\n$expectedStdout';
-    }
-
     print("Version ${Platform.version}");
 
     final generate1Result = await runDart('GENERATE SNAPSHOT 1', [
@@ -144,6 +138,7 @@
       '--trace_type_finalization',
       '--trace_compiler',
       '--verbose_gc',
+      '--verbosity=warning',
       '--snapshot=$snapshot1Path',
       '--snapshot-kind=$snapshotKind',
       Platform.script.toFilePath(),
@@ -157,6 +152,7 @@
       '--trace_type_finalization',
       '--trace_compiler',
       '--verbose_gc',
+      '--verbosity=warning',
       '--snapshot=$snapshot2Path',
       '--snapshot-kind=$snapshotKind',
       Platform.script.toFilePath(),
@@ -189,14 +185,12 @@
     final trainingResult = await runDart('TRAINING RUN', [
       '--snapshot=$snapshotPath',
       '--snapshot-kind=app-jit',
+      '--verbosity=warning',
       testPath,
       '--train'
     ]);
-    expectOutput("$unsoundNullSafetyMessage\nOK(Trained)", trainingResult);
+    expectOutput("OK(Trained)", trainingResult);
     final runResult = await runSnapshot(snapshotPath);
     expectOutput("OK(Run)", runResult);
   });
 }
-
-const String unsoundNullSafetyMessage =
-    'Info: Compiling without sound null safety';
diff --git a/tests/ffi/function_callbacks_structs_by_value_generated_test.dart b/tests/ffi/function_callbacks_structs_by_value_generated_test.dart
index 785f03a..8fa5b93 100644
--- a/tests/ffi/function_callbacks_structs_by_value_generated_test.dart
+++ b/tests/ffi/function_callbacks_structs_by_value_generated_test.dart
@@ -5242,14 +5242,15 @@
 int returnStruct1ByteInt_a0 = 0;
 
 // Result variable also global, so we can delete it after the callback.
-Struct1ByteInt returnStruct1ByteIntResult = Struct1ByteInt();
+Pointer<Struct1ByteInt> returnStruct1ByteIntResultPointer = nullptr;
 
 Struct1ByteInt returnStruct1ByteIntCalculateResult() {
-  Struct1ByteInt result = calloc<Struct1ByteInt>().ref;
+  final resultPointer = calloc<Struct1ByteInt>();
+  final result = resultPointer.ref;
 
   result.a0 = returnStruct1ByteInt_a0;
 
-  returnStruct1ByteIntResult = result;
+  returnStruct1ByteIntResultPointer = resultPointer;
 
   return result;
 }
@@ -5276,13 +5277,13 @@
 }
 
 void returnStruct1ByteIntAfterCallback() {
-  calloc.free(returnStruct1ByteIntResult.addressOf);
+  calloc.free(returnStruct1ByteIntResultPointer);
 
   final result = returnStruct1ByteIntCalculateResult();
 
   print("after callback result = $result");
 
-  calloc.free(returnStruct1ByteIntResult.addressOf);
+  calloc.free(returnStruct1ByteIntResultPointer);
 }
 
 typedef ReturnStruct3BytesHomogeneousUint8Type = Struct3BytesHomogeneousUint8
@@ -5294,19 +5295,19 @@
 int returnStruct3BytesHomogeneousUint8_a2 = 0;
 
 // Result variable also global, so we can delete it after the callback.
-Struct3BytesHomogeneousUint8 returnStruct3BytesHomogeneousUint8Result =
-    Struct3BytesHomogeneousUint8();
+Pointer<Struct3BytesHomogeneousUint8>
+    returnStruct3BytesHomogeneousUint8ResultPointer = nullptr;
 
 Struct3BytesHomogeneousUint8
     returnStruct3BytesHomogeneousUint8CalculateResult() {
-  Struct3BytesHomogeneousUint8 result =
-      calloc<Struct3BytesHomogeneousUint8>().ref;
+  final resultPointer = calloc<Struct3BytesHomogeneousUint8>();
+  final result = resultPointer.ref;
 
   result.a0 = returnStruct3BytesHomogeneousUint8_a0;
   result.a1 = returnStruct3BytesHomogeneousUint8_a1;
   result.a2 = returnStruct3BytesHomogeneousUint8_a2;
 
-  returnStruct3BytesHomogeneousUint8Result = result;
+  returnStruct3BytesHomogeneousUint8ResultPointer = resultPointer;
 
   return result;
 }
@@ -5336,13 +5337,13 @@
 }
 
 void returnStruct3BytesHomogeneousUint8AfterCallback() {
-  calloc.free(returnStruct3BytesHomogeneousUint8Result.addressOf);
+  calloc.free(returnStruct3BytesHomogeneousUint8ResultPointer);
 
   final result = returnStruct3BytesHomogeneousUint8CalculateResult();
 
   print("after callback result = $result");
 
-  calloc.free(returnStruct3BytesHomogeneousUint8Result.addressOf);
+  calloc.free(returnStruct3BytesHomogeneousUint8ResultPointer);
 }
 
 typedef ReturnStruct3BytesInt2ByteAlignedType = Struct3BytesInt2ByteAligned
@@ -5353,17 +5354,17 @@
 int returnStruct3BytesInt2ByteAligned_a1 = 0;
 
 // Result variable also global, so we can delete it after the callback.
-Struct3BytesInt2ByteAligned returnStruct3BytesInt2ByteAlignedResult =
-    Struct3BytesInt2ByteAligned();
+Pointer<Struct3BytesInt2ByteAligned>
+    returnStruct3BytesInt2ByteAlignedResultPointer = nullptr;
 
 Struct3BytesInt2ByteAligned returnStruct3BytesInt2ByteAlignedCalculateResult() {
-  Struct3BytesInt2ByteAligned result =
-      calloc<Struct3BytesInt2ByteAligned>().ref;
+  final resultPointer = calloc<Struct3BytesInt2ByteAligned>();
+  final result = resultPointer.ref;
 
   result.a0 = returnStruct3BytesInt2ByteAligned_a0;
   result.a1 = returnStruct3BytesInt2ByteAligned_a1;
 
-  returnStruct3BytesInt2ByteAlignedResult = result;
+  returnStruct3BytesInt2ByteAlignedResultPointer = resultPointer;
 
   return result;
 }
@@ -5392,13 +5393,13 @@
 }
 
 void returnStruct3BytesInt2ByteAlignedAfterCallback() {
-  calloc.free(returnStruct3BytesInt2ByteAlignedResult.addressOf);
+  calloc.free(returnStruct3BytesInt2ByteAlignedResultPointer);
 
   final result = returnStruct3BytesInt2ByteAlignedCalculateResult();
 
   print("after callback result = $result");
 
-  calloc.free(returnStruct3BytesInt2ByteAlignedResult.addressOf);
+  calloc.free(returnStruct3BytesInt2ByteAlignedResultPointer);
 }
 
 typedef ReturnStruct4BytesHomogeneousInt16Type = Struct4BytesHomogeneousInt16
@@ -5409,18 +5410,18 @@
 int returnStruct4BytesHomogeneousInt16_a1 = 0;
 
 // Result variable also global, so we can delete it after the callback.
-Struct4BytesHomogeneousInt16 returnStruct4BytesHomogeneousInt16Result =
-    Struct4BytesHomogeneousInt16();
+Pointer<Struct4BytesHomogeneousInt16>
+    returnStruct4BytesHomogeneousInt16ResultPointer = nullptr;
 
 Struct4BytesHomogeneousInt16
     returnStruct4BytesHomogeneousInt16CalculateResult() {
-  Struct4BytesHomogeneousInt16 result =
-      calloc<Struct4BytesHomogeneousInt16>().ref;
+  final resultPointer = calloc<Struct4BytesHomogeneousInt16>();
+  final result = resultPointer.ref;
 
   result.a0 = returnStruct4BytesHomogeneousInt16_a0;
   result.a1 = returnStruct4BytesHomogeneousInt16_a1;
 
-  returnStruct4BytesHomogeneousInt16Result = result;
+  returnStruct4BytesHomogeneousInt16ResultPointer = resultPointer;
 
   return result;
 }
@@ -5449,13 +5450,13 @@
 }
 
 void returnStruct4BytesHomogeneousInt16AfterCallback() {
-  calloc.free(returnStruct4BytesHomogeneousInt16Result.addressOf);
+  calloc.free(returnStruct4BytesHomogeneousInt16ResultPointer);
 
   final result = returnStruct4BytesHomogeneousInt16CalculateResult();
 
   print("after callback result = $result");
 
-  calloc.free(returnStruct4BytesHomogeneousInt16Result.addressOf);
+  calloc.free(returnStruct4BytesHomogeneousInt16ResultPointer);
 }
 
 typedef ReturnStruct7BytesHomogeneousUint8Type = Struct7BytesHomogeneousUint8
@@ -5471,13 +5472,13 @@
 int returnStruct7BytesHomogeneousUint8_a6 = 0;
 
 // Result variable also global, so we can delete it after the callback.
-Struct7BytesHomogeneousUint8 returnStruct7BytesHomogeneousUint8Result =
-    Struct7BytesHomogeneousUint8();
+Pointer<Struct7BytesHomogeneousUint8>
+    returnStruct7BytesHomogeneousUint8ResultPointer = nullptr;
 
 Struct7BytesHomogeneousUint8
     returnStruct7BytesHomogeneousUint8CalculateResult() {
-  Struct7BytesHomogeneousUint8 result =
-      calloc<Struct7BytesHomogeneousUint8>().ref;
+  final resultPointer = calloc<Struct7BytesHomogeneousUint8>();
+  final result = resultPointer.ref;
 
   result.a0 = returnStruct7BytesHomogeneousUint8_a0;
   result.a1 = returnStruct7BytesHomogeneousUint8_a1;
@@ -5487,7 +5488,7 @@
   result.a5 = returnStruct7BytesHomogeneousUint8_a5;
   result.a6 = returnStruct7BytesHomogeneousUint8_a6;
 
-  returnStruct7BytesHomogeneousUint8Result = result;
+  returnStruct7BytesHomogeneousUint8ResultPointer = resultPointer;
 
   return result;
 }
@@ -5522,13 +5523,13 @@
 }
 
 void returnStruct7BytesHomogeneousUint8AfterCallback() {
-  calloc.free(returnStruct7BytesHomogeneousUint8Result.addressOf);
+  calloc.free(returnStruct7BytesHomogeneousUint8ResultPointer);
 
   final result = returnStruct7BytesHomogeneousUint8CalculateResult();
 
   print("after callback result = $result");
 
-  calloc.free(returnStruct7BytesHomogeneousUint8Result.addressOf);
+  calloc.free(returnStruct7BytesHomogeneousUint8ResultPointer);
 }
 
 typedef ReturnStruct7BytesInt4ByteAlignedType = Struct7BytesInt4ByteAligned
@@ -5540,18 +5541,18 @@
 int returnStruct7BytesInt4ByteAligned_a2 = 0;
 
 // Result variable also global, so we can delete it after the callback.
-Struct7BytesInt4ByteAligned returnStruct7BytesInt4ByteAlignedResult =
-    Struct7BytesInt4ByteAligned();
+Pointer<Struct7BytesInt4ByteAligned>
+    returnStruct7BytesInt4ByteAlignedResultPointer = nullptr;
 
 Struct7BytesInt4ByteAligned returnStruct7BytesInt4ByteAlignedCalculateResult() {
-  Struct7BytesInt4ByteAligned result =
-      calloc<Struct7BytesInt4ByteAligned>().ref;
+  final resultPointer = calloc<Struct7BytesInt4ByteAligned>();
+  final result = resultPointer.ref;
 
   result.a0 = returnStruct7BytesInt4ByteAligned_a0;
   result.a1 = returnStruct7BytesInt4ByteAligned_a1;
   result.a2 = returnStruct7BytesInt4ByteAligned_a2;
 
-  returnStruct7BytesInt4ByteAlignedResult = result;
+  returnStruct7BytesInt4ByteAlignedResultPointer = resultPointer;
 
   return result;
 }
@@ -5582,13 +5583,13 @@
 }
 
 void returnStruct7BytesInt4ByteAlignedAfterCallback() {
-  calloc.free(returnStruct7BytesInt4ByteAlignedResult.addressOf);
+  calloc.free(returnStruct7BytesInt4ByteAlignedResultPointer);
 
   final result = returnStruct7BytesInt4ByteAlignedCalculateResult();
 
   print("after callback result = $result");
 
-  calloc.free(returnStruct7BytesInt4ByteAlignedResult.addressOf);
+  calloc.free(returnStruct7BytesInt4ByteAlignedResultPointer);
 }
 
 typedef ReturnStruct8BytesIntType = Struct8BytesInt Function(
@@ -5600,16 +5601,17 @@
 int returnStruct8BytesInt_a2 = 0;
 
 // Result variable also global, so we can delete it after the callback.
-Struct8BytesInt returnStruct8BytesIntResult = Struct8BytesInt();
+Pointer<Struct8BytesInt> returnStruct8BytesIntResultPointer = nullptr;
 
 Struct8BytesInt returnStruct8BytesIntCalculateResult() {
-  Struct8BytesInt result = calloc<Struct8BytesInt>().ref;
+  final resultPointer = calloc<Struct8BytesInt>();
+  final result = resultPointer.ref;
 
   result.a0 = returnStruct8BytesInt_a0;
   result.a1 = returnStruct8BytesInt_a1;
   result.a2 = returnStruct8BytesInt_a2;
 
-  returnStruct8BytesIntResult = result;
+  returnStruct8BytesIntResultPointer = resultPointer;
 
   return result;
 }
@@ -5638,13 +5640,13 @@
 }
 
 void returnStruct8BytesIntAfterCallback() {
-  calloc.free(returnStruct8BytesIntResult.addressOf);
+  calloc.free(returnStruct8BytesIntResultPointer);
 
   final result = returnStruct8BytesIntCalculateResult();
 
   print("after callback result = $result");
 
-  calloc.free(returnStruct8BytesIntResult.addressOf);
+  calloc.free(returnStruct8BytesIntResultPointer);
 }
 
 typedef ReturnStruct8BytesHomogeneousFloatType = Struct8BytesHomogeneousFloat
@@ -5655,18 +5657,18 @@
 double returnStruct8BytesHomogeneousFloat_a1 = 0.0;
 
 // Result variable also global, so we can delete it after the callback.
-Struct8BytesHomogeneousFloat returnStruct8BytesHomogeneousFloatResult =
-    Struct8BytesHomogeneousFloat();
+Pointer<Struct8BytesHomogeneousFloat>
+    returnStruct8BytesHomogeneousFloatResultPointer = nullptr;
 
 Struct8BytesHomogeneousFloat
     returnStruct8BytesHomogeneousFloatCalculateResult() {
-  Struct8BytesHomogeneousFloat result =
-      calloc<Struct8BytesHomogeneousFloat>().ref;
+  final resultPointer = calloc<Struct8BytesHomogeneousFloat>();
+  final result = resultPointer.ref;
 
   result.a0 = returnStruct8BytesHomogeneousFloat_a0;
   result.a1 = returnStruct8BytesHomogeneousFloat_a1;
 
-  returnStruct8BytesHomogeneousFloatResult = result;
+  returnStruct8BytesHomogeneousFloatResultPointer = resultPointer;
 
   return result;
 }
@@ -5695,13 +5697,13 @@
 }
 
 void returnStruct8BytesHomogeneousFloatAfterCallback() {
-  calloc.free(returnStruct8BytesHomogeneousFloatResult.addressOf);
+  calloc.free(returnStruct8BytesHomogeneousFloatResultPointer);
 
   final result = returnStruct8BytesHomogeneousFloatCalculateResult();
 
   print("after callback result = $result");
 
-  calloc.free(returnStruct8BytesHomogeneousFloatResult.addressOf);
+  calloc.free(returnStruct8BytesHomogeneousFloatResultPointer);
 }
 
 typedef ReturnStruct8BytesMixedType = Struct8BytesMixed Function(
@@ -5713,16 +5715,17 @@
 int returnStruct8BytesMixed_a2 = 0;
 
 // Result variable also global, so we can delete it after the callback.
-Struct8BytesMixed returnStruct8BytesMixedResult = Struct8BytesMixed();
+Pointer<Struct8BytesMixed> returnStruct8BytesMixedResultPointer = nullptr;
 
 Struct8BytesMixed returnStruct8BytesMixedCalculateResult() {
-  Struct8BytesMixed result = calloc<Struct8BytesMixed>().ref;
+  final resultPointer = calloc<Struct8BytesMixed>();
+  final result = resultPointer.ref;
 
   result.a0 = returnStruct8BytesMixed_a0;
   result.a1 = returnStruct8BytesMixed_a1;
   result.a2 = returnStruct8BytesMixed_a2;
 
-  returnStruct8BytesMixedResult = result;
+  returnStruct8BytesMixedResultPointer = resultPointer;
 
   return result;
 }
@@ -5751,13 +5754,13 @@
 }
 
 void returnStruct8BytesMixedAfterCallback() {
-  calloc.free(returnStruct8BytesMixedResult.addressOf);
+  calloc.free(returnStruct8BytesMixedResultPointer);
 
   final result = returnStruct8BytesMixedCalculateResult();
 
   print("after callback result = $result");
 
-  calloc.free(returnStruct8BytesMixedResult.addressOf);
+  calloc.free(returnStruct8BytesMixedResultPointer);
 }
 
 typedef ReturnStruct9BytesHomogeneousUint8Type = Struct9BytesHomogeneousUint8
@@ -5775,13 +5778,13 @@
 int returnStruct9BytesHomogeneousUint8_a8 = 0;
 
 // Result variable also global, so we can delete it after the callback.
-Struct9BytesHomogeneousUint8 returnStruct9BytesHomogeneousUint8Result =
-    Struct9BytesHomogeneousUint8();
+Pointer<Struct9BytesHomogeneousUint8>
+    returnStruct9BytesHomogeneousUint8ResultPointer = nullptr;
 
 Struct9BytesHomogeneousUint8
     returnStruct9BytesHomogeneousUint8CalculateResult() {
-  Struct9BytesHomogeneousUint8 result =
-      calloc<Struct9BytesHomogeneousUint8>().ref;
+  final resultPointer = calloc<Struct9BytesHomogeneousUint8>();
+  final result = resultPointer.ref;
 
   result.a0 = returnStruct9BytesHomogeneousUint8_a0;
   result.a1 = returnStruct9BytesHomogeneousUint8_a1;
@@ -5793,7 +5796,7 @@
   result.a7 = returnStruct9BytesHomogeneousUint8_a7;
   result.a8 = returnStruct9BytesHomogeneousUint8_a8;
 
-  returnStruct9BytesHomogeneousUint8Result = result;
+  returnStruct9BytesHomogeneousUint8ResultPointer = resultPointer;
 
   return result;
 }
@@ -5832,13 +5835,13 @@
 }
 
 void returnStruct9BytesHomogeneousUint8AfterCallback() {
-  calloc.free(returnStruct9BytesHomogeneousUint8Result.addressOf);
+  calloc.free(returnStruct9BytesHomogeneousUint8ResultPointer);
 
   final result = returnStruct9BytesHomogeneousUint8CalculateResult();
 
   print("after callback result = $result");
 
-  calloc.free(returnStruct9BytesHomogeneousUint8Result.addressOf);
+  calloc.free(returnStruct9BytesHomogeneousUint8ResultPointer);
 }
 
 typedef ReturnStruct9BytesInt4Or8ByteAlignedType
@@ -5849,18 +5852,18 @@
 int returnStruct9BytesInt4Or8ByteAligned_a1 = 0;
 
 // Result variable also global, so we can delete it after the callback.
-Struct9BytesInt4Or8ByteAligned returnStruct9BytesInt4Or8ByteAlignedResult =
-    Struct9BytesInt4Or8ByteAligned();
+Pointer<Struct9BytesInt4Or8ByteAligned>
+    returnStruct9BytesInt4Or8ByteAlignedResultPointer = nullptr;
 
 Struct9BytesInt4Or8ByteAligned
     returnStruct9BytesInt4Or8ByteAlignedCalculateResult() {
-  Struct9BytesInt4Or8ByteAligned result =
-      calloc<Struct9BytesInt4Or8ByteAligned>().ref;
+  final resultPointer = calloc<Struct9BytesInt4Or8ByteAligned>();
+  final result = resultPointer.ref;
 
   result.a0 = returnStruct9BytesInt4Or8ByteAligned_a0;
   result.a1 = returnStruct9BytesInt4Or8ByteAligned_a1;
 
-  returnStruct9BytesInt4Or8ByteAlignedResult = result;
+  returnStruct9BytesInt4Or8ByteAlignedResultPointer = resultPointer;
 
   return result;
 }
@@ -5891,13 +5894,13 @@
 }
 
 void returnStruct9BytesInt4Or8ByteAlignedAfterCallback() {
-  calloc.free(returnStruct9BytesInt4Or8ByteAlignedResult.addressOf);
+  calloc.free(returnStruct9BytesInt4Or8ByteAlignedResultPointer);
 
   final result = returnStruct9BytesInt4Or8ByteAlignedCalculateResult();
 
   print("after callback result = $result");
 
-  calloc.free(returnStruct9BytesInt4Or8ByteAlignedResult.addressOf);
+  calloc.free(returnStruct9BytesInt4Or8ByteAlignedResultPointer);
 }
 
 typedef ReturnStruct12BytesHomogeneousFloatType = Struct12BytesHomogeneousFloat
@@ -5909,19 +5912,19 @@
 double returnStruct12BytesHomogeneousFloat_a2 = 0.0;
 
 // Result variable also global, so we can delete it after the callback.
-Struct12BytesHomogeneousFloat returnStruct12BytesHomogeneousFloatResult =
-    Struct12BytesHomogeneousFloat();
+Pointer<Struct12BytesHomogeneousFloat>
+    returnStruct12BytesHomogeneousFloatResultPointer = nullptr;
 
 Struct12BytesHomogeneousFloat
     returnStruct12BytesHomogeneousFloatCalculateResult() {
-  Struct12BytesHomogeneousFloat result =
-      calloc<Struct12BytesHomogeneousFloat>().ref;
+  final resultPointer = calloc<Struct12BytesHomogeneousFloat>();
+  final result = resultPointer.ref;
 
   result.a0 = returnStruct12BytesHomogeneousFloat_a0;
   result.a1 = returnStruct12BytesHomogeneousFloat_a1;
   result.a2 = returnStruct12BytesHomogeneousFloat_a2;
 
-  returnStruct12BytesHomogeneousFloatResult = result;
+  returnStruct12BytesHomogeneousFloatResultPointer = resultPointer;
 
   return result;
 }
@@ -5952,13 +5955,13 @@
 }
 
 void returnStruct12BytesHomogeneousFloatAfterCallback() {
-  calloc.free(returnStruct12BytesHomogeneousFloatResult.addressOf);
+  calloc.free(returnStruct12BytesHomogeneousFloatResultPointer);
 
   final result = returnStruct12BytesHomogeneousFloatCalculateResult();
 
   print("after callback result = $result");
 
-  calloc.free(returnStruct12BytesHomogeneousFloatResult.addressOf);
+  calloc.free(returnStruct12BytesHomogeneousFloatResultPointer);
 }
 
 typedef ReturnStruct16BytesHomogeneousFloatType = Struct16BytesHomogeneousFloat
@@ -5971,20 +5974,20 @@
 double returnStruct16BytesHomogeneousFloat_a3 = 0.0;
 
 // Result variable also global, so we can delete it after the callback.
-Struct16BytesHomogeneousFloat returnStruct16BytesHomogeneousFloatResult =
-    Struct16BytesHomogeneousFloat();
+Pointer<Struct16BytesHomogeneousFloat>
+    returnStruct16BytesHomogeneousFloatResultPointer = nullptr;
 
 Struct16BytesHomogeneousFloat
     returnStruct16BytesHomogeneousFloatCalculateResult() {
-  Struct16BytesHomogeneousFloat result =
-      calloc<Struct16BytesHomogeneousFloat>().ref;
+  final resultPointer = calloc<Struct16BytesHomogeneousFloat>();
+  final result = resultPointer.ref;
 
   result.a0 = returnStruct16BytesHomogeneousFloat_a0;
   result.a1 = returnStruct16BytesHomogeneousFloat_a1;
   result.a2 = returnStruct16BytesHomogeneousFloat_a2;
   result.a3 = returnStruct16BytesHomogeneousFloat_a3;
 
-  returnStruct16BytesHomogeneousFloatResult = result;
+  returnStruct16BytesHomogeneousFloatResultPointer = resultPointer;
 
   return result;
 }
@@ -6015,13 +6018,13 @@
 }
 
 void returnStruct16BytesHomogeneousFloatAfterCallback() {
-  calloc.free(returnStruct16BytesHomogeneousFloatResult.addressOf);
+  calloc.free(returnStruct16BytesHomogeneousFloatResultPointer);
 
   final result = returnStruct16BytesHomogeneousFloatCalculateResult();
 
   print("after callback result = $result");
 
-  calloc.free(returnStruct16BytesHomogeneousFloatResult.addressOf);
+  calloc.free(returnStruct16BytesHomogeneousFloatResultPointer);
 }
 
 typedef ReturnStruct16BytesMixedType = Struct16BytesMixed Function(
@@ -6032,15 +6035,16 @@
 int returnStruct16BytesMixed_a1 = 0;
 
 // Result variable also global, so we can delete it after the callback.
-Struct16BytesMixed returnStruct16BytesMixedResult = Struct16BytesMixed();
+Pointer<Struct16BytesMixed> returnStruct16BytesMixedResultPointer = nullptr;
 
 Struct16BytesMixed returnStruct16BytesMixedCalculateResult() {
-  Struct16BytesMixed result = calloc<Struct16BytesMixed>().ref;
+  final resultPointer = calloc<Struct16BytesMixed>();
+  final result = resultPointer.ref;
 
   result.a0 = returnStruct16BytesMixed_a0;
   result.a1 = returnStruct16BytesMixed_a1;
 
-  returnStruct16BytesMixedResult = result;
+  returnStruct16BytesMixedResultPointer = resultPointer;
 
   return result;
 }
@@ -6068,13 +6072,13 @@
 }
 
 void returnStruct16BytesMixedAfterCallback() {
-  calloc.free(returnStruct16BytesMixedResult.addressOf);
+  calloc.free(returnStruct16BytesMixedResultPointer);
 
   final result = returnStruct16BytesMixedCalculateResult();
 
   print("after callback result = $result");
 
-  calloc.free(returnStruct16BytesMixedResult.addressOf);
+  calloc.free(returnStruct16BytesMixedResultPointer);
 }
 
 typedef ReturnStruct16BytesMixed2Type = Struct16BytesMixed2 Function(
@@ -6087,17 +6091,18 @@
 int returnStruct16BytesMixed2_a3 = 0;
 
 // Result variable also global, so we can delete it after the callback.
-Struct16BytesMixed2 returnStruct16BytesMixed2Result = Struct16BytesMixed2();
+Pointer<Struct16BytesMixed2> returnStruct16BytesMixed2ResultPointer = nullptr;
 
 Struct16BytesMixed2 returnStruct16BytesMixed2CalculateResult() {
-  Struct16BytesMixed2 result = calloc<Struct16BytesMixed2>().ref;
+  final resultPointer = calloc<Struct16BytesMixed2>();
+  final result = resultPointer.ref;
 
   result.a0 = returnStruct16BytesMixed2_a0;
   result.a1 = returnStruct16BytesMixed2_a1;
   result.a2 = returnStruct16BytesMixed2_a2;
   result.a3 = returnStruct16BytesMixed2_a3;
 
-  returnStruct16BytesMixed2Result = result;
+  returnStruct16BytesMixed2ResultPointer = resultPointer;
 
   return result;
 }
@@ -6129,13 +6134,13 @@
 }
 
 void returnStruct16BytesMixed2AfterCallback() {
-  calloc.free(returnStruct16BytesMixed2Result.addressOf);
+  calloc.free(returnStruct16BytesMixed2ResultPointer);
 
   final result = returnStruct16BytesMixed2CalculateResult();
 
   print("after callback result = $result");
 
-  calloc.free(returnStruct16BytesMixed2Result.addressOf);
+  calloc.free(returnStruct16BytesMixed2ResultPointer);
 }
 
 typedef ReturnStruct17BytesIntType = Struct17BytesInt Function(
@@ -6147,16 +6152,17 @@
 int returnStruct17BytesInt_a2 = 0;
 
 // Result variable also global, so we can delete it after the callback.
-Struct17BytesInt returnStruct17BytesIntResult = Struct17BytesInt();
+Pointer<Struct17BytesInt> returnStruct17BytesIntResultPointer = nullptr;
 
 Struct17BytesInt returnStruct17BytesIntCalculateResult() {
-  Struct17BytesInt result = calloc<Struct17BytesInt>().ref;
+  final resultPointer = calloc<Struct17BytesInt>();
+  final result = resultPointer.ref;
 
   result.a0 = returnStruct17BytesInt_a0;
   result.a1 = returnStruct17BytesInt_a1;
   result.a2 = returnStruct17BytesInt_a2;
 
-  returnStruct17BytesIntResult = result;
+  returnStruct17BytesIntResultPointer = resultPointer;
 
   return result;
 }
@@ -6187,13 +6193,13 @@
 }
 
 void returnStruct17BytesIntAfterCallback() {
-  calloc.free(returnStruct17BytesIntResult.addressOf);
+  calloc.free(returnStruct17BytesIntResultPointer);
 
   final result = returnStruct17BytesIntCalculateResult();
 
   print("after callback result = $result");
 
-  calloc.free(returnStruct17BytesIntResult.addressOf);
+  calloc.free(returnStruct17BytesIntResultPointer);
 }
 
 typedef ReturnStruct19BytesHomogeneousUint8Type
@@ -6240,13 +6246,13 @@
 int returnStruct19BytesHomogeneousUint8_a18 = 0;
 
 // Result variable also global, so we can delete it after the callback.
-Struct19BytesHomogeneousUint8 returnStruct19BytesHomogeneousUint8Result =
-    Struct19BytesHomogeneousUint8();
+Pointer<Struct19BytesHomogeneousUint8>
+    returnStruct19BytesHomogeneousUint8ResultPointer = nullptr;
 
 Struct19BytesHomogeneousUint8
     returnStruct19BytesHomogeneousUint8CalculateResult() {
-  Struct19BytesHomogeneousUint8 result =
-      calloc<Struct19BytesHomogeneousUint8>().ref;
+  final resultPointer = calloc<Struct19BytesHomogeneousUint8>();
+  final result = resultPointer.ref;
 
   result.a0 = returnStruct19BytesHomogeneousUint8_a0;
   result.a1 = returnStruct19BytesHomogeneousUint8_a1;
@@ -6268,7 +6274,7 @@
   result.a17 = returnStruct19BytesHomogeneousUint8_a17;
   result.a18 = returnStruct19BytesHomogeneousUint8_a18;
 
-  returnStruct19BytesHomogeneousUint8Result = result;
+  returnStruct19BytesHomogeneousUint8ResultPointer = resultPointer;
 
   return result;
 }
@@ -6335,13 +6341,13 @@
 }
 
 void returnStruct19BytesHomogeneousUint8AfterCallback() {
-  calloc.free(returnStruct19BytesHomogeneousUint8Result.addressOf);
+  calloc.free(returnStruct19BytesHomogeneousUint8ResultPointer);
 
   final result = returnStruct19BytesHomogeneousUint8CalculateResult();
 
   print("after callback result = $result");
 
-  calloc.free(returnStruct19BytesHomogeneousUint8Result.addressOf);
+  calloc.free(returnStruct19BytesHomogeneousUint8ResultPointer);
 }
 
 typedef ReturnStruct20BytesHomogeneousInt32Type = Struct20BytesHomogeneousInt32
@@ -6355,13 +6361,13 @@
 int returnStruct20BytesHomogeneousInt32_a4 = 0;
 
 // Result variable also global, so we can delete it after the callback.
-Struct20BytesHomogeneousInt32 returnStruct20BytesHomogeneousInt32Result =
-    Struct20BytesHomogeneousInt32();
+Pointer<Struct20BytesHomogeneousInt32>
+    returnStruct20BytesHomogeneousInt32ResultPointer = nullptr;
 
 Struct20BytesHomogeneousInt32
     returnStruct20BytesHomogeneousInt32CalculateResult() {
-  Struct20BytesHomogeneousInt32 result =
-      calloc<Struct20BytesHomogeneousInt32>().ref;
+  final resultPointer = calloc<Struct20BytesHomogeneousInt32>();
+  final result = resultPointer.ref;
 
   result.a0 = returnStruct20BytesHomogeneousInt32_a0;
   result.a1 = returnStruct20BytesHomogeneousInt32_a1;
@@ -6369,7 +6375,7 @@
   result.a3 = returnStruct20BytesHomogeneousInt32_a3;
   result.a4 = returnStruct20BytesHomogeneousInt32_a4;
 
-  returnStruct20BytesHomogeneousInt32Result = result;
+  returnStruct20BytesHomogeneousInt32ResultPointer = resultPointer;
 
   return result;
 }
@@ -6402,13 +6408,13 @@
 }
 
 void returnStruct20BytesHomogeneousInt32AfterCallback() {
-  calloc.free(returnStruct20BytesHomogeneousInt32Result.addressOf);
+  calloc.free(returnStruct20BytesHomogeneousInt32ResultPointer);
 
   final result = returnStruct20BytesHomogeneousInt32CalculateResult();
 
   print("after callback result = $result");
 
-  calloc.free(returnStruct20BytesHomogeneousInt32Result.addressOf);
+  calloc.free(returnStruct20BytesHomogeneousInt32ResultPointer);
 }
 
 typedef ReturnStruct20BytesHomogeneousFloatType = Struct20BytesHomogeneousFloat
@@ -6422,13 +6428,13 @@
 double returnStruct20BytesHomogeneousFloat_a4 = 0.0;
 
 // Result variable also global, so we can delete it after the callback.
-Struct20BytesHomogeneousFloat returnStruct20BytesHomogeneousFloatResult =
-    Struct20BytesHomogeneousFloat();
+Pointer<Struct20BytesHomogeneousFloat>
+    returnStruct20BytesHomogeneousFloatResultPointer = nullptr;
 
 Struct20BytesHomogeneousFloat
     returnStruct20BytesHomogeneousFloatCalculateResult() {
-  Struct20BytesHomogeneousFloat result =
-      calloc<Struct20BytesHomogeneousFloat>().ref;
+  final resultPointer = calloc<Struct20BytesHomogeneousFloat>();
+  final result = resultPointer.ref;
 
   result.a0 = returnStruct20BytesHomogeneousFloat_a0;
   result.a1 = returnStruct20BytesHomogeneousFloat_a1;
@@ -6436,7 +6442,7 @@
   result.a3 = returnStruct20BytesHomogeneousFloat_a3;
   result.a4 = returnStruct20BytesHomogeneousFloat_a4;
 
-  returnStruct20BytesHomogeneousFloatResult = result;
+  returnStruct20BytesHomogeneousFloatResultPointer = resultPointer;
 
   return result;
 }
@@ -6469,13 +6475,13 @@
 }
 
 void returnStruct20BytesHomogeneousFloatAfterCallback() {
-  calloc.free(returnStruct20BytesHomogeneousFloatResult.addressOf);
+  calloc.free(returnStruct20BytesHomogeneousFloatResultPointer);
 
   final result = returnStruct20BytesHomogeneousFloatCalculateResult();
 
   print("after callback result = $result");
 
-  calloc.free(returnStruct20BytesHomogeneousFloatResult.addressOf);
+  calloc.free(returnStruct20BytesHomogeneousFloatResultPointer);
 }
 
 typedef ReturnStruct32BytesHomogeneousDoubleType
@@ -6488,20 +6494,20 @@
 double returnStruct32BytesHomogeneousDouble_a3 = 0.0;
 
 // Result variable also global, so we can delete it after the callback.
-Struct32BytesHomogeneousDouble returnStruct32BytesHomogeneousDoubleResult =
-    Struct32BytesHomogeneousDouble();
+Pointer<Struct32BytesHomogeneousDouble>
+    returnStruct32BytesHomogeneousDoubleResultPointer = nullptr;
 
 Struct32BytesHomogeneousDouble
     returnStruct32BytesHomogeneousDoubleCalculateResult() {
-  Struct32BytesHomogeneousDouble result =
-      calloc<Struct32BytesHomogeneousDouble>().ref;
+  final resultPointer = calloc<Struct32BytesHomogeneousDouble>();
+  final result = resultPointer.ref;
 
   result.a0 = returnStruct32BytesHomogeneousDouble_a0;
   result.a1 = returnStruct32BytesHomogeneousDouble_a1;
   result.a2 = returnStruct32BytesHomogeneousDouble_a2;
   result.a3 = returnStruct32BytesHomogeneousDouble_a3;
 
-  returnStruct32BytesHomogeneousDoubleResult = result;
+  returnStruct32BytesHomogeneousDoubleResultPointer = resultPointer;
 
   return result;
 }
@@ -6533,13 +6539,13 @@
 }
 
 void returnStruct32BytesHomogeneousDoubleAfterCallback() {
-  calloc.free(returnStruct32BytesHomogeneousDoubleResult.addressOf);
+  calloc.free(returnStruct32BytesHomogeneousDoubleResultPointer);
 
   final result = returnStruct32BytesHomogeneousDoubleCalculateResult();
 
   print("after callback result = $result");
 
-  calloc.free(returnStruct32BytesHomogeneousDoubleResult.addressOf);
+  calloc.free(returnStruct32BytesHomogeneousDoubleResultPointer);
 }
 
 typedef ReturnStruct40BytesHomogeneousDoubleType
@@ -6554,13 +6560,13 @@
 double returnStruct40BytesHomogeneousDouble_a4 = 0.0;
 
 // Result variable also global, so we can delete it after the callback.
-Struct40BytesHomogeneousDouble returnStruct40BytesHomogeneousDoubleResult =
-    Struct40BytesHomogeneousDouble();
+Pointer<Struct40BytesHomogeneousDouble>
+    returnStruct40BytesHomogeneousDoubleResultPointer = nullptr;
 
 Struct40BytesHomogeneousDouble
     returnStruct40BytesHomogeneousDoubleCalculateResult() {
-  Struct40BytesHomogeneousDouble result =
-      calloc<Struct40BytesHomogeneousDouble>().ref;
+  final resultPointer = calloc<Struct40BytesHomogeneousDouble>();
+  final result = resultPointer.ref;
 
   result.a0 = returnStruct40BytesHomogeneousDouble_a0;
   result.a1 = returnStruct40BytesHomogeneousDouble_a1;
@@ -6568,7 +6574,7 @@
   result.a3 = returnStruct40BytesHomogeneousDouble_a3;
   result.a4 = returnStruct40BytesHomogeneousDouble_a4;
 
-  returnStruct40BytesHomogeneousDoubleResult = result;
+  returnStruct40BytesHomogeneousDoubleResultPointer = resultPointer;
 
   return result;
 }
@@ -6602,13 +6608,13 @@
 }
 
 void returnStruct40BytesHomogeneousDoubleAfterCallback() {
-  calloc.free(returnStruct40BytesHomogeneousDoubleResult.addressOf);
+  calloc.free(returnStruct40BytesHomogeneousDoubleResultPointer);
 
   final result = returnStruct40BytesHomogeneousDoubleCalculateResult();
 
   print("after callback result = $result");
 
-  calloc.free(returnStruct40BytesHomogeneousDoubleResult.addressOf);
+  calloc.free(returnStruct40BytesHomogeneousDoubleResultPointer);
 }
 
 typedef ReturnStruct1024BytesHomogeneousUint64Type
@@ -6873,13 +6879,13 @@
 int returnStruct1024BytesHomogeneousUint64_a127 = 0;
 
 // Result variable also global, so we can delete it after the callback.
-Struct1024BytesHomogeneousUint64 returnStruct1024BytesHomogeneousUint64Result =
-    Struct1024BytesHomogeneousUint64();
+Pointer<Struct1024BytesHomogeneousUint64>
+    returnStruct1024BytesHomogeneousUint64ResultPointer = nullptr;
 
 Struct1024BytesHomogeneousUint64
     returnStruct1024BytesHomogeneousUint64CalculateResult() {
-  Struct1024BytesHomogeneousUint64 result =
-      calloc<Struct1024BytesHomogeneousUint64>().ref;
+  final resultPointer = calloc<Struct1024BytesHomogeneousUint64>();
+  final result = resultPointer.ref;
 
   result.a0 = returnStruct1024BytesHomogeneousUint64_a0;
   result.a1 = returnStruct1024BytesHomogeneousUint64_a1;
@@ -7010,7 +7016,7 @@
   result.a126 = returnStruct1024BytesHomogeneousUint64_a126;
   result.a127 = returnStruct1024BytesHomogeneousUint64_a127;
 
-  returnStruct1024BytesHomogeneousUint64Result = result;
+  returnStruct1024BytesHomogeneousUint64ResultPointer = resultPointer;
 
   return result;
 }
@@ -7294,13 +7300,13 @@
 }
 
 void returnStruct1024BytesHomogeneousUint64AfterCallback() {
-  calloc.free(returnStruct1024BytesHomogeneousUint64Result.addressOf);
+  calloc.free(returnStruct1024BytesHomogeneousUint64ResultPointer);
 
   final result = returnStruct1024BytesHomogeneousUint64CalculateResult();
 
   print("after callback result = $result");
 
-  calloc.free(returnStruct1024BytesHomogeneousUint64Result.addressOf);
+  calloc.free(returnStruct1024BytesHomogeneousUint64ResultPointer);
 }
 
 typedef ReturnStructArgumentStruct1ByteIntType = Struct1ByteInt Function(
@@ -7616,16 +7622,17 @@
 int returnStructAlignmentInt16_a2 = 0;
 
 // Result variable also global, so we can delete it after the callback.
-StructAlignmentInt16 returnStructAlignmentInt16Result = StructAlignmentInt16();
+Pointer<StructAlignmentInt16> returnStructAlignmentInt16ResultPointer = nullptr;
 
 StructAlignmentInt16 returnStructAlignmentInt16CalculateResult() {
-  StructAlignmentInt16 result = calloc<StructAlignmentInt16>().ref;
+  final resultPointer = calloc<StructAlignmentInt16>();
+  final result = resultPointer.ref;
 
   result.a0 = returnStructAlignmentInt16_a0;
   result.a1 = returnStructAlignmentInt16_a1;
   result.a2 = returnStructAlignmentInt16_a2;
 
-  returnStructAlignmentInt16Result = result;
+  returnStructAlignmentInt16ResultPointer = resultPointer;
 
   return result;
 }
@@ -7654,13 +7661,13 @@
 }
 
 void returnStructAlignmentInt16AfterCallback() {
-  calloc.free(returnStructAlignmentInt16Result.addressOf);
+  calloc.free(returnStructAlignmentInt16ResultPointer);
 
   final result = returnStructAlignmentInt16CalculateResult();
 
   print("after callback result = $result");
 
-  calloc.free(returnStructAlignmentInt16Result.addressOf);
+  calloc.free(returnStructAlignmentInt16ResultPointer);
 }
 
 typedef ReturnStructAlignmentInt32Type = StructAlignmentInt32 Function(
@@ -7672,16 +7679,17 @@
 int returnStructAlignmentInt32_a2 = 0;
 
 // Result variable also global, so we can delete it after the callback.
-StructAlignmentInt32 returnStructAlignmentInt32Result = StructAlignmentInt32();
+Pointer<StructAlignmentInt32> returnStructAlignmentInt32ResultPointer = nullptr;
 
 StructAlignmentInt32 returnStructAlignmentInt32CalculateResult() {
-  StructAlignmentInt32 result = calloc<StructAlignmentInt32>().ref;
+  final resultPointer = calloc<StructAlignmentInt32>();
+  final result = resultPointer.ref;
 
   result.a0 = returnStructAlignmentInt32_a0;
   result.a1 = returnStructAlignmentInt32_a1;
   result.a2 = returnStructAlignmentInt32_a2;
 
-  returnStructAlignmentInt32Result = result;
+  returnStructAlignmentInt32ResultPointer = resultPointer;
 
   return result;
 }
@@ -7710,13 +7718,13 @@
 }
 
 void returnStructAlignmentInt32AfterCallback() {
-  calloc.free(returnStructAlignmentInt32Result.addressOf);
+  calloc.free(returnStructAlignmentInt32ResultPointer);
 
   final result = returnStructAlignmentInt32CalculateResult();
 
   print("after callback result = $result");
 
-  calloc.free(returnStructAlignmentInt32Result.addressOf);
+  calloc.free(returnStructAlignmentInt32ResultPointer);
 }
 
 typedef ReturnStructAlignmentInt64Type = StructAlignmentInt64 Function(
@@ -7728,16 +7736,17 @@
 int returnStructAlignmentInt64_a2 = 0;
 
 // Result variable also global, so we can delete it after the callback.
-StructAlignmentInt64 returnStructAlignmentInt64Result = StructAlignmentInt64();
+Pointer<StructAlignmentInt64> returnStructAlignmentInt64ResultPointer = nullptr;
 
 StructAlignmentInt64 returnStructAlignmentInt64CalculateResult() {
-  StructAlignmentInt64 result = calloc<StructAlignmentInt64>().ref;
+  final resultPointer = calloc<StructAlignmentInt64>();
+  final result = resultPointer.ref;
 
   result.a0 = returnStructAlignmentInt64_a0;
   result.a1 = returnStructAlignmentInt64_a1;
   result.a2 = returnStructAlignmentInt64_a2;
 
-  returnStructAlignmentInt64Result = result;
+  returnStructAlignmentInt64ResultPointer = resultPointer;
 
   return result;
 }
@@ -7766,13 +7775,13 @@
 }
 
 void returnStructAlignmentInt64AfterCallback() {
-  calloc.free(returnStructAlignmentInt64Result.addressOf);
+  calloc.free(returnStructAlignmentInt64ResultPointer);
 
   final result = returnStructAlignmentInt64CalculateResult();
 
   print("after callback result = $result");
 
-  calloc.free(returnStructAlignmentInt64Result.addressOf);
+  calloc.free(returnStructAlignmentInt64ResultPointer);
 }
 
 typedef ReturnStruct8BytesNestedIntType = Struct8BytesNestedInt Function(
@@ -7785,18 +7794,19 @@
     Struct4BytesHomogeneousInt16();
 
 // Result variable also global, so we can delete it after the callback.
-Struct8BytesNestedInt returnStruct8BytesNestedIntResult =
-    Struct8BytesNestedInt();
+Pointer<Struct8BytesNestedInt> returnStruct8BytesNestedIntResultPointer =
+    nullptr;
 
 Struct8BytesNestedInt returnStruct8BytesNestedIntCalculateResult() {
-  Struct8BytesNestedInt result = calloc<Struct8BytesNestedInt>().ref;
+  final resultPointer = calloc<Struct8BytesNestedInt>();
+  final result = resultPointer.ref;
 
   result.a0.a0 = returnStruct8BytesNestedInt_a0.a0;
   result.a0.a1 = returnStruct8BytesNestedInt_a0.a1;
   result.a1.a0 = returnStruct8BytesNestedInt_a1.a0;
   result.a1.a1 = returnStruct8BytesNestedInt_a1.a1;
 
-  returnStruct8BytesNestedIntResult = result;
+  returnStruct8BytesNestedIntResultPointer = resultPointer;
 
   return result;
 }
@@ -7825,13 +7835,13 @@
 }
 
 void returnStruct8BytesNestedIntAfterCallback() {
-  calloc.free(returnStruct8BytesNestedIntResult.addressOf);
+  calloc.free(returnStruct8BytesNestedIntResultPointer);
 
   final result = returnStruct8BytesNestedIntCalculateResult();
 
   print("after callback result = $result");
 
-  calloc.free(returnStruct8BytesNestedIntResult.addressOf);
+  calloc.free(returnStruct8BytesNestedIntResultPointer);
 }
 
 typedef ReturnStruct8BytesNestedFloatType = Struct8BytesNestedFloat Function(
@@ -7842,16 +7852,17 @@
 Struct4BytesFloat returnStruct8BytesNestedFloat_a1 = Struct4BytesFloat();
 
 // Result variable also global, so we can delete it after the callback.
-Struct8BytesNestedFloat returnStruct8BytesNestedFloatResult =
-    Struct8BytesNestedFloat();
+Pointer<Struct8BytesNestedFloat> returnStruct8BytesNestedFloatResultPointer =
+    nullptr;
 
 Struct8BytesNestedFloat returnStruct8BytesNestedFloatCalculateResult() {
-  Struct8BytesNestedFloat result = calloc<Struct8BytesNestedFloat>().ref;
+  final resultPointer = calloc<Struct8BytesNestedFloat>();
+  final result = resultPointer.ref;
 
   result.a0.a0 = returnStruct8BytesNestedFloat_a0.a0;
   result.a1.a0 = returnStruct8BytesNestedFloat_a1.a0;
 
-  returnStruct8BytesNestedFloatResult = result;
+  returnStruct8BytesNestedFloatResultPointer = resultPointer;
 
   return result;
 }
@@ -7880,13 +7891,13 @@
 }
 
 void returnStruct8BytesNestedFloatAfterCallback() {
-  calloc.free(returnStruct8BytesNestedFloatResult.addressOf);
+  calloc.free(returnStruct8BytesNestedFloatResultPointer);
 
   final result = returnStruct8BytesNestedFloatCalculateResult();
 
   print("after callback result = $result");
 
-  calloc.free(returnStruct8BytesNestedFloatResult.addressOf);
+  calloc.free(returnStruct8BytesNestedFloatResultPointer);
 }
 
 typedef ReturnStruct8BytesNestedFloat2Type = Struct8BytesNestedFloat2 Function(
@@ -7897,16 +7908,17 @@
 double returnStruct8BytesNestedFloat2_a1 = 0.0;
 
 // Result variable also global, so we can delete it after the callback.
-Struct8BytesNestedFloat2 returnStruct8BytesNestedFloat2Result =
-    Struct8BytesNestedFloat2();
+Pointer<Struct8BytesNestedFloat2> returnStruct8BytesNestedFloat2ResultPointer =
+    nullptr;
 
 Struct8BytesNestedFloat2 returnStruct8BytesNestedFloat2CalculateResult() {
-  Struct8BytesNestedFloat2 result = calloc<Struct8BytesNestedFloat2>().ref;
+  final resultPointer = calloc<Struct8BytesNestedFloat2>();
+  final result = resultPointer.ref;
 
   result.a0.a0 = returnStruct8BytesNestedFloat2_a0.a0;
   result.a1 = returnStruct8BytesNestedFloat2_a1;
 
-  returnStruct8BytesNestedFloat2Result = result;
+  returnStruct8BytesNestedFloat2ResultPointer = resultPointer;
 
   return result;
 }
@@ -7936,13 +7948,13 @@
 }
 
 void returnStruct8BytesNestedFloat2AfterCallback() {
-  calloc.free(returnStruct8BytesNestedFloat2Result.addressOf);
+  calloc.free(returnStruct8BytesNestedFloat2ResultPointer);
 
   final result = returnStruct8BytesNestedFloat2CalculateResult();
 
   print("after callback result = $result");
 
-  calloc.free(returnStruct8BytesNestedFloat2Result.addressOf);
+  calloc.free(returnStruct8BytesNestedFloat2ResultPointer);
 }
 
 typedef ReturnStruct8BytesNestedMixedType = Struct8BytesNestedMixed Function(
@@ -7954,17 +7966,18 @@
 Struct4BytesFloat returnStruct8BytesNestedMixed_a1 = Struct4BytesFloat();
 
 // Result variable also global, so we can delete it after the callback.
-Struct8BytesNestedMixed returnStruct8BytesNestedMixedResult =
-    Struct8BytesNestedMixed();
+Pointer<Struct8BytesNestedMixed> returnStruct8BytesNestedMixedResultPointer =
+    nullptr;
 
 Struct8BytesNestedMixed returnStruct8BytesNestedMixedCalculateResult() {
-  Struct8BytesNestedMixed result = calloc<Struct8BytesNestedMixed>().ref;
+  final resultPointer = calloc<Struct8BytesNestedMixed>();
+  final result = resultPointer.ref;
 
   result.a0.a0 = returnStruct8BytesNestedMixed_a0.a0;
   result.a0.a1 = returnStruct8BytesNestedMixed_a0.a1;
   result.a1.a0 = returnStruct8BytesNestedMixed_a1.a0;
 
-  returnStruct8BytesNestedMixedResult = result;
+  returnStruct8BytesNestedMixedResultPointer = resultPointer;
 
   return result;
 }
@@ -7993,13 +8006,13 @@
 }
 
 void returnStruct8BytesNestedMixedAfterCallback() {
-  calloc.free(returnStruct8BytesNestedMixedResult.addressOf);
+  calloc.free(returnStruct8BytesNestedMixedResultPointer);
 
   final result = returnStruct8BytesNestedMixedCalculateResult();
 
   print("after callback result = $result");
 
-  calloc.free(returnStruct8BytesNestedMixedResult.addressOf);
+  calloc.free(returnStruct8BytesNestedMixedResultPointer);
 }
 
 typedef ReturnStruct16BytesNestedIntType = Struct16BytesNestedInt Function(
@@ -8010,11 +8023,12 @@
 Struct8BytesNestedInt returnStruct16BytesNestedInt_a1 = Struct8BytesNestedInt();
 
 // Result variable also global, so we can delete it after the callback.
-Struct16BytesNestedInt returnStruct16BytesNestedIntResult =
-    Struct16BytesNestedInt();
+Pointer<Struct16BytesNestedInt> returnStruct16BytesNestedIntResultPointer =
+    nullptr;
 
 Struct16BytesNestedInt returnStruct16BytesNestedIntCalculateResult() {
-  Struct16BytesNestedInt result = calloc<Struct16BytesNestedInt>().ref;
+  final resultPointer = calloc<Struct16BytesNestedInt>();
+  final result = resultPointer.ref;
 
   result.a0.a0.a0 = returnStruct16BytesNestedInt_a0.a0.a0;
   result.a0.a0.a1 = returnStruct16BytesNestedInt_a0.a0.a1;
@@ -8025,7 +8039,7 @@
   result.a1.a1.a0 = returnStruct16BytesNestedInt_a1.a1.a0;
   result.a1.a1.a1 = returnStruct16BytesNestedInt_a1.a1.a1;
 
-  returnStruct16BytesNestedIntResult = result;
+  returnStruct16BytesNestedIntResultPointer = resultPointer;
 
   return result;
 }
@@ -8054,13 +8068,13 @@
 }
 
 void returnStruct16BytesNestedIntAfterCallback() {
-  calloc.free(returnStruct16BytesNestedIntResult.addressOf);
+  calloc.free(returnStruct16BytesNestedIntResultPointer);
 
   final result = returnStruct16BytesNestedIntCalculateResult();
 
   print("after callback result = $result");
 
-  calloc.free(returnStruct16BytesNestedIntResult.addressOf);
+  calloc.free(returnStruct16BytesNestedIntResultPointer);
 }
 
 typedef ReturnStruct32BytesNestedIntType = Struct32BytesNestedInt Function(
@@ -8073,11 +8087,12 @@
     Struct16BytesNestedInt();
 
 // Result variable also global, so we can delete it after the callback.
-Struct32BytesNestedInt returnStruct32BytesNestedIntResult =
-    Struct32BytesNestedInt();
+Pointer<Struct32BytesNestedInt> returnStruct32BytesNestedIntResultPointer =
+    nullptr;
 
 Struct32BytesNestedInt returnStruct32BytesNestedIntCalculateResult() {
-  Struct32BytesNestedInt result = calloc<Struct32BytesNestedInt>().ref;
+  final resultPointer = calloc<Struct32BytesNestedInt>();
+  final result = resultPointer.ref;
 
   result.a0.a0.a0.a0 = returnStruct32BytesNestedInt_a0.a0.a0.a0;
   result.a0.a0.a0.a1 = returnStruct32BytesNestedInt_a0.a0.a0.a1;
@@ -8096,7 +8111,7 @@
   result.a1.a1.a1.a0 = returnStruct32BytesNestedInt_a1.a1.a1.a0;
   result.a1.a1.a1.a1 = returnStruct32BytesNestedInt_a1.a1.a1.a1;
 
-  returnStruct32BytesNestedIntResult = result;
+  returnStruct32BytesNestedIntResultPointer = resultPointer;
 
   return result;
 }
@@ -8125,13 +8140,13 @@
 }
 
 void returnStruct32BytesNestedIntAfterCallback() {
-  calloc.free(returnStruct32BytesNestedIntResult.addressOf);
+  calloc.free(returnStruct32BytesNestedIntResultPointer);
 
   final result = returnStruct32BytesNestedIntCalculateResult();
 
   print("after callback result = $result");
 
-  calloc.free(returnStruct32BytesNestedIntResult.addressOf);
+  calloc.free(returnStruct32BytesNestedIntResultPointer);
 }
 
 typedef ReturnStructNestedIntStructAlignmentInt16Type
@@ -8145,14 +8160,13 @@
     StructAlignmentInt16();
 
 // Result variable also global, so we can delete it after the callback.
-StructNestedIntStructAlignmentInt16
-    returnStructNestedIntStructAlignmentInt16Result =
-    StructNestedIntStructAlignmentInt16();
+Pointer<StructNestedIntStructAlignmentInt16>
+    returnStructNestedIntStructAlignmentInt16ResultPointer = nullptr;
 
 StructNestedIntStructAlignmentInt16
     returnStructNestedIntStructAlignmentInt16CalculateResult() {
-  StructNestedIntStructAlignmentInt16 result =
-      calloc<StructNestedIntStructAlignmentInt16>().ref;
+  final resultPointer = calloc<StructNestedIntStructAlignmentInt16>();
+  final result = resultPointer.ref;
 
   result.a0.a0 = returnStructNestedIntStructAlignmentInt16_a0.a0;
   result.a0.a1 = returnStructNestedIntStructAlignmentInt16_a0.a1;
@@ -8161,7 +8175,7 @@
   result.a1.a1 = returnStructNestedIntStructAlignmentInt16_a1.a1;
   result.a1.a2 = returnStructNestedIntStructAlignmentInt16_a1.a2;
 
-  returnStructNestedIntStructAlignmentInt16Result = result;
+  returnStructNestedIntStructAlignmentInt16ResultPointer = resultPointer;
 
   return result;
 }
@@ -8191,13 +8205,13 @@
 }
 
 void returnStructNestedIntStructAlignmentInt16AfterCallback() {
-  calloc.free(returnStructNestedIntStructAlignmentInt16Result.addressOf);
+  calloc.free(returnStructNestedIntStructAlignmentInt16ResultPointer);
 
   final result = returnStructNestedIntStructAlignmentInt16CalculateResult();
 
   print("after callback result = $result");
 
-  calloc.free(returnStructNestedIntStructAlignmentInt16Result.addressOf);
+  calloc.free(returnStructNestedIntStructAlignmentInt16ResultPointer);
 }
 
 typedef ReturnStructNestedIntStructAlignmentInt32Type
@@ -8211,14 +8225,13 @@
     StructAlignmentInt32();
 
 // Result variable also global, so we can delete it after the callback.
-StructNestedIntStructAlignmentInt32
-    returnStructNestedIntStructAlignmentInt32Result =
-    StructNestedIntStructAlignmentInt32();
+Pointer<StructNestedIntStructAlignmentInt32>
+    returnStructNestedIntStructAlignmentInt32ResultPointer = nullptr;
 
 StructNestedIntStructAlignmentInt32
     returnStructNestedIntStructAlignmentInt32CalculateResult() {
-  StructNestedIntStructAlignmentInt32 result =
-      calloc<StructNestedIntStructAlignmentInt32>().ref;
+  final resultPointer = calloc<StructNestedIntStructAlignmentInt32>();
+  final result = resultPointer.ref;
 
   result.a0.a0 = returnStructNestedIntStructAlignmentInt32_a0.a0;
   result.a0.a1 = returnStructNestedIntStructAlignmentInt32_a0.a1;
@@ -8227,7 +8240,7 @@
   result.a1.a1 = returnStructNestedIntStructAlignmentInt32_a1.a1;
   result.a1.a2 = returnStructNestedIntStructAlignmentInt32_a1.a2;
 
-  returnStructNestedIntStructAlignmentInt32Result = result;
+  returnStructNestedIntStructAlignmentInt32ResultPointer = resultPointer;
 
   return result;
 }
@@ -8257,13 +8270,13 @@
 }
 
 void returnStructNestedIntStructAlignmentInt32AfterCallback() {
-  calloc.free(returnStructNestedIntStructAlignmentInt32Result.addressOf);
+  calloc.free(returnStructNestedIntStructAlignmentInt32ResultPointer);
 
   final result = returnStructNestedIntStructAlignmentInt32CalculateResult();
 
   print("after callback result = $result");
 
-  calloc.free(returnStructNestedIntStructAlignmentInt32Result.addressOf);
+  calloc.free(returnStructNestedIntStructAlignmentInt32ResultPointer);
 }
 
 typedef ReturnStructNestedIntStructAlignmentInt64Type
@@ -8277,14 +8290,13 @@
     StructAlignmentInt64();
 
 // Result variable also global, so we can delete it after the callback.
-StructNestedIntStructAlignmentInt64
-    returnStructNestedIntStructAlignmentInt64Result =
-    StructNestedIntStructAlignmentInt64();
+Pointer<StructNestedIntStructAlignmentInt64>
+    returnStructNestedIntStructAlignmentInt64ResultPointer = nullptr;
 
 StructNestedIntStructAlignmentInt64
     returnStructNestedIntStructAlignmentInt64CalculateResult() {
-  StructNestedIntStructAlignmentInt64 result =
-      calloc<StructNestedIntStructAlignmentInt64>().ref;
+  final resultPointer = calloc<StructNestedIntStructAlignmentInt64>();
+  final result = resultPointer.ref;
 
   result.a0.a0 = returnStructNestedIntStructAlignmentInt64_a0.a0;
   result.a0.a1 = returnStructNestedIntStructAlignmentInt64_a0.a1;
@@ -8293,7 +8305,7 @@
   result.a1.a1 = returnStructNestedIntStructAlignmentInt64_a1.a1;
   result.a1.a2 = returnStructNestedIntStructAlignmentInt64_a1.a2;
 
-  returnStructNestedIntStructAlignmentInt64Result = result;
+  returnStructNestedIntStructAlignmentInt64ResultPointer = resultPointer;
 
   return result;
 }
@@ -8323,13 +8335,13 @@
 }
 
 void returnStructNestedIntStructAlignmentInt64AfterCallback() {
-  calloc.free(returnStructNestedIntStructAlignmentInt64Result.addressOf);
+  calloc.free(returnStructNestedIntStructAlignmentInt64ResultPointer);
 
   final result = returnStructNestedIntStructAlignmentInt64CalculateResult();
 
   print("after callback result = $result");
 
-  calloc.free(returnStructNestedIntStructAlignmentInt64Result.addressOf);
+  calloc.free(returnStructNestedIntStructAlignmentInt64ResultPointer);
 }
 
 typedef ReturnStructNestedIrregularEvenBiggerType
@@ -8345,13 +8357,13 @@
 double returnStructNestedIrregularEvenBigger_a3 = 0.0;
 
 // Result variable also global, so we can delete it after the callback.
-StructNestedIrregularEvenBigger returnStructNestedIrregularEvenBiggerResult =
-    StructNestedIrregularEvenBigger();
+Pointer<StructNestedIrregularEvenBigger>
+    returnStructNestedIrregularEvenBiggerResultPointer = nullptr;
 
 StructNestedIrregularEvenBigger
     returnStructNestedIrregularEvenBiggerCalculateResult() {
-  StructNestedIrregularEvenBigger result =
-      calloc<StructNestedIrregularEvenBigger>().ref;
+  final resultPointer = calloc<StructNestedIrregularEvenBigger>();
+  final result = resultPointer.ref;
 
   result.a0 = returnStructNestedIrregularEvenBigger_a0;
   result.a1.a0.a0 = returnStructNestedIrregularEvenBigger_a1.a0.a0;
@@ -8388,7 +8400,7 @@
   result.a2.a3 = returnStructNestedIrregularEvenBigger_a2.a3;
   result.a3 = returnStructNestedIrregularEvenBigger_a3;
 
-  returnStructNestedIrregularEvenBiggerResult = result;
+  returnStructNestedIrregularEvenBiggerResultPointer = resultPointer;
 
   return result;
 }
@@ -8420,11 +8432,11 @@
 }
 
 void returnStructNestedIrregularEvenBiggerAfterCallback() {
-  calloc.free(returnStructNestedIrregularEvenBiggerResult.addressOf);
+  calloc.free(returnStructNestedIrregularEvenBiggerResultPointer);
 
   final result = returnStructNestedIrregularEvenBiggerCalculateResult();
 
   print("after callback result = $result");
 
-  calloc.free(returnStructNestedIrregularEvenBiggerResult.addressOf);
+  calloc.free(returnStructNestedIrregularEvenBiggerResultPointer);
 }
diff --git a/tests/ffi/function_structs_by_value_generated_test.dart b/tests/ffi/function_structs_by_value_generated_test.dart
index ba98841..cabe1e6 100644
--- a/tests/ffi/function_structs_by_value_generated_test.dart
+++ b/tests/ffi/function_structs_by_value_generated_test.dart
@@ -1050,16 +1050,26 @@
 /// Smallest struct with data.
 /// 10 struct arguments will exhaust available registers.
 void testPassStruct1ByteIntx10() {
-  Struct1ByteInt a0 = calloc<Struct1ByteInt>().ref;
-  Struct1ByteInt a1 = calloc<Struct1ByteInt>().ref;
-  Struct1ByteInt a2 = calloc<Struct1ByteInt>().ref;
-  Struct1ByteInt a3 = calloc<Struct1ByteInt>().ref;
-  Struct1ByteInt a4 = calloc<Struct1ByteInt>().ref;
-  Struct1ByteInt a5 = calloc<Struct1ByteInt>().ref;
-  Struct1ByteInt a6 = calloc<Struct1ByteInt>().ref;
-  Struct1ByteInt a7 = calloc<Struct1ByteInt>().ref;
-  Struct1ByteInt a8 = calloc<Struct1ByteInt>().ref;
-  Struct1ByteInt a9 = calloc<Struct1ByteInt>().ref;
+  final a0Pointer = calloc<Struct1ByteInt>();
+  final Struct1ByteInt a0 = a0Pointer.ref;
+  final a1Pointer = calloc<Struct1ByteInt>();
+  final Struct1ByteInt a1 = a1Pointer.ref;
+  final a2Pointer = calloc<Struct1ByteInt>();
+  final Struct1ByteInt a2 = a2Pointer.ref;
+  final a3Pointer = calloc<Struct1ByteInt>();
+  final Struct1ByteInt a3 = a3Pointer.ref;
+  final a4Pointer = calloc<Struct1ByteInt>();
+  final Struct1ByteInt a4 = a4Pointer.ref;
+  final a5Pointer = calloc<Struct1ByteInt>();
+  final Struct1ByteInt a5 = a5Pointer.ref;
+  final a6Pointer = calloc<Struct1ByteInt>();
+  final Struct1ByteInt a6 = a6Pointer.ref;
+  final a7Pointer = calloc<Struct1ByteInt>();
+  final Struct1ByteInt a7 = a7Pointer.ref;
+  final a8Pointer = calloc<Struct1ByteInt>();
+  final Struct1ByteInt a8 = a8Pointer.ref;
+  final a9Pointer = calloc<Struct1ByteInt>();
+  final Struct1ByteInt a9 = a9Pointer.ref;
 
   a0.a0 = -1;
   a1.a0 = 2;
@@ -1078,16 +1088,16 @@
 
   Expect.equals(5, result);
 
-  calloc.free(a0.addressOf);
-  calloc.free(a1.addressOf);
-  calloc.free(a2.addressOf);
-  calloc.free(a3.addressOf);
-  calloc.free(a4.addressOf);
-  calloc.free(a5.addressOf);
-  calloc.free(a6.addressOf);
-  calloc.free(a7.addressOf);
-  calloc.free(a8.addressOf);
-  calloc.free(a9.addressOf);
+  calloc.free(a0Pointer);
+  calloc.free(a1Pointer);
+  calloc.free(a2Pointer);
+  calloc.free(a3Pointer);
+  calloc.free(a4Pointer);
+  calloc.free(a5Pointer);
+  calloc.free(a6Pointer);
+  calloc.free(a7Pointer);
+  calloc.free(a8Pointer);
+  calloc.free(a9Pointer);
 }
 
 final passStruct3BytesHomogeneousUint8x10 = ffiTestFunctions.lookupFunction<
@@ -1117,16 +1127,26 @@
 /// Not a multiple of word size, not a power of two.
 /// 10 struct arguments will exhaust available registers.
 void testPassStruct3BytesHomogeneousUint8x10() {
-  Struct3BytesHomogeneousUint8 a0 = calloc<Struct3BytesHomogeneousUint8>().ref;
-  Struct3BytesHomogeneousUint8 a1 = calloc<Struct3BytesHomogeneousUint8>().ref;
-  Struct3BytesHomogeneousUint8 a2 = calloc<Struct3BytesHomogeneousUint8>().ref;
-  Struct3BytesHomogeneousUint8 a3 = calloc<Struct3BytesHomogeneousUint8>().ref;
-  Struct3BytesHomogeneousUint8 a4 = calloc<Struct3BytesHomogeneousUint8>().ref;
-  Struct3BytesHomogeneousUint8 a5 = calloc<Struct3BytesHomogeneousUint8>().ref;
-  Struct3BytesHomogeneousUint8 a6 = calloc<Struct3BytesHomogeneousUint8>().ref;
-  Struct3BytesHomogeneousUint8 a7 = calloc<Struct3BytesHomogeneousUint8>().ref;
-  Struct3BytesHomogeneousUint8 a8 = calloc<Struct3BytesHomogeneousUint8>().ref;
-  Struct3BytesHomogeneousUint8 a9 = calloc<Struct3BytesHomogeneousUint8>().ref;
+  final a0Pointer = calloc<Struct3BytesHomogeneousUint8>();
+  final Struct3BytesHomogeneousUint8 a0 = a0Pointer.ref;
+  final a1Pointer = calloc<Struct3BytesHomogeneousUint8>();
+  final Struct3BytesHomogeneousUint8 a1 = a1Pointer.ref;
+  final a2Pointer = calloc<Struct3BytesHomogeneousUint8>();
+  final Struct3BytesHomogeneousUint8 a2 = a2Pointer.ref;
+  final a3Pointer = calloc<Struct3BytesHomogeneousUint8>();
+  final Struct3BytesHomogeneousUint8 a3 = a3Pointer.ref;
+  final a4Pointer = calloc<Struct3BytesHomogeneousUint8>();
+  final Struct3BytesHomogeneousUint8 a4 = a4Pointer.ref;
+  final a5Pointer = calloc<Struct3BytesHomogeneousUint8>();
+  final Struct3BytesHomogeneousUint8 a5 = a5Pointer.ref;
+  final a6Pointer = calloc<Struct3BytesHomogeneousUint8>();
+  final Struct3BytesHomogeneousUint8 a6 = a6Pointer.ref;
+  final a7Pointer = calloc<Struct3BytesHomogeneousUint8>();
+  final Struct3BytesHomogeneousUint8 a7 = a7Pointer.ref;
+  final a8Pointer = calloc<Struct3BytesHomogeneousUint8>();
+  final Struct3BytesHomogeneousUint8 a8 = a8Pointer.ref;
+  final a9Pointer = calloc<Struct3BytesHomogeneousUint8>();
+  final Struct3BytesHomogeneousUint8 a9 = a9Pointer.ref;
 
   a0.a0 = 1;
   a0.a1 = 2;
@@ -1166,16 +1186,16 @@
 
   Expect.equals(465, result);
 
-  calloc.free(a0.addressOf);
-  calloc.free(a1.addressOf);
-  calloc.free(a2.addressOf);
-  calloc.free(a3.addressOf);
-  calloc.free(a4.addressOf);
-  calloc.free(a5.addressOf);
-  calloc.free(a6.addressOf);
-  calloc.free(a7.addressOf);
-  calloc.free(a8.addressOf);
-  calloc.free(a9.addressOf);
+  calloc.free(a0Pointer);
+  calloc.free(a1Pointer);
+  calloc.free(a2Pointer);
+  calloc.free(a3Pointer);
+  calloc.free(a4Pointer);
+  calloc.free(a5Pointer);
+  calloc.free(a6Pointer);
+  calloc.free(a7Pointer);
+  calloc.free(a8Pointer);
+  calloc.free(a9Pointer);
 }
 
 final passStruct3BytesInt2ByteAlignedx10 = ffiTestFunctions.lookupFunction<
@@ -1206,16 +1226,26 @@
 /// With alignment rules taken into account size is 4 bytes.
 /// 10 struct arguments will exhaust available registers.
 void testPassStruct3BytesInt2ByteAlignedx10() {
-  Struct3BytesInt2ByteAligned a0 = calloc<Struct3BytesInt2ByteAligned>().ref;
-  Struct3BytesInt2ByteAligned a1 = calloc<Struct3BytesInt2ByteAligned>().ref;
-  Struct3BytesInt2ByteAligned a2 = calloc<Struct3BytesInt2ByteAligned>().ref;
-  Struct3BytesInt2ByteAligned a3 = calloc<Struct3BytesInt2ByteAligned>().ref;
-  Struct3BytesInt2ByteAligned a4 = calloc<Struct3BytesInt2ByteAligned>().ref;
-  Struct3BytesInt2ByteAligned a5 = calloc<Struct3BytesInt2ByteAligned>().ref;
-  Struct3BytesInt2ByteAligned a6 = calloc<Struct3BytesInt2ByteAligned>().ref;
-  Struct3BytesInt2ByteAligned a7 = calloc<Struct3BytesInt2ByteAligned>().ref;
-  Struct3BytesInt2ByteAligned a8 = calloc<Struct3BytesInt2ByteAligned>().ref;
-  Struct3BytesInt2ByteAligned a9 = calloc<Struct3BytesInt2ByteAligned>().ref;
+  final a0Pointer = calloc<Struct3BytesInt2ByteAligned>();
+  final Struct3BytesInt2ByteAligned a0 = a0Pointer.ref;
+  final a1Pointer = calloc<Struct3BytesInt2ByteAligned>();
+  final Struct3BytesInt2ByteAligned a1 = a1Pointer.ref;
+  final a2Pointer = calloc<Struct3BytesInt2ByteAligned>();
+  final Struct3BytesInt2ByteAligned a2 = a2Pointer.ref;
+  final a3Pointer = calloc<Struct3BytesInt2ByteAligned>();
+  final Struct3BytesInt2ByteAligned a3 = a3Pointer.ref;
+  final a4Pointer = calloc<Struct3BytesInt2ByteAligned>();
+  final Struct3BytesInt2ByteAligned a4 = a4Pointer.ref;
+  final a5Pointer = calloc<Struct3BytesInt2ByteAligned>();
+  final Struct3BytesInt2ByteAligned a5 = a5Pointer.ref;
+  final a6Pointer = calloc<Struct3BytesInt2ByteAligned>();
+  final Struct3BytesInt2ByteAligned a6 = a6Pointer.ref;
+  final a7Pointer = calloc<Struct3BytesInt2ByteAligned>();
+  final Struct3BytesInt2ByteAligned a7 = a7Pointer.ref;
+  final a8Pointer = calloc<Struct3BytesInt2ByteAligned>();
+  final Struct3BytesInt2ByteAligned a8 = a8Pointer.ref;
+  final a9Pointer = calloc<Struct3BytesInt2ByteAligned>();
+  final Struct3BytesInt2ByteAligned a9 = a9Pointer.ref;
 
   a0.a0 = -1;
   a0.a1 = 2;
@@ -1245,16 +1275,16 @@
 
   Expect.equals(10, result);
 
-  calloc.free(a0.addressOf);
-  calloc.free(a1.addressOf);
-  calloc.free(a2.addressOf);
-  calloc.free(a3.addressOf);
-  calloc.free(a4.addressOf);
-  calloc.free(a5.addressOf);
-  calloc.free(a6.addressOf);
-  calloc.free(a7.addressOf);
-  calloc.free(a8.addressOf);
-  calloc.free(a9.addressOf);
+  calloc.free(a0Pointer);
+  calloc.free(a1Pointer);
+  calloc.free(a2Pointer);
+  calloc.free(a3Pointer);
+  calloc.free(a4Pointer);
+  calloc.free(a5Pointer);
+  calloc.free(a6Pointer);
+  calloc.free(a7Pointer);
+  calloc.free(a8Pointer);
+  calloc.free(a9Pointer);
 }
 
 final passStruct4BytesHomogeneousInt16x10 = ffiTestFunctions.lookupFunction<
@@ -1284,16 +1314,26 @@
 /// Exactly word size on 32-bit architectures.
 /// 10 struct arguments will exhaust available registers.
 void testPassStruct4BytesHomogeneousInt16x10() {
-  Struct4BytesHomogeneousInt16 a0 = calloc<Struct4BytesHomogeneousInt16>().ref;
-  Struct4BytesHomogeneousInt16 a1 = calloc<Struct4BytesHomogeneousInt16>().ref;
-  Struct4BytesHomogeneousInt16 a2 = calloc<Struct4BytesHomogeneousInt16>().ref;
-  Struct4BytesHomogeneousInt16 a3 = calloc<Struct4BytesHomogeneousInt16>().ref;
-  Struct4BytesHomogeneousInt16 a4 = calloc<Struct4BytesHomogeneousInt16>().ref;
-  Struct4BytesHomogeneousInt16 a5 = calloc<Struct4BytesHomogeneousInt16>().ref;
-  Struct4BytesHomogeneousInt16 a6 = calloc<Struct4BytesHomogeneousInt16>().ref;
-  Struct4BytesHomogeneousInt16 a7 = calloc<Struct4BytesHomogeneousInt16>().ref;
-  Struct4BytesHomogeneousInt16 a8 = calloc<Struct4BytesHomogeneousInt16>().ref;
-  Struct4BytesHomogeneousInt16 a9 = calloc<Struct4BytesHomogeneousInt16>().ref;
+  final a0Pointer = calloc<Struct4BytesHomogeneousInt16>();
+  final Struct4BytesHomogeneousInt16 a0 = a0Pointer.ref;
+  final a1Pointer = calloc<Struct4BytesHomogeneousInt16>();
+  final Struct4BytesHomogeneousInt16 a1 = a1Pointer.ref;
+  final a2Pointer = calloc<Struct4BytesHomogeneousInt16>();
+  final Struct4BytesHomogeneousInt16 a2 = a2Pointer.ref;
+  final a3Pointer = calloc<Struct4BytesHomogeneousInt16>();
+  final Struct4BytesHomogeneousInt16 a3 = a3Pointer.ref;
+  final a4Pointer = calloc<Struct4BytesHomogeneousInt16>();
+  final Struct4BytesHomogeneousInt16 a4 = a4Pointer.ref;
+  final a5Pointer = calloc<Struct4BytesHomogeneousInt16>();
+  final Struct4BytesHomogeneousInt16 a5 = a5Pointer.ref;
+  final a6Pointer = calloc<Struct4BytesHomogeneousInt16>();
+  final Struct4BytesHomogeneousInt16 a6 = a6Pointer.ref;
+  final a7Pointer = calloc<Struct4BytesHomogeneousInt16>();
+  final Struct4BytesHomogeneousInt16 a7 = a7Pointer.ref;
+  final a8Pointer = calloc<Struct4BytesHomogeneousInt16>();
+  final Struct4BytesHomogeneousInt16 a8 = a8Pointer.ref;
+  final a9Pointer = calloc<Struct4BytesHomogeneousInt16>();
+  final Struct4BytesHomogeneousInt16 a9 = a9Pointer.ref;
 
   a0.a0 = -1;
   a0.a1 = 2;
@@ -1323,16 +1363,16 @@
 
   Expect.equals(10, result);
 
-  calloc.free(a0.addressOf);
-  calloc.free(a1.addressOf);
-  calloc.free(a2.addressOf);
-  calloc.free(a3.addressOf);
-  calloc.free(a4.addressOf);
-  calloc.free(a5.addressOf);
-  calloc.free(a6.addressOf);
-  calloc.free(a7.addressOf);
-  calloc.free(a8.addressOf);
-  calloc.free(a9.addressOf);
+  calloc.free(a0Pointer);
+  calloc.free(a1Pointer);
+  calloc.free(a2Pointer);
+  calloc.free(a3Pointer);
+  calloc.free(a4Pointer);
+  calloc.free(a5Pointer);
+  calloc.free(a6Pointer);
+  calloc.free(a7Pointer);
+  calloc.free(a8Pointer);
+  calloc.free(a9Pointer);
 }
 
 final passStruct7BytesHomogeneousUint8x10 = ffiTestFunctions.lookupFunction<
@@ -1362,16 +1402,26 @@
 /// Sub word size on 64 bit architectures.
 /// 10 struct arguments will exhaust available registers.
 void testPassStruct7BytesHomogeneousUint8x10() {
-  Struct7BytesHomogeneousUint8 a0 = calloc<Struct7BytesHomogeneousUint8>().ref;
-  Struct7BytesHomogeneousUint8 a1 = calloc<Struct7BytesHomogeneousUint8>().ref;
-  Struct7BytesHomogeneousUint8 a2 = calloc<Struct7BytesHomogeneousUint8>().ref;
-  Struct7BytesHomogeneousUint8 a3 = calloc<Struct7BytesHomogeneousUint8>().ref;
-  Struct7BytesHomogeneousUint8 a4 = calloc<Struct7BytesHomogeneousUint8>().ref;
-  Struct7BytesHomogeneousUint8 a5 = calloc<Struct7BytesHomogeneousUint8>().ref;
-  Struct7BytesHomogeneousUint8 a6 = calloc<Struct7BytesHomogeneousUint8>().ref;
-  Struct7BytesHomogeneousUint8 a7 = calloc<Struct7BytesHomogeneousUint8>().ref;
-  Struct7BytesHomogeneousUint8 a8 = calloc<Struct7BytesHomogeneousUint8>().ref;
-  Struct7BytesHomogeneousUint8 a9 = calloc<Struct7BytesHomogeneousUint8>().ref;
+  final a0Pointer = calloc<Struct7BytesHomogeneousUint8>();
+  final Struct7BytesHomogeneousUint8 a0 = a0Pointer.ref;
+  final a1Pointer = calloc<Struct7BytesHomogeneousUint8>();
+  final Struct7BytesHomogeneousUint8 a1 = a1Pointer.ref;
+  final a2Pointer = calloc<Struct7BytesHomogeneousUint8>();
+  final Struct7BytesHomogeneousUint8 a2 = a2Pointer.ref;
+  final a3Pointer = calloc<Struct7BytesHomogeneousUint8>();
+  final Struct7BytesHomogeneousUint8 a3 = a3Pointer.ref;
+  final a4Pointer = calloc<Struct7BytesHomogeneousUint8>();
+  final Struct7BytesHomogeneousUint8 a4 = a4Pointer.ref;
+  final a5Pointer = calloc<Struct7BytesHomogeneousUint8>();
+  final Struct7BytesHomogeneousUint8 a5 = a5Pointer.ref;
+  final a6Pointer = calloc<Struct7BytesHomogeneousUint8>();
+  final Struct7BytesHomogeneousUint8 a6 = a6Pointer.ref;
+  final a7Pointer = calloc<Struct7BytesHomogeneousUint8>();
+  final Struct7BytesHomogeneousUint8 a7 = a7Pointer.ref;
+  final a8Pointer = calloc<Struct7BytesHomogeneousUint8>();
+  final Struct7BytesHomogeneousUint8 a8 = a8Pointer.ref;
+  final a9Pointer = calloc<Struct7BytesHomogeneousUint8>();
+  final Struct7BytesHomogeneousUint8 a9 = a9Pointer.ref;
 
   a0.a0 = 1;
   a0.a1 = 2;
@@ -1451,16 +1501,16 @@
 
   Expect.equals(2485, result);
 
-  calloc.free(a0.addressOf);
-  calloc.free(a1.addressOf);
-  calloc.free(a2.addressOf);
-  calloc.free(a3.addressOf);
-  calloc.free(a4.addressOf);
-  calloc.free(a5.addressOf);
-  calloc.free(a6.addressOf);
-  calloc.free(a7.addressOf);
-  calloc.free(a8.addressOf);
-  calloc.free(a9.addressOf);
+  calloc.free(a0Pointer);
+  calloc.free(a1Pointer);
+  calloc.free(a2Pointer);
+  calloc.free(a3Pointer);
+  calloc.free(a4Pointer);
+  calloc.free(a5Pointer);
+  calloc.free(a6Pointer);
+  calloc.free(a7Pointer);
+  calloc.free(a8Pointer);
+  calloc.free(a9Pointer);
 }
 
 final passStruct7BytesInt4ByteAlignedx10 = ffiTestFunctions.lookupFunction<
@@ -1491,16 +1541,26 @@
 /// With alignment rules taken into account size is 8 bytes.
 /// 10 struct arguments will exhaust available registers.
 void testPassStruct7BytesInt4ByteAlignedx10() {
-  Struct7BytesInt4ByteAligned a0 = calloc<Struct7BytesInt4ByteAligned>().ref;
-  Struct7BytesInt4ByteAligned a1 = calloc<Struct7BytesInt4ByteAligned>().ref;
-  Struct7BytesInt4ByteAligned a2 = calloc<Struct7BytesInt4ByteAligned>().ref;
-  Struct7BytesInt4ByteAligned a3 = calloc<Struct7BytesInt4ByteAligned>().ref;
-  Struct7BytesInt4ByteAligned a4 = calloc<Struct7BytesInt4ByteAligned>().ref;
-  Struct7BytesInt4ByteAligned a5 = calloc<Struct7BytesInt4ByteAligned>().ref;
-  Struct7BytesInt4ByteAligned a6 = calloc<Struct7BytesInt4ByteAligned>().ref;
-  Struct7BytesInt4ByteAligned a7 = calloc<Struct7BytesInt4ByteAligned>().ref;
-  Struct7BytesInt4ByteAligned a8 = calloc<Struct7BytesInt4ByteAligned>().ref;
-  Struct7BytesInt4ByteAligned a9 = calloc<Struct7BytesInt4ByteAligned>().ref;
+  final a0Pointer = calloc<Struct7BytesInt4ByteAligned>();
+  final Struct7BytesInt4ByteAligned a0 = a0Pointer.ref;
+  final a1Pointer = calloc<Struct7BytesInt4ByteAligned>();
+  final Struct7BytesInt4ByteAligned a1 = a1Pointer.ref;
+  final a2Pointer = calloc<Struct7BytesInt4ByteAligned>();
+  final Struct7BytesInt4ByteAligned a2 = a2Pointer.ref;
+  final a3Pointer = calloc<Struct7BytesInt4ByteAligned>();
+  final Struct7BytesInt4ByteAligned a3 = a3Pointer.ref;
+  final a4Pointer = calloc<Struct7BytesInt4ByteAligned>();
+  final Struct7BytesInt4ByteAligned a4 = a4Pointer.ref;
+  final a5Pointer = calloc<Struct7BytesInt4ByteAligned>();
+  final Struct7BytesInt4ByteAligned a5 = a5Pointer.ref;
+  final a6Pointer = calloc<Struct7BytesInt4ByteAligned>();
+  final Struct7BytesInt4ByteAligned a6 = a6Pointer.ref;
+  final a7Pointer = calloc<Struct7BytesInt4ByteAligned>();
+  final Struct7BytesInt4ByteAligned a7 = a7Pointer.ref;
+  final a8Pointer = calloc<Struct7BytesInt4ByteAligned>();
+  final Struct7BytesInt4ByteAligned a8 = a8Pointer.ref;
+  final a9Pointer = calloc<Struct7BytesInt4ByteAligned>();
+  final Struct7BytesInt4ByteAligned a9 = a9Pointer.ref;
 
   a0.a0 = -1;
   a0.a1 = 2;
@@ -1540,16 +1600,16 @@
 
   Expect.equals(15, result);
 
-  calloc.free(a0.addressOf);
-  calloc.free(a1.addressOf);
-  calloc.free(a2.addressOf);
-  calloc.free(a3.addressOf);
-  calloc.free(a4.addressOf);
-  calloc.free(a5.addressOf);
-  calloc.free(a6.addressOf);
-  calloc.free(a7.addressOf);
-  calloc.free(a8.addressOf);
-  calloc.free(a9.addressOf);
+  calloc.free(a0Pointer);
+  calloc.free(a1Pointer);
+  calloc.free(a2Pointer);
+  calloc.free(a3Pointer);
+  calloc.free(a4Pointer);
+  calloc.free(a5Pointer);
+  calloc.free(a6Pointer);
+  calloc.free(a7Pointer);
+  calloc.free(a8Pointer);
+  calloc.free(a9Pointer);
 }
 
 final passStruct8BytesIntx10 = ffiTestFunctions.lookupFunction<
@@ -1579,16 +1639,26 @@
 /// Exactly word size struct on 64bit architectures.
 /// 10 struct arguments will exhaust available registers.
 void testPassStruct8BytesIntx10() {
-  Struct8BytesInt a0 = calloc<Struct8BytesInt>().ref;
-  Struct8BytesInt a1 = calloc<Struct8BytesInt>().ref;
-  Struct8BytesInt a2 = calloc<Struct8BytesInt>().ref;
-  Struct8BytesInt a3 = calloc<Struct8BytesInt>().ref;
-  Struct8BytesInt a4 = calloc<Struct8BytesInt>().ref;
-  Struct8BytesInt a5 = calloc<Struct8BytesInt>().ref;
-  Struct8BytesInt a6 = calloc<Struct8BytesInt>().ref;
-  Struct8BytesInt a7 = calloc<Struct8BytesInt>().ref;
-  Struct8BytesInt a8 = calloc<Struct8BytesInt>().ref;
-  Struct8BytesInt a9 = calloc<Struct8BytesInt>().ref;
+  final a0Pointer = calloc<Struct8BytesInt>();
+  final Struct8BytesInt a0 = a0Pointer.ref;
+  final a1Pointer = calloc<Struct8BytesInt>();
+  final Struct8BytesInt a1 = a1Pointer.ref;
+  final a2Pointer = calloc<Struct8BytesInt>();
+  final Struct8BytesInt a2 = a2Pointer.ref;
+  final a3Pointer = calloc<Struct8BytesInt>();
+  final Struct8BytesInt a3 = a3Pointer.ref;
+  final a4Pointer = calloc<Struct8BytesInt>();
+  final Struct8BytesInt a4 = a4Pointer.ref;
+  final a5Pointer = calloc<Struct8BytesInt>();
+  final Struct8BytesInt a5 = a5Pointer.ref;
+  final a6Pointer = calloc<Struct8BytesInt>();
+  final Struct8BytesInt a6 = a6Pointer.ref;
+  final a7Pointer = calloc<Struct8BytesInt>();
+  final Struct8BytesInt a7 = a7Pointer.ref;
+  final a8Pointer = calloc<Struct8BytesInt>();
+  final Struct8BytesInt a8 = a8Pointer.ref;
+  final a9Pointer = calloc<Struct8BytesInt>();
+  final Struct8BytesInt a9 = a9Pointer.ref;
 
   a0.a0 = -1;
   a0.a1 = 2;
@@ -1627,16 +1697,16 @@
 
   Expect.equals(15, result);
 
-  calloc.free(a0.addressOf);
-  calloc.free(a1.addressOf);
-  calloc.free(a2.addressOf);
-  calloc.free(a3.addressOf);
-  calloc.free(a4.addressOf);
-  calloc.free(a5.addressOf);
-  calloc.free(a6.addressOf);
-  calloc.free(a7.addressOf);
-  calloc.free(a8.addressOf);
-  calloc.free(a9.addressOf);
+  calloc.free(a0Pointer);
+  calloc.free(a1Pointer);
+  calloc.free(a2Pointer);
+  calloc.free(a3Pointer);
+  calloc.free(a4Pointer);
+  calloc.free(a5Pointer);
+  calloc.free(a6Pointer);
+  calloc.free(a7Pointer);
+  calloc.free(a8Pointer);
+  calloc.free(a9Pointer);
 }
 
 final passStruct8BytesHomogeneousFloatx10 = ffiTestFunctions.lookupFunction<
@@ -1666,16 +1736,26 @@
 /// Arguments passed in FP registers as long as they fit.
 /// 10 struct arguments will exhaust available registers.
 void testPassStruct8BytesHomogeneousFloatx10() {
-  Struct8BytesHomogeneousFloat a0 = calloc<Struct8BytesHomogeneousFloat>().ref;
-  Struct8BytesHomogeneousFloat a1 = calloc<Struct8BytesHomogeneousFloat>().ref;
-  Struct8BytesHomogeneousFloat a2 = calloc<Struct8BytesHomogeneousFloat>().ref;
-  Struct8BytesHomogeneousFloat a3 = calloc<Struct8BytesHomogeneousFloat>().ref;
-  Struct8BytesHomogeneousFloat a4 = calloc<Struct8BytesHomogeneousFloat>().ref;
-  Struct8BytesHomogeneousFloat a5 = calloc<Struct8BytesHomogeneousFloat>().ref;
-  Struct8BytesHomogeneousFloat a6 = calloc<Struct8BytesHomogeneousFloat>().ref;
-  Struct8BytesHomogeneousFloat a7 = calloc<Struct8BytesHomogeneousFloat>().ref;
-  Struct8BytesHomogeneousFloat a8 = calloc<Struct8BytesHomogeneousFloat>().ref;
-  Struct8BytesHomogeneousFloat a9 = calloc<Struct8BytesHomogeneousFloat>().ref;
+  final a0Pointer = calloc<Struct8BytesHomogeneousFloat>();
+  final Struct8BytesHomogeneousFloat a0 = a0Pointer.ref;
+  final a1Pointer = calloc<Struct8BytesHomogeneousFloat>();
+  final Struct8BytesHomogeneousFloat a1 = a1Pointer.ref;
+  final a2Pointer = calloc<Struct8BytesHomogeneousFloat>();
+  final Struct8BytesHomogeneousFloat a2 = a2Pointer.ref;
+  final a3Pointer = calloc<Struct8BytesHomogeneousFloat>();
+  final Struct8BytesHomogeneousFloat a3 = a3Pointer.ref;
+  final a4Pointer = calloc<Struct8BytesHomogeneousFloat>();
+  final Struct8BytesHomogeneousFloat a4 = a4Pointer.ref;
+  final a5Pointer = calloc<Struct8BytesHomogeneousFloat>();
+  final Struct8BytesHomogeneousFloat a5 = a5Pointer.ref;
+  final a6Pointer = calloc<Struct8BytesHomogeneousFloat>();
+  final Struct8BytesHomogeneousFloat a6 = a6Pointer.ref;
+  final a7Pointer = calloc<Struct8BytesHomogeneousFloat>();
+  final Struct8BytesHomogeneousFloat a7 = a7Pointer.ref;
+  final a8Pointer = calloc<Struct8BytesHomogeneousFloat>();
+  final Struct8BytesHomogeneousFloat a8 = a8Pointer.ref;
+  final a9Pointer = calloc<Struct8BytesHomogeneousFloat>();
+  final Struct8BytesHomogeneousFloat a9 = a9Pointer.ref;
 
   a0.a0 = -1.0;
   a0.a1 = 2.0;
@@ -1705,16 +1785,16 @@
 
   Expect.approxEquals(10.0, result);
 
-  calloc.free(a0.addressOf);
-  calloc.free(a1.addressOf);
-  calloc.free(a2.addressOf);
-  calloc.free(a3.addressOf);
-  calloc.free(a4.addressOf);
-  calloc.free(a5.addressOf);
-  calloc.free(a6.addressOf);
-  calloc.free(a7.addressOf);
-  calloc.free(a8.addressOf);
-  calloc.free(a9.addressOf);
+  calloc.free(a0Pointer);
+  calloc.free(a1Pointer);
+  calloc.free(a2Pointer);
+  calloc.free(a3Pointer);
+  calloc.free(a4Pointer);
+  calloc.free(a5Pointer);
+  calloc.free(a6Pointer);
+  calloc.free(a7Pointer);
+  calloc.free(a8Pointer);
+  calloc.free(a9Pointer);
 }
 
 final passStruct8BytesMixedx10 = ffiTestFunctions.lookupFunction<
@@ -1744,16 +1824,26 @@
 /// On x64, arguments go in int registers because it is not only float.
 /// 10 struct arguments will exhaust available registers.
 void testPassStruct8BytesMixedx10() {
-  Struct8BytesMixed a0 = calloc<Struct8BytesMixed>().ref;
-  Struct8BytesMixed a1 = calloc<Struct8BytesMixed>().ref;
-  Struct8BytesMixed a2 = calloc<Struct8BytesMixed>().ref;
-  Struct8BytesMixed a3 = calloc<Struct8BytesMixed>().ref;
-  Struct8BytesMixed a4 = calloc<Struct8BytesMixed>().ref;
-  Struct8BytesMixed a5 = calloc<Struct8BytesMixed>().ref;
-  Struct8BytesMixed a6 = calloc<Struct8BytesMixed>().ref;
-  Struct8BytesMixed a7 = calloc<Struct8BytesMixed>().ref;
-  Struct8BytesMixed a8 = calloc<Struct8BytesMixed>().ref;
-  Struct8BytesMixed a9 = calloc<Struct8BytesMixed>().ref;
+  final a0Pointer = calloc<Struct8BytesMixed>();
+  final Struct8BytesMixed a0 = a0Pointer.ref;
+  final a1Pointer = calloc<Struct8BytesMixed>();
+  final Struct8BytesMixed a1 = a1Pointer.ref;
+  final a2Pointer = calloc<Struct8BytesMixed>();
+  final Struct8BytesMixed a2 = a2Pointer.ref;
+  final a3Pointer = calloc<Struct8BytesMixed>();
+  final Struct8BytesMixed a3 = a3Pointer.ref;
+  final a4Pointer = calloc<Struct8BytesMixed>();
+  final Struct8BytesMixed a4 = a4Pointer.ref;
+  final a5Pointer = calloc<Struct8BytesMixed>();
+  final Struct8BytesMixed a5 = a5Pointer.ref;
+  final a6Pointer = calloc<Struct8BytesMixed>();
+  final Struct8BytesMixed a6 = a6Pointer.ref;
+  final a7Pointer = calloc<Struct8BytesMixed>();
+  final Struct8BytesMixed a7 = a7Pointer.ref;
+  final a8Pointer = calloc<Struct8BytesMixed>();
+  final Struct8BytesMixed a8 = a8Pointer.ref;
+  final a9Pointer = calloc<Struct8BytesMixed>();
+  final Struct8BytesMixed a9 = a9Pointer.ref;
 
   a0.a0 = -1.0;
   a0.a1 = 2;
@@ -1793,16 +1883,16 @@
 
   Expect.approxEquals(15.0, result);
 
-  calloc.free(a0.addressOf);
-  calloc.free(a1.addressOf);
-  calloc.free(a2.addressOf);
-  calloc.free(a3.addressOf);
-  calloc.free(a4.addressOf);
-  calloc.free(a5.addressOf);
-  calloc.free(a6.addressOf);
-  calloc.free(a7.addressOf);
-  calloc.free(a8.addressOf);
-  calloc.free(a9.addressOf);
+  calloc.free(a0Pointer);
+  calloc.free(a1Pointer);
+  calloc.free(a2Pointer);
+  calloc.free(a3Pointer);
+  calloc.free(a4Pointer);
+  calloc.free(a5Pointer);
+  calloc.free(a6Pointer);
+  calloc.free(a7Pointer);
+  calloc.free(a8Pointer);
+  calloc.free(a9Pointer);
 }
 
 final passStruct9BytesHomogeneousUint8x10 = ffiTestFunctions.lookupFunction<
@@ -1835,16 +1925,26 @@
 /// Tests upper bytes in the integer registers that are partly filled.
 /// Tests stack alignment of non word size stack arguments.
 void testPassStruct9BytesHomogeneousUint8x10() {
-  Struct9BytesHomogeneousUint8 a0 = calloc<Struct9BytesHomogeneousUint8>().ref;
-  Struct9BytesHomogeneousUint8 a1 = calloc<Struct9BytesHomogeneousUint8>().ref;
-  Struct9BytesHomogeneousUint8 a2 = calloc<Struct9BytesHomogeneousUint8>().ref;
-  Struct9BytesHomogeneousUint8 a3 = calloc<Struct9BytesHomogeneousUint8>().ref;
-  Struct9BytesHomogeneousUint8 a4 = calloc<Struct9BytesHomogeneousUint8>().ref;
-  Struct9BytesHomogeneousUint8 a5 = calloc<Struct9BytesHomogeneousUint8>().ref;
-  Struct9BytesHomogeneousUint8 a6 = calloc<Struct9BytesHomogeneousUint8>().ref;
-  Struct9BytesHomogeneousUint8 a7 = calloc<Struct9BytesHomogeneousUint8>().ref;
-  Struct9BytesHomogeneousUint8 a8 = calloc<Struct9BytesHomogeneousUint8>().ref;
-  Struct9BytesHomogeneousUint8 a9 = calloc<Struct9BytesHomogeneousUint8>().ref;
+  final a0Pointer = calloc<Struct9BytesHomogeneousUint8>();
+  final Struct9BytesHomogeneousUint8 a0 = a0Pointer.ref;
+  final a1Pointer = calloc<Struct9BytesHomogeneousUint8>();
+  final Struct9BytesHomogeneousUint8 a1 = a1Pointer.ref;
+  final a2Pointer = calloc<Struct9BytesHomogeneousUint8>();
+  final Struct9BytesHomogeneousUint8 a2 = a2Pointer.ref;
+  final a3Pointer = calloc<Struct9BytesHomogeneousUint8>();
+  final Struct9BytesHomogeneousUint8 a3 = a3Pointer.ref;
+  final a4Pointer = calloc<Struct9BytesHomogeneousUint8>();
+  final Struct9BytesHomogeneousUint8 a4 = a4Pointer.ref;
+  final a5Pointer = calloc<Struct9BytesHomogeneousUint8>();
+  final Struct9BytesHomogeneousUint8 a5 = a5Pointer.ref;
+  final a6Pointer = calloc<Struct9BytesHomogeneousUint8>();
+  final Struct9BytesHomogeneousUint8 a6 = a6Pointer.ref;
+  final a7Pointer = calloc<Struct9BytesHomogeneousUint8>();
+  final Struct9BytesHomogeneousUint8 a7 = a7Pointer.ref;
+  final a8Pointer = calloc<Struct9BytesHomogeneousUint8>();
+  final Struct9BytesHomogeneousUint8 a8 = a8Pointer.ref;
+  final a9Pointer = calloc<Struct9BytesHomogeneousUint8>();
+  final Struct9BytesHomogeneousUint8 a9 = a9Pointer.ref;
 
   a0.a0 = 1;
   a0.a1 = 2;
@@ -1944,16 +2044,16 @@
 
   Expect.equals(4095, result);
 
-  calloc.free(a0.addressOf);
-  calloc.free(a1.addressOf);
-  calloc.free(a2.addressOf);
-  calloc.free(a3.addressOf);
-  calloc.free(a4.addressOf);
-  calloc.free(a5.addressOf);
-  calloc.free(a6.addressOf);
-  calloc.free(a7.addressOf);
-  calloc.free(a8.addressOf);
-  calloc.free(a9.addressOf);
+  calloc.free(a0Pointer);
+  calloc.free(a1Pointer);
+  calloc.free(a2Pointer);
+  calloc.free(a3Pointer);
+  calloc.free(a4Pointer);
+  calloc.free(a5Pointer);
+  calloc.free(a6Pointer);
+  calloc.free(a7Pointer);
+  calloc.free(a8Pointer);
+  calloc.free(a9Pointer);
 }
 
 final passStruct9BytesInt4Or8ByteAlignedx10 = ffiTestFunctions.lookupFunction<
@@ -1986,26 +2086,26 @@
 /// 10 struct arguments will exhaust available registers.
 ///
 void testPassStruct9BytesInt4Or8ByteAlignedx10() {
-  Struct9BytesInt4Or8ByteAligned a0 =
-      calloc<Struct9BytesInt4Or8ByteAligned>().ref;
-  Struct9BytesInt4Or8ByteAligned a1 =
-      calloc<Struct9BytesInt4Or8ByteAligned>().ref;
-  Struct9BytesInt4Or8ByteAligned a2 =
-      calloc<Struct9BytesInt4Or8ByteAligned>().ref;
-  Struct9BytesInt4Or8ByteAligned a3 =
-      calloc<Struct9BytesInt4Or8ByteAligned>().ref;
-  Struct9BytesInt4Or8ByteAligned a4 =
-      calloc<Struct9BytesInt4Or8ByteAligned>().ref;
-  Struct9BytesInt4Or8ByteAligned a5 =
-      calloc<Struct9BytesInt4Or8ByteAligned>().ref;
-  Struct9BytesInt4Or8ByteAligned a6 =
-      calloc<Struct9BytesInt4Or8ByteAligned>().ref;
-  Struct9BytesInt4Or8ByteAligned a7 =
-      calloc<Struct9BytesInt4Or8ByteAligned>().ref;
-  Struct9BytesInt4Or8ByteAligned a8 =
-      calloc<Struct9BytesInt4Or8ByteAligned>().ref;
-  Struct9BytesInt4Or8ByteAligned a9 =
-      calloc<Struct9BytesInt4Or8ByteAligned>().ref;
+  final a0Pointer = calloc<Struct9BytesInt4Or8ByteAligned>();
+  final Struct9BytesInt4Or8ByteAligned a0 = a0Pointer.ref;
+  final a1Pointer = calloc<Struct9BytesInt4Or8ByteAligned>();
+  final Struct9BytesInt4Or8ByteAligned a1 = a1Pointer.ref;
+  final a2Pointer = calloc<Struct9BytesInt4Or8ByteAligned>();
+  final Struct9BytesInt4Or8ByteAligned a2 = a2Pointer.ref;
+  final a3Pointer = calloc<Struct9BytesInt4Or8ByteAligned>();
+  final Struct9BytesInt4Or8ByteAligned a3 = a3Pointer.ref;
+  final a4Pointer = calloc<Struct9BytesInt4Or8ByteAligned>();
+  final Struct9BytesInt4Or8ByteAligned a4 = a4Pointer.ref;
+  final a5Pointer = calloc<Struct9BytesInt4Or8ByteAligned>();
+  final Struct9BytesInt4Or8ByteAligned a5 = a5Pointer.ref;
+  final a6Pointer = calloc<Struct9BytesInt4Or8ByteAligned>();
+  final Struct9BytesInt4Or8ByteAligned a6 = a6Pointer.ref;
+  final a7Pointer = calloc<Struct9BytesInt4Or8ByteAligned>();
+  final Struct9BytesInt4Or8ByteAligned a7 = a7Pointer.ref;
+  final a8Pointer = calloc<Struct9BytesInt4Or8ByteAligned>();
+  final Struct9BytesInt4Or8ByteAligned a8 = a8Pointer.ref;
+  final a9Pointer = calloc<Struct9BytesInt4Or8ByteAligned>();
+  final Struct9BytesInt4Or8ByteAligned a9 = a9Pointer.ref;
 
   a0.a0 = -1;
   a0.a1 = 2;
@@ -2035,16 +2135,16 @@
 
   Expect.equals(10, result);
 
-  calloc.free(a0.addressOf);
-  calloc.free(a1.addressOf);
-  calloc.free(a2.addressOf);
-  calloc.free(a3.addressOf);
-  calloc.free(a4.addressOf);
-  calloc.free(a5.addressOf);
-  calloc.free(a6.addressOf);
-  calloc.free(a7.addressOf);
-  calloc.free(a8.addressOf);
-  calloc.free(a9.addressOf);
+  calloc.free(a0Pointer);
+  calloc.free(a1Pointer);
+  calloc.free(a2Pointer);
+  calloc.free(a3Pointer);
+  calloc.free(a4Pointer);
+  calloc.free(a5Pointer);
+  calloc.free(a6Pointer);
+  calloc.free(a7Pointer);
+  calloc.free(a8Pointer);
+  calloc.free(a9Pointer);
 }
 
 final passStruct12BytesHomogeneousFloatx6 = ffiTestFunctions.lookupFunction<
@@ -2067,18 +2167,18 @@
 /// Struct arguments will exhaust available registers, and leave some empty.
 /// The last argument is to test whether arguments are backfilled.
 void testPassStruct12BytesHomogeneousFloatx6() {
-  Struct12BytesHomogeneousFloat a0 =
-      calloc<Struct12BytesHomogeneousFloat>().ref;
-  Struct12BytesHomogeneousFloat a1 =
-      calloc<Struct12BytesHomogeneousFloat>().ref;
-  Struct12BytesHomogeneousFloat a2 =
-      calloc<Struct12BytesHomogeneousFloat>().ref;
-  Struct12BytesHomogeneousFloat a3 =
-      calloc<Struct12BytesHomogeneousFloat>().ref;
-  Struct12BytesHomogeneousFloat a4 =
-      calloc<Struct12BytesHomogeneousFloat>().ref;
-  Struct12BytesHomogeneousFloat a5 =
-      calloc<Struct12BytesHomogeneousFloat>().ref;
+  final a0Pointer = calloc<Struct12BytesHomogeneousFloat>();
+  final Struct12BytesHomogeneousFloat a0 = a0Pointer.ref;
+  final a1Pointer = calloc<Struct12BytesHomogeneousFloat>();
+  final Struct12BytesHomogeneousFloat a1 = a1Pointer.ref;
+  final a2Pointer = calloc<Struct12BytesHomogeneousFloat>();
+  final Struct12BytesHomogeneousFloat a2 = a2Pointer.ref;
+  final a3Pointer = calloc<Struct12BytesHomogeneousFloat>();
+  final Struct12BytesHomogeneousFloat a3 = a3Pointer.ref;
+  final a4Pointer = calloc<Struct12BytesHomogeneousFloat>();
+  final Struct12BytesHomogeneousFloat a4 = a4Pointer.ref;
+  final a5Pointer = calloc<Struct12BytesHomogeneousFloat>();
+  final Struct12BytesHomogeneousFloat a5 = a5Pointer.ref;
 
   a0.a0 = -1.0;
   a0.a1 = 2.0;
@@ -2105,12 +2205,12 @@
 
   Expect.approxEquals(9.0, result);
 
-  calloc.free(a0.addressOf);
-  calloc.free(a1.addressOf);
-  calloc.free(a2.addressOf);
-  calloc.free(a3.addressOf);
-  calloc.free(a4.addressOf);
-  calloc.free(a5.addressOf);
+  calloc.free(a0Pointer);
+  calloc.free(a1Pointer);
+  calloc.free(a2Pointer);
+  calloc.free(a3Pointer);
+  calloc.free(a4Pointer);
+  calloc.free(a5Pointer);
 }
 
 final passStruct16BytesHomogeneousFloatx5 = ffiTestFunctions.lookupFunction<
@@ -2131,16 +2231,16 @@
 /// Arguments in FPU registers on arm hardfp and arm64.
 /// 5 struct arguments will exhaust available registers.
 void testPassStruct16BytesHomogeneousFloatx5() {
-  Struct16BytesHomogeneousFloat a0 =
-      calloc<Struct16BytesHomogeneousFloat>().ref;
-  Struct16BytesHomogeneousFloat a1 =
-      calloc<Struct16BytesHomogeneousFloat>().ref;
-  Struct16BytesHomogeneousFloat a2 =
-      calloc<Struct16BytesHomogeneousFloat>().ref;
-  Struct16BytesHomogeneousFloat a3 =
-      calloc<Struct16BytesHomogeneousFloat>().ref;
-  Struct16BytesHomogeneousFloat a4 =
-      calloc<Struct16BytesHomogeneousFloat>().ref;
+  final a0Pointer = calloc<Struct16BytesHomogeneousFloat>();
+  final Struct16BytesHomogeneousFloat a0 = a0Pointer.ref;
+  final a1Pointer = calloc<Struct16BytesHomogeneousFloat>();
+  final Struct16BytesHomogeneousFloat a1 = a1Pointer.ref;
+  final a2Pointer = calloc<Struct16BytesHomogeneousFloat>();
+  final Struct16BytesHomogeneousFloat a2 = a2Pointer.ref;
+  final a3Pointer = calloc<Struct16BytesHomogeneousFloat>();
+  final Struct16BytesHomogeneousFloat a3 = a3Pointer.ref;
+  final a4Pointer = calloc<Struct16BytesHomogeneousFloat>();
+  final Struct16BytesHomogeneousFloat a4 = a4Pointer.ref;
 
   a0.a0 = -1.0;
   a0.a1 = 2.0;
@@ -2169,11 +2269,11 @@
 
   Expect.approxEquals(10.0, result);
 
-  calloc.free(a0.addressOf);
-  calloc.free(a1.addressOf);
-  calloc.free(a2.addressOf);
-  calloc.free(a3.addressOf);
-  calloc.free(a4.addressOf);
+  calloc.free(a0Pointer);
+  calloc.free(a1Pointer);
+  calloc.free(a2Pointer);
+  calloc.free(a3Pointer);
+  calloc.free(a4Pointer);
 }
 
 final passStruct16BytesMixedx10 = ffiTestFunctions.lookupFunction<
@@ -2205,16 +2305,26 @@
 /// The rest goes on the stack.
 /// On arm, arguments are 8 byte aligned.
 void testPassStruct16BytesMixedx10() {
-  Struct16BytesMixed a0 = calloc<Struct16BytesMixed>().ref;
-  Struct16BytesMixed a1 = calloc<Struct16BytesMixed>().ref;
-  Struct16BytesMixed a2 = calloc<Struct16BytesMixed>().ref;
-  Struct16BytesMixed a3 = calloc<Struct16BytesMixed>().ref;
-  Struct16BytesMixed a4 = calloc<Struct16BytesMixed>().ref;
-  Struct16BytesMixed a5 = calloc<Struct16BytesMixed>().ref;
-  Struct16BytesMixed a6 = calloc<Struct16BytesMixed>().ref;
-  Struct16BytesMixed a7 = calloc<Struct16BytesMixed>().ref;
-  Struct16BytesMixed a8 = calloc<Struct16BytesMixed>().ref;
-  Struct16BytesMixed a9 = calloc<Struct16BytesMixed>().ref;
+  final a0Pointer = calloc<Struct16BytesMixed>();
+  final Struct16BytesMixed a0 = a0Pointer.ref;
+  final a1Pointer = calloc<Struct16BytesMixed>();
+  final Struct16BytesMixed a1 = a1Pointer.ref;
+  final a2Pointer = calloc<Struct16BytesMixed>();
+  final Struct16BytesMixed a2 = a2Pointer.ref;
+  final a3Pointer = calloc<Struct16BytesMixed>();
+  final Struct16BytesMixed a3 = a3Pointer.ref;
+  final a4Pointer = calloc<Struct16BytesMixed>();
+  final Struct16BytesMixed a4 = a4Pointer.ref;
+  final a5Pointer = calloc<Struct16BytesMixed>();
+  final Struct16BytesMixed a5 = a5Pointer.ref;
+  final a6Pointer = calloc<Struct16BytesMixed>();
+  final Struct16BytesMixed a6 = a6Pointer.ref;
+  final a7Pointer = calloc<Struct16BytesMixed>();
+  final Struct16BytesMixed a7 = a7Pointer.ref;
+  final a8Pointer = calloc<Struct16BytesMixed>();
+  final Struct16BytesMixed a8 = a8Pointer.ref;
+  final a9Pointer = calloc<Struct16BytesMixed>();
+  final Struct16BytesMixed a9 = a9Pointer.ref;
 
   a0.a0 = -1.0;
   a0.a1 = 2;
@@ -2244,16 +2354,16 @@
 
   Expect.approxEquals(10.0, result);
 
-  calloc.free(a0.addressOf);
-  calloc.free(a1.addressOf);
-  calloc.free(a2.addressOf);
-  calloc.free(a3.addressOf);
-  calloc.free(a4.addressOf);
-  calloc.free(a5.addressOf);
-  calloc.free(a6.addressOf);
-  calloc.free(a7.addressOf);
-  calloc.free(a8.addressOf);
-  calloc.free(a9.addressOf);
+  calloc.free(a0Pointer);
+  calloc.free(a1Pointer);
+  calloc.free(a2Pointer);
+  calloc.free(a3Pointer);
+  calloc.free(a4Pointer);
+  calloc.free(a5Pointer);
+  calloc.free(a6Pointer);
+  calloc.free(a7Pointer);
+  calloc.free(a8Pointer);
+  calloc.free(a9Pointer);
 }
 
 final passStruct16BytesMixed2x10 = ffiTestFunctions.lookupFunction<
@@ -2285,16 +2395,26 @@
 /// The rest goes on the stack.
 /// On arm, arguments are 4 byte aligned.
 void testPassStruct16BytesMixed2x10() {
-  Struct16BytesMixed2 a0 = calloc<Struct16BytesMixed2>().ref;
-  Struct16BytesMixed2 a1 = calloc<Struct16BytesMixed2>().ref;
-  Struct16BytesMixed2 a2 = calloc<Struct16BytesMixed2>().ref;
-  Struct16BytesMixed2 a3 = calloc<Struct16BytesMixed2>().ref;
-  Struct16BytesMixed2 a4 = calloc<Struct16BytesMixed2>().ref;
-  Struct16BytesMixed2 a5 = calloc<Struct16BytesMixed2>().ref;
-  Struct16BytesMixed2 a6 = calloc<Struct16BytesMixed2>().ref;
-  Struct16BytesMixed2 a7 = calloc<Struct16BytesMixed2>().ref;
-  Struct16BytesMixed2 a8 = calloc<Struct16BytesMixed2>().ref;
-  Struct16BytesMixed2 a9 = calloc<Struct16BytesMixed2>().ref;
+  final a0Pointer = calloc<Struct16BytesMixed2>();
+  final Struct16BytesMixed2 a0 = a0Pointer.ref;
+  final a1Pointer = calloc<Struct16BytesMixed2>();
+  final Struct16BytesMixed2 a1 = a1Pointer.ref;
+  final a2Pointer = calloc<Struct16BytesMixed2>();
+  final Struct16BytesMixed2 a2 = a2Pointer.ref;
+  final a3Pointer = calloc<Struct16BytesMixed2>();
+  final Struct16BytesMixed2 a3 = a3Pointer.ref;
+  final a4Pointer = calloc<Struct16BytesMixed2>();
+  final Struct16BytesMixed2 a4 = a4Pointer.ref;
+  final a5Pointer = calloc<Struct16BytesMixed2>();
+  final Struct16BytesMixed2 a5 = a5Pointer.ref;
+  final a6Pointer = calloc<Struct16BytesMixed2>();
+  final Struct16BytesMixed2 a6 = a6Pointer.ref;
+  final a7Pointer = calloc<Struct16BytesMixed2>();
+  final Struct16BytesMixed2 a7 = a7Pointer.ref;
+  final a8Pointer = calloc<Struct16BytesMixed2>();
+  final Struct16BytesMixed2 a8 = a8Pointer.ref;
+  final a9Pointer = calloc<Struct16BytesMixed2>();
+  final Struct16BytesMixed2 a9 = a9Pointer.ref;
 
   a0.a0 = -1.0;
   a0.a1 = 2.0;
@@ -2344,16 +2464,16 @@
 
   Expect.approxEquals(20.0, result);
 
-  calloc.free(a0.addressOf);
-  calloc.free(a1.addressOf);
-  calloc.free(a2.addressOf);
-  calloc.free(a3.addressOf);
-  calloc.free(a4.addressOf);
-  calloc.free(a5.addressOf);
-  calloc.free(a6.addressOf);
-  calloc.free(a7.addressOf);
-  calloc.free(a8.addressOf);
-  calloc.free(a9.addressOf);
+  calloc.free(a0Pointer);
+  calloc.free(a1Pointer);
+  calloc.free(a2Pointer);
+  calloc.free(a3Pointer);
+  calloc.free(a4Pointer);
+  calloc.free(a5Pointer);
+  calloc.free(a6Pointer);
+  calloc.free(a7Pointer);
+  calloc.free(a8Pointer);
+  calloc.free(a9Pointer);
 }
 
 final passStruct17BytesIntx10 = ffiTestFunctions.lookupFunction<
@@ -2383,16 +2503,26 @@
 /// Arguments are passed as pointer to copy on arm64.
 /// Tests that the memory allocated for copies are rounded up to word size.
 void testPassStruct17BytesIntx10() {
-  Struct17BytesInt a0 = calloc<Struct17BytesInt>().ref;
-  Struct17BytesInt a1 = calloc<Struct17BytesInt>().ref;
-  Struct17BytesInt a2 = calloc<Struct17BytesInt>().ref;
-  Struct17BytesInt a3 = calloc<Struct17BytesInt>().ref;
-  Struct17BytesInt a4 = calloc<Struct17BytesInt>().ref;
-  Struct17BytesInt a5 = calloc<Struct17BytesInt>().ref;
-  Struct17BytesInt a6 = calloc<Struct17BytesInt>().ref;
-  Struct17BytesInt a7 = calloc<Struct17BytesInt>().ref;
-  Struct17BytesInt a8 = calloc<Struct17BytesInt>().ref;
-  Struct17BytesInt a9 = calloc<Struct17BytesInt>().ref;
+  final a0Pointer = calloc<Struct17BytesInt>();
+  final Struct17BytesInt a0 = a0Pointer.ref;
+  final a1Pointer = calloc<Struct17BytesInt>();
+  final Struct17BytesInt a1 = a1Pointer.ref;
+  final a2Pointer = calloc<Struct17BytesInt>();
+  final Struct17BytesInt a2 = a2Pointer.ref;
+  final a3Pointer = calloc<Struct17BytesInt>();
+  final Struct17BytesInt a3 = a3Pointer.ref;
+  final a4Pointer = calloc<Struct17BytesInt>();
+  final Struct17BytesInt a4 = a4Pointer.ref;
+  final a5Pointer = calloc<Struct17BytesInt>();
+  final Struct17BytesInt a5 = a5Pointer.ref;
+  final a6Pointer = calloc<Struct17BytesInt>();
+  final Struct17BytesInt a6 = a6Pointer.ref;
+  final a7Pointer = calloc<Struct17BytesInt>();
+  final Struct17BytesInt a7 = a7Pointer.ref;
+  final a8Pointer = calloc<Struct17BytesInt>();
+  final Struct17BytesInt a8 = a8Pointer.ref;
+  final a9Pointer = calloc<Struct17BytesInt>();
+  final Struct17BytesInt a9 = a9Pointer.ref;
 
   a0.a0 = -1;
   a0.a1 = 2;
@@ -2432,16 +2562,16 @@
 
   Expect.equals(15, result);
 
-  calloc.free(a0.addressOf);
-  calloc.free(a1.addressOf);
-  calloc.free(a2.addressOf);
-  calloc.free(a3.addressOf);
-  calloc.free(a4.addressOf);
-  calloc.free(a5.addressOf);
-  calloc.free(a6.addressOf);
-  calloc.free(a7.addressOf);
-  calloc.free(a8.addressOf);
-  calloc.free(a9.addressOf);
+  calloc.free(a0Pointer);
+  calloc.free(a1Pointer);
+  calloc.free(a2Pointer);
+  calloc.free(a3Pointer);
+  calloc.free(a4Pointer);
+  calloc.free(a5Pointer);
+  calloc.free(a6Pointer);
+  calloc.free(a7Pointer);
+  calloc.free(a8Pointer);
+  calloc.free(a9Pointer);
 }
 
 final passStruct19BytesHomogeneousUint8x10 = ffiTestFunctions.lookupFunction<
@@ -2472,26 +2602,26 @@
 /// Test that the memory backing these structs is extended to the right size.
 ///
 void testPassStruct19BytesHomogeneousUint8x10() {
-  Struct19BytesHomogeneousUint8 a0 =
-      calloc<Struct19BytesHomogeneousUint8>().ref;
-  Struct19BytesHomogeneousUint8 a1 =
-      calloc<Struct19BytesHomogeneousUint8>().ref;
-  Struct19BytesHomogeneousUint8 a2 =
-      calloc<Struct19BytesHomogeneousUint8>().ref;
-  Struct19BytesHomogeneousUint8 a3 =
-      calloc<Struct19BytesHomogeneousUint8>().ref;
-  Struct19BytesHomogeneousUint8 a4 =
-      calloc<Struct19BytesHomogeneousUint8>().ref;
-  Struct19BytesHomogeneousUint8 a5 =
-      calloc<Struct19BytesHomogeneousUint8>().ref;
-  Struct19BytesHomogeneousUint8 a6 =
-      calloc<Struct19BytesHomogeneousUint8>().ref;
-  Struct19BytesHomogeneousUint8 a7 =
-      calloc<Struct19BytesHomogeneousUint8>().ref;
-  Struct19BytesHomogeneousUint8 a8 =
-      calloc<Struct19BytesHomogeneousUint8>().ref;
-  Struct19BytesHomogeneousUint8 a9 =
-      calloc<Struct19BytesHomogeneousUint8>().ref;
+  final a0Pointer = calloc<Struct19BytesHomogeneousUint8>();
+  final Struct19BytesHomogeneousUint8 a0 = a0Pointer.ref;
+  final a1Pointer = calloc<Struct19BytesHomogeneousUint8>();
+  final Struct19BytesHomogeneousUint8 a1 = a1Pointer.ref;
+  final a2Pointer = calloc<Struct19BytesHomogeneousUint8>();
+  final Struct19BytesHomogeneousUint8 a2 = a2Pointer.ref;
+  final a3Pointer = calloc<Struct19BytesHomogeneousUint8>();
+  final Struct19BytesHomogeneousUint8 a3 = a3Pointer.ref;
+  final a4Pointer = calloc<Struct19BytesHomogeneousUint8>();
+  final Struct19BytesHomogeneousUint8 a4 = a4Pointer.ref;
+  final a5Pointer = calloc<Struct19BytesHomogeneousUint8>();
+  final Struct19BytesHomogeneousUint8 a5 = a5Pointer.ref;
+  final a6Pointer = calloc<Struct19BytesHomogeneousUint8>();
+  final Struct19BytesHomogeneousUint8 a6 = a6Pointer.ref;
+  final a7Pointer = calloc<Struct19BytesHomogeneousUint8>();
+  final Struct19BytesHomogeneousUint8 a7 = a7Pointer.ref;
+  final a8Pointer = calloc<Struct19BytesHomogeneousUint8>();
+  final Struct19BytesHomogeneousUint8 a8 = a8Pointer.ref;
+  final a9Pointer = calloc<Struct19BytesHomogeneousUint8>();
+  final Struct19BytesHomogeneousUint8 a9 = a9Pointer.ref;
 
   a0.a0 = 1;
   a0.a1 = 2;
@@ -2691,16 +2821,16 @@
 
   Expect.equals(18145, result);
 
-  calloc.free(a0.addressOf);
-  calloc.free(a1.addressOf);
-  calloc.free(a2.addressOf);
-  calloc.free(a3.addressOf);
-  calloc.free(a4.addressOf);
-  calloc.free(a5.addressOf);
-  calloc.free(a6.addressOf);
-  calloc.free(a7.addressOf);
-  calloc.free(a8.addressOf);
-  calloc.free(a9.addressOf);
+  calloc.free(a0Pointer);
+  calloc.free(a1Pointer);
+  calloc.free(a2Pointer);
+  calloc.free(a3Pointer);
+  calloc.free(a4Pointer);
+  calloc.free(a5Pointer);
+  calloc.free(a6Pointer);
+  calloc.free(a7Pointer);
+  calloc.free(a8Pointer);
+  calloc.free(a9Pointer);
 }
 
 final passStruct20BytesHomogeneousInt32x10 = ffiTestFunctions.lookupFunction<
@@ -2732,26 +2862,26 @@
 /// The amount of arguments exhausts the number of integer registers, such that
 /// pointers to copies are also passed on the stack.
 void testPassStruct20BytesHomogeneousInt32x10() {
-  Struct20BytesHomogeneousInt32 a0 =
-      calloc<Struct20BytesHomogeneousInt32>().ref;
-  Struct20BytesHomogeneousInt32 a1 =
-      calloc<Struct20BytesHomogeneousInt32>().ref;
-  Struct20BytesHomogeneousInt32 a2 =
-      calloc<Struct20BytesHomogeneousInt32>().ref;
-  Struct20BytesHomogeneousInt32 a3 =
-      calloc<Struct20BytesHomogeneousInt32>().ref;
-  Struct20BytesHomogeneousInt32 a4 =
-      calloc<Struct20BytesHomogeneousInt32>().ref;
-  Struct20BytesHomogeneousInt32 a5 =
-      calloc<Struct20BytesHomogeneousInt32>().ref;
-  Struct20BytesHomogeneousInt32 a6 =
-      calloc<Struct20BytesHomogeneousInt32>().ref;
-  Struct20BytesHomogeneousInt32 a7 =
-      calloc<Struct20BytesHomogeneousInt32>().ref;
-  Struct20BytesHomogeneousInt32 a8 =
-      calloc<Struct20BytesHomogeneousInt32>().ref;
-  Struct20BytesHomogeneousInt32 a9 =
-      calloc<Struct20BytesHomogeneousInt32>().ref;
+  final a0Pointer = calloc<Struct20BytesHomogeneousInt32>();
+  final Struct20BytesHomogeneousInt32 a0 = a0Pointer.ref;
+  final a1Pointer = calloc<Struct20BytesHomogeneousInt32>();
+  final Struct20BytesHomogeneousInt32 a1 = a1Pointer.ref;
+  final a2Pointer = calloc<Struct20BytesHomogeneousInt32>();
+  final Struct20BytesHomogeneousInt32 a2 = a2Pointer.ref;
+  final a3Pointer = calloc<Struct20BytesHomogeneousInt32>();
+  final Struct20BytesHomogeneousInt32 a3 = a3Pointer.ref;
+  final a4Pointer = calloc<Struct20BytesHomogeneousInt32>();
+  final Struct20BytesHomogeneousInt32 a4 = a4Pointer.ref;
+  final a5Pointer = calloc<Struct20BytesHomogeneousInt32>();
+  final Struct20BytesHomogeneousInt32 a5 = a5Pointer.ref;
+  final a6Pointer = calloc<Struct20BytesHomogeneousInt32>();
+  final Struct20BytesHomogeneousInt32 a6 = a6Pointer.ref;
+  final a7Pointer = calloc<Struct20BytesHomogeneousInt32>();
+  final Struct20BytesHomogeneousInt32 a7 = a7Pointer.ref;
+  final a8Pointer = calloc<Struct20BytesHomogeneousInt32>();
+  final Struct20BytesHomogeneousInt32 a8 = a8Pointer.ref;
+  final a9Pointer = calloc<Struct20BytesHomogeneousInt32>();
+  final Struct20BytesHomogeneousInt32 a9 = a9Pointer.ref;
 
   a0.a0 = -1;
   a0.a1 = 2;
@@ -2811,16 +2941,16 @@
 
   Expect.equals(25, result);
 
-  calloc.free(a0.addressOf);
-  calloc.free(a1.addressOf);
-  calloc.free(a2.addressOf);
-  calloc.free(a3.addressOf);
-  calloc.free(a4.addressOf);
-  calloc.free(a5.addressOf);
-  calloc.free(a6.addressOf);
-  calloc.free(a7.addressOf);
-  calloc.free(a8.addressOf);
-  calloc.free(a9.addressOf);
+  calloc.free(a0Pointer);
+  calloc.free(a1Pointer);
+  calloc.free(a2Pointer);
+  calloc.free(a3Pointer);
+  calloc.free(a4Pointer);
+  calloc.free(a5Pointer);
+  calloc.free(a6Pointer);
+  calloc.free(a7Pointer);
+  calloc.free(a8Pointer);
+  calloc.free(a9Pointer);
 }
 
 final passStruct20BytesHomogeneousFloat = ffiTestFunctions.lookupFunction<
@@ -2830,8 +2960,8 @@
 
 /// Argument too big to go into FPU registers in hardfp and arm64.
 void testPassStruct20BytesHomogeneousFloat() {
-  Struct20BytesHomogeneousFloat a0 =
-      calloc<Struct20BytesHomogeneousFloat>().ref;
+  final a0Pointer = calloc<Struct20BytesHomogeneousFloat>();
+  final Struct20BytesHomogeneousFloat a0 = a0Pointer.ref;
 
   a0.a0 = -1.0;
   a0.a1 = 2.0;
@@ -2845,7 +2975,7 @@
 
   Expect.approxEquals(-3.0, result);
 
-  calloc.free(a0.addressOf);
+  calloc.free(a0Pointer);
 }
 
 final passStruct32BytesHomogeneousDoublex5 = ffiTestFunctions.lookupFunction<
@@ -2866,16 +2996,16 @@
 /// Arguments in FPU registers on arm64.
 /// 5 struct arguments will exhaust available registers.
 void testPassStruct32BytesHomogeneousDoublex5() {
-  Struct32BytesHomogeneousDouble a0 =
-      calloc<Struct32BytesHomogeneousDouble>().ref;
-  Struct32BytesHomogeneousDouble a1 =
-      calloc<Struct32BytesHomogeneousDouble>().ref;
-  Struct32BytesHomogeneousDouble a2 =
-      calloc<Struct32BytesHomogeneousDouble>().ref;
-  Struct32BytesHomogeneousDouble a3 =
-      calloc<Struct32BytesHomogeneousDouble>().ref;
-  Struct32BytesHomogeneousDouble a4 =
-      calloc<Struct32BytesHomogeneousDouble>().ref;
+  final a0Pointer = calloc<Struct32BytesHomogeneousDouble>();
+  final Struct32BytesHomogeneousDouble a0 = a0Pointer.ref;
+  final a1Pointer = calloc<Struct32BytesHomogeneousDouble>();
+  final Struct32BytesHomogeneousDouble a1 = a1Pointer.ref;
+  final a2Pointer = calloc<Struct32BytesHomogeneousDouble>();
+  final Struct32BytesHomogeneousDouble a2 = a2Pointer.ref;
+  final a3Pointer = calloc<Struct32BytesHomogeneousDouble>();
+  final Struct32BytesHomogeneousDouble a3 = a3Pointer.ref;
+  final a4Pointer = calloc<Struct32BytesHomogeneousDouble>();
+  final Struct32BytesHomogeneousDouble a4 = a4Pointer.ref;
 
   a0.a0 = -1.0;
   a0.a1 = 2.0;
@@ -2904,11 +3034,11 @@
 
   Expect.approxEquals(10.0, result);
 
-  calloc.free(a0.addressOf);
-  calloc.free(a1.addressOf);
-  calloc.free(a2.addressOf);
-  calloc.free(a3.addressOf);
-  calloc.free(a4.addressOf);
+  calloc.free(a0Pointer);
+  calloc.free(a1Pointer);
+  calloc.free(a2Pointer);
+  calloc.free(a3Pointer);
+  calloc.free(a4Pointer);
 }
 
 final passStruct40BytesHomogeneousDouble = ffiTestFunctions.lookupFunction<
@@ -2918,8 +3048,8 @@
 
 /// Argument too big to go into FPU registers in arm64.
 void testPassStruct40BytesHomogeneousDouble() {
-  Struct40BytesHomogeneousDouble a0 =
-      calloc<Struct40BytesHomogeneousDouble>().ref;
+  final a0Pointer = calloc<Struct40BytesHomogeneousDouble>();
+  final Struct40BytesHomogeneousDouble a0 = a0Pointer.ref;
 
   a0.a0 = -1.0;
   a0.a1 = 2.0;
@@ -2933,7 +3063,7 @@
 
   Expect.approxEquals(-3.0, result);
 
-  calloc.free(a0.addressOf);
+  calloc.free(a0Pointer);
 }
 
 final passStruct1024BytesHomogeneousUint64 = ffiTestFunctions.lookupFunction<
@@ -2943,8 +3073,8 @@
 
 /// Test 1kb struct.
 void testPassStruct1024BytesHomogeneousUint64() {
-  Struct1024BytesHomogeneousUint64 a0 =
-      calloc<Struct1024BytesHomogeneousUint64>().ref;
+  final a0Pointer = calloc<Struct1024BytesHomogeneousUint64>();
+  final Struct1024BytesHomogeneousUint64 a0 = a0Pointer.ref;
 
   a0.a0 = 1;
   a0.a1 = 2;
@@ -3081,7 +3211,7 @@
 
   Expect.equals(8256, result);
 
-  calloc.free(a0.addressOf);
+  calloc.free(a0Pointer);
 }
 
 final passFloatStruct16BytesHomogeneousFloatFloatStruct1 =
@@ -3110,17 +3240,17 @@
 /// Tests the alignment of structs in FPU registers and backfilling.
 void testPassFloatStruct16BytesHomogeneousFloatFloatStruct1() {
   double a0;
-  Struct16BytesHomogeneousFloat a1 =
-      calloc<Struct16BytesHomogeneousFloat>().ref;
+  final a1Pointer = calloc<Struct16BytesHomogeneousFloat>();
+  final Struct16BytesHomogeneousFloat a1 = a1Pointer.ref;
   double a2;
-  Struct16BytesHomogeneousFloat a3 =
-      calloc<Struct16BytesHomogeneousFloat>().ref;
+  final a3Pointer = calloc<Struct16BytesHomogeneousFloat>();
+  final Struct16BytesHomogeneousFloat a3 = a3Pointer.ref;
   double a4;
-  Struct16BytesHomogeneousFloat a5 =
-      calloc<Struct16BytesHomogeneousFloat>().ref;
+  final a5Pointer = calloc<Struct16BytesHomogeneousFloat>();
+  final Struct16BytesHomogeneousFloat a5 = a5Pointer.ref;
   double a6;
-  Struct16BytesHomogeneousFloat a7 =
-      calloc<Struct16BytesHomogeneousFloat>().ref;
+  final a7Pointer = calloc<Struct16BytesHomogeneousFloat>();
+  final Struct16BytesHomogeneousFloat a7 = a7Pointer.ref;
   double a8;
 
   a0 = -1.0;
@@ -3152,10 +3282,10 @@
 
   Expect.approxEquals(-11.0, result);
 
-  calloc.free(a1.addressOf);
-  calloc.free(a3.addressOf);
-  calloc.free(a5.addressOf);
-  calloc.free(a7.addressOf);
+  calloc.free(a1Pointer);
+  calloc.free(a3Pointer);
+  calloc.free(a5Pointer);
+  calloc.free(a7Pointer);
 }
 
 final passFloatStruct32BytesHomogeneousDoubleFloatStruct =
@@ -3184,17 +3314,17 @@
 /// Tests the alignment of structs in FPU registers and backfilling.
 void testPassFloatStruct32BytesHomogeneousDoubleFloatStruct() {
   double a0;
-  Struct32BytesHomogeneousDouble a1 =
-      calloc<Struct32BytesHomogeneousDouble>().ref;
+  final a1Pointer = calloc<Struct32BytesHomogeneousDouble>();
+  final Struct32BytesHomogeneousDouble a1 = a1Pointer.ref;
   double a2;
-  Struct32BytesHomogeneousDouble a3 =
-      calloc<Struct32BytesHomogeneousDouble>().ref;
+  final a3Pointer = calloc<Struct32BytesHomogeneousDouble>();
+  final Struct32BytesHomogeneousDouble a3 = a3Pointer.ref;
   double a4;
-  Struct32BytesHomogeneousDouble a5 =
-      calloc<Struct32BytesHomogeneousDouble>().ref;
+  final a5Pointer = calloc<Struct32BytesHomogeneousDouble>();
+  final Struct32BytesHomogeneousDouble a5 = a5Pointer.ref;
   double a6;
-  Struct32BytesHomogeneousDouble a7 =
-      calloc<Struct32BytesHomogeneousDouble>().ref;
+  final a7Pointer = calloc<Struct32BytesHomogeneousDouble>();
+  final Struct32BytesHomogeneousDouble a7 = a7Pointer.ref;
   double a8;
 
   a0 = -1.0;
@@ -3226,10 +3356,10 @@
 
   Expect.approxEquals(-11.0, result);
 
-  calloc.free(a1.addressOf);
-  calloc.free(a3.addressOf);
-  calloc.free(a5.addressOf);
-  calloc.free(a7.addressOf);
+  calloc.free(a1Pointer);
+  calloc.free(a3Pointer);
+  calloc.free(a5Pointer);
+  calloc.free(a7Pointer);
 }
 
 final passInt8Struct16BytesMixedInt8Struct16BytesMixedIn =
@@ -3254,13 +3384,17 @@
 /// Test backfilling of integer registers.
 void testPassInt8Struct16BytesMixedInt8Struct16BytesMixedIn() {
   int a0;
-  Struct16BytesMixed a1 = calloc<Struct16BytesMixed>().ref;
+  final a1Pointer = calloc<Struct16BytesMixed>();
+  final Struct16BytesMixed a1 = a1Pointer.ref;
   int a2;
-  Struct16BytesMixed a3 = calloc<Struct16BytesMixed>().ref;
+  final a3Pointer = calloc<Struct16BytesMixed>();
+  final Struct16BytesMixed a3 = a3Pointer.ref;
   int a4;
-  Struct16BytesMixed a5 = calloc<Struct16BytesMixed>().ref;
+  final a5Pointer = calloc<Struct16BytesMixed>();
+  final Struct16BytesMixed a5 = a5Pointer.ref;
   int a6;
-  Struct16BytesMixed a7 = calloc<Struct16BytesMixed>().ref;
+  final a7Pointer = calloc<Struct16BytesMixed>();
+  final Struct16BytesMixed a7 = a7Pointer.ref;
   int a8;
 
   a0 = -1;
@@ -3284,10 +3418,10 @@
 
   Expect.approxEquals(-7.0, result);
 
-  calloc.free(a1.addressOf);
-  calloc.free(a3.addressOf);
-  calloc.free(a5.addressOf);
-  calloc.free(a7.addressOf);
+  calloc.free(a1Pointer);
+  calloc.free(a3Pointer);
+  calloc.free(a5Pointer);
+  calloc.free(a7Pointer);
 }
 
 final passDoublex6Struct16BytesMixedx4Int32 = ffiTestFunctions.lookupFunction<
@@ -3326,10 +3460,14 @@
   double a3;
   double a4;
   double a5;
-  Struct16BytesMixed a6 = calloc<Struct16BytesMixed>().ref;
-  Struct16BytesMixed a7 = calloc<Struct16BytesMixed>().ref;
-  Struct16BytesMixed a8 = calloc<Struct16BytesMixed>().ref;
-  Struct16BytesMixed a9 = calloc<Struct16BytesMixed>().ref;
+  final a6Pointer = calloc<Struct16BytesMixed>();
+  final Struct16BytesMixed a6 = a6Pointer.ref;
+  final a7Pointer = calloc<Struct16BytesMixed>();
+  final Struct16BytesMixed a7 = a7Pointer.ref;
+  final a8Pointer = calloc<Struct16BytesMixed>();
+  final Struct16BytesMixed a8 = a8Pointer.ref;
+  final a9Pointer = calloc<Struct16BytesMixed>();
+  final Struct16BytesMixed a9 = a9Pointer.ref;
   int a10;
 
   a0 = -1.0;
@@ -3355,10 +3493,10 @@
 
   Expect.approxEquals(-8.0, result);
 
-  calloc.free(a6.addressOf);
-  calloc.free(a7.addressOf);
-  calloc.free(a8.addressOf);
-  calloc.free(a9.addressOf);
+  calloc.free(a6Pointer);
+  calloc.free(a7Pointer);
+  calloc.free(a8Pointer);
+  calloc.free(a9Pointer);
 }
 
 final passInt32x4Struct16BytesMixedx4Double = ffiTestFunctions.lookupFunction<
@@ -3383,10 +3521,14 @@
   int a1;
   int a2;
   int a3;
-  Struct16BytesMixed a4 = calloc<Struct16BytesMixed>().ref;
-  Struct16BytesMixed a5 = calloc<Struct16BytesMixed>().ref;
-  Struct16BytesMixed a6 = calloc<Struct16BytesMixed>().ref;
-  Struct16BytesMixed a7 = calloc<Struct16BytesMixed>().ref;
+  final a4Pointer = calloc<Struct16BytesMixed>();
+  final Struct16BytesMixed a4 = a4Pointer.ref;
+  final a5Pointer = calloc<Struct16BytesMixed>();
+  final Struct16BytesMixed a5 = a5Pointer.ref;
+  final a6Pointer = calloc<Struct16BytesMixed>();
+  final Struct16BytesMixed a6 = a6Pointer.ref;
+  final a7Pointer = calloc<Struct16BytesMixed>();
+  final Struct16BytesMixed a7 = a7Pointer.ref;
   double a8;
 
   a0 = -1;
@@ -3410,10 +3552,10 @@
 
   Expect.approxEquals(-7.0, result);
 
-  calloc.free(a4.addressOf);
-  calloc.free(a5.addressOf);
-  calloc.free(a6.addressOf);
-  calloc.free(a7.addressOf);
+  calloc.free(a4Pointer);
+  calloc.free(a5Pointer);
+  calloc.free(a6Pointer);
+  calloc.free(a7Pointer);
 }
 
 final passStruct40BytesHomogeneousDoubleStruct4BytesHomo =
@@ -3427,10 +3569,12 @@
 /// On various architectures, first struct is allocated on stack.
 /// Check that the other two arguments are allocated on registers.
 void testPassStruct40BytesHomogeneousDoubleStruct4BytesHomo() {
-  Struct40BytesHomogeneousDouble a0 =
-      calloc<Struct40BytesHomogeneousDouble>().ref;
-  Struct4BytesHomogeneousInt16 a1 = calloc<Struct4BytesHomogeneousInt16>().ref;
-  Struct8BytesHomogeneousFloat a2 = calloc<Struct8BytesHomogeneousFloat>().ref;
+  final a0Pointer = calloc<Struct40BytesHomogeneousDouble>();
+  final Struct40BytesHomogeneousDouble a0 = a0Pointer.ref;
+  final a1Pointer = calloc<Struct4BytesHomogeneousInt16>();
+  final Struct4BytesHomogeneousInt16 a1 = a1Pointer.ref;
+  final a2Pointer = calloc<Struct8BytesHomogeneousFloat>();
+  final Struct8BytesHomogeneousFloat a2 = a2Pointer.ref;
 
   a0.a0 = -1.0;
   a0.a1 = 2.0;
@@ -3448,9 +3592,9 @@
 
   Expect.approxEquals(-5.0, result);
 
-  calloc.free(a0.addressOf);
-  calloc.free(a1.addressOf);
-  calloc.free(a2.addressOf);
+  calloc.free(a0Pointer);
+  calloc.free(a1Pointer);
+  calloc.free(a2Pointer);
 }
 
 final passInt32x8Doublex8Int64Int8Struct1ByteIntInt64Int =
@@ -3558,28 +3702,36 @@
   double a15;
   int a16;
   int a17;
-  Struct1ByteInt a18 = calloc<Struct1ByteInt>().ref;
+  final a18Pointer = calloc<Struct1ByteInt>();
+  final Struct1ByteInt a18 = a18Pointer.ref;
   int a19;
   int a20;
-  Struct4BytesHomogeneousInt16 a21 = calloc<Struct4BytesHomogeneousInt16>().ref;
+  final a21Pointer = calloc<Struct4BytesHomogeneousInt16>();
+  final Struct4BytesHomogeneousInt16 a21 = a21Pointer.ref;
   int a22;
   int a23;
-  Struct8BytesInt a24 = calloc<Struct8BytesInt>().ref;
+  final a24Pointer = calloc<Struct8BytesInt>();
+  final Struct8BytesInt a24 = a24Pointer.ref;
   int a25;
   int a26;
-  Struct8BytesHomogeneousFloat a27 = calloc<Struct8BytesHomogeneousFloat>().ref;
+  final a27Pointer = calloc<Struct8BytesHomogeneousFloat>();
+  final Struct8BytesHomogeneousFloat a27 = a27Pointer.ref;
   int a28;
   int a29;
-  Struct8BytesMixed a30 = calloc<Struct8BytesMixed>().ref;
+  final a30Pointer = calloc<Struct8BytesMixed>();
+  final Struct8BytesMixed a30 = a30Pointer.ref;
   int a31;
   int a32;
-  StructAlignmentInt16 a33 = calloc<StructAlignmentInt16>().ref;
+  final a33Pointer = calloc<StructAlignmentInt16>();
+  final StructAlignmentInt16 a33 = a33Pointer.ref;
   int a34;
   int a35;
-  StructAlignmentInt32 a36 = calloc<StructAlignmentInt32>().ref;
+  final a36Pointer = calloc<StructAlignmentInt32>();
+  final StructAlignmentInt32 a36 = a36Pointer.ref;
   int a37;
   int a38;
-  StructAlignmentInt64 a39 = calloc<StructAlignmentInt64>().ref;
+  final a39Pointer = calloc<StructAlignmentInt64>();
+  final StructAlignmentInt64 a39 = a39Pointer.ref;
 
   a0 = -1;
   a1 = 2;
@@ -3680,14 +3832,14 @@
 
   Expect.approxEquals(26.0, result);
 
-  calloc.free(a18.addressOf);
-  calloc.free(a21.addressOf);
-  calloc.free(a24.addressOf);
-  calloc.free(a27.addressOf);
-  calloc.free(a30.addressOf);
-  calloc.free(a33.addressOf);
-  calloc.free(a36.addressOf);
-  calloc.free(a39.addressOf);
+  calloc.free(a18Pointer);
+  calloc.free(a21Pointer);
+  calloc.free(a24Pointer);
+  calloc.free(a27Pointer);
+  calloc.free(a30Pointer);
+  calloc.free(a33Pointer);
+  calloc.free(a36Pointer);
+  calloc.free(a39Pointer);
 }
 
 final passStructAlignmentInt16 = ffiTestFunctions.lookupFunction<
@@ -3696,7 +3848,8 @@
 
 /// Test alignment and padding of 16 byte int within struct.
 void testPassStructAlignmentInt16() {
-  StructAlignmentInt16 a0 = calloc<StructAlignmentInt16>().ref;
+  final a0Pointer = calloc<StructAlignmentInt16>();
+  final StructAlignmentInt16 a0 = a0Pointer.ref;
 
   a0.a0 = -1;
   a0.a1 = 2;
@@ -3708,7 +3861,7 @@
 
   Expect.equals(-2, result);
 
-  calloc.free(a0.addressOf);
+  calloc.free(a0Pointer);
 }
 
 final passStructAlignmentInt32 = ffiTestFunctions.lookupFunction<
@@ -3717,7 +3870,8 @@
 
 /// Test alignment and padding of 32 byte int within struct.
 void testPassStructAlignmentInt32() {
-  StructAlignmentInt32 a0 = calloc<StructAlignmentInt32>().ref;
+  final a0Pointer = calloc<StructAlignmentInt32>();
+  final StructAlignmentInt32 a0 = a0Pointer.ref;
 
   a0.a0 = -1;
   a0.a1 = 2;
@@ -3729,7 +3883,7 @@
 
   Expect.equals(-2, result);
 
-  calloc.free(a0.addressOf);
+  calloc.free(a0Pointer);
 }
 
 final passStructAlignmentInt64 = ffiTestFunctions.lookupFunction<
@@ -3738,7 +3892,8 @@
 
 /// Test alignment and padding of 64 byte int within struct.
 void testPassStructAlignmentInt64() {
-  StructAlignmentInt64 a0 = calloc<StructAlignmentInt64>().ref;
+  final a0Pointer = calloc<StructAlignmentInt64>();
+  final StructAlignmentInt64 a0 = a0Pointer.ref;
 
   a0.a0 = -1;
   a0.a1 = 2;
@@ -3750,7 +3905,7 @@
 
   Expect.equals(-2, result);
 
-  calloc.free(a0.addressOf);
+  calloc.free(a0Pointer);
 }
 
 final passStruct8BytesNestedIntx10 = ffiTestFunctions.lookupFunction<
@@ -3780,16 +3935,26 @@
 /// Simple nested struct. No alignment gaps on any architectures.
 /// 10 arguments exhaust registers on all platforms.
 void testPassStruct8BytesNestedIntx10() {
-  Struct8BytesNestedInt a0 = calloc<Struct8BytesNestedInt>().ref;
-  Struct8BytesNestedInt a1 = calloc<Struct8BytesNestedInt>().ref;
-  Struct8BytesNestedInt a2 = calloc<Struct8BytesNestedInt>().ref;
-  Struct8BytesNestedInt a3 = calloc<Struct8BytesNestedInt>().ref;
-  Struct8BytesNestedInt a4 = calloc<Struct8BytesNestedInt>().ref;
-  Struct8BytesNestedInt a5 = calloc<Struct8BytesNestedInt>().ref;
-  Struct8BytesNestedInt a6 = calloc<Struct8BytesNestedInt>().ref;
-  Struct8BytesNestedInt a7 = calloc<Struct8BytesNestedInt>().ref;
-  Struct8BytesNestedInt a8 = calloc<Struct8BytesNestedInt>().ref;
-  Struct8BytesNestedInt a9 = calloc<Struct8BytesNestedInt>().ref;
+  final a0Pointer = calloc<Struct8BytesNestedInt>();
+  final Struct8BytesNestedInt a0 = a0Pointer.ref;
+  final a1Pointer = calloc<Struct8BytesNestedInt>();
+  final Struct8BytesNestedInt a1 = a1Pointer.ref;
+  final a2Pointer = calloc<Struct8BytesNestedInt>();
+  final Struct8BytesNestedInt a2 = a2Pointer.ref;
+  final a3Pointer = calloc<Struct8BytesNestedInt>();
+  final Struct8BytesNestedInt a3 = a3Pointer.ref;
+  final a4Pointer = calloc<Struct8BytesNestedInt>();
+  final Struct8BytesNestedInt a4 = a4Pointer.ref;
+  final a5Pointer = calloc<Struct8BytesNestedInt>();
+  final Struct8BytesNestedInt a5 = a5Pointer.ref;
+  final a6Pointer = calloc<Struct8BytesNestedInt>();
+  final Struct8BytesNestedInt a6 = a6Pointer.ref;
+  final a7Pointer = calloc<Struct8BytesNestedInt>();
+  final Struct8BytesNestedInt a7 = a7Pointer.ref;
+  final a8Pointer = calloc<Struct8BytesNestedInt>();
+  final Struct8BytesNestedInt a8 = a8Pointer.ref;
+  final a9Pointer = calloc<Struct8BytesNestedInt>();
+  final Struct8BytesNestedInt a9 = a9Pointer.ref;
 
   a0.a0.a0 = -1;
   a0.a0.a1 = 2;
@@ -3839,16 +4004,16 @@
 
   Expect.equals(20, result);
 
-  calloc.free(a0.addressOf);
-  calloc.free(a1.addressOf);
-  calloc.free(a2.addressOf);
-  calloc.free(a3.addressOf);
-  calloc.free(a4.addressOf);
-  calloc.free(a5.addressOf);
-  calloc.free(a6.addressOf);
-  calloc.free(a7.addressOf);
-  calloc.free(a8.addressOf);
-  calloc.free(a9.addressOf);
+  calloc.free(a0Pointer);
+  calloc.free(a1Pointer);
+  calloc.free(a2Pointer);
+  calloc.free(a3Pointer);
+  calloc.free(a4Pointer);
+  calloc.free(a5Pointer);
+  calloc.free(a6Pointer);
+  calloc.free(a7Pointer);
+  calloc.free(a8Pointer);
+  calloc.free(a9Pointer);
 }
 
 final passStruct8BytesNestedFloatx10 = ffiTestFunctions.lookupFunction<
@@ -3878,16 +4043,26 @@
 /// Simple nested struct. No alignment gaps on any architectures.
 /// 10 arguments exhaust fpu registers on all platforms.
 void testPassStruct8BytesNestedFloatx10() {
-  Struct8BytesNestedFloat a0 = calloc<Struct8BytesNestedFloat>().ref;
-  Struct8BytesNestedFloat a1 = calloc<Struct8BytesNestedFloat>().ref;
-  Struct8BytesNestedFloat a2 = calloc<Struct8BytesNestedFloat>().ref;
-  Struct8BytesNestedFloat a3 = calloc<Struct8BytesNestedFloat>().ref;
-  Struct8BytesNestedFloat a4 = calloc<Struct8BytesNestedFloat>().ref;
-  Struct8BytesNestedFloat a5 = calloc<Struct8BytesNestedFloat>().ref;
-  Struct8BytesNestedFloat a6 = calloc<Struct8BytesNestedFloat>().ref;
-  Struct8BytesNestedFloat a7 = calloc<Struct8BytesNestedFloat>().ref;
-  Struct8BytesNestedFloat a8 = calloc<Struct8BytesNestedFloat>().ref;
-  Struct8BytesNestedFloat a9 = calloc<Struct8BytesNestedFloat>().ref;
+  final a0Pointer = calloc<Struct8BytesNestedFloat>();
+  final Struct8BytesNestedFloat a0 = a0Pointer.ref;
+  final a1Pointer = calloc<Struct8BytesNestedFloat>();
+  final Struct8BytesNestedFloat a1 = a1Pointer.ref;
+  final a2Pointer = calloc<Struct8BytesNestedFloat>();
+  final Struct8BytesNestedFloat a2 = a2Pointer.ref;
+  final a3Pointer = calloc<Struct8BytesNestedFloat>();
+  final Struct8BytesNestedFloat a3 = a3Pointer.ref;
+  final a4Pointer = calloc<Struct8BytesNestedFloat>();
+  final Struct8BytesNestedFloat a4 = a4Pointer.ref;
+  final a5Pointer = calloc<Struct8BytesNestedFloat>();
+  final Struct8BytesNestedFloat a5 = a5Pointer.ref;
+  final a6Pointer = calloc<Struct8BytesNestedFloat>();
+  final Struct8BytesNestedFloat a6 = a6Pointer.ref;
+  final a7Pointer = calloc<Struct8BytesNestedFloat>();
+  final Struct8BytesNestedFloat a7 = a7Pointer.ref;
+  final a8Pointer = calloc<Struct8BytesNestedFloat>();
+  final Struct8BytesNestedFloat a8 = a8Pointer.ref;
+  final a9Pointer = calloc<Struct8BytesNestedFloat>();
+  final Struct8BytesNestedFloat a9 = a9Pointer.ref;
 
   a0.a0.a0 = -1.0;
   a0.a1.a0 = 2.0;
@@ -3917,16 +4092,16 @@
 
   Expect.approxEquals(10.0, result);
 
-  calloc.free(a0.addressOf);
-  calloc.free(a1.addressOf);
-  calloc.free(a2.addressOf);
-  calloc.free(a3.addressOf);
-  calloc.free(a4.addressOf);
-  calloc.free(a5.addressOf);
-  calloc.free(a6.addressOf);
-  calloc.free(a7.addressOf);
-  calloc.free(a8.addressOf);
-  calloc.free(a9.addressOf);
+  calloc.free(a0Pointer);
+  calloc.free(a1Pointer);
+  calloc.free(a2Pointer);
+  calloc.free(a3Pointer);
+  calloc.free(a4Pointer);
+  calloc.free(a5Pointer);
+  calloc.free(a6Pointer);
+  calloc.free(a7Pointer);
+  calloc.free(a8Pointer);
+  calloc.free(a9Pointer);
 }
 
 final passStruct8BytesNestedFloat2x10 = ffiTestFunctions.lookupFunction<
@@ -3958,16 +4133,26 @@
 /// The nesting is irregular, testing homogenous float rules on arm and arm64,
 /// and the fpu register usage on x64.
 void testPassStruct8BytesNestedFloat2x10() {
-  Struct8BytesNestedFloat2 a0 = calloc<Struct8BytesNestedFloat2>().ref;
-  Struct8BytesNestedFloat2 a1 = calloc<Struct8BytesNestedFloat2>().ref;
-  Struct8BytesNestedFloat2 a2 = calloc<Struct8BytesNestedFloat2>().ref;
-  Struct8BytesNestedFloat2 a3 = calloc<Struct8BytesNestedFloat2>().ref;
-  Struct8BytesNestedFloat2 a4 = calloc<Struct8BytesNestedFloat2>().ref;
-  Struct8BytesNestedFloat2 a5 = calloc<Struct8BytesNestedFloat2>().ref;
-  Struct8BytesNestedFloat2 a6 = calloc<Struct8BytesNestedFloat2>().ref;
-  Struct8BytesNestedFloat2 a7 = calloc<Struct8BytesNestedFloat2>().ref;
-  Struct8BytesNestedFloat2 a8 = calloc<Struct8BytesNestedFloat2>().ref;
-  Struct8BytesNestedFloat2 a9 = calloc<Struct8BytesNestedFloat2>().ref;
+  final a0Pointer = calloc<Struct8BytesNestedFloat2>();
+  final Struct8BytesNestedFloat2 a0 = a0Pointer.ref;
+  final a1Pointer = calloc<Struct8BytesNestedFloat2>();
+  final Struct8BytesNestedFloat2 a1 = a1Pointer.ref;
+  final a2Pointer = calloc<Struct8BytesNestedFloat2>();
+  final Struct8BytesNestedFloat2 a2 = a2Pointer.ref;
+  final a3Pointer = calloc<Struct8BytesNestedFloat2>();
+  final Struct8BytesNestedFloat2 a3 = a3Pointer.ref;
+  final a4Pointer = calloc<Struct8BytesNestedFloat2>();
+  final Struct8BytesNestedFloat2 a4 = a4Pointer.ref;
+  final a5Pointer = calloc<Struct8BytesNestedFloat2>();
+  final Struct8BytesNestedFloat2 a5 = a5Pointer.ref;
+  final a6Pointer = calloc<Struct8BytesNestedFloat2>();
+  final Struct8BytesNestedFloat2 a6 = a6Pointer.ref;
+  final a7Pointer = calloc<Struct8BytesNestedFloat2>();
+  final Struct8BytesNestedFloat2 a7 = a7Pointer.ref;
+  final a8Pointer = calloc<Struct8BytesNestedFloat2>();
+  final Struct8BytesNestedFloat2 a8 = a8Pointer.ref;
+  final a9Pointer = calloc<Struct8BytesNestedFloat2>();
+  final Struct8BytesNestedFloat2 a9 = a9Pointer.ref;
 
   a0.a0.a0 = -1.0;
   a0.a1 = 2.0;
@@ -3997,16 +4182,16 @@
 
   Expect.approxEquals(10.0, result);
 
-  calloc.free(a0.addressOf);
-  calloc.free(a1.addressOf);
-  calloc.free(a2.addressOf);
-  calloc.free(a3.addressOf);
-  calloc.free(a4.addressOf);
-  calloc.free(a5.addressOf);
-  calloc.free(a6.addressOf);
-  calloc.free(a7.addressOf);
-  calloc.free(a8.addressOf);
-  calloc.free(a9.addressOf);
+  calloc.free(a0Pointer);
+  calloc.free(a1Pointer);
+  calloc.free(a2Pointer);
+  calloc.free(a3Pointer);
+  calloc.free(a4Pointer);
+  calloc.free(a5Pointer);
+  calloc.free(a6Pointer);
+  calloc.free(a7Pointer);
+  calloc.free(a8Pointer);
+  calloc.free(a9Pointer);
 }
 
 final passStruct8BytesNestedMixedx10 = ffiTestFunctions.lookupFunction<
@@ -4036,16 +4221,26 @@
 /// Simple nested struct. No alignment gaps on any architectures.
 /// 10 arguments exhaust all registers on all platforms.
 void testPassStruct8BytesNestedMixedx10() {
-  Struct8BytesNestedMixed a0 = calloc<Struct8BytesNestedMixed>().ref;
-  Struct8BytesNestedMixed a1 = calloc<Struct8BytesNestedMixed>().ref;
-  Struct8BytesNestedMixed a2 = calloc<Struct8BytesNestedMixed>().ref;
-  Struct8BytesNestedMixed a3 = calloc<Struct8BytesNestedMixed>().ref;
-  Struct8BytesNestedMixed a4 = calloc<Struct8BytesNestedMixed>().ref;
-  Struct8BytesNestedMixed a5 = calloc<Struct8BytesNestedMixed>().ref;
-  Struct8BytesNestedMixed a6 = calloc<Struct8BytesNestedMixed>().ref;
-  Struct8BytesNestedMixed a7 = calloc<Struct8BytesNestedMixed>().ref;
-  Struct8BytesNestedMixed a8 = calloc<Struct8BytesNestedMixed>().ref;
-  Struct8BytesNestedMixed a9 = calloc<Struct8BytesNestedMixed>().ref;
+  final a0Pointer = calloc<Struct8BytesNestedMixed>();
+  final Struct8BytesNestedMixed a0 = a0Pointer.ref;
+  final a1Pointer = calloc<Struct8BytesNestedMixed>();
+  final Struct8BytesNestedMixed a1 = a1Pointer.ref;
+  final a2Pointer = calloc<Struct8BytesNestedMixed>();
+  final Struct8BytesNestedMixed a2 = a2Pointer.ref;
+  final a3Pointer = calloc<Struct8BytesNestedMixed>();
+  final Struct8BytesNestedMixed a3 = a3Pointer.ref;
+  final a4Pointer = calloc<Struct8BytesNestedMixed>();
+  final Struct8BytesNestedMixed a4 = a4Pointer.ref;
+  final a5Pointer = calloc<Struct8BytesNestedMixed>();
+  final Struct8BytesNestedMixed a5 = a5Pointer.ref;
+  final a6Pointer = calloc<Struct8BytesNestedMixed>();
+  final Struct8BytesNestedMixed a6 = a6Pointer.ref;
+  final a7Pointer = calloc<Struct8BytesNestedMixed>();
+  final Struct8BytesNestedMixed a7 = a7Pointer.ref;
+  final a8Pointer = calloc<Struct8BytesNestedMixed>();
+  final Struct8BytesNestedMixed a8 = a8Pointer.ref;
+  final a9Pointer = calloc<Struct8BytesNestedMixed>();
+  final Struct8BytesNestedMixed a9 = a9Pointer.ref;
 
   a0.a0.a0 = -1;
   a0.a0.a1 = 2;
@@ -4085,16 +4280,16 @@
 
   Expect.approxEquals(15.0, result);
 
-  calloc.free(a0.addressOf);
-  calloc.free(a1.addressOf);
-  calloc.free(a2.addressOf);
-  calloc.free(a3.addressOf);
-  calloc.free(a4.addressOf);
-  calloc.free(a5.addressOf);
-  calloc.free(a6.addressOf);
-  calloc.free(a7.addressOf);
-  calloc.free(a8.addressOf);
-  calloc.free(a9.addressOf);
+  calloc.free(a0Pointer);
+  calloc.free(a1Pointer);
+  calloc.free(a2Pointer);
+  calloc.free(a3Pointer);
+  calloc.free(a4Pointer);
+  calloc.free(a5Pointer);
+  calloc.free(a6Pointer);
+  calloc.free(a7Pointer);
+  calloc.free(a8Pointer);
+  calloc.free(a9Pointer);
 }
 
 final passStruct16BytesNestedIntx2 = ffiTestFunctions.lookupFunction<
@@ -4104,8 +4299,10 @@
 
 /// Deeper nested struct to test recursive member access.
 void testPassStruct16BytesNestedIntx2() {
-  Struct16BytesNestedInt a0 = calloc<Struct16BytesNestedInt>().ref;
-  Struct16BytesNestedInt a1 = calloc<Struct16BytesNestedInt>().ref;
+  final a0Pointer = calloc<Struct16BytesNestedInt>();
+  final Struct16BytesNestedInt a0 = a0Pointer.ref;
+  final a1Pointer = calloc<Struct16BytesNestedInt>();
+  final Struct16BytesNestedInt a1 = a1Pointer.ref;
 
   a0.a0.a0.a0 = -1;
   a0.a0.a0.a1 = 2;
@@ -4130,8 +4327,8 @@
 
   Expect.equals(8, result);
 
-  calloc.free(a0.addressOf);
-  calloc.free(a1.addressOf);
+  calloc.free(a0Pointer);
+  calloc.free(a1Pointer);
 }
 
 final passStruct32BytesNestedIntx2 = ffiTestFunctions.lookupFunction<
@@ -4141,8 +4338,10 @@
 
 /// Even deeper nested struct to test recursive member access.
 void testPassStruct32BytesNestedIntx2() {
-  Struct32BytesNestedInt a0 = calloc<Struct32BytesNestedInt>().ref;
-  Struct32BytesNestedInt a1 = calloc<Struct32BytesNestedInt>().ref;
+  final a0Pointer = calloc<Struct32BytesNestedInt>();
+  final Struct32BytesNestedInt a0 = a0Pointer.ref;
+  final a1Pointer = calloc<Struct32BytesNestedInt>();
+  final Struct32BytesNestedInt a1 = a1Pointer.ref;
 
   a0.a0.a0.a0.a0 = -1;
   a0.a0.a0.a0.a1 = 2;
@@ -4183,8 +4382,8 @@
 
   Expect.equals(16, result);
 
-  calloc.free(a0.addressOf);
-  calloc.free(a1.addressOf);
+  calloc.free(a0Pointer);
+  calloc.free(a1Pointer);
 }
 
 final passStructNestedIntStructAlignmentInt16 = ffiTestFunctions.lookupFunction<
@@ -4194,8 +4393,8 @@
 
 /// Test alignment and padding of nested struct with 16 byte int.
 void testPassStructNestedIntStructAlignmentInt16() {
-  StructNestedIntStructAlignmentInt16 a0 =
-      calloc<StructNestedIntStructAlignmentInt16>().ref;
+  final a0Pointer = calloc<StructNestedIntStructAlignmentInt16>();
+  final StructNestedIntStructAlignmentInt16 a0 = a0Pointer.ref;
 
   a0.a0.a0 = -1;
   a0.a0.a1 = 2;
@@ -4210,7 +4409,7 @@
 
   Expect.equals(3, result);
 
-  calloc.free(a0.addressOf);
+  calloc.free(a0Pointer);
 }
 
 final passStructNestedIntStructAlignmentInt32 = ffiTestFunctions.lookupFunction<
@@ -4220,8 +4419,8 @@
 
 /// Test alignment and padding of nested struct with 32 byte int.
 void testPassStructNestedIntStructAlignmentInt32() {
-  StructNestedIntStructAlignmentInt32 a0 =
-      calloc<StructNestedIntStructAlignmentInt32>().ref;
+  final a0Pointer = calloc<StructNestedIntStructAlignmentInt32>();
+  final StructNestedIntStructAlignmentInt32 a0 = a0Pointer.ref;
 
   a0.a0.a0 = -1;
   a0.a0.a1 = 2;
@@ -4236,7 +4435,7 @@
 
   Expect.equals(3, result);
 
-  calloc.free(a0.addressOf);
+  calloc.free(a0Pointer);
 }
 
 final passStructNestedIntStructAlignmentInt64 = ffiTestFunctions.lookupFunction<
@@ -4246,8 +4445,8 @@
 
 /// Test alignment and padding of nested struct with 64 byte int.
 void testPassStructNestedIntStructAlignmentInt64() {
-  StructNestedIntStructAlignmentInt64 a0 =
-      calloc<StructNestedIntStructAlignmentInt64>().ref;
+  final a0Pointer = calloc<StructNestedIntStructAlignmentInt64>();
+  final StructNestedIntStructAlignmentInt64 a0 = a0Pointer.ref;
 
   a0.a0.a0 = -1;
   a0.a0.a1 = 2;
@@ -4262,7 +4461,7 @@
 
   Expect.equals(3, result);
 
-  calloc.free(a0.addressOf);
+  calloc.free(a0Pointer);
 }
 
 final passStructNestedIrregularEvenBiggerx4 = ffiTestFunctions.lookupFunction<
@@ -4280,14 +4479,14 @@
 
 /// Return big irregular struct as smoke test.
 void testPassStructNestedIrregularEvenBiggerx4() {
-  StructNestedIrregularEvenBigger a0 =
-      calloc<StructNestedIrregularEvenBigger>().ref;
-  StructNestedIrregularEvenBigger a1 =
-      calloc<StructNestedIrregularEvenBigger>().ref;
-  StructNestedIrregularEvenBigger a2 =
-      calloc<StructNestedIrregularEvenBigger>().ref;
-  StructNestedIrregularEvenBigger a3 =
-      calloc<StructNestedIrregularEvenBigger>().ref;
+  final a0Pointer = calloc<StructNestedIrregularEvenBigger>();
+  final StructNestedIrregularEvenBigger a0 = a0Pointer.ref;
+  final a1Pointer = calloc<StructNestedIrregularEvenBigger>();
+  final StructNestedIrregularEvenBigger a1 = a1Pointer.ref;
+  final a2Pointer = calloc<StructNestedIrregularEvenBigger>();
+  final StructNestedIrregularEvenBigger a2 = a2Pointer.ref;
+  final a3Pointer = calloc<StructNestedIrregularEvenBigger>();
+  final StructNestedIrregularEvenBigger a3 = a3Pointer.ref;
 
   a0.a0 = 1;
   a0.a1.a0.a0 = 2;
@@ -4432,10 +4631,10 @@
 
   Expect.approxEquals(1572.0, result);
 
-  calloc.free(a0.addressOf);
-  calloc.free(a1.addressOf);
-  calloc.free(a2.addressOf);
-  calloc.free(a3.addressOf);
+  calloc.free(a0Pointer);
+  calloc.free(a1Pointer);
+  calloc.free(a2Pointer);
+  calloc.free(a3Pointer);
 }
 
 final returnStruct1ByteInt = ffiTestFunctions.lookupFunction<
@@ -5865,7 +6064,8 @@
 /// Especially for ffi callbacks.
 /// Struct is passed in int registers in most ABIs.
 void testReturnStructArgumentStruct1ByteInt() {
-  Struct1ByteInt a0 = calloc<Struct1ByteInt>().ref;
+  final a0Pointer = calloc<Struct1ByteInt>();
+  final Struct1ByteInt a0 = a0Pointer.ref;
 
   a0.a0 = -1;
 
@@ -5875,7 +6075,7 @@
 
   Expect.equals(a0.a0, result.a0);
 
-  calloc.free(a0.addressOf);
+  calloc.free(a0Pointer);
 }
 
 final returnStructArgumentInt32x8Struct1ByteInt =
@@ -5897,7 +6097,8 @@
   int a5;
   int a6;
   int a7;
-  Struct1ByteInt a8 = calloc<Struct1ByteInt>().ref;
+  final a8Pointer = calloc<Struct1ByteInt>();
+  final Struct1ByteInt a8 = a8Pointer.ref;
 
   a0 = -1;
   a1 = 2;
@@ -5916,7 +6117,7 @@
 
   Expect.equals(a8.a0, result.a0);
 
-  calloc.free(a8.addressOf);
+  calloc.free(a8Pointer);
 }
 
 final returnStructArgumentStruct8BytesHomogeneousFloat =
@@ -5930,7 +6131,8 @@
 /// Especially for ffi callbacks.
 /// Struct is passed in float registers in most ABIs.
 void testReturnStructArgumentStruct8BytesHomogeneousFloat() {
-  Struct8BytesHomogeneousFloat a0 = calloc<Struct8BytesHomogeneousFloat>().ref;
+  final a0Pointer = calloc<Struct8BytesHomogeneousFloat>();
+  final Struct8BytesHomogeneousFloat a0 = a0Pointer.ref;
 
   a0.a0 = -1.0;
   a0.a1 = 2.0;
@@ -5942,7 +6144,7 @@
   Expect.approxEquals(a0.a0, result.a0);
   Expect.approxEquals(a0.a1, result.a1);
 
-  calloc.free(a0.addressOf);
+  calloc.free(a0Pointer);
 }
 
 final returnStructArgumentStruct20BytesHomogeneousInt32 =
@@ -5956,8 +6158,8 @@
 
 /// On arm64, both argument and return value are passed in by pointer.
 void testReturnStructArgumentStruct20BytesHomogeneousInt32() {
-  Struct20BytesHomogeneousInt32 a0 =
-      calloc<Struct20BytesHomogeneousInt32>().ref;
+  final a0Pointer = calloc<Struct20BytesHomogeneousInt32>();
+  final Struct20BytesHomogeneousInt32 a0 = a0Pointer.ref;
 
   a0.a0 = -1;
   a0.a1 = 2;
@@ -5975,7 +6177,7 @@
   Expect.equals(a0.a3, result.a3);
   Expect.equals(a0.a4, result.a4);
 
-  calloc.free(a0.addressOf);
+  calloc.free(a0Pointer);
 }
 
 final returnStructArgumentInt32x8Struct20BytesHomogeneou =
@@ -5997,8 +6199,8 @@
   int a5;
   int a6;
   int a7;
-  Struct20BytesHomogeneousInt32 a8 =
-      calloc<Struct20BytesHomogeneousInt32>().ref;
+  final a8Pointer = calloc<Struct20BytesHomogeneousInt32>();
+  final Struct20BytesHomogeneousInt32 a8 = a8Pointer.ref;
 
   a0 = -1;
   a1 = 2;
@@ -6025,7 +6227,7 @@
   Expect.equals(a8.a3, result.a3);
   Expect.equals(a8.a4, result.a4);
 
-  calloc.free(a8.addressOf);
+  calloc.free(a8Pointer);
 }
 
 final returnStructAlignmentInt16 = ffiTestFunctions.lookupFunction<
@@ -6105,8 +6307,10 @@
 
 /// Simple nested struct.
 void testReturnStruct8BytesNestedInt() {
-  Struct4BytesHomogeneousInt16 a0 = calloc<Struct4BytesHomogeneousInt16>().ref;
-  Struct4BytesHomogeneousInt16 a1 = calloc<Struct4BytesHomogeneousInt16>().ref;
+  final a0Pointer = calloc<Struct4BytesHomogeneousInt16>();
+  final Struct4BytesHomogeneousInt16 a0 = a0Pointer.ref;
+  final a1Pointer = calloc<Struct4BytesHomogeneousInt16>();
+  final Struct4BytesHomogeneousInt16 a1 = a1Pointer.ref;
 
   a0.a0 = -1;
   a0.a1 = 2;
@@ -6122,8 +6326,8 @@
   Expect.equals(a1.a0, result.a1.a0);
   Expect.equals(a1.a1, result.a1.a1);
 
-  calloc.free(a0.addressOf);
-  calloc.free(a1.addressOf);
+  calloc.free(a0Pointer);
+  calloc.free(a1Pointer);
 }
 
 final returnStruct8BytesNestedFloat = ffiTestFunctions.lookupFunction<
@@ -6133,8 +6337,10 @@
 
 /// Simple nested struct with floats.
 void testReturnStruct8BytesNestedFloat() {
-  Struct4BytesFloat a0 = calloc<Struct4BytesFloat>().ref;
-  Struct4BytesFloat a1 = calloc<Struct4BytesFloat>().ref;
+  final a0Pointer = calloc<Struct4BytesFloat>();
+  final Struct4BytesFloat a0 = a0Pointer.ref;
+  final a1Pointer = calloc<Struct4BytesFloat>();
+  final Struct4BytesFloat a1 = a1Pointer.ref;
 
   a0.a0 = -1.0;
   a1.a0 = 2.0;
@@ -6146,8 +6352,8 @@
   Expect.approxEquals(a0.a0, result.a0.a0);
   Expect.approxEquals(a1.a0, result.a1.a0);
 
-  calloc.free(a0.addressOf);
-  calloc.free(a1.addressOf);
+  calloc.free(a0Pointer);
+  calloc.free(a1Pointer);
 }
 
 final returnStruct8BytesNestedFloat2 = ffiTestFunctions.lookupFunction<
@@ -6158,7 +6364,8 @@
 /// The nesting is irregular, testing homogenous float rules on arm and arm64,
 /// and the fpu register usage on x64.
 void testReturnStruct8BytesNestedFloat2() {
-  Struct4BytesFloat a0 = calloc<Struct4BytesFloat>().ref;
+  final a0Pointer = calloc<Struct4BytesFloat>();
+  final Struct4BytesFloat a0 = a0Pointer.ref;
   double a1;
 
   a0.a0 = -1.0;
@@ -6171,7 +6378,7 @@
   Expect.approxEquals(a0.a0, result.a0.a0);
   Expect.approxEquals(a1, result.a1);
 
-  calloc.free(a0.addressOf);
+  calloc.free(a0Pointer);
 }
 
 final returnStruct8BytesNestedMixed = ffiTestFunctions.lookupFunction<
@@ -6182,8 +6389,10 @@
 
 /// Simple nested struct with mixed members.
 void testReturnStruct8BytesNestedMixed() {
-  Struct4BytesHomogeneousInt16 a0 = calloc<Struct4BytesHomogeneousInt16>().ref;
-  Struct4BytesFloat a1 = calloc<Struct4BytesFloat>().ref;
+  final a0Pointer = calloc<Struct4BytesHomogeneousInt16>();
+  final Struct4BytesHomogeneousInt16 a0 = a0Pointer.ref;
+  final a1Pointer = calloc<Struct4BytesFloat>();
+  final Struct4BytesFloat a1 = a1Pointer.ref;
 
   a0.a0 = -1;
   a0.a1 = 2;
@@ -6197,8 +6406,8 @@
   Expect.equals(a0.a1, result.a0.a1);
   Expect.approxEquals(a1.a0, result.a1.a0);
 
-  calloc.free(a0.addressOf);
-  calloc.free(a1.addressOf);
+  calloc.free(a0Pointer);
+  calloc.free(a1Pointer);
 }
 
 final returnStruct16BytesNestedInt = ffiTestFunctions.lookupFunction<
@@ -6209,8 +6418,10 @@
 
 /// Deeper nested struct to test recursive member access.
 void testReturnStruct16BytesNestedInt() {
-  Struct8BytesNestedInt a0 = calloc<Struct8BytesNestedInt>().ref;
-  Struct8BytesNestedInt a1 = calloc<Struct8BytesNestedInt>().ref;
+  final a0Pointer = calloc<Struct8BytesNestedInt>();
+  final Struct8BytesNestedInt a0 = a0Pointer.ref;
+  final a1Pointer = calloc<Struct8BytesNestedInt>();
+  final Struct8BytesNestedInt a1 = a1Pointer.ref;
 
   a0.a0.a0 = -1;
   a0.a0.a1 = 2;
@@ -6234,8 +6445,8 @@
   Expect.equals(a1.a1.a0, result.a1.a1.a0);
   Expect.equals(a1.a1.a1, result.a1.a1.a1);
 
-  calloc.free(a0.addressOf);
-  calloc.free(a1.addressOf);
+  calloc.free(a0Pointer);
+  calloc.free(a1Pointer);
 }
 
 final returnStruct32BytesNestedInt = ffiTestFunctions.lookupFunction<
@@ -6246,8 +6457,10 @@
 
 /// Even deeper nested struct to test recursive member access.
 void testReturnStruct32BytesNestedInt() {
-  Struct16BytesNestedInt a0 = calloc<Struct16BytesNestedInt>().ref;
-  Struct16BytesNestedInt a1 = calloc<Struct16BytesNestedInt>().ref;
+  final a0Pointer = calloc<Struct16BytesNestedInt>();
+  final Struct16BytesNestedInt a0 = a0Pointer.ref;
+  final a1Pointer = calloc<Struct16BytesNestedInt>();
+  final Struct16BytesNestedInt a1 = a1Pointer.ref;
 
   a0.a0.a0.a0 = -1;
   a0.a0.a0.a1 = 2;
@@ -6287,8 +6500,8 @@
   Expect.equals(a1.a1.a1.a0, result.a1.a1.a1.a0);
   Expect.equals(a1.a1.a1.a1, result.a1.a1.a1.a1);
 
-  calloc.free(a0.addressOf);
-  calloc.free(a1.addressOf);
+  calloc.free(a0Pointer);
+  calloc.free(a1Pointer);
 }
 
 final returnStructNestedIntStructAlignmentInt16 =
@@ -6300,8 +6513,10 @@
 
 /// Test alignment and padding of nested struct with 16 byte int.
 void testReturnStructNestedIntStructAlignmentInt16() {
-  StructAlignmentInt16 a0 = calloc<StructAlignmentInt16>().ref;
-  StructAlignmentInt16 a1 = calloc<StructAlignmentInt16>().ref;
+  final a0Pointer = calloc<StructAlignmentInt16>();
+  final StructAlignmentInt16 a0 = a0Pointer.ref;
+  final a1Pointer = calloc<StructAlignmentInt16>();
+  final StructAlignmentInt16 a1 = a1Pointer.ref;
 
   a0.a0 = -1;
   a0.a1 = 2;
@@ -6321,8 +6536,8 @@
   Expect.equals(a1.a1, result.a1.a1);
   Expect.equals(a1.a2, result.a1.a2);
 
-  calloc.free(a0.addressOf);
-  calloc.free(a1.addressOf);
+  calloc.free(a0Pointer);
+  calloc.free(a1Pointer);
 }
 
 final returnStructNestedIntStructAlignmentInt32 =
@@ -6334,8 +6549,10 @@
 
 /// Test alignment and padding of nested struct with 32 byte int.
 void testReturnStructNestedIntStructAlignmentInt32() {
-  StructAlignmentInt32 a0 = calloc<StructAlignmentInt32>().ref;
-  StructAlignmentInt32 a1 = calloc<StructAlignmentInt32>().ref;
+  final a0Pointer = calloc<StructAlignmentInt32>();
+  final StructAlignmentInt32 a0 = a0Pointer.ref;
+  final a1Pointer = calloc<StructAlignmentInt32>();
+  final StructAlignmentInt32 a1 = a1Pointer.ref;
 
   a0.a0 = -1;
   a0.a1 = 2;
@@ -6355,8 +6572,8 @@
   Expect.equals(a1.a1, result.a1.a1);
   Expect.equals(a1.a2, result.a1.a2);
 
-  calloc.free(a0.addressOf);
-  calloc.free(a1.addressOf);
+  calloc.free(a0Pointer);
+  calloc.free(a1Pointer);
 }
 
 final returnStructNestedIntStructAlignmentInt64 =
@@ -6368,8 +6585,10 @@
 
 /// Test alignment and padding of nested struct with 64 byte int.
 void testReturnStructNestedIntStructAlignmentInt64() {
-  StructAlignmentInt64 a0 = calloc<StructAlignmentInt64>().ref;
-  StructAlignmentInt64 a1 = calloc<StructAlignmentInt64>().ref;
+  final a0Pointer = calloc<StructAlignmentInt64>();
+  final StructAlignmentInt64 a0 = a0Pointer.ref;
+  final a1Pointer = calloc<StructAlignmentInt64>();
+  final StructAlignmentInt64 a1 = a1Pointer.ref;
 
   a0.a0 = -1;
   a0.a1 = 2;
@@ -6389,8 +6608,8 @@
   Expect.equals(a1.a1, result.a1.a1);
   Expect.equals(a1.a2, result.a1.a2);
 
-  calloc.free(a0.addressOf);
-  calloc.free(a1.addressOf);
+  calloc.free(a0Pointer);
+  calloc.free(a1Pointer);
 }
 
 final returnStructNestedIrregularEvenBigger = ffiTestFunctions.lookupFunction<
@@ -6405,8 +6624,10 @@
 /// Return big irregular struct as smoke test.
 void testReturnStructNestedIrregularEvenBigger() {
   int a0;
-  StructNestedIrregularBigger a1 = calloc<StructNestedIrregularBigger>().ref;
-  StructNestedIrregularBigger a2 = calloc<StructNestedIrregularBigger>().ref;
+  final a1Pointer = calloc<StructNestedIrregularBigger>();
+  final StructNestedIrregularBigger a1 = a1Pointer.ref;
+  final a2Pointer = calloc<StructNestedIrregularBigger>();
+  final StructNestedIrregularBigger a2 = a2Pointer.ref;
   double a3;
 
   a0 = 1;
@@ -6483,6 +6704,6 @@
   Expect.approxEquals(a2.a3, result.a2.a3);
   Expect.approxEquals(a3, result.a3);
 
-  calloc.free(a1.addressOf);
-  calloc.free(a2.addressOf);
+  calloc.free(a1Pointer);
+  calloc.free(a2Pointer);
 }
diff --git a/tests/ffi/generator/structs_by_value_tests_generator.dart b/tests/ffi/generator/structs_by_value_tests_generator.dart
index 7bd7c83..3c678d3 100644
--- a/tests/ffi/generator/structs_by_value_tests_generator.dart
+++ b/tests/ffi/generator/structs_by_value_tests_generator.dart
@@ -197,14 +197,18 @@
         return "${dartType} ${variableName};\n";
 
       case StructType:
-        return "${dartType} ${variableName} = calloc<$dartType>().ref;\n";
+        return """
+final ${variableName}Pointer = calloc<$dartType>();
+final ${dartType} ${variableName} = ${variableName}Pointer.ref;
+""";
     }
 
     throw Exception("Not implemented for ${this.runtimeType}");
   }
 
   /// A list of Dart statements allocating as zero or nullptr.
-  String dartAllocateZeroStatements(String variableName) {
+  String dartAllocateZeroStatements(String variableName,
+      {bool structsAsPointers = false}) {
     switch (this.runtimeType) {
       case FundamentalType:
         final this_ = this as FundamentalType;
@@ -214,7 +218,11 @@
         return "${dartType} ${variableName} = 0.0;\n";
 
       case StructType:
-        return "${dartType} ${variableName} = ${dartType}();\n";
+        if (structsAsPointers) {
+          return "Pointer<${dartType}> ${variableName}Pointer = nullptr;\n";
+        } else {
+          return "${dartType} ${variableName} = ${dartType}();\n";
+        }
     }
 
     throw Exception("Not implemented for ${this.runtimeType}");
@@ -229,7 +237,7 @@
   }
 
   /// A list of Dart statements as zero or nullptr.
-  String dartAllocateZeroStatements([String namePrefix = ""]) {
+  String dartAllocateZeroStatements(String namePrefix) {
     return map((m) => m.type.dartAllocateZeroStatements("$namePrefix${m.name}"))
         .join();
   }
@@ -243,7 +251,7 @@
         return "";
 
       case StructType:
-        return "calloc.free($variableName.addressOf);\n";
+        return "calloc.free(${variableName}Pointer);\n";
     }
 
     throw Exception("Not implemented for ${this.runtimeType}");
@@ -472,6 +480,8 @@
 
     final prints = arguments.map((a) => "\$\{${a.name}\}").join(", ");
 
+    bool structsAsPointers = false;
+    String assignReturnGlobal = "";
     String buildReturnValue = "";
     switch (testType) {
       case TestType.structArguments:
@@ -481,19 +491,24 @@
 
         ${arguments.addToResultStatements('${dartName}_')}
         """;
+        assignReturnGlobal = "${dartName}Result = result;";
         break;
       case TestType.structReturn:
         // Allocate a struct.
         buildReturnValue = """
-        ${returnValue.dartType} result = calloc<${returnValue.dartType}>().ref;
+        final resultPointer = calloc<${returnValue.dartType}>();
+        final result = resultPointer.ref;
 
         ${arguments.copyValueStatements("${dartName}_", "result.")}
         """;
+        assignReturnGlobal = "${dartName}ResultPointer = resultPointer;";
+        structsAsPointers = true;
         break;
       case TestType.structReturnArgument:
         buildReturnValue = """
         ${returnValue.cType} result = ${dartName}_${structReturnArgument.name};
         """;
+        assignReturnGlobal = "${dartName}Result = result;";
         break;
     }
 
@@ -542,12 +557,12 @@
     $globals
 
     // Result variable also global, so we can delete it after the callback.
-    ${returnValue.dartAllocateZeroStatements("${dartName}Result")}
+    ${returnValue.dartAllocateZeroStatements("${dartName}Result", structsAsPointers: structsAsPointers)}
 
     ${returnValue.dartType} ${dartName}CalculateResult() {
       $buildReturnValue
 
-      ${dartName}Result = result;
+      $assignReturnGlobal
 
       return result;
     }
diff --git a/tests/ffi_2/function_callbacks_structs_by_value_generated_test.dart b/tests/ffi_2/function_callbacks_structs_by_value_generated_test.dart
index e11d962..94b19e2 100644
--- a/tests/ffi_2/function_callbacks_structs_by_value_generated_test.dart
+++ b/tests/ffi_2/function_callbacks_structs_by_value_generated_test.dart
@@ -5410,14 +5410,15 @@
 int returnStruct1ByteInt_a0 = 0;
 
 // Result variable also global, so we can delete it after the callback.
-Struct1ByteInt returnStruct1ByteIntResult = Struct1ByteInt();
+Pointer<Struct1ByteInt> returnStruct1ByteIntResultPointer = nullptr;
 
 Struct1ByteInt returnStruct1ByteIntCalculateResult() {
-  Struct1ByteInt result = calloc<Struct1ByteInt>().ref;
+  final resultPointer = calloc<Struct1ByteInt>();
+  final result = resultPointer.ref;
 
   result.a0 = returnStruct1ByteInt_a0;
 
-  returnStruct1ByteIntResult = result;
+  returnStruct1ByteIntResultPointer = resultPointer;
 
   return result;
 }
@@ -5448,13 +5449,13 @@
 }
 
 void returnStruct1ByteIntAfterCallback() {
-  calloc.free(returnStruct1ByteIntResult.addressOf);
+  calloc.free(returnStruct1ByteIntResultPointer);
 
   final result = returnStruct1ByteIntCalculateResult();
 
   print("after callback result = $result");
 
-  calloc.free(returnStruct1ByteIntResult.addressOf);
+  calloc.free(returnStruct1ByteIntResultPointer);
 }
 
 typedef ReturnStruct3BytesHomogeneousUint8Type = Struct3BytesHomogeneousUint8
@@ -5466,19 +5467,19 @@
 int returnStruct3BytesHomogeneousUint8_a2 = 0;
 
 // Result variable also global, so we can delete it after the callback.
-Struct3BytesHomogeneousUint8 returnStruct3BytesHomogeneousUint8Result =
-    Struct3BytesHomogeneousUint8();
+Pointer<Struct3BytesHomogeneousUint8>
+    returnStruct3BytesHomogeneousUint8ResultPointer = nullptr;
 
 Struct3BytesHomogeneousUint8
     returnStruct3BytesHomogeneousUint8CalculateResult() {
-  Struct3BytesHomogeneousUint8 result =
-      calloc<Struct3BytesHomogeneousUint8>().ref;
+  final resultPointer = calloc<Struct3BytesHomogeneousUint8>();
+  final result = resultPointer.ref;
 
   result.a0 = returnStruct3BytesHomogeneousUint8_a0;
   result.a1 = returnStruct3BytesHomogeneousUint8_a1;
   result.a2 = returnStruct3BytesHomogeneousUint8_a2;
 
-  returnStruct3BytesHomogeneousUint8Result = result;
+  returnStruct3BytesHomogeneousUint8ResultPointer = resultPointer;
 
   return result;
 }
@@ -5512,13 +5513,13 @@
 }
 
 void returnStruct3BytesHomogeneousUint8AfterCallback() {
-  calloc.free(returnStruct3BytesHomogeneousUint8Result.addressOf);
+  calloc.free(returnStruct3BytesHomogeneousUint8ResultPointer);
 
   final result = returnStruct3BytesHomogeneousUint8CalculateResult();
 
   print("after callback result = $result");
 
-  calloc.free(returnStruct3BytesHomogeneousUint8Result.addressOf);
+  calloc.free(returnStruct3BytesHomogeneousUint8ResultPointer);
 }
 
 typedef ReturnStruct3BytesInt2ByteAlignedType = Struct3BytesInt2ByteAligned
@@ -5529,17 +5530,17 @@
 int returnStruct3BytesInt2ByteAligned_a1 = 0;
 
 // Result variable also global, so we can delete it after the callback.
-Struct3BytesInt2ByteAligned returnStruct3BytesInt2ByteAlignedResult =
-    Struct3BytesInt2ByteAligned();
+Pointer<Struct3BytesInt2ByteAligned>
+    returnStruct3BytesInt2ByteAlignedResultPointer = nullptr;
 
 Struct3BytesInt2ByteAligned returnStruct3BytesInt2ByteAlignedCalculateResult() {
-  Struct3BytesInt2ByteAligned result =
-      calloc<Struct3BytesInt2ByteAligned>().ref;
+  final resultPointer = calloc<Struct3BytesInt2ByteAligned>();
+  final result = resultPointer.ref;
 
   result.a0 = returnStruct3BytesInt2ByteAligned_a0;
   result.a1 = returnStruct3BytesInt2ByteAligned_a1;
 
-  returnStruct3BytesInt2ByteAlignedResult = result;
+  returnStruct3BytesInt2ByteAlignedResultPointer = resultPointer;
 
   return result;
 }
@@ -5572,13 +5573,13 @@
 }
 
 void returnStruct3BytesInt2ByteAlignedAfterCallback() {
-  calloc.free(returnStruct3BytesInt2ByteAlignedResult.addressOf);
+  calloc.free(returnStruct3BytesInt2ByteAlignedResultPointer);
 
   final result = returnStruct3BytesInt2ByteAlignedCalculateResult();
 
   print("after callback result = $result");
 
-  calloc.free(returnStruct3BytesInt2ByteAlignedResult.addressOf);
+  calloc.free(returnStruct3BytesInt2ByteAlignedResultPointer);
 }
 
 typedef ReturnStruct4BytesHomogeneousInt16Type = Struct4BytesHomogeneousInt16
@@ -5589,18 +5590,18 @@
 int returnStruct4BytesHomogeneousInt16_a1 = 0;
 
 // Result variable also global, so we can delete it after the callback.
-Struct4BytesHomogeneousInt16 returnStruct4BytesHomogeneousInt16Result =
-    Struct4BytesHomogeneousInt16();
+Pointer<Struct4BytesHomogeneousInt16>
+    returnStruct4BytesHomogeneousInt16ResultPointer = nullptr;
 
 Struct4BytesHomogeneousInt16
     returnStruct4BytesHomogeneousInt16CalculateResult() {
-  Struct4BytesHomogeneousInt16 result =
-      calloc<Struct4BytesHomogeneousInt16>().ref;
+  final resultPointer = calloc<Struct4BytesHomogeneousInt16>();
+  final result = resultPointer.ref;
 
   result.a0 = returnStruct4BytesHomogeneousInt16_a0;
   result.a1 = returnStruct4BytesHomogeneousInt16_a1;
 
-  returnStruct4BytesHomogeneousInt16Result = result;
+  returnStruct4BytesHomogeneousInt16ResultPointer = resultPointer;
 
   return result;
 }
@@ -5633,13 +5634,13 @@
 }
 
 void returnStruct4BytesHomogeneousInt16AfterCallback() {
-  calloc.free(returnStruct4BytesHomogeneousInt16Result.addressOf);
+  calloc.free(returnStruct4BytesHomogeneousInt16ResultPointer);
 
   final result = returnStruct4BytesHomogeneousInt16CalculateResult();
 
   print("after callback result = $result");
 
-  calloc.free(returnStruct4BytesHomogeneousInt16Result.addressOf);
+  calloc.free(returnStruct4BytesHomogeneousInt16ResultPointer);
 }
 
 typedef ReturnStruct7BytesHomogeneousUint8Type = Struct7BytesHomogeneousUint8
@@ -5655,13 +5656,13 @@
 int returnStruct7BytesHomogeneousUint8_a6 = 0;
 
 // Result variable also global, so we can delete it after the callback.
-Struct7BytesHomogeneousUint8 returnStruct7BytesHomogeneousUint8Result =
-    Struct7BytesHomogeneousUint8();
+Pointer<Struct7BytesHomogeneousUint8>
+    returnStruct7BytesHomogeneousUint8ResultPointer = nullptr;
 
 Struct7BytesHomogeneousUint8
     returnStruct7BytesHomogeneousUint8CalculateResult() {
-  Struct7BytesHomogeneousUint8 result =
-      calloc<Struct7BytesHomogeneousUint8>().ref;
+  final resultPointer = calloc<Struct7BytesHomogeneousUint8>();
+  final result = resultPointer.ref;
 
   result.a0 = returnStruct7BytesHomogeneousUint8_a0;
   result.a1 = returnStruct7BytesHomogeneousUint8_a1;
@@ -5671,7 +5672,7 @@
   result.a5 = returnStruct7BytesHomogeneousUint8_a5;
   result.a6 = returnStruct7BytesHomogeneousUint8_a6;
 
-  returnStruct7BytesHomogeneousUint8Result = result;
+  returnStruct7BytesHomogeneousUint8ResultPointer = resultPointer;
 
   return result;
 }
@@ -5710,13 +5711,13 @@
 }
 
 void returnStruct7BytesHomogeneousUint8AfterCallback() {
-  calloc.free(returnStruct7BytesHomogeneousUint8Result.addressOf);
+  calloc.free(returnStruct7BytesHomogeneousUint8ResultPointer);
 
   final result = returnStruct7BytesHomogeneousUint8CalculateResult();
 
   print("after callback result = $result");
 
-  calloc.free(returnStruct7BytesHomogeneousUint8Result.addressOf);
+  calloc.free(returnStruct7BytesHomogeneousUint8ResultPointer);
 }
 
 typedef ReturnStruct7BytesInt4ByteAlignedType = Struct7BytesInt4ByteAligned
@@ -5728,18 +5729,18 @@
 int returnStruct7BytesInt4ByteAligned_a2 = 0;
 
 // Result variable also global, so we can delete it after the callback.
-Struct7BytesInt4ByteAligned returnStruct7BytesInt4ByteAlignedResult =
-    Struct7BytesInt4ByteAligned();
+Pointer<Struct7BytesInt4ByteAligned>
+    returnStruct7BytesInt4ByteAlignedResultPointer = nullptr;
 
 Struct7BytesInt4ByteAligned returnStruct7BytesInt4ByteAlignedCalculateResult() {
-  Struct7BytesInt4ByteAligned result =
-      calloc<Struct7BytesInt4ByteAligned>().ref;
+  final resultPointer = calloc<Struct7BytesInt4ByteAligned>();
+  final result = resultPointer.ref;
 
   result.a0 = returnStruct7BytesInt4ByteAligned_a0;
   result.a1 = returnStruct7BytesInt4ByteAligned_a1;
   result.a2 = returnStruct7BytesInt4ByteAligned_a2;
 
-  returnStruct7BytesInt4ByteAlignedResult = result;
+  returnStruct7BytesInt4ByteAlignedResultPointer = resultPointer;
 
   return result;
 }
@@ -5774,13 +5775,13 @@
 }
 
 void returnStruct7BytesInt4ByteAlignedAfterCallback() {
-  calloc.free(returnStruct7BytesInt4ByteAlignedResult.addressOf);
+  calloc.free(returnStruct7BytesInt4ByteAlignedResultPointer);
 
   final result = returnStruct7BytesInt4ByteAlignedCalculateResult();
 
   print("after callback result = $result");
 
-  calloc.free(returnStruct7BytesInt4ByteAlignedResult.addressOf);
+  calloc.free(returnStruct7BytesInt4ByteAlignedResultPointer);
 }
 
 typedef ReturnStruct8BytesIntType = Struct8BytesInt Function(
@@ -5792,16 +5793,17 @@
 int returnStruct8BytesInt_a2 = 0;
 
 // Result variable also global, so we can delete it after the callback.
-Struct8BytesInt returnStruct8BytesIntResult = Struct8BytesInt();
+Pointer<Struct8BytesInt> returnStruct8BytesIntResultPointer = nullptr;
 
 Struct8BytesInt returnStruct8BytesIntCalculateResult() {
-  Struct8BytesInt result = calloc<Struct8BytesInt>().ref;
+  final resultPointer = calloc<Struct8BytesInt>();
+  final result = resultPointer.ref;
 
   result.a0 = returnStruct8BytesInt_a0;
   result.a1 = returnStruct8BytesInt_a1;
   result.a2 = returnStruct8BytesInt_a2;
 
-  returnStruct8BytesIntResult = result;
+  returnStruct8BytesIntResultPointer = resultPointer;
 
   return result;
 }
@@ -5834,13 +5836,13 @@
 }
 
 void returnStruct8BytesIntAfterCallback() {
-  calloc.free(returnStruct8BytesIntResult.addressOf);
+  calloc.free(returnStruct8BytesIntResultPointer);
 
   final result = returnStruct8BytesIntCalculateResult();
 
   print("after callback result = $result");
 
-  calloc.free(returnStruct8BytesIntResult.addressOf);
+  calloc.free(returnStruct8BytesIntResultPointer);
 }
 
 typedef ReturnStruct8BytesHomogeneousFloatType = Struct8BytesHomogeneousFloat
@@ -5851,18 +5853,18 @@
 double returnStruct8BytesHomogeneousFloat_a1 = 0.0;
 
 // Result variable also global, so we can delete it after the callback.
-Struct8BytesHomogeneousFloat returnStruct8BytesHomogeneousFloatResult =
-    Struct8BytesHomogeneousFloat();
+Pointer<Struct8BytesHomogeneousFloat>
+    returnStruct8BytesHomogeneousFloatResultPointer = nullptr;
 
 Struct8BytesHomogeneousFloat
     returnStruct8BytesHomogeneousFloatCalculateResult() {
-  Struct8BytesHomogeneousFloat result =
-      calloc<Struct8BytesHomogeneousFloat>().ref;
+  final resultPointer = calloc<Struct8BytesHomogeneousFloat>();
+  final result = resultPointer.ref;
 
   result.a0 = returnStruct8BytesHomogeneousFloat_a0;
   result.a1 = returnStruct8BytesHomogeneousFloat_a1;
 
-  returnStruct8BytesHomogeneousFloatResult = result;
+  returnStruct8BytesHomogeneousFloatResultPointer = resultPointer;
 
   return result;
 }
@@ -5895,13 +5897,13 @@
 }
 
 void returnStruct8BytesHomogeneousFloatAfterCallback() {
-  calloc.free(returnStruct8BytesHomogeneousFloatResult.addressOf);
+  calloc.free(returnStruct8BytesHomogeneousFloatResultPointer);
 
   final result = returnStruct8BytesHomogeneousFloatCalculateResult();
 
   print("after callback result = $result");
 
-  calloc.free(returnStruct8BytesHomogeneousFloatResult.addressOf);
+  calloc.free(returnStruct8BytesHomogeneousFloatResultPointer);
 }
 
 typedef ReturnStruct8BytesMixedType = Struct8BytesMixed Function(
@@ -5913,16 +5915,17 @@
 int returnStruct8BytesMixed_a2 = 0;
 
 // Result variable also global, so we can delete it after the callback.
-Struct8BytesMixed returnStruct8BytesMixedResult = Struct8BytesMixed();
+Pointer<Struct8BytesMixed> returnStruct8BytesMixedResultPointer = nullptr;
 
 Struct8BytesMixed returnStruct8BytesMixedCalculateResult() {
-  Struct8BytesMixed result = calloc<Struct8BytesMixed>().ref;
+  final resultPointer = calloc<Struct8BytesMixed>();
+  final result = resultPointer.ref;
 
   result.a0 = returnStruct8BytesMixed_a0;
   result.a1 = returnStruct8BytesMixed_a1;
   result.a2 = returnStruct8BytesMixed_a2;
 
-  returnStruct8BytesMixedResult = result;
+  returnStruct8BytesMixedResultPointer = resultPointer;
 
   return result;
 }
@@ -5955,13 +5958,13 @@
 }
 
 void returnStruct8BytesMixedAfterCallback() {
-  calloc.free(returnStruct8BytesMixedResult.addressOf);
+  calloc.free(returnStruct8BytesMixedResultPointer);
 
   final result = returnStruct8BytesMixedCalculateResult();
 
   print("after callback result = $result");
 
-  calloc.free(returnStruct8BytesMixedResult.addressOf);
+  calloc.free(returnStruct8BytesMixedResultPointer);
 }
 
 typedef ReturnStruct9BytesHomogeneousUint8Type = Struct9BytesHomogeneousUint8
@@ -5979,13 +5982,13 @@
 int returnStruct9BytesHomogeneousUint8_a8 = 0;
 
 // Result variable also global, so we can delete it after the callback.
-Struct9BytesHomogeneousUint8 returnStruct9BytesHomogeneousUint8Result =
-    Struct9BytesHomogeneousUint8();
+Pointer<Struct9BytesHomogeneousUint8>
+    returnStruct9BytesHomogeneousUint8ResultPointer = nullptr;
 
 Struct9BytesHomogeneousUint8
     returnStruct9BytesHomogeneousUint8CalculateResult() {
-  Struct9BytesHomogeneousUint8 result =
-      calloc<Struct9BytesHomogeneousUint8>().ref;
+  final resultPointer = calloc<Struct9BytesHomogeneousUint8>();
+  final result = resultPointer.ref;
 
   result.a0 = returnStruct9BytesHomogeneousUint8_a0;
   result.a1 = returnStruct9BytesHomogeneousUint8_a1;
@@ -5997,7 +6000,7 @@
   result.a7 = returnStruct9BytesHomogeneousUint8_a7;
   result.a8 = returnStruct9BytesHomogeneousUint8_a8;
 
-  returnStruct9BytesHomogeneousUint8Result = result;
+  returnStruct9BytesHomogeneousUint8ResultPointer = resultPointer;
 
   return result;
 }
@@ -6040,13 +6043,13 @@
 }
 
 void returnStruct9BytesHomogeneousUint8AfterCallback() {
-  calloc.free(returnStruct9BytesHomogeneousUint8Result.addressOf);
+  calloc.free(returnStruct9BytesHomogeneousUint8ResultPointer);
 
   final result = returnStruct9BytesHomogeneousUint8CalculateResult();
 
   print("after callback result = $result");
 
-  calloc.free(returnStruct9BytesHomogeneousUint8Result.addressOf);
+  calloc.free(returnStruct9BytesHomogeneousUint8ResultPointer);
 }
 
 typedef ReturnStruct9BytesInt4Or8ByteAlignedType
@@ -6057,18 +6060,18 @@
 int returnStruct9BytesInt4Or8ByteAligned_a1 = 0;
 
 // Result variable also global, so we can delete it after the callback.
-Struct9BytesInt4Or8ByteAligned returnStruct9BytesInt4Or8ByteAlignedResult =
-    Struct9BytesInt4Or8ByteAligned();
+Pointer<Struct9BytesInt4Or8ByteAligned>
+    returnStruct9BytesInt4Or8ByteAlignedResultPointer = nullptr;
 
 Struct9BytesInt4Or8ByteAligned
     returnStruct9BytesInt4Or8ByteAlignedCalculateResult() {
-  Struct9BytesInt4Or8ByteAligned result =
-      calloc<Struct9BytesInt4Or8ByteAligned>().ref;
+  final resultPointer = calloc<Struct9BytesInt4Or8ByteAligned>();
+  final result = resultPointer.ref;
 
   result.a0 = returnStruct9BytesInt4Or8ByteAligned_a0;
   result.a1 = returnStruct9BytesInt4Or8ByteAligned_a1;
 
-  returnStruct9BytesInt4Or8ByteAlignedResult = result;
+  returnStruct9BytesInt4Or8ByteAlignedResultPointer = resultPointer;
 
   return result;
 }
@@ -6103,13 +6106,13 @@
 }
 
 void returnStruct9BytesInt4Or8ByteAlignedAfterCallback() {
-  calloc.free(returnStruct9BytesInt4Or8ByteAlignedResult.addressOf);
+  calloc.free(returnStruct9BytesInt4Or8ByteAlignedResultPointer);
 
   final result = returnStruct9BytesInt4Or8ByteAlignedCalculateResult();
 
   print("after callback result = $result");
 
-  calloc.free(returnStruct9BytesInt4Or8ByteAlignedResult.addressOf);
+  calloc.free(returnStruct9BytesInt4Or8ByteAlignedResultPointer);
 }
 
 typedef ReturnStruct12BytesHomogeneousFloatType = Struct12BytesHomogeneousFloat
@@ -6121,19 +6124,19 @@
 double returnStruct12BytesHomogeneousFloat_a2 = 0.0;
 
 // Result variable also global, so we can delete it after the callback.
-Struct12BytesHomogeneousFloat returnStruct12BytesHomogeneousFloatResult =
-    Struct12BytesHomogeneousFloat();
+Pointer<Struct12BytesHomogeneousFloat>
+    returnStruct12BytesHomogeneousFloatResultPointer = nullptr;
 
 Struct12BytesHomogeneousFloat
     returnStruct12BytesHomogeneousFloatCalculateResult() {
-  Struct12BytesHomogeneousFloat result =
-      calloc<Struct12BytesHomogeneousFloat>().ref;
+  final resultPointer = calloc<Struct12BytesHomogeneousFloat>();
+  final result = resultPointer.ref;
 
   result.a0 = returnStruct12BytesHomogeneousFloat_a0;
   result.a1 = returnStruct12BytesHomogeneousFloat_a1;
   result.a2 = returnStruct12BytesHomogeneousFloat_a2;
 
-  returnStruct12BytesHomogeneousFloatResult = result;
+  returnStruct12BytesHomogeneousFloatResultPointer = resultPointer;
 
   return result;
 }
@@ -6168,13 +6171,13 @@
 }
 
 void returnStruct12BytesHomogeneousFloatAfterCallback() {
-  calloc.free(returnStruct12BytesHomogeneousFloatResult.addressOf);
+  calloc.free(returnStruct12BytesHomogeneousFloatResultPointer);
 
   final result = returnStruct12BytesHomogeneousFloatCalculateResult();
 
   print("after callback result = $result");
 
-  calloc.free(returnStruct12BytesHomogeneousFloatResult.addressOf);
+  calloc.free(returnStruct12BytesHomogeneousFloatResultPointer);
 }
 
 typedef ReturnStruct16BytesHomogeneousFloatType = Struct16BytesHomogeneousFloat
@@ -6187,20 +6190,20 @@
 double returnStruct16BytesHomogeneousFloat_a3 = 0.0;
 
 // Result variable also global, so we can delete it after the callback.
-Struct16BytesHomogeneousFloat returnStruct16BytesHomogeneousFloatResult =
-    Struct16BytesHomogeneousFloat();
+Pointer<Struct16BytesHomogeneousFloat>
+    returnStruct16BytesHomogeneousFloatResultPointer = nullptr;
 
 Struct16BytesHomogeneousFloat
     returnStruct16BytesHomogeneousFloatCalculateResult() {
-  Struct16BytesHomogeneousFloat result =
-      calloc<Struct16BytesHomogeneousFloat>().ref;
+  final resultPointer = calloc<Struct16BytesHomogeneousFloat>();
+  final result = resultPointer.ref;
 
   result.a0 = returnStruct16BytesHomogeneousFloat_a0;
   result.a1 = returnStruct16BytesHomogeneousFloat_a1;
   result.a2 = returnStruct16BytesHomogeneousFloat_a2;
   result.a3 = returnStruct16BytesHomogeneousFloat_a3;
 
-  returnStruct16BytesHomogeneousFloatResult = result;
+  returnStruct16BytesHomogeneousFloatResultPointer = resultPointer;
 
   return result;
 }
@@ -6235,13 +6238,13 @@
 }
 
 void returnStruct16BytesHomogeneousFloatAfterCallback() {
-  calloc.free(returnStruct16BytesHomogeneousFloatResult.addressOf);
+  calloc.free(returnStruct16BytesHomogeneousFloatResultPointer);
 
   final result = returnStruct16BytesHomogeneousFloatCalculateResult();
 
   print("after callback result = $result");
 
-  calloc.free(returnStruct16BytesHomogeneousFloatResult.addressOf);
+  calloc.free(returnStruct16BytesHomogeneousFloatResultPointer);
 }
 
 typedef ReturnStruct16BytesMixedType = Struct16BytesMixed Function(
@@ -6252,15 +6255,16 @@
 int returnStruct16BytesMixed_a1 = 0;
 
 // Result variable also global, so we can delete it after the callback.
-Struct16BytesMixed returnStruct16BytesMixedResult = Struct16BytesMixed();
+Pointer<Struct16BytesMixed> returnStruct16BytesMixedResultPointer = nullptr;
 
 Struct16BytesMixed returnStruct16BytesMixedCalculateResult() {
-  Struct16BytesMixed result = calloc<Struct16BytesMixed>().ref;
+  final resultPointer = calloc<Struct16BytesMixed>();
+  final result = resultPointer.ref;
 
   result.a0 = returnStruct16BytesMixed_a0;
   result.a1 = returnStruct16BytesMixed_a1;
 
-  returnStruct16BytesMixedResult = result;
+  returnStruct16BytesMixedResultPointer = resultPointer;
 
   return result;
 }
@@ -6292,13 +6296,13 @@
 }
 
 void returnStruct16BytesMixedAfterCallback() {
-  calloc.free(returnStruct16BytesMixedResult.addressOf);
+  calloc.free(returnStruct16BytesMixedResultPointer);
 
   final result = returnStruct16BytesMixedCalculateResult();
 
   print("after callback result = $result");
 
-  calloc.free(returnStruct16BytesMixedResult.addressOf);
+  calloc.free(returnStruct16BytesMixedResultPointer);
 }
 
 typedef ReturnStruct16BytesMixed2Type = Struct16BytesMixed2 Function(
@@ -6311,17 +6315,18 @@
 int returnStruct16BytesMixed2_a3 = 0;
 
 // Result variable also global, so we can delete it after the callback.
-Struct16BytesMixed2 returnStruct16BytesMixed2Result = Struct16BytesMixed2();
+Pointer<Struct16BytesMixed2> returnStruct16BytesMixed2ResultPointer = nullptr;
 
 Struct16BytesMixed2 returnStruct16BytesMixed2CalculateResult() {
-  Struct16BytesMixed2 result = calloc<Struct16BytesMixed2>().ref;
+  final resultPointer = calloc<Struct16BytesMixed2>();
+  final result = resultPointer.ref;
 
   result.a0 = returnStruct16BytesMixed2_a0;
   result.a1 = returnStruct16BytesMixed2_a1;
   result.a2 = returnStruct16BytesMixed2_a2;
   result.a3 = returnStruct16BytesMixed2_a3;
 
-  returnStruct16BytesMixed2Result = result;
+  returnStruct16BytesMixed2ResultPointer = resultPointer;
 
   return result;
 }
@@ -6357,13 +6362,13 @@
 }
 
 void returnStruct16BytesMixed2AfterCallback() {
-  calloc.free(returnStruct16BytesMixed2Result.addressOf);
+  calloc.free(returnStruct16BytesMixed2ResultPointer);
 
   final result = returnStruct16BytesMixed2CalculateResult();
 
   print("after callback result = $result");
 
-  calloc.free(returnStruct16BytesMixed2Result.addressOf);
+  calloc.free(returnStruct16BytesMixed2ResultPointer);
 }
 
 typedef ReturnStruct17BytesIntType = Struct17BytesInt Function(
@@ -6375,16 +6380,17 @@
 int returnStruct17BytesInt_a2 = 0;
 
 // Result variable also global, so we can delete it after the callback.
-Struct17BytesInt returnStruct17BytesIntResult = Struct17BytesInt();
+Pointer<Struct17BytesInt> returnStruct17BytesIntResultPointer = nullptr;
 
 Struct17BytesInt returnStruct17BytesIntCalculateResult() {
-  Struct17BytesInt result = calloc<Struct17BytesInt>().ref;
+  final resultPointer = calloc<Struct17BytesInt>();
+  final result = resultPointer.ref;
 
   result.a0 = returnStruct17BytesInt_a0;
   result.a1 = returnStruct17BytesInt_a1;
   result.a2 = returnStruct17BytesInt_a2;
 
-  returnStruct17BytesIntResult = result;
+  returnStruct17BytesIntResultPointer = resultPointer;
 
   return result;
 }
@@ -6419,13 +6425,13 @@
 }
 
 void returnStruct17BytesIntAfterCallback() {
-  calloc.free(returnStruct17BytesIntResult.addressOf);
+  calloc.free(returnStruct17BytesIntResultPointer);
 
   final result = returnStruct17BytesIntCalculateResult();
 
   print("after callback result = $result");
 
-  calloc.free(returnStruct17BytesIntResult.addressOf);
+  calloc.free(returnStruct17BytesIntResultPointer);
 }
 
 typedef ReturnStruct19BytesHomogeneousUint8Type
@@ -6472,13 +6478,13 @@
 int returnStruct19BytesHomogeneousUint8_a18 = 0;
 
 // Result variable also global, so we can delete it after the callback.
-Struct19BytesHomogeneousUint8 returnStruct19BytesHomogeneousUint8Result =
-    Struct19BytesHomogeneousUint8();
+Pointer<Struct19BytesHomogeneousUint8>
+    returnStruct19BytesHomogeneousUint8ResultPointer = nullptr;
 
 Struct19BytesHomogeneousUint8
     returnStruct19BytesHomogeneousUint8CalculateResult() {
-  Struct19BytesHomogeneousUint8 result =
-      calloc<Struct19BytesHomogeneousUint8>().ref;
+  final resultPointer = calloc<Struct19BytesHomogeneousUint8>();
+  final result = resultPointer.ref;
 
   result.a0 = returnStruct19BytesHomogeneousUint8_a0;
   result.a1 = returnStruct19BytesHomogeneousUint8_a1;
@@ -6500,7 +6506,7 @@
   result.a17 = returnStruct19BytesHomogeneousUint8_a17;
   result.a18 = returnStruct19BytesHomogeneousUint8_a18;
 
-  returnStruct19BytesHomogeneousUint8Result = result;
+  returnStruct19BytesHomogeneousUint8ResultPointer = resultPointer;
 
   return result;
 }
@@ -6571,13 +6577,13 @@
 }
 
 void returnStruct19BytesHomogeneousUint8AfterCallback() {
-  calloc.free(returnStruct19BytesHomogeneousUint8Result.addressOf);
+  calloc.free(returnStruct19BytesHomogeneousUint8ResultPointer);
 
   final result = returnStruct19BytesHomogeneousUint8CalculateResult();
 
   print("after callback result = $result");
 
-  calloc.free(returnStruct19BytesHomogeneousUint8Result.addressOf);
+  calloc.free(returnStruct19BytesHomogeneousUint8ResultPointer);
 }
 
 typedef ReturnStruct20BytesHomogeneousInt32Type = Struct20BytesHomogeneousInt32
@@ -6591,13 +6597,13 @@
 int returnStruct20BytesHomogeneousInt32_a4 = 0;
 
 // Result variable also global, so we can delete it after the callback.
-Struct20BytesHomogeneousInt32 returnStruct20BytesHomogeneousInt32Result =
-    Struct20BytesHomogeneousInt32();
+Pointer<Struct20BytesHomogeneousInt32>
+    returnStruct20BytesHomogeneousInt32ResultPointer = nullptr;
 
 Struct20BytesHomogeneousInt32
     returnStruct20BytesHomogeneousInt32CalculateResult() {
-  Struct20BytesHomogeneousInt32 result =
-      calloc<Struct20BytesHomogeneousInt32>().ref;
+  final resultPointer = calloc<Struct20BytesHomogeneousInt32>();
+  final result = resultPointer.ref;
 
   result.a0 = returnStruct20BytesHomogeneousInt32_a0;
   result.a1 = returnStruct20BytesHomogeneousInt32_a1;
@@ -6605,7 +6611,7 @@
   result.a3 = returnStruct20BytesHomogeneousInt32_a3;
   result.a4 = returnStruct20BytesHomogeneousInt32_a4;
 
-  returnStruct20BytesHomogeneousInt32Result = result;
+  returnStruct20BytesHomogeneousInt32ResultPointer = resultPointer;
 
   return result;
 }
@@ -6642,13 +6648,13 @@
 }
 
 void returnStruct20BytesHomogeneousInt32AfterCallback() {
-  calloc.free(returnStruct20BytesHomogeneousInt32Result.addressOf);
+  calloc.free(returnStruct20BytesHomogeneousInt32ResultPointer);
 
   final result = returnStruct20BytesHomogeneousInt32CalculateResult();
 
   print("after callback result = $result");
 
-  calloc.free(returnStruct20BytesHomogeneousInt32Result.addressOf);
+  calloc.free(returnStruct20BytesHomogeneousInt32ResultPointer);
 }
 
 typedef ReturnStruct20BytesHomogeneousFloatType = Struct20BytesHomogeneousFloat
@@ -6662,13 +6668,13 @@
 double returnStruct20BytesHomogeneousFloat_a4 = 0.0;
 
 // Result variable also global, so we can delete it after the callback.
-Struct20BytesHomogeneousFloat returnStruct20BytesHomogeneousFloatResult =
-    Struct20BytesHomogeneousFloat();
+Pointer<Struct20BytesHomogeneousFloat>
+    returnStruct20BytesHomogeneousFloatResultPointer = nullptr;
 
 Struct20BytesHomogeneousFloat
     returnStruct20BytesHomogeneousFloatCalculateResult() {
-  Struct20BytesHomogeneousFloat result =
-      calloc<Struct20BytesHomogeneousFloat>().ref;
+  final resultPointer = calloc<Struct20BytesHomogeneousFloat>();
+  final result = resultPointer.ref;
 
   result.a0 = returnStruct20BytesHomogeneousFloat_a0;
   result.a1 = returnStruct20BytesHomogeneousFloat_a1;
@@ -6676,7 +6682,7 @@
   result.a3 = returnStruct20BytesHomogeneousFloat_a3;
   result.a4 = returnStruct20BytesHomogeneousFloat_a4;
 
-  returnStruct20BytesHomogeneousFloatResult = result;
+  returnStruct20BytesHomogeneousFloatResultPointer = resultPointer;
 
   return result;
 }
@@ -6713,13 +6719,13 @@
 }
 
 void returnStruct20BytesHomogeneousFloatAfterCallback() {
-  calloc.free(returnStruct20BytesHomogeneousFloatResult.addressOf);
+  calloc.free(returnStruct20BytesHomogeneousFloatResultPointer);
 
   final result = returnStruct20BytesHomogeneousFloatCalculateResult();
 
   print("after callback result = $result");
 
-  calloc.free(returnStruct20BytesHomogeneousFloatResult.addressOf);
+  calloc.free(returnStruct20BytesHomogeneousFloatResultPointer);
 }
 
 typedef ReturnStruct32BytesHomogeneousDoubleType
@@ -6732,20 +6738,20 @@
 double returnStruct32BytesHomogeneousDouble_a3 = 0.0;
 
 // Result variable also global, so we can delete it after the callback.
-Struct32BytesHomogeneousDouble returnStruct32BytesHomogeneousDoubleResult =
-    Struct32BytesHomogeneousDouble();
+Pointer<Struct32BytesHomogeneousDouble>
+    returnStruct32BytesHomogeneousDoubleResultPointer = nullptr;
 
 Struct32BytesHomogeneousDouble
     returnStruct32BytesHomogeneousDoubleCalculateResult() {
-  Struct32BytesHomogeneousDouble result =
-      calloc<Struct32BytesHomogeneousDouble>().ref;
+  final resultPointer = calloc<Struct32BytesHomogeneousDouble>();
+  final result = resultPointer.ref;
 
   result.a0 = returnStruct32BytesHomogeneousDouble_a0;
   result.a1 = returnStruct32BytesHomogeneousDouble_a1;
   result.a2 = returnStruct32BytesHomogeneousDouble_a2;
   result.a3 = returnStruct32BytesHomogeneousDouble_a3;
 
-  returnStruct32BytesHomogeneousDoubleResult = result;
+  returnStruct32BytesHomogeneousDoubleResultPointer = resultPointer;
 
   return result;
 }
@@ -6781,13 +6787,13 @@
 }
 
 void returnStruct32BytesHomogeneousDoubleAfterCallback() {
-  calloc.free(returnStruct32BytesHomogeneousDoubleResult.addressOf);
+  calloc.free(returnStruct32BytesHomogeneousDoubleResultPointer);
 
   final result = returnStruct32BytesHomogeneousDoubleCalculateResult();
 
   print("after callback result = $result");
 
-  calloc.free(returnStruct32BytesHomogeneousDoubleResult.addressOf);
+  calloc.free(returnStruct32BytesHomogeneousDoubleResultPointer);
 }
 
 typedef ReturnStruct40BytesHomogeneousDoubleType
@@ -6802,13 +6808,13 @@
 double returnStruct40BytesHomogeneousDouble_a4 = 0.0;
 
 // Result variable also global, so we can delete it after the callback.
-Struct40BytesHomogeneousDouble returnStruct40BytesHomogeneousDoubleResult =
-    Struct40BytesHomogeneousDouble();
+Pointer<Struct40BytesHomogeneousDouble>
+    returnStruct40BytesHomogeneousDoubleResultPointer = nullptr;
 
 Struct40BytesHomogeneousDouble
     returnStruct40BytesHomogeneousDoubleCalculateResult() {
-  Struct40BytesHomogeneousDouble result =
-      calloc<Struct40BytesHomogeneousDouble>().ref;
+  final resultPointer = calloc<Struct40BytesHomogeneousDouble>();
+  final result = resultPointer.ref;
 
   result.a0 = returnStruct40BytesHomogeneousDouble_a0;
   result.a1 = returnStruct40BytesHomogeneousDouble_a1;
@@ -6816,7 +6822,7 @@
   result.a3 = returnStruct40BytesHomogeneousDouble_a3;
   result.a4 = returnStruct40BytesHomogeneousDouble_a4;
 
-  returnStruct40BytesHomogeneousDoubleResult = result;
+  returnStruct40BytesHomogeneousDoubleResultPointer = resultPointer;
 
   return result;
 }
@@ -6854,13 +6860,13 @@
 }
 
 void returnStruct40BytesHomogeneousDoubleAfterCallback() {
-  calloc.free(returnStruct40BytesHomogeneousDoubleResult.addressOf);
+  calloc.free(returnStruct40BytesHomogeneousDoubleResultPointer);
 
   final result = returnStruct40BytesHomogeneousDoubleCalculateResult();
 
   print("after callback result = $result");
 
-  calloc.free(returnStruct40BytesHomogeneousDoubleResult.addressOf);
+  calloc.free(returnStruct40BytesHomogeneousDoubleResultPointer);
 }
 
 typedef ReturnStruct1024BytesHomogeneousUint64Type
@@ -7125,13 +7131,13 @@
 int returnStruct1024BytesHomogeneousUint64_a127 = 0;
 
 // Result variable also global, so we can delete it after the callback.
-Struct1024BytesHomogeneousUint64 returnStruct1024BytesHomogeneousUint64Result =
-    Struct1024BytesHomogeneousUint64();
+Pointer<Struct1024BytesHomogeneousUint64>
+    returnStruct1024BytesHomogeneousUint64ResultPointer = nullptr;
 
 Struct1024BytesHomogeneousUint64
     returnStruct1024BytesHomogeneousUint64CalculateResult() {
-  Struct1024BytesHomogeneousUint64 result =
-      calloc<Struct1024BytesHomogeneousUint64>().ref;
+  final resultPointer = calloc<Struct1024BytesHomogeneousUint64>();
+  final result = resultPointer.ref;
 
   result.a0 = returnStruct1024BytesHomogeneousUint64_a0;
   result.a1 = returnStruct1024BytesHomogeneousUint64_a1;
@@ -7262,7 +7268,7 @@
   result.a126 = returnStruct1024BytesHomogeneousUint64_a126;
   result.a127 = returnStruct1024BytesHomogeneousUint64_a127;
 
-  returnStruct1024BytesHomogeneousUint64Result = result;
+  returnStruct1024BytesHomogeneousUint64ResultPointer = resultPointer;
 
   return result;
 }
@@ -7550,13 +7556,13 @@
 }
 
 void returnStruct1024BytesHomogeneousUint64AfterCallback() {
-  calloc.free(returnStruct1024BytesHomogeneousUint64Result.addressOf);
+  calloc.free(returnStruct1024BytesHomogeneousUint64ResultPointer);
 
   final result = returnStruct1024BytesHomogeneousUint64CalculateResult();
 
   print("after callback result = $result");
 
-  calloc.free(returnStruct1024BytesHomogeneousUint64Result.addressOf);
+  calloc.free(returnStruct1024BytesHomogeneousUint64ResultPointer);
 }
 
 typedef ReturnStructArgumentStruct1ByteIntType = Struct1ByteInt Function(
@@ -7892,16 +7898,17 @@
 int returnStructAlignmentInt16_a2 = 0;
 
 // Result variable also global, so we can delete it after the callback.
-StructAlignmentInt16 returnStructAlignmentInt16Result = StructAlignmentInt16();
+Pointer<StructAlignmentInt16> returnStructAlignmentInt16ResultPointer = nullptr;
 
 StructAlignmentInt16 returnStructAlignmentInt16CalculateResult() {
-  StructAlignmentInt16 result = calloc<StructAlignmentInt16>().ref;
+  final resultPointer = calloc<StructAlignmentInt16>();
+  final result = resultPointer.ref;
 
   result.a0 = returnStructAlignmentInt16_a0;
   result.a1 = returnStructAlignmentInt16_a1;
   result.a2 = returnStructAlignmentInt16_a2;
 
-  returnStructAlignmentInt16Result = result;
+  returnStructAlignmentInt16ResultPointer = resultPointer;
 
   return result;
 }
@@ -7934,13 +7941,13 @@
 }
 
 void returnStructAlignmentInt16AfterCallback() {
-  calloc.free(returnStructAlignmentInt16Result.addressOf);
+  calloc.free(returnStructAlignmentInt16ResultPointer);
 
   final result = returnStructAlignmentInt16CalculateResult();
 
   print("after callback result = $result");
 
-  calloc.free(returnStructAlignmentInt16Result.addressOf);
+  calloc.free(returnStructAlignmentInt16ResultPointer);
 }
 
 typedef ReturnStructAlignmentInt32Type = StructAlignmentInt32 Function(
@@ -7952,16 +7959,17 @@
 int returnStructAlignmentInt32_a2 = 0;
 
 // Result variable also global, so we can delete it after the callback.
-StructAlignmentInt32 returnStructAlignmentInt32Result = StructAlignmentInt32();
+Pointer<StructAlignmentInt32> returnStructAlignmentInt32ResultPointer = nullptr;
 
 StructAlignmentInt32 returnStructAlignmentInt32CalculateResult() {
-  StructAlignmentInt32 result = calloc<StructAlignmentInt32>().ref;
+  final resultPointer = calloc<StructAlignmentInt32>();
+  final result = resultPointer.ref;
 
   result.a0 = returnStructAlignmentInt32_a0;
   result.a1 = returnStructAlignmentInt32_a1;
   result.a2 = returnStructAlignmentInt32_a2;
 
-  returnStructAlignmentInt32Result = result;
+  returnStructAlignmentInt32ResultPointer = resultPointer;
 
   return result;
 }
@@ -7994,13 +8002,13 @@
 }
 
 void returnStructAlignmentInt32AfterCallback() {
-  calloc.free(returnStructAlignmentInt32Result.addressOf);
+  calloc.free(returnStructAlignmentInt32ResultPointer);
 
   final result = returnStructAlignmentInt32CalculateResult();
 
   print("after callback result = $result");
 
-  calloc.free(returnStructAlignmentInt32Result.addressOf);
+  calloc.free(returnStructAlignmentInt32ResultPointer);
 }
 
 typedef ReturnStructAlignmentInt64Type = StructAlignmentInt64 Function(
@@ -8012,16 +8020,17 @@
 int returnStructAlignmentInt64_a2 = 0;
 
 // Result variable also global, so we can delete it after the callback.
-StructAlignmentInt64 returnStructAlignmentInt64Result = StructAlignmentInt64();
+Pointer<StructAlignmentInt64> returnStructAlignmentInt64ResultPointer = nullptr;
 
 StructAlignmentInt64 returnStructAlignmentInt64CalculateResult() {
-  StructAlignmentInt64 result = calloc<StructAlignmentInt64>().ref;
+  final resultPointer = calloc<StructAlignmentInt64>();
+  final result = resultPointer.ref;
 
   result.a0 = returnStructAlignmentInt64_a0;
   result.a1 = returnStructAlignmentInt64_a1;
   result.a2 = returnStructAlignmentInt64_a2;
 
-  returnStructAlignmentInt64Result = result;
+  returnStructAlignmentInt64ResultPointer = resultPointer;
 
   return result;
 }
@@ -8054,13 +8063,13 @@
 }
 
 void returnStructAlignmentInt64AfterCallback() {
-  calloc.free(returnStructAlignmentInt64Result.addressOf);
+  calloc.free(returnStructAlignmentInt64ResultPointer);
 
   final result = returnStructAlignmentInt64CalculateResult();
 
   print("after callback result = $result");
 
-  calloc.free(returnStructAlignmentInt64Result.addressOf);
+  calloc.free(returnStructAlignmentInt64ResultPointer);
 }
 
 typedef ReturnStruct8BytesNestedIntType = Struct8BytesNestedInt Function(
@@ -8073,18 +8082,19 @@
     Struct4BytesHomogeneousInt16();
 
 // Result variable also global, so we can delete it after the callback.
-Struct8BytesNestedInt returnStruct8BytesNestedIntResult =
-    Struct8BytesNestedInt();
+Pointer<Struct8BytesNestedInt> returnStruct8BytesNestedIntResultPointer =
+    nullptr;
 
 Struct8BytesNestedInt returnStruct8BytesNestedIntCalculateResult() {
-  Struct8BytesNestedInt result = calloc<Struct8BytesNestedInt>().ref;
+  final resultPointer = calloc<Struct8BytesNestedInt>();
+  final result = resultPointer.ref;
 
   result.a0.a0 = returnStruct8BytesNestedInt_a0.a0;
   result.a0.a1 = returnStruct8BytesNestedInt_a0.a1;
   result.a1.a0 = returnStruct8BytesNestedInt_a1.a0;
   result.a1.a1 = returnStruct8BytesNestedInt_a1.a1;
 
-  returnStruct8BytesNestedIntResult = result;
+  returnStruct8BytesNestedIntResultPointer = resultPointer;
 
   return result;
 }
@@ -8117,13 +8127,13 @@
 }
 
 void returnStruct8BytesNestedIntAfterCallback() {
-  calloc.free(returnStruct8BytesNestedIntResult.addressOf);
+  calloc.free(returnStruct8BytesNestedIntResultPointer);
 
   final result = returnStruct8BytesNestedIntCalculateResult();
 
   print("after callback result = $result");
 
-  calloc.free(returnStruct8BytesNestedIntResult.addressOf);
+  calloc.free(returnStruct8BytesNestedIntResultPointer);
 }
 
 typedef ReturnStruct8BytesNestedFloatType = Struct8BytesNestedFloat Function(
@@ -8134,16 +8144,17 @@
 Struct4BytesFloat returnStruct8BytesNestedFloat_a1 = Struct4BytesFloat();
 
 // Result variable also global, so we can delete it after the callback.
-Struct8BytesNestedFloat returnStruct8BytesNestedFloatResult =
-    Struct8BytesNestedFloat();
+Pointer<Struct8BytesNestedFloat> returnStruct8BytesNestedFloatResultPointer =
+    nullptr;
 
 Struct8BytesNestedFloat returnStruct8BytesNestedFloatCalculateResult() {
-  Struct8BytesNestedFloat result = calloc<Struct8BytesNestedFloat>().ref;
+  final resultPointer = calloc<Struct8BytesNestedFloat>();
+  final result = resultPointer.ref;
 
   result.a0.a0 = returnStruct8BytesNestedFloat_a0.a0;
   result.a1.a0 = returnStruct8BytesNestedFloat_a1.a0;
 
-  returnStruct8BytesNestedFloatResult = result;
+  returnStruct8BytesNestedFloatResultPointer = resultPointer;
 
   return result;
 }
@@ -8176,13 +8187,13 @@
 }
 
 void returnStruct8BytesNestedFloatAfterCallback() {
-  calloc.free(returnStruct8BytesNestedFloatResult.addressOf);
+  calloc.free(returnStruct8BytesNestedFloatResultPointer);
 
   final result = returnStruct8BytesNestedFloatCalculateResult();
 
   print("after callback result = $result");
 
-  calloc.free(returnStruct8BytesNestedFloatResult.addressOf);
+  calloc.free(returnStruct8BytesNestedFloatResultPointer);
 }
 
 typedef ReturnStruct8BytesNestedFloat2Type = Struct8BytesNestedFloat2 Function(
@@ -8193,16 +8204,17 @@
 double returnStruct8BytesNestedFloat2_a1 = 0.0;
 
 // Result variable also global, so we can delete it after the callback.
-Struct8BytesNestedFloat2 returnStruct8BytesNestedFloat2Result =
-    Struct8BytesNestedFloat2();
+Pointer<Struct8BytesNestedFloat2> returnStruct8BytesNestedFloat2ResultPointer =
+    nullptr;
 
 Struct8BytesNestedFloat2 returnStruct8BytesNestedFloat2CalculateResult() {
-  Struct8BytesNestedFloat2 result = calloc<Struct8BytesNestedFloat2>().ref;
+  final resultPointer = calloc<Struct8BytesNestedFloat2>();
+  final result = resultPointer.ref;
 
   result.a0.a0 = returnStruct8BytesNestedFloat2_a0.a0;
   result.a1 = returnStruct8BytesNestedFloat2_a1;
 
-  returnStruct8BytesNestedFloat2Result = result;
+  returnStruct8BytesNestedFloat2ResultPointer = resultPointer;
 
   return result;
 }
@@ -8236,13 +8248,13 @@
 }
 
 void returnStruct8BytesNestedFloat2AfterCallback() {
-  calloc.free(returnStruct8BytesNestedFloat2Result.addressOf);
+  calloc.free(returnStruct8BytesNestedFloat2ResultPointer);
 
   final result = returnStruct8BytesNestedFloat2CalculateResult();
 
   print("after callback result = $result");
 
-  calloc.free(returnStruct8BytesNestedFloat2Result.addressOf);
+  calloc.free(returnStruct8BytesNestedFloat2ResultPointer);
 }
 
 typedef ReturnStruct8BytesNestedMixedType = Struct8BytesNestedMixed Function(
@@ -8254,17 +8266,18 @@
 Struct4BytesFloat returnStruct8BytesNestedMixed_a1 = Struct4BytesFloat();
 
 // Result variable also global, so we can delete it after the callback.
-Struct8BytesNestedMixed returnStruct8BytesNestedMixedResult =
-    Struct8BytesNestedMixed();
+Pointer<Struct8BytesNestedMixed> returnStruct8BytesNestedMixedResultPointer =
+    nullptr;
 
 Struct8BytesNestedMixed returnStruct8BytesNestedMixedCalculateResult() {
-  Struct8BytesNestedMixed result = calloc<Struct8BytesNestedMixed>().ref;
+  final resultPointer = calloc<Struct8BytesNestedMixed>();
+  final result = resultPointer.ref;
 
   result.a0.a0 = returnStruct8BytesNestedMixed_a0.a0;
   result.a0.a1 = returnStruct8BytesNestedMixed_a0.a1;
   result.a1.a0 = returnStruct8BytesNestedMixed_a1.a0;
 
-  returnStruct8BytesNestedMixedResult = result;
+  returnStruct8BytesNestedMixedResultPointer = resultPointer;
 
   return result;
 }
@@ -8297,13 +8310,13 @@
 }
 
 void returnStruct8BytesNestedMixedAfterCallback() {
-  calloc.free(returnStruct8BytesNestedMixedResult.addressOf);
+  calloc.free(returnStruct8BytesNestedMixedResultPointer);
 
   final result = returnStruct8BytesNestedMixedCalculateResult();
 
   print("after callback result = $result");
 
-  calloc.free(returnStruct8BytesNestedMixedResult.addressOf);
+  calloc.free(returnStruct8BytesNestedMixedResultPointer);
 }
 
 typedef ReturnStruct16BytesNestedIntType = Struct16BytesNestedInt Function(
@@ -8314,11 +8327,12 @@
 Struct8BytesNestedInt returnStruct16BytesNestedInt_a1 = Struct8BytesNestedInt();
 
 // Result variable also global, so we can delete it after the callback.
-Struct16BytesNestedInt returnStruct16BytesNestedIntResult =
-    Struct16BytesNestedInt();
+Pointer<Struct16BytesNestedInt> returnStruct16BytesNestedIntResultPointer =
+    nullptr;
 
 Struct16BytesNestedInt returnStruct16BytesNestedIntCalculateResult() {
-  Struct16BytesNestedInt result = calloc<Struct16BytesNestedInt>().ref;
+  final resultPointer = calloc<Struct16BytesNestedInt>();
+  final result = resultPointer.ref;
 
   result.a0.a0.a0 = returnStruct16BytesNestedInt_a0.a0.a0;
   result.a0.a0.a1 = returnStruct16BytesNestedInt_a0.a0.a1;
@@ -8329,7 +8343,7 @@
   result.a1.a1.a0 = returnStruct16BytesNestedInt_a1.a1.a0;
   result.a1.a1.a1 = returnStruct16BytesNestedInt_a1.a1.a1;
 
-  returnStruct16BytesNestedIntResult = result;
+  returnStruct16BytesNestedIntResultPointer = resultPointer;
 
   return result;
 }
@@ -8362,13 +8376,13 @@
 }
 
 void returnStruct16BytesNestedIntAfterCallback() {
-  calloc.free(returnStruct16BytesNestedIntResult.addressOf);
+  calloc.free(returnStruct16BytesNestedIntResultPointer);
 
   final result = returnStruct16BytesNestedIntCalculateResult();
 
   print("after callback result = $result");
 
-  calloc.free(returnStruct16BytesNestedIntResult.addressOf);
+  calloc.free(returnStruct16BytesNestedIntResultPointer);
 }
 
 typedef ReturnStruct32BytesNestedIntType = Struct32BytesNestedInt Function(
@@ -8381,11 +8395,12 @@
     Struct16BytesNestedInt();
 
 // Result variable also global, so we can delete it after the callback.
-Struct32BytesNestedInt returnStruct32BytesNestedIntResult =
-    Struct32BytesNestedInt();
+Pointer<Struct32BytesNestedInt> returnStruct32BytesNestedIntResultPointer =
+    nullptr;
 
 Struct32BytesNestedInt returnStruct32BytesNestedIntCalculateResult() {
-  Struct32BytesNestedInt result = calloc<Struct32BytesNestedInt>().ref;
+  final resultPointer = calloc<Struct32BytesNestedInt>();
+  final result = resultPointer.ref;
 
   result.a0.a0.a0.a0 = returnStruct32BytesNestedInt_a0.a0.a0.a0;
   result.a0.a0.a0.a1 = returnStruct32BytesNestedInt_a0.a0.a0.a1;
@@ -8404,7 +8419,7 @@
   result.a1.a1.a1.a0 = returnStruct32BytesNestedInt_a1.a1.a1.a0;
   result.a1.a1.a1.a1 = returnStruct32BytesNestedInt_a1.a1.a1.a1;
 
-  returnStruct32BytesNestedIntResult = result;
+  returnStruct32BytesNestedIntResultPointer = resultPointer;
 
   return result;
 }
@@ -8437,13 +8452,13 @@
 }
 
 void returnStruct32BytesNestedIntAfterCallback() {
-  calloc.free(returnStruct32BytesNestedIntResult.addressOf);
+  calloc.free(returnStruct32BytesNestedIntResultPointer);
 
   final result = returnStruct32BytesNestedIntCalculateResult();
 
   print("after callback result = $result");
 
-  calloc.free(returnStruct32BytesNestedIntResult.addressOf);
+  calloc.free(returnStruct32BytesNestedIntResultPointer);
 }
 
 typedef ReturnStructNestedIntStructAlignmentInt16Type
@@ -8457,14 +8472,13 @@
     StructAlignmentInt16();
 
 // Result variable also global, so we can delete it after the callback.
-StructNestedIntStructAlignmentInt16
-    returnStructNestedIntStructAlignmentInt16Result =
-    StructNestedIntStructAlignmentInt16();
+Pointer<StructNestedIntStructAlignmentInt16>
+    returnStructNestedIntStructAlignmentInt16ResultPointer = nullptr;
 
 StructNestedIntStructAlignmentInt16
     returnStructNestedIntStructAlignmentInt16CalculateResult() {
-  StructNestedIntStructAlignmentInt16 result =
-      calloc<StructNestedIntStructAlignmentInt16>().ref;
+  final resultPointer = calloc<StructNestedIntStructAlignmentInt16>();
+  final result = resultPointer.ref;
 
   result.a0.a0 = returnStructNestedIntStructAlignmentInt16_a0.a0;
   result.a0.a1 = returnStructNestedIntStructAlignmentInt16_a0.a1;
@@ -8473,7 +8487,7 @@
   result.a1.a1 = returnStructNestedIntStructAlignmentInt16_a1.a1;
   result.a1.a2 = returnStructNestedIntStructAlignmentInt16_a1.a2;
 
-  returnStructNestedIntStructAlignmentInt16Result = result;
+  returnStructNestedIntStructAlignmentInt16ResultPointer = resultPointer;
 
   return result;
 }
@@ -8507,13 +8521,13 @@
 }
 
 void returnStructNestedIntStructAlignmentInt16AfterCallback() {
-  calloc.free(returnStructNestedIntStructAlignmentInt16Result.addressOf);
+  calloc.free(returnStructNestedIntStructAlignmentInt16ResultPointer);
 
   final result = returnStructNestedIntStructAlignmentInt16CalculateResult();
 
   print("after callback result = $result");
 
-  calloc.free(returnStructNestedIntStructAlignmentInt16Result.addressOf);
+  calloc.free(returnStructNestedIntStructAlignmentInt16ResultPointer);
 }
 
 typedef ReturnStructNestedIntStructAlignmentInt32Type
@@ -8527,14 +8541,13 @@
     StructAlignmentInt32();
 
 // Result variable also global, so we can delete it after the callback.
-StructNestedIntStructAlignmentInt32
-    returnStructNestedIntStructAlignmentInt32Result =
-    StructNestedIntStructAlignmentInt32();
+Pointer<StructNestedIntStructAlignmentInt32>
+    returnStructNestedIntStructAlignmentInt32ResultPointer = nullptr;
 
 StructNestedIntStructAlignmentInt32
     returnStructNestedIntStructAlignmentInt32CalculateResult() {
-  StructNestedIntStructAlignmentInt32 result =
-      calloc<StructNestedIntStructAlignmentInt32>().ref;
+  final resultPointer = calloc<StructNestedIntStructAlignmentInt32>();
+  final result = resultPointer.ref;
 
   result.a0.a0 = returnStructNestedIntStructAlignmentInt32_a0.a0;
   result.a0.a1 = returnStructNestedIntStructAlignmentInt32_a0.a1;
@@ -8543,7 +8556,7 @@
   result.a1.a1 = returnStructNestedIntStructAlignmentInt32_a1.a1;
   result.a1.a2 = returnStructNestedIntStructAlignmentInt32_a1.a2;
 
-  returnStructNestedIntStructAlignmentInt32Result = result;
+  returnStructNestedIntStructAlignmentInt32ResultPointer = resultPointer;
 
   return result;
 }
@@ -8577,13 +8590,13 @@
 }
 
 void returnStructNestedIntStructAlignmentInt32AfterCallback() {
-  calloc.free(returnStructNestedIntStructAlignmentInt32Result.addressOf);
+  calloc.free(returnStructNestedIntStructAlignmentInt32ResultPointer);
 
   final result = returnStructNestedIntStructAlignmentInt32CalculateResult();
 
   print("after callback result = $result");
 
-  calloc.free(returnStructNestedIntStructAlignmentInt32Result.addressOf);
+  calloc.free(returnStructNestedIntStructAlignmentInt32ResultPointer);
 }
 
 typedef ReturnStructNestedIntStructAlignmentInt64Type
@@ -8597,14 +8610,13 @@
     StructAlignmentInt64();
 
 // Result variable also global, so we can delete it after the callback.
-StructNestedIntStructAlignmentInt64
-    returnStructNestedIntStructAlignmentInt64Result =
-    StructNestedIntStructAlignmentInt64();
+Pointer<StructNestedIntStructAlignmentInt64>
+    returnStructNestedIntStructAlignmentInt64ResultPointer = nullptr;
 
 StructNestedIntStructAlignmentInt64
     returnStructNestedIntStructAlignmentInt64CalculateResult() {
-  StructNestedIntStructAlignmentInt64 result =
-      calloc<StructNestedIntStructAlignmentInt64>().ref;
+  final resultPointer = calloc<StructNestedIntStructAlignmentInt64>();
+  final result = resultPointer.ref;
 
   result.a0.a0 = returnStructNestedIntStructAlignmentInt64_a0.a0;
   result.a0.a1 = returnStructNestedIntStructAlignmentInt64_a0.a1;
@@ -8613,7 +8625,7 @@
   result.a1.a1 = returnStructNestedIntStructAlignmentInt64_a1.a1;
   result.a1.a2 = returnStructNestedIntStructAlignmentInt64_a1.a2;
 
-  returnStructNestedIntStructAlignmentInt64Result = result;
+  returnStructNestedIntStructAlignmentInt64ResultPointer = resultPointer;
 
   return result;
 }
@@ -8647,13 +8659,13 @@
 }
 
 void returnStructNestedIntStructAlignmentInt64AfterCallback() {
-  calloc.free(returnStructNestedIntStructAlignmentInt64Result.addressOf);
+  calloc.free(returnStructNestedIntStructAlignmentInt64ResultPointer);
 
   final result = returnStructNestedIntStructAlignmentInt64CalculateResult();
 
   print("after callback result = $result");
 
-  calloc.free(returnStructNestedIntStructAlignmentInt64Result.addressOf);
+  calloc.free(returnStructNestedIntStructAlignmentInt64ResultPointer);
 }
 
 typedef ReturnStructNestedIrregularEvenBiggerType
@@ -8669,13 +8681,13 @@
 double returnStructNestedIrregularEvenBigger_a3 = 0.0;
 
 // Result variable also global, so we can delete it after the callback.
-StructNestedIrregularEvenBigger returnStructNestedIrregularEvenBiggerResult =
-    StructNestedIrregularEvenBigger();
+Pointer<StructNestedIrregularEvenBigger>
+    returnStructNestedIrregularEvenBiggerResultPointer = nullptr;
 
 StructNestedIrregularEvenBigger
     returnStructNestedIrregularEvenBiggerCalculateResult() {
-  StructNestedIrregularEvenBigger result =
-      calloc<StructNestedIrregularEvenBigger>().ref;
+  final resultPointer = calloc<StructNestedIrregularEvenBigger>();
+  final result = resultPointer.ref;
 
   result.a0 = returnStructNestedIrregularEvenBigger_a0;
   result.a1.a0.a0 = returnStructNestedIrregularEvenBigger_a1.a0.a0;
@@ -8712,7 +8724,7 @@
   result.a2.a3 = returnStructNestedIrregularEvenBigger_a2.a3;
   result.a3 = returnStructNestedIrregularEvenBigger_a3;
 
-  returnStructNestedIrregularEvenBiggerResult = result;
+  returnStructNestedIrregularEvenBiggerResultPointer = resultPointer;
 
   return result;
 }
@@ -8748,11 +8760,11 @@
 }
 
 void returnStructNestedIrregularEvenBiggerAfterCallback() {
-  calloc.free(returnStructNestedIrregularEvenBiggerResult.addressOf);
+  calloc.free(returnStructNestedIrregularEvenBiggerResultPointer);
 
   final result = returnStructNestedIrregularEvenBiggerCalculateResult();
 
   print("after callback result = $result");
 
-  calloc.free(returnStructNestedIrregularEvenBiggerResult.addressOf);
+  calloc.free(returnStructNestedIrregularEvenBiggerResultPointer);
 }
diff --git a/tests/ffi_2/function_structs_by_value_generated_test.dart b/tests/ffi_2/function_structs_by_value_generated_test.dart
index 6867406..b44f8e1 100644
--- a/tests/ffi_2/function_structs_by_value_generated_test.dart
+++ b/tests/ffi_2/function_structs_by_value_generated_test.dart
@@ -1050,16 +1050,26 @@
 /// Smallest struct with data.
 /// 10 struct arguments will exhaust available registers.
 void testPassStruct1ByteIntx10() {
-  Struct1ByteInt a0 = calloc<Struct1ByteInt>().ref;
-  Struct1ByteInt a1 = calloc<Struct1ByteInt>().ref;
-  Struct1ByteInt a2 = calloc<Struct1ByteInt>().ref;
-  Struct1ByteInt a3 = calloc<Struct1ByteInt>().ref;
-  Struct1ByteInt a4 = calloc<Struct1ByteInt>().ref;
-  Struct1ByteInt a5 = calloc<Struct1ByteInt>().ref;
-  Struct1ByteInt a6 = calloc<Struct1ByteInt>().ref;
-  Struct1ByteInt a7 = calloc<Struct1ByteInt>().ref;
-  Struct1ByteInt a8 = calloc<Struct1ByteInt>().ref;
-  Struct1ByteInt a9 = calloc<Struct1ByteInt>().ref;
+  final a0Pointer = calloc<Struct1ByteInt>();
+  final Struct1ByteInt a0 = a0Pointer.ref;
+  final a1Pointer = calloc<Struct1ByteInt>();
+  final Struct1ByteInt a1 = a1Pointer.ref;
+  final a2Pointer = calloc<Struct1ByteInt>();
+  final Struct1ByteInt a2 = a2Pointer.ref;
+  final a3Pointer = calloc<Struct1ByteInt>();
+  final Struct1ByteInt a3 = a3Pointer.ref;
+  final a4Pointer = calloc<Struct1ByteInt>();
+  final Struct1ByteInt a4 = a4Pointer.ref;
+  final a5Pointer = calloc<Struct1ByteInt>();
+  final Struct1ByteInt a5 = a5Pointer.ref;
+  final a6Pointer = calloc<Struct1ByteInt>();
+  final Struct1ByteInt a6 = a6Pointer.ref;
+  final a7Pointer = calloc<Struct1ByteInt>();
+  final Struct1ByteInt a7 = a7Pointer.ref;
+  final a8Pointer = calloc<Struct1ByteInt>();
+  final Struct1ByteInt a8 = a8Pointer.ref;
+  final a9Pointer = calloc<Struct1ByteInt>();
+  final Struct1ByteInt a9 = a9Pointer.ref;
 
   a0.a0 = -1;
   a1.a0 = 2;
@@ -1078,16 +1088,16 @@
 
   Expect.equals(5, result);
 
-  calloc.free(a0.addressOf);
-  calloc.free(a1.addressOf);
-  calloc.free(a2.addressOf);
-  calloc.free(a3.addressOf);
-  calloc.free(a4.addressOf);
-  calloc.free(a5.addressOf);
-  calloc.free(a6.addressOf);
-  calloc.free(a7.addressOf);
-  calloc.free(a8.addressOf);
-  calloc.free(a9.addressOf);
+  calloc.free(a0Pointer);
+  calloc.free(a1Pointer);
+  calloc.free(a2Pointer);
+  calloc.free(a3Pointer);
+  calloc.free(a4Pointer);
+  calloc.free(a5Pointer);
+  calloc.free(a6Pointer);
+  calloc.free(a7Pointer);
+  calloc.free(a8Pointer);
+  calloc.free(a9Pointer);
 }
 
 final passStruct3BytesHomogeneousUint8x10 = ffiTestFunctions.lookupFunction<
@@ -1117,16 +1127,26 @@
 /// Not a multiple of word size, not a power of two.
 /// 10 struct arguments will exhaust available registers.
 void testPassStruct3BytesHomogeneousUint8x10() {
-  Struct3BytesHomogeneousUint8 a0 = calloc<Struct3BytesHomogeneousUint8>().ref;
-  Struct3BytesHomogeneousUint8 a1 = calloc<Struct3BytesHomogeneousUint8>().ref;
-  Struct3BytesHomogeneousUint8 a2 = calloc<Struct3BytesHomogeneousUint8>().ref;
-  Struct3BytesHomogeneousUint8 a3 = calloc<Struct3BytesHomogeneousUint8>().ref;
-  Struct3BytesHomogeneousUint8 a4 = calloc<Struct3BytesHomogeneousUint8>().ref;
-  Struct3BytesHomogeneousUint8 a5 = calloc<Struct3BytesHomogeneousUint8>().ref;
-  Struct3BytesHomogeneousUint8 a6 = calloc<Struct3BytesHomogeneousUint8>().ref;
-  Struct3BytesHomogeneousUint8 a7 = calloc<Struct3BytesHomogeneousUint8>().ref;
-  Struct3BytesHomogeneousUint8 a8 = calloc<Struct3BytesHomogeneousUint8>().ref;
-  Struct3BytesHomogeneousUint8 a9 = calloc<Struct3BytesHomogeneousUint8>().ref;
+  final a0Pointer = calloc<Struct3BytesHomogeneousUint8>();
+  final Struct3BytesHomogeneousUint8 a0 = a0Pointer.ref;
+  final a1Pointer = calloc<Struct3BytesHomogeneousUint8>();
+  final Struct3BytesHomogeneousUint8 a1 = a1Pointer.ref;
+  final a2Pointer = calloc<Struct3BytesHomogeneousUint8>();
+  final Struct3BytesHomogeneousUint8 a2 = a2Pointer.ref;
+  final a3Pointer = calloc<Struct3BytesHomogeneousUint8>();
+  final Struct3BytesHomogeneousUint8 a3 = a3Pointer.ref;
+  final a4Pointer = calloc<Struct3BytesHomogeneousUint8>();
+  final Struct3BytesHomogeneousUint8 a4 = a4Pointer.ref;
+  final a5Pointer = calloc<Struct3BytesHomogeneousUint8>();
+  final Struct3BytesHomogeneousUint8 a5 = a5Pointer.ref;
+  final a6Pointer = calloc<Struct3BytesHomogeneousUint8>();
+  final Struct3BytesHomogeneousUint8 a6 = a6Pointer.ref;
+  final a7Pointer = calloc<Struct3BytesHomogeneousUint8>();
+  final Struct3BytesHomogeneousUint8 a7 = a7Pointer.ref;
+  final a8Pointer = calloc<Struct3BytesHomogeneousUint8>();
+  final Struct3BytesHomogeneousUint8 a8 = a8Pointer.ref;
+  final a9Pointer = calloc<Struct3BytesHomogeneousUint8>();
+  final Struct3BytesHomogeneousUint8 a9 = a9Pointer.ref;
 
   a0.a0 = 1;
   a0.a1 = 2;
@@ -1166,16 +1186,16 @@
 
   Expect.equals(465, result);
 
-  calloc.free(a0.addressOf);
-  calloc.free(a1.addressOf);
-  calloc.free(a2.addressOf);
-  calloc.free(a3.addressOf);
-  calloc.free(a4.addressOf);
-  calloc.free(a5.addressOf);
-  calloc.free(a6.addressOf);
-  calloc.free(a7.addressOf);
-  calloc.free(a8.addressOf);
-  calloc.free(a9.addressOf);
+  calloc.free(a0Pointer);
+  calloc.free(a1Pointer);
+  calloc.free(a2Pointer);
+  calloc.free(a3Pointer);
+  calloc.free(a4Pointer);
+  calloc.free(a5Pointer);
+  calloc.free(a6Pointer);
+  calloc.free(a7Pointer);
+  calloc.free(a8Pointer);
+  calloc.free(a9Pointer);
 }
 
 final passStruct3BytesInt2ByteAlignedx10 = ffiTestFunctions.lookupFunction<
@@ -1206,16 +1226,26 @@
 /// With alignment rules taken into account size is 4 bytes.
 /// 10 struct arguments will exhaust available registers.
 void testPassStruct3BytesInt2ByteAlignedx10() {
-  Struct3BytesInt2ByteAligned a0 = calloc<Struct3BytesInt2ByteAligned>().ref;
-  Struct3BytesInt2ByteAligned a1 = calloc<Struct3BytesInt2ByteAligned>().ref;
-  Struct3BytesInt2ByteAligned a2 = calloc<Struct3BytesInt2ByteAligned>().ref;
-  Struct3BytesInt2ByteAligned a3 = calloc<Struct3BytesInt2ByteAligned>().ref;
-  Struct3BytesInt2ByteAligned a4 = calloc<Struct3BytesInt2ByteAligned>().ref;
-  Struct3BytesInt2ByteAligned a5 = calloc<Struct3BytesInt2ByteAligned>().ref;
-  Struct3BytesInt2ByteAligned a6 = calloc<Struct3BytesInt2ByteAligned>().ref;
-  Struct3BytesInt2ByteAligned a7 = calloc<Struct3BytesInt2ByteAligned>().ref;
-  Struct3BytesInt2ByteAligned a8 = calloc<Struct3BytesInt2ByteAligned>().ref;
-  Struct3BytesInt2ByteAligned a9 = calloc<Struct3BytesInt2ByteAligned>().ref;
+  final a0Pointer = calloc<Struct3BytesInt2ByteAligned>();
+  final Struct3BytesInt2ByteAligned a0 = a0Pointer.ref;
+  final a1Pointer = calloc<Struct3BytesInt2ByteAligned>();
+  final Struct3BytesInt2ByteAligned a1 = a1Pointer.ref;
+  final a2Pointer = calloc<Struct3BytesInt2ByteAligned>();
+  final Struct3BytesInt2ByteAligned a2 = a2Pointer.ref;
+  final a3Pointer = calloc<Struct3BytesInt2ByteAligned>();
+  final Struct3BytesInt2ByteAligned a3 = a3Pointer.ref;
+  final a4Pointer = calloc<Struct3BytesInt2ByteAligned>();
+  final Struct3BytesInt2ByteAligned a4 = a4Pointer.ref;
+  final a5Pointer = calloc<Struct3BytesInt2ByteAligned>();
+  final Struct3BytesInt2ByteAligned a5 = a5Pointer.ref;
+  final a6Pointer = calloc<Struct3BytesInt2ByteAligned>();
+  final Struct3BytesInt2ByteAligned a6 = a6Pointer.ref;
+  final a7Pointer = calloc<Struct3BytesInt2ByteAligned>();
+  final Struct3BytesInt2ByteAligned a7 = a7Pointer.ref;
+  final a8Pointer = calloc<Struct3BytesInt2ByteAligned>();
+  final Struct3BytesInt2ByteAligned a8 = a8Pointer.ref;
+  final a9Pointer = calloc<Struct3BytesInt2ByteAligned>();
+  final Struct3BytesInt2ByteAligned a9 = a9Pointer.ref;
 
   a0.a0 = -1;
   a0.a1 = 2;
@@ -1245,16 +1275,16 @@
 
   Expect.equals(10, result);
 
-  calloc.free(a0.addressOf);
-  calloc.free(a1.addressOf);
-  calloc.free(a2.addressOf);
-  calloc.free(a3.addressOf);
-  calloc.free(a4.addressOf);
-  calloc.free(a5.addressOf);
-  calloc.free(a6.addressOf);
-  calloc.free(a7.addressOf);
-  calloc.free(a8.addressOf);
-  calloc.free(a9.addressOf);
+  calloc.free(a0Pointer);
+  calloc.free(a1Pointer);
+  calloc.free(a2Pointer);
+  calloc.free(a3Pointer);
+  calloc.free(a4Pointer);
+  calloc.free(a5Pointer);
+  calloc.free(a6Pointer);
+  calloc.free(a7Pointer);
+  calloc.free(a8Pointer);
+  calloc.free(a9Pointer);
 }
 
 final passStruct4BytesHomogeneousInt16x10 = ffiTestFunctions.lookupFunction<
@@ -1284,16 +1314,26 @@
 /// Exactly word size on 32-bit architectures.
 /// 10 struct arguments will exhaust available registers.
 void testPassStruct4BytesHomogeneousInt16x10() {
-  Struct4BytesHomogeneousInt16 a0 = calloc<Struct4BytesHomogeneousInt16>().ref;
-  Struct4BytesHomogeneousInt16 a1 = calloc<Struct4BytesHomogeneousInt16>().ref;
-  Struct4BytesHomogeneousInt16 a2 = calloc<Struct4BytesHomogeneousInt16>().ref;
-  Struct4BytesHomogeneousInt16 a3 = calloc<Struct4BytesHomogeneousInt16>().ref;
-  Struct4BytesHomogeneousInt16 a4 = calloc<Struct4BytesHomogeneousInt16>().ref;
-  Struct4BytesHomogeneousInt16 a5 = calloc<Struct4BytesHomogeneousInt16>().ref;
-  Struct4BytesHomogeneousInt16 a6 = calloc<Struct4BytesHomogeneousInt16>().ref;
-  Struct4BytesHomogeneousInt16 a7 = calloc<Struct4BytesHomogeneousInt16>().ref;
-  Struct4BytesHomogeneousInt16 a8 = calloc<Struct4BytesHomogeneousInt16>().ref;
-  Struct4BytesHomogeneousInt16 a9 = calloc<Struct4BytesHomogeneousInt16>().ref;
+  final a0Pointer = calloc<Struct4BytesHomogeneousInt16>();
+  final Struct4BytesHomogeneousInt16 a0 = a0Pointer.ref;
+  final a1Pointer = calloc<Struct4BytesHomogeneousInt16>();
+  final Struct4BytesHomogeneousInt16 a1 = a1Pointer.ref;
+  final a2Pointer = calloc<Struct4BytesHomogeneousInt16>();
+  final Struct4BytesHomogeneousInt16 a2 = a2Pointer.ref;
+  final a3Pointer = calloc<Struct4BytesHomogeneousInt16>();
+  final Struct4BytesHomogeneousInt16 a3 = a3Pointer.ref;
+  final a4Pointer = calloc<Struct4BytesHomogeneousInt16>();
+  final Struct4BytesHomogeneousInt16 a4 = a4Pointer.ref;
+  final a5Pointer = calloc<Struct4BytesHomogeneousInt16>();
+  final Struct4BytesHomogeneousInt16 a5 = a5Pointer.ref;
+  final a6Pointer = calloc<Struct4BytesHomogeneousInt16>();
+  final Struct4BytesHomogeneousInt16 a6 = a6Pointer.ref;
+  final a7Pointer = calloc<Struct4BytesHomogeneousInt16>();
+  final Struct4BytesHomogeneousInt16 a7 = a7Pointer.ref;
+  final a8Pointer = calloc<Struct4BytesHomogeneousInt16>();
+  final Struct4BytesHomogeneousInt16 a8 = a8Pointer.ref;
+  final a9Pointer = calloc<Struct4BytesHomogeneousInt16>();
+  final Struct4BytesHomogeneousInt16 a9 = a9Pointer.ref;
 
   a0.a0 = -1;
   a0.a1 = 2;
@@ -1323,16 +1363,16 @@
 
   Expect.equals(10, result);
 
-  calloc.free(a0.addressOf);
-  calloc.free(a1.addressOf);
-  calloc.free(a2.addressOf);
-  calloc.free(a3.addressOf);
-  calloc.free(a4.addressOf);
-  calloc.free(a5.addressOf);
-  calloc.free(a6.addressOf);
-  calloc.free(a7.addressOf);
-  calloc.free(a8.addressOf);
-  calloc.free(a9.addressOf);
+  calloc.free(a0Pointer);
+  calloc.free(a1Pointer);
+  calloc.free(a2Pointer);
+  calloc.free(a3Pointer);
+  calloc.free(a4Pointer);
+  calloc.free(a5Pointer);
+  calloc.free(a6Pointer);
+  calloc.free(a7Pointer);
+  calloc.free(a8Pointer);
+  calloc.free(a9Pointer);
 }
 
 final passStruct7BytesHomogeneousUint8x10 = ffiTestFunctions.lookupFunction<
@@ -1362,16 +1402,26 @@
 /// Sub word size on 64 bit architectures.
 /// 10 struct arguments will exhaust available registers.
 void testPassStruct7BytesHomogeneousUint8x10() {
-  Struct7BytesHomogeneousUint8 a0 = calloc<Struct7BytesHomogeneousUint8>().ref;
-  Struct7BytesHomogeneousUint8 a1 = calloc<Struct7BytesHomogeneousUint8>().ref;
-  Struct7BytesHomogeneousUint8 a2 = calloc<Struct7BytesHomogeneousUint8>().ref;
-  Struct7BytesHomogeneousUint8 a3 = calloc<Struct7BytesHomogeneousUint8>().ref;
-  Struct7BytesHomogeneousUint8 a4 = calloc<Struct7BytesHomogeneousUint8>().ref;
-  Struct7BytesHomogeneousUint8 a5 = calloc<Struct7BytesHomogeneousUint8>().ref;
-  Struct7BytesHomogeneousUint8 a6 = calloc<Struct7BytesHomogeneousUint8>().ref;
-  Struct7BytesHomogeneousUint8 a7 = calloc<Struct7BytesHomogeneousUint8>().ref;
-  Struct7BytesHomogeneousUint8 a8 = calloc<Struct7BytesHomogeneousUint8>().ref;
-  Struct7BytesHomogeneousUint8 a9 = calloc<Struct7BytesHomogeneousUint8>().ref;
+  final a0Pointer = calloc<Struct7BytesHomogeneousUint8>();
+  final Struct7BytesHomogeneousUint8 a0 = a0Pointer.ref;
+  final a1Pointer = calloc<Struct7BytesHomogeneousUint8>();
+  final Struct7BytesHomogeneousUint8 a1 = a1Pointer.ref;
+  final a2Pointer = calloc<Struct7BytesHomogeneousUint8>();
+  final Struct7BytesHomogeneousUint8 a2 = a2Pointer.ref;
+  final a3Pointer = calloc<Struct7BytesHomogeneousUint8>();
+  final Struct7BytesHomogeneousUint8 a3 = a3Pointer.ref;
+  final a4Pointer = calloc<Struct7BytesHomogeneousUint8>();
+  final Struct7BytesHomogeneousUint8 a4 = a4Pointer.ref;
+  final a5Pointer = calloc<Struct7BytesHomogeneousUint8>();
+  final Struct7BytesHomogeneousUint8 a5 = a5Pointer.ref;
+  final a6Pointer = calloc<Struct7BytesHomogeneousUint8>();
+  final Struct7BytesHomogeneousUint8 a6 = a6Pointer.ref;
+  final a7Pointer = calloc<Struct7BytesHomogeneousUint8>();
+  final Struct7BytesHomogeneousUint8 a7 = a7Pointer.ref;
+  final a8Pointer = calloc<Struct7BytesHomogeneousUint8>();
+  final Struct7BytesHomogeneousUint8 a8 = a8Pointer.ref;
+  final a9Pointer = calloc<Struct7BytesHomogeneousUint8>();
+  final Struct7BytesHomogeneousUint8 a9 = a9Pointer.ref;
 
   a0.a0 = 1;
   a0.a1 = 2;
@@ -1451,16 +1501,16 @@
 
   Expect.equals(2485, result);
 
-  calloc.free(a0.addressOf);
-  calloc.free(a1.addressOf);
-  calloc.free(a2.addressOf);
-  calloc.free(a3.addressOf);
-  calloc.free(a4.addressOf);
-  calloc.free(a5.addressOf);
-  calloc.free(a6.addressOf);
-  calloc.free(a7.addressOf);
-  calloc.free(a8.addressOf);
-  calloc.free(a9.addressOf);
+  calloc.free(a0Pointer);
+  calloc.free(a1Pointer);
+  calloc.free(a2Pointer);
+  calloc.free(a3Pointer);
+  calloc.free(a4Pointer);
+  calloc.free(a5Pointer);
+  calloc.free(a6Pointer);
+  calloc.free(a7Pointer);
+  calloc.free(a8Pointer);
+  calloc.free(a9Pointer);
 }
 
 final passStruct7BytesInt4ByteAlignedx10 = ffiTestFunctions.lookupFunction<
@@ -1491,16 +1541,26 @@
 /// With alignment rules taken into account size is 8 bytes.
 /// 10 struct arguments will exhaust available registers.
 void testPassStruct7BytesInt4ByteAlignedx10() {
-  Struct7BytesInt4ByteAligned a0 = calloc<Struct7BytesInt4ByteAligned>().ref;
-  Struct7BytesInt4ByteAligned a1 = calloc<Struct7BytesInt4ByteAligned>().ref;
-  Struct7BytesInt4ByteAligned a2 = calloc<Struct7BytesInt4ByteAligned>().ref;
-  Struct7BytesInt4ByteAligned a3 = calloc<Struct7BytesInt4ByteAligned>().ref;
-  Struct7BytesInt4ByteAligned a4 = calloc<Struct7BytesInt4ByteAligned>().ref;
-  Struct7BytesInt4ByteAligned a5 = calloc<Struct7BytesInt4ByteAligned>().ref;
-  Struct7BytesInt4ByteAligned a6 = calloc<Struct7BytesInt4ByteAligned>().ref;
-  Struct7BytesInt4ByteAligned a7 = calloc<Struct7BytesInt4ByteAligned>().ref;
-  Struct7BytesInt4ByteAligned a8 = calloc<Struct7BytesInt4ByteAligned>().ref;
-  Struct7BytesInt4ByteAligned a9 = calloc<Struct7BytesInt4ByteAligned>().ref;
+  final a0Pointer = calloc<Struct7BytesInt4ByteAligned>();
+  final Struct7BytesInt4ByteAligned a0 = a0Pointer.ref;
+  final a1Pointer = calloc<Struct7BytesInt4ByteAligned>();
+  final Struct7BytesInt4ByteAligned a1 = a1Pointer.ref;
+  final a2Pointer = calloc<Struct7BytesInt4ByteAligned>();
+  final Struct7BytesInt4ByteAligned a2 = a2Pointer.ref;
+  final a3Pointer = calloc<Struct7BytesInt4ByteAligned>();
+  final Struct7BytesInt4ByteAligned a3 = a3Pointer.ref;
+  final a4Pointer = calloc<Struct7BytesInt4ByteAligned>();
+  final Struct7BytesInt4ByteAligned a4 = a4Pointer.ref;
+  final a5Pointer = calloc<Struct7BytesInt4ByteAligned>();
+  final Struct7BytesInt4ByteAligned a5 = a5Pointer.ref;
+  final a6Pointer = calloc<Struct7BytesInt4ByteAligned>();
+  final Struct7BytesInt4ByteAligned a6 = a6Pointer.ref;
+  final a7Pointer = calloc<Struct7BytesInt4ByteAligned>();
+  final Struct7BytesInt4ByteAligned a7 = a7Pointer.ref;
+  final a8Pointer = calloc<Struct7BytesInt4ByteAligned>();
+  final Struct7BytesInt4ByteAligned a8 = a8Pointer.ref;
+  final a9Pointer = calloc<Struct7BytesInt4ByteAligned>();
+  final Struct7BytesInt4ByteAligned a9 = a9Pointer.ref;
 
   a0.a0 = -1;
   a0.a1 = 2;
@@ -1540,16 +1600,16 @@
 
   Expect.equals(15, result);
 
-  calloc.free(a0.addressOf);
-  calloc.free(a1.addressOf);
-  calloc.free(a2.addressOf);
-  calloc.free(a3.addressOf);
-  calloc.free(a4.addressOf);
-  calloc.free(a5.addressOf);
-  calloc.free(a6.addressOf);
-  calloc.free(a7.addressOf);
-  calloc.free(a8.addressOf);
-  calloc.free(a9.addressOf);
+  calloc.free(a0Pointer);
+  calloc.free(a1Pointer);
+  calloc.free(a2Pointer);
+  calloc.free(a3Pointer);
+  calloc.free(a4Pointer);
+  calloc.free(a5Pointer);
+  calloc.free(a6Pointer);
+  calloc.free(a7Pointer);
+  calloc.free(a8Pointer);
+  calloc.free(a9Pointer);
 }
 
 final passStruct8BytesIntx10 = ffiTestFunctions.lookupFunction<
@@ -1579,16 +1639,26 @@
 /// Exactly word size struct on 64bit architectures.
 /// 10 struct arguments will exhaust available registers.
 void testPassStruct8BytesIntx10() {
-  Struct8BytesInt a0 = calloc<Struct8BytesInt>().ref;
-  Struct8BytesInt a1 = calloc<Struct8BytesInt>().ref;
-  Struct8BytesInt a2 = calloc<Struct8BytesInt>().ref;
-  Struct8BytesInt a3 = calloc<Struct8BytesInt>().ref;
-  Struct8BytesInt a4 = calloc<Struct8BytesInt>().ref;
-  Struct8BytesInt a5 = calloc<Struct8BytesInt>().ref;
-  Struct8BytesInt a6 = calloc<Struct8BytesInt>().ref;
-  Struct8BytesInt a7 = calloc<Struct8BytesInt>().ref;
-  Struct8BytesInt a8 = calloc<Struct8BytesInt>().ref;
-  Struct8BytesInt a9 = calloc<Struct8BytesInt>().ref;
+  final a0Pointer = calloc<Struct8BytesInt>();
+  final Struct8BytesInt a0 = a0Pointer.ref;
+  final a1Pointer = calloc<Struct8BytesInt>();
+  final Struct8BytesInt a1 = a1Pointer.ref;
+  final a2Pointer = calloc<Struct8BytesInt>();
+  final Struct8BytesInt a2 = a2Pointer.ref;
+  final a3Pointer = calloc<Struct8BytesInt>();
+  final Struct8BytesInt a3 = a3Pointer.ref;
+  final a4Pointer = calloc<Struct8BytesInt>();
+  final Struct8BytesInt a4 = a4Pointer.ref;
+  final a5Pointer = calloc<Struct8BytesInt>();
+  final Struct8BytesInt a5 = a5Pointer.ref;
+  final a6Pointer = calloc<Struct8BytesInt>();
+  final Struct8BytesInt a6 = a6Pointer.ref;
+  final a7Pointer = calloc<Struct8BytesInt>();
+  final Struct8BytesInt a7 = a7Pointer.ref;
+  final a8Pointer = calloc<Struct8BytesInt>();
+  final Struct8BytesInt a8 = a8Pointer.ref;
+  final a9Pointer = calloc<Struct8BytesInt>();
+  final Struct8BytesInt a9 = a9Pointer.ref;
 
   a0.a0 = -1;
   a0.a1 = 2;
@@ -1627,16 +1697,16 @@
 
   Expect.equals(15, result);
 
-  calloc.free(a0.addressOf);
-  calloc.free(a1.addressOf);
-  calloc.free(a2.addressOf);
-  calloc.free(a3.addressOf);
-  calloc.free(a4.addressOf);
-  calloc.free(a5.addressOf);
-  calloc.free(a6.addressOf);
-  calloc.free(a7.addressOf);
-  calloc.free(a8.addressOf);
-  calloc.free(a9.addressOf);
+  calloc.free(a0Pointer);
+  calloc.free(a1Pointer);
+  calloc.free(a2Pointer);
+  calloc.free(a3Pointer);
+  calloc.free(a4Pointer);
+  calloc.free(a5Pointer);
+  calloc.free(a6Pointer);
+  calloc.free(a7Pointer);
+  calloc.free(a8Pointer);
+  calloc.free(a9Pointer);
 }
 
 final passStruct8BytesHomogeneousFloatx10 = ffiTestFunctions.lookupFunction<
@@ -1666,16 +1736,26 @@
 /// Arguments passed in FP registers as long as they fit.
 /// 10 struct arguments will exhaust available registers.
 void testPassStruct8BytesHomogeneousFloatx10() {
-  Struct8BytesHomogeneousFloat a0 = calloc<Struct8BytesHomogeneousFloat>().ref;
-  Struct8BytesHomogeneousFloat a1 = calloc<Struct8BytesHomogeneousFloat>().ref;
-  Struct8BytesHomogeneousFloat a2 = calloc<Struct8BytesHomogeneousFloat>().ref;
-  Struct8BytesHomogeneousFloat a3 = calloc<Struct8BytesHomogeneousFloat>().ref;
-  Struct8BytesHomogeneousFloat a4 = calloc<Struct8BytesHomogeneousFloat>().ref;
-  Struct8BytesHomogeneousFloat a5 = calloc<Struct8BytesHomogeneousFloat>().ref;
-  Struct8BytesHomogeneousFloat a6 = calloc<Struct8BytesHomogeneousFloat>().ref;
-  Struct8BytesHomogeneousFloat a7 = calloc<Struct8BytesHomogeneousFloat>().ref;
-  Struct8BytesHomogeneousFloat a8 = calloc<Struct8BytesHomogeneousFloat>().ref;
-  Struct8BytesHomogeneousFloat a9 = calloc<Struct8BytesHomogeneousFloat>().ref;
+  final a0Pointer = calloc<Struct8BytesHomogeneousFloat>();
+  final Struct8BytesHomogeneousFloat a0 = a0Pointer.ref;
+  final a1Pointer = calloc<Struct8BytesHomogeneousFloat>();
+  final Struct8BytesHomogeneousFloat a1 = a1Pointer.ref;
+  final a2Pointer = calloc<Struct8BytesHomogeneousFloat>();
+  final Struct8BytesHomogeneousFloat a2 = a2Pointer.ref;
+  final a3Pointer = calloc<Struct8BytesHomogeneousFloat>();
+  final Struct8BytesHomogeneousFloat a3 = a3Pointer.ref;
+  final a4Pointer = calloc<Struct8BytesHomogeneousFloat>();
+  final Struct8BytesHomogeneousFloat a4 = a4Pointer.ref;
+  final a5Pointer = calloc<Struct8BytesHomogeneousFloat>();
+  final Struct8BytesHomogeneousFloat a5 = a5Pointer.ref;
+  final a6Pointer = calloc<Struct8BytesHomogeneousFloat>();
+  final Struct8BytesHomogeneousFloat a6 = a6Pointer.ref;
+  final a7Pointer = calloc<Struct8BytesHomogeneousFloat>();
+  final Struct8BytesHomogeneousFloat a7 = a7Pointer.ref;
+  final a8Pointer = calloc<Struct8BytesHomogeneousFloat>();
+  final Struct8BytesHomogeneousFloat a8 = a8Pointer.ref;
+  final a9Pointer = calloc<Struct8BytesHomogeneousFloat>();
+  final Struct8BytesHomogeneousFloat a9 = a9Pointer.ref;
 
   a0.a0 = -1.0;
   a0.a1 = 2.0;
@@ -1705,16 +1785,16 @@
 
   Expect.approxEquals(10.0, result);
 
-  calloc.free(a0.addressOf);
-  calloc.free(a1.addressOf);
-  calloc.free(a2.addressOf);
-  calloc.free(a3.addressOf);
-  calloc.free(a4.addressOf);
-  calloc.free(a5.addressOf);
-  calloc.free(a6.addressOf);
-  calloc.free(a7.addressOf);
-  calloc.free(a8.addressOf);
-  calloc.free(a9.addressOf);
+  calloc.free(a0Pointer);
+  calloc.free(a1Pointer);
+  calloc.free(a2Pointer);
+  calloc.free(a3Pointer);
+  calloc.free(a4Pointer);
+  calloc.free(a5Pointer);
+  calloc.free(a6Pointer);
+  calloc.free(a7Pointer);
+  calloc.free(a8Pointer);
+  calloc.free(a9Pointer);
 }
 
 final passStruct8BytesMixedx10 = ffiTestFunctions.lookupFunction<
@@ -1744,16 +1824,26 @@
 /// On x64, arguments go in int registers because it is not only float.
 /// 10 struct arguments will exhaust available registers.
 void testPassStruct8BytesMixedx10() {
-  Struct8BytesMixed a0 = calloc<Struct8BytesMixed>().ref;
-  Struct8BytesMixed a1 = calloc<Struct8BytesMixed>().ref;
-  Struct8BytesMixed a2 = calloc<Struct8BytesMixed>().ref;
-  Struct8BytesMixed a3 = calloc<Struct8BytesMixed>().ref;
-  Struct8BytesMixed a4 = calloc<Struct8BytesMixed>().ref;
-  Struct8BytesMixed a5 = calloc<Struct8BytesMixed>().ref;
-  Struct8BytesMixed a6 = calloc<Struct8BytesMixed>().ref;
-  Struct8BytesMixed a7 = calloc<Struct8BytesMixed>().ref;
-  Struct8BytesMixed a8 = calloc<Struct8BytesMixed>().ref;
-  Struct8BytesMixed a9 = calloc<Struct8BytesMixed>().ref;
+  final a0Pointer = calloc<Struct8BytesMixed>();
+  final Struct8BytesMixed a0 = a0Pointer.ref;
+  final a1Pointer = calloc<Struct8BytesMixed>();
+  final Struct8BytesMixed a1 = a1Pointer.ref;
+  final a2Pointer = calloc<Struct8BytesMixed>();
+  final Struct8BytesMixed a2 = a2Pointer.ref;
+  final a3Pointer = calloc<Struct8BytesMixed>();
+  final Struct8BytesMixed a3 = a3Pointer.ref;
+  final a4Pointer = calloc<Struct8BytesMixed>();
+  final Struct8BytesMixed a4 = a4Pointer.ref;
+  final a5Pointer = calloc<Struct8BytesMixed>();
+  final Struct8BytesMixed a5 = a5Pointer.ref;
+  final a6Pointer = calloc<Struct8BytesMixed>();
+  final Struct8BytesMixed a6 = a6Pointer.ref;
+  final a7Pointer = calloc<Struct8BytesMixed>();
+  final Struct8BytesMixed a7 = a7Pointer.ref;
+  final a8Pointer = calloc<Struct8BytesMixed>();
+  final Struct8BytesMixed a8 = a8Pointer.ref;
+  final a9Pointer = calloc<Struct8BytesMixed>();
+  final Struct8BytesMixed a9 = a9Pointer.ref;
 
   a0.a0 = -1.0;
   a0.a1 = 2;
@@ -1793,16 +1883,16 @@
 
   Expect.approxEquals(15.0, result);
 
-  calloc.free(a0.addressOf);
-  calloc.free(a1.addressOf);
-  calloc.free(a2.addressOf);
-  calloc.free(a3.addressOf);
-  calloc.free(a4.addressOf);
-  calloc.free(a5.addressOf);
-  calloc.free(a6.addressOf);
-  calloc.free(a7.addressOf);
-  calloc.free(a8.addressOf);
-  calloc.free(a9.addressOf);
+  calloc.free(a0Pointer);
+  calloc.free(a1Pointer);
+  calloc.free(a2Pointer);
+  calloc.free(a3Pointer);
+  calloc.free(a4Pointer);
+  calloc.free(a5Pointer);
+  calloc.free(a6Pointer);
+  calloc.free(a7Pointer);
+  calloc.free(a8Pointer);
+  calloc.free(a9Pointer);
 }
 
 final passStruct9BytesHomogeneousUint8x10 = ffiTestFunctions.lookupFunction<
@@ -1835,16 +1925,26 @@
 /// Tests upper bytes in the integer registers that are partly filled.
 /// Tests stack alignment of non word size stack arguments.
 void testPassStruct9BytesHomogeneousUint8x10() {
-  Struct9BytesHomogeneousUint8 a0 = calloc<Struct9BytesHomogeneousUint8>().ref;
-  Struct9BytesHomogeneousUint8 a1 = calloc<Struct9BytesHomogeneousUint8>().ref;
-  Struct9BytesHomogeneousUint8 a2 = calloc<Struct9BytesHomogeneousUint8>().ref;
-  Struct9BytesHomogeneousUint8 a3 = calloc<Struct9BytesHomogeneousUint8>().ref;
-  Struct9BytesHomogeneousUint8 a4 = calloc<Struct9BytesHomogeneousUint8>().ref;
-  Struct9BytesHomogeneousUint8 a5 = calloc<Struct9BytesHomogeneousUint8>().ref;
-  Struct9BytesHomogeneousUint8 a6 = calloc<Struct9BytesHomogeneousUint8>().ref;
-  Struct9BytesHomogeneousUint8 a7 = calloc<Struct9BytesHomogeneousUint8>().ref;
-  Struct9BytesHomogeneousUint8 a8 = calloc<Struct9BytesHomogeneousUint8>().ref;
-  Struct9BytesHomogeneousUint8 a9 = calloc<Struct9BytesHomogeneousUint8>().ref;
+  final a0Pointer = calloc<Struct9BytesHomogeneousUint8>();
+  final Struct9BytesHomogeneousUint8 a0 = a0Pointer.ref;
+  final a1Pointer = calloc<Struct9BytesHomogeneousUint8>();
+  final Struct9BytesHomogeneousUint8 a1 = a1Pointer.ref;
+  final a2Pointer = calloc<Struct9BytesHomogeneousUint8>();
+  final Struct9BytesHomogeneousUint8 a2 = a2Pointer.ref;
+  final a3Pointer = calloc<Struct9BytesHomogeneousUint8>();
+  final Struct9BytesHomogeneousUint8 a3 = a3Pointer.ref;
+  final a4Pointer = calloc<Struct9BytesHomogeneousUint8>();
+  final Struct9BytesHomogeneousUint8 a4 = a4Pointer.ref;
+  final a5Pointer = calloc<Struct9BytesHomogeneousUint8>();
+  final Struct9BytesHomogeneousUint8 a5 = a5Pointer.ref;
+  final a6Pointer = calloc<Struct9BytesHomogeneousUint8>();
+  final Struct9BytesHomogeneousUint8 a6 = a6Pointer.ref;
+  final a7Pointer = calloc<Struct9BytesHomogeneousUint8>();
+  final Struct9BytesHomogeneousUint8 a7 = a7Pointer.ref;
+  final a8Pointer = calloc<Struct9BytesHomogeneousUint8>();
+  final Struct9BytesHomogeneousUint8 a8 = a8Pointer.ref;
+  final a9Pointer = calloc<Struct9BytesHomogeneousUint8>();
+  final Struct9BytesHomogeneousUint8 a9 = a9Pointer.ref;
 
   a0.a0 = 1;
   a0.a1 = 2;
@@ -1944,16 +2044,16 @@
 
   Expect.equals(4095, result);
 
-  calloc.free(a0.addressOf);
-  calloc.free(a1.addressOf);
-  calloc.free(a2.addressOf);
-  calloc.free(a3.addressOf);
-  calloc.free(a4.addressOf);
-  calloc.free(a5.addressOf);
-  calloc.free(a6.addressOf);
-  calloc.free(a7.addressOf);
-  calloc.free(a8.addressOf);
-  calloc.free(a9.addressOf);
+  calloc.free(a0Pointer);
+  calloc.free(a1Pointer);
+  calloc.free(a2Pointer);
+  calloc.free(a3Pointer);
+  calloc.free(a4Pointer);
+  calloc.free(a5Pointer);
+  calloc.free(a6Pointer);
+  calloc.free(a7Pointer);
+  calloc.free(a8Pointer);
+  calloc.free(a9Pointer);
 }
 
 final passStruct9BytesInt4Or8ByteAlignedx10 = ffiTestFunctions.lookupFunction<
@@ -1986,26 +2086,26 @@
 /// 10 struct arguments will exhaust available registers.
 ///
 void testPassStruct9BytesInt4Or8ByteAlignedx10() {
-  Struct9BytesInt4Or8ByteAligned a0 =
-      calloc<Struct9BytesInt4Or8ByteAligned>().ref;
-  Struct9BytesInt4Or8ByteAligned a1 =
-      calloc<Struct9BytesInt4Or8ByteAligned>().ref;
-  Struct9BytesInt4Or8ByteAligned a2 =
-      calloc<Struct9BytesInt4Or8ByteAligned>().ref;
-  Struct9BytesInt4Or8ByteAligned a3 =
-      calloc<Struct9BytesInt4Or8ByteAligned>().ref;
-  Struct9BytesInt4Or8ByteAligned a4 =
-      calloc<Struct9BytesInt4Or8ByteAligned>().ref;
-  Struct9BytesInt4Or8ByteAligned a5 =
-      calloc<Struct9BytesInt4Or8ByteAligned>().ref;
-  Struct9BytesInt4Or8ByteAligned a6 =
-      calloc<Struct9BytesInt4Or8ByteAligned>().ref;
-  Struct9BytesInt4Or8ByteAligned a7 =
-      calloc<Struct9BytesInt4Or8ByteAligned>().ref;
-  Struct9BytesInt4Or8ByteAligned a8 =
-      calloc<Struct9BytesInt4Or8ByteAligned>().ref;
-  Struct9BytesInt4Or8ByteAligned a9 =
-      calloc<Struct9BytesInt4Or8ByteAligned>().ref;
+  final a0Pointer = calloc<Struct9BytesInt4Or8ByteAligned>();
+  final Struct9BytesInt4Or8ByteAligned a0 = a0Pointer.ref;
+  final a1Pointer = calloc<Struct9BytesInt4Or8ByteAligned>();
+  final Struct9BytesInt4Or8ByteAligned a1 = a1Pointer.ref;
+  final a2Pointer = calloc<Struct9BytesInt4Or8ByteAligned>();
+  final Struct9BytesInt4Or8ByteAligned a2 = a2Pointer.ref;
+  final a3Pointer = calloc<Struct9BytesInt4Or8ByteAligned>();
+  final Struct9BytesInt4Or8ByteAligned a3 = a3Pointer.ref;
+  final a4Pointer = calloc<Struct9BytesInt4Or8ByteAligned>();
+  final Struct9BytesInt4Or8ByteAligned a4 = a4Pointer.ref;
+  final a5Pointer = calloc<Struct9BytesInt4Or8ByteAligned>();
+  final Struct9BytesInt4Or8ByteAligned a5 = a5Pointer.ref;
+  final a6Pointer = calloc<Struct9BytesInt4Or8ByteAligned>();
+  final Struct9BytesInt4Or8ByteAligned a6 = a6Pointer.ref;
+  final a7Pointer = calloc<Struct9BytesInt4Or8ByteAligned>();
+  final Struct9BytesInt4Or8ByteAligned a7 = a7Pointer.ref;
+  final a8Pointer = calloc<Struct9BytesInt4Or8ByteAligned>();
+  final Struct9BytesInt4Or8ByteAligned a8 = a8Pointer.ref;
+  final a9Pointer = calloc<Struct9BytesInt4Or8ByteAligned>();
+  final Struct9BytesInt4Or8ByteAligned a9 = a9Pointer.ref;
 
   a0.a0 = -1;
   a0.a1 = 2;
@@ -2035,16 +2135,16 @@
 
   Expect.equals(10, result);
 
-  calloc.free(a0.addressOf);
-  calloc.free(a1.addressOf);
-  calloc.free(a2.addressOf);
-  calloc.free(a3.addressOf);
-  calloc.free(a4.addressOf);
-  calloc.free(a5.addressOf);
-  calloc.free(a6.addressOf);
-  calloc.free(a7.addressOf);
-  calloc.free(a8.addressOf);
-  calloc.free(a9.addressOf);
+  calloc.free(a0Pointer);
+  calloc.free(a1Pointer);
+  calloc.free(a2Pointer);
+  calloc.free(a3Pointer);
+  calloc.free(a4Pointer);
+  calloc.free(a5Pointer);
+  calloc.free(a6Pointer);
+  calloc.free(a7Pointer);
+  calloc.free(a8Pointer);
+  calloc.free(a9Pointer);
 }
 
 final passStruct12BytesHomogeneousFloatx6 = ffiTestFunctions.lookupFunction<
@@ -2067,18 +2167,18 @@
 /// Struct arguments will exhaust available registers, and leave some empty.
 /// The last argument is to test whether arguments are backfilled.
 void testPassStruct12BytesHomogeneousFloatx6() {
-  Struct12BytesHomogeneousFloat a0 =
-      calloc<Struct12BytesHomogeneousFloat>().ref;
-  Struct12BytesHomogeneousFloat a1 =
-      calloc<Struct12BytesHomogeneousFloat>().ref;
-  Struct12BytesHomogeneousFloat a2 =
-      calloc<Struct12BytesHomogeneousFloat>().ref;
-  Struct12BytesHomogeneousFloat a3 =
-      calloc<Struct12BytesHomogeneousFloat>().ref;
-  Struct12BytesHomogeneousFloat a4 =
-      calloc<Struct12BytesHomogeneousFloat>().ref;
-  Struct12BytesHomogeneousFloat a5 =
-      calloc<Struct12BytesHomogeneousFloat>().ref;
+  final a0Pointer = calloc<Struct12BytesHomogeneousFloat>();
+  final Struct12BytesHomogeneousFloat a0 = a0Pointer.ref;
+  final a1Pointer = calloc<Struct12BytesHomogeneousFloat>();
+  final Struct12BytesHomogeneousFloat a1 = a1Pointer.ref;
+  final a2Pointer = calloc<Struct12BytesHomogeneousFloat>();
+  final Struct12BytesHomogeneousFloat a2 = a2Pointer.ref;
+  final a3Pointer = calloc<Struct12BytesHomogeneousFloat>();
+  final Struct12BytesHomogeneousFloat a3 = a3Pointer.ref;
+  final a4Pointer = calloc<Struct12BytesHomogeneousFloat>();
+  final Struct12BytesHomogeneousFloat a4 = a4Pointer.ref;
+  final a5Pointer = calloc<Struct12BytesHomogeneousFloat>();
+  final Struct12BytesHomogeneousFloat a5 = a5Pointer.ref;
 
   a0.a0 = -1.0;
   a0.a1 = 2.0;
@@ -2105,12 +2205,12 @@
 
   Expect.approxEquals(9.0, result);
 
-  calloc.free(a0.addressOf);
-  calloc.free(a1.addressOf);
-  calloc.free(a2.addressOf);
-  calloc.free(a3.addressOf);
-  calloc.free(a4.addressOf);
-  calloc.free(a5.addressOf);
+  calloc.free(a0Pointer);
+  calloc.free(a1Pointer);
+  calloc.free(a2Pointer);
+  calloc.free(a3Pointer);
+  calloc.free(a4Pointer);
+  calloc.free(a5Pointer);
 }
 
 final passStruct16BytesHomogeneousFloatx5 = ffiTestFunctions.lookupFunction<
@@ -2131,16 +2231,16 @@
 /// Arguments in FPU registers on arm hardfp and arm64.
 /// 5 struct arguments will exhaust available registers.
 void testPassStruct16BytesHomogeneousFloatx5() {
-  Struct16BytesHomogeneousFloat a0 =
-      calloc<Struct16BytesHomogeneousFloat>().ref;
-  Struct16BytesHomogeneousFloat a1 =
-      calloc<Struct16BytesHomogeneousFloat>().ref;
-  Struct16BytesHomogeneousFloat a2 =
-      calloc<Struct16BytesHomogeneousFloat>().ref;
-  Struct16BytesHomogeneousFloat a3 =
-      calloc<Struct16BytesHomogeneousFloat>().ref;
-  Struct16BytesHomogeneousFloat a4 =
-      calloc<Struct16BytesHomogeneousFloat>().ref;
+  final a0Pointer = calloc<Struct16BytesHomogeneousFloat>();
+  final Struct16BytesHomogeneousFloat a0 = a0Pointer.ref;
+  final a1Pointer = calloc<Struct16BytesHomogeneousFloat>();
+  final Struct16BytesHomogeneousFloat a1 = a1Pointer.ref;
+  final a2Pointer = calloc<Struct16BytesHomogeneousFloat>();
+  final Struct16BytesHomogeneousFloat a2 = a2Pointer.ref;
+  final a3Pointer = calloc<Struct16BytesHomogeneousFloat>();
+  final Struct16BytesHomogeneousFloat a3 = a3Pointer.ref;
+  final a4Pointer = calloc<Struct16BytesHomogeneousFloat>();
+  final Struct16BytesHomogeneousFloat a4 = a4Pointer.ref;
 
   a0.a0 = -1.0;
   a0.a1 = 2.0;
@@ -2169,11 +2269,11 @@
 
   Expect.approxEquals(10.0, result);
 
-  calloc.free(a0.addressOf);
-  calloc.free(a1.addressOf);
-  calloc.free(a2.addressOf);
-  calloc.free(a3.addressOf);
-  calloc.free(a4.addressOf);
+  calloc.free(a0Pointer);
+  calloc.free(a1Pointer);
+  calloc.free(a2Pointer);
+  calloc.free(a3Pointer);
+  calloc.free(a4Pointer);
 }
 
 final passStruct16BytesMixedx10 = ffiTestFunctions.lookupFunction<
@@ -2205,16 +2305,26 @@
 /// The rest goes on the stack.
 /// On arm, arguments are 8 byte aligned.
 void testPassStruct16BytesMixedx10() {
-  Struct16BytesMixed a0 = calloc<Struct16BytesMixed>().ref;
-  Struct16BytesMixed a1 = calloc<Struct16BytesMixed>().ref;
-  Struct16BytesMixed a2 = calloc<Struct16BytesMixed>().ref;
-  Struct16BytesMixed a3 = calloc<Struct16BytesMixed>().ref;
-  Struct16BytesMixed a4 = calloc<Struct16BytesMixed>().ref;
-  Struct16BytesMixed a5 = calloc<Struct16BytesMixed>().ref;
-  Struct16BytesMixed a6 = calloc<Struct16BytesMixed>().ref;
-  Struct16BytesMixed a7 = calloc<Struct16BytesMixed>().ref;
-  Struct16BytesMixed a8 = calloc<Struct16BytesMixed>().ref;
-  Struct16BytesMixed a9 = calloc<Struct16BytesMixed>().ref;
+  final a0Pointer = calloc<Struct16BytesMixed>();
+  final Struct16BytesMixed a0 = a0Pointer.ref;
+  final a1Pointer = calloc<Struct16BytesMixed>();
+  final Struct16BytesMixed a1 = a1Pointer.ref;
+  final a2Pointer = calloc<Struct16BytesMixed>();
+  final Struct16BytesMixed a2 = a2Pointer.ref;
+  final a3Pointer = calloc<Struct16BytesMixed>();
+  final Struct16BytesMixed a3 = a3Pointer.ref;
+  final a4Pointer = calloc<Struct16BytesMixed>();
+  final Struct16BytesMixed a4 = a4Pointer.ref;
+  final a5Pointer = calloc<Struct16BytesMixed>();
+  final Struct16BytesMixed a5 = a5Pointer.ref;
+  final a6Pointer = calloc<Struct16BytesMixed>();
+  final Struct16BytesMixed a6 = a6Pointer.ref;
+  final a7Pointer = calloc<Struct16BytesMixed>();
+  final Struct16BytesMixed a7 = a7Pointer.ref;
+  final a8Pointer = calloc<Struct16BytesMixed>();
+  final Struct16BytesMixed a8 = a8Pointer.ref;
+  final a9Pointer = calloc<Struct16BytesMixed>();
+  final Struct16BytesMixed a9 = a9Pointer.ref;
 
   a0.a0 = -1.0;
   a0.a1 = 2;
@@ -2244,16 +2354,16 @@
 
   Expect.approxEquals(10.0, result);
 
-  calloc.free(a0.addressOf);
-  calloc.free(a1.addressOf);
-  calloc.free(a2.addressOf);
-  calloc.free(a3.addressOf);
-  calloc.free(a4.addressOf);
-  calloc.free(a5.addressOf);
-  calloc.free(a6.addressOf);
-  calloc.free(a7.addressOf);
-  calloc.free(a8.addressOf);
-  calloc.free(a9.addressOf);
+  calloc.free(a0Pointer);
+  calloc.free(a1Pointer);
+  calloc.free(a2Pointer);
+  calloc.free(a3Pointer);
+  calloc.free(a4Pointer);
+  calloc.free(a5Pointer);
+  calloc.free(a6Pointer);
+  calloc.free(a7Pointer);
+  calloc.free(a8Pointer);
+  calloc.free(a9Pointer);
 }
 
 final passStruct16BytesMixed2x10 = ffiTestFunctions.lookupFunction<
@@ -2285,16 +2395,26 @@
 /// The rest goes on the stack.
 /// On arm, arguments are 4 byte aligned.
 void testPassStruct16BytesMixed2x10() {
-  Struct16BytesMixed2 a0 = calloc<Struct16BytesMixed2>().ref;
-  Struct16BytesMixed2 a1 = calloc<Struct16BytesMixed2>().ref;
-  Struct16BytesMixed2 a2 = calloc<Struct16BytesMixed2>().ref;
-  Struct16BytesMixed2 a3 = calloc<Struct16BytesMixed2>().ref;
-  Struct16BytesMixed2 a4 = calloc<Struct16BytesMixed2>().ref;
-  Struct16BytesMixed2 a5 = calloc<Struct16BytesMixed2>().ref;
-  Struct16BytesMixed2 a6 = calloc<Struct16BytesMixed2>().ref;
-  Struct16BytesMixed2 a7 = calloc<Struct16BytesMixed2>().ref;
-  Struct16BytesMixed2 a8 = calloc<Struct16BytesMixed2>().ref;
-  Struct16BytesMixed2 a9 = calloc<Struct16BytesMixed2>().ref;
+  final a0Pointer = calloc<Struct16BytesMixed2>();
+  final Struct16BytesMixed2 a0 = a0Pointer.ref;
+  final a1Pointer = calloc<Struct16BytesMixed2>();
+  final Struct16BytesMixed2 a1 = a1Pointer.ref;
+  final a2Pointer = calloc<Struct16BytesMixed2>();
+  final Struct16BytesMixed2 a2 = a2Pointer.ref;
+  final a3Pointer = calloc<Struct16BytesMixed2>();
+  final Struct16BytesMixed2 a3 = a3Pointer.ref;
+  final a4Pointer = calloc<Struct16BytesMixed2>();
+  final Struct16BytesMixed2 a4 = a4Pointer.ref;
+  final a5Pointer = calloc<Struct16BytesMixed2>();
+  final Struct16BytesMixed2 a5 = a5Pointer.ref;
+  final a6Pointer = calloc<Struct16BytesMixed2>();
+  final Struct16BytesMixed2 a6 = a6Pointer.ref;
+  final a7Pointer = calloc<Struct16BytesMixed2>();
+  final Struct16BytesMixed2 a7 = a7Pointer.ref;
+  final a8Pointer = calloc<Struct16BytesMixed2>();
+  final Struct16BytesMixed2 a8 = a8Pointer.ref;
+  final a9Pointer = calloc<Struct16BytesMixed2>();
+  final Struct16BytesMixed2 a9 = a9Pointer.ref;
 
   a0.a0 = -1.0;
   a0.a1 = 2.0;
@@ -2344,16 +2464,16 @@
 
   Expect.approxEquals(20.0, result);
 
-  calloc.free(a0.addressOf);
-  calloc.free(a1.addressOf);
-  calloc.free(a2.addressOf);
-  calloc.free(a3.addressOf);
-  calloc.free(a4.addressOf);
-  calloc.free(a5.addressOf);
-  calloc.free(a6.addressOf);
-  calloc.free(a7.addressOf);
-  calloc.free(a8.addressOf);
-  calloc.free(a9.addressOf);
+  calloc.free(a0Pointer);
+  calloc.free(a1Pointer);
+  calloc.free(a2Pointer);
+  calloc.free(a3Pointer);
+  calloc.free(a4Pointer);
+  calloc.free(a5Pointer);
+  calloc.free(a6Pointer);
+  calloc.free(a7Pointer);
+  calloc.free(a8Pointer);
+  calloc.free(a9Pointer);
 }
 
 final passStruct17BytesIntx10 = ffiTestFunctions.lookupFunction<
@@ -2383,16 +2503,26 @@
 /// Arguments are passed as pointer to copy on arm64.
 /// Tests that the memory allocated for copies are rounded up to word size.
 void testPassStruct17BytesIntx10() {
-  Struct17BytesInt a0 = calloc<Struct17BytesInt>().ref;
-  Struct17BytesInt a1 = calloc<Struct17BytesInt>().ref;
-  Struct17BytesInt a2 = calloc<Struct17BytesInt>().ref;
-  Struct17BytesInt a3 = calloc<Struct17BytesInt>().ref;
-  Struct17BytesInt a4 = calloc<Struct17BytesInt>().ref;
-  Struct17BytesInt a5 = calloc<Struct17BytesInt>().ref;
-  Struct17BytesInt a6 = calloc<Struct17BytesInt>().ref;
-  Struct17BytesInt a7 = calloc<Struct17BytesInt>().ref;
-  Struct17BytesInt a8 = calloc<Struct17BytesInt>().ref;
-  Struct17BytesInt a9 = calloc<Struct17BytesInt>().ref;
+  final a0Pointer = calloc<Struct17BytesInt>();
+  final Struct17BytesInt a0 = a0Pointer.ref;
+  final a1Pointer = calloc<Struct17BytesInt>();
+  final Struct17BytesInt a1 = a1Pointer.ref;
+  final a2Pointer = calloc<Struct17BytesInt>();
+  final Struct17BytesInt a2 = a2Pointer.ref;
+  final a3Pointer = calloc<Struct17BytesInt>();
+  final Struct17BytesInt a3 = a3Pointer.ref;
+  final a4Pointer = calloc<Struct17BytesInt>();
+  final Struct17BytesInt a4 = a4Pointer.ref;
+  final a5Pointer = calloc<Struct17BytesInt>();
+  final Struct17BytesInt a5 = a5Pointer.ref;
+  final a6Pointer = calloc<Struct17BytesInt>();
+  final Struct17BytesInt a6 = a6Pointer.ref;
+  final a7Pointer = calloc<Struct17BytesInt>();
+  final Struct17BytesInt a7 = a7Pointer.ref;
+  final a8Pointer = calloc<Struct17BytesInt>();
+  final Struct17BytesInt a8 = a8Pointer.ref;
+  final a9Pointer = calloc<Struct17BytesInt>();
+  final Struct17BytesInt a9 = a9Pointer.ref;
 
   a0.a0 = -1;
   a0.a1 = 2;
@@ -2432,16 +2562,16 @@
 
   Expect.equals(15, result);
 
-  calloc.free(a0.addressOf);
-  calloc.free(a1.addressOf);
-  calloc.free(a2.addressOf);
-  calloc.free(a3.addressOf);
-  calloc.free(a4.addressOf);
-  calloc.free(a5.addressOf);
-  calloc.free(a6.addressOf);
-  calloc.free(a7.addressOf);
-  calloc.free(a8.addressOf);
-  calloc.free(a9.addressOf);
+  calloc.free(a0Pointer);
+  calloc.free(a1Pointer);
+  calloc.free(a2Pointer);
+  calloc.free(a3Pointer);
+  calloc.free(a4Pointer);
+  calloc.free(a5Pointer);
+  calloc.free(a6Pointer);
+  calloc.free(a7Pointer);
+  calloc.free(a8Pointer);
+  calloc.free(a9Pointer);
 }
 
 final passStruct19BytesHomogeneousUint8x10 = ffiTestFunctions.lookupFunction<
@@ -2472,26 +2602,26 @@
 /// Test that the memory backing these structs is extended to the right size.
 ///
 void testPassStruct19BytesHomogeneousUint8x10() {
-  Struct19BytesHomogeneousUint8 a0 =
-      calloc<Struct19BytesHomogeneousUint8>().ref;
-  Struct19BytesHomogeneousUint8 a1 =
-      calloc<Struct19BytesHomogeneousUint8>().ref;
-  Struct19BytesHomogeneousUint8 a2 =
-      calloc<Struct19BytesHomogeneousUint8>().ref;
-  Struct19BytesHomogeneousUint8 a3 =
-      calloc<Struct19BytesHomogeneousUint8>().ref;
-  Struct19BytesHomogeneousUint8 a4 =
-      calloc<Struct19BytesHomogeneousUint8>().ref;
-  Struct19BytesHomogeneousUint8 a5 =
-      calloc<Struct19BytesHomogeneousUint8>().ref;
-  Struct19BytesHomogeneousUint8 a6 =
-      calloc<Struct19BytesHomogeneousUint8>().ref;
-  Struct19BytesHomogeneousUint8 a7 =
-      calloc<Struct19BytesHomogeneousUint8>().ref;
-  Struct19BytesHomogeneousUint8 a8 =
-      calloc<Struct19BytesHomogeneousUint8>().ref;
-  Struct19BytesHomogeneousUint8 a9 =
-      calloc<Struct19BytesHomogeneousUint8>().ref;
+  final a0Pointer = calloc<Struct19BytesHomogeneousUint8>();
+  final Struct19BytesHomogeneousUint8 a0 = a0Pointer.ref;
+  final a1Pointer = calloc<Struct19BytesHomogeneousUint8>();
+  final Struct19BytesHomogeneousUint8 a1 = a1Pointer.ref;
+  final a2Pointer = calloc<Struct19BytesHomogeneousUint8>();
+  final Struct19BytesHomogeneousUint8 a2 = a2Pointer.ref;
+  final a3Pointer = calloc<Struct19BytesHomogeneousUint8>();
+  final Struct19BytesHomogeneousUint8 a3 = a3Pointer.ref;
+  final a4Pointer = calloc<Struct19BytesHomogeneousUint8>();
+  final Struct19BytesHomogeneousUint8 a4 = a4Pointer.ref;
+  final a5Pointer = calloc<Struct19BytesHomogeneousUint8>();
+  final Struct19BytesHomogeneousUint8 a5 = a5Pointer.ref;
+  final a6Pointer = calloc<Struct19BytesHomogeneousUint8>();
+  final Struct19BytesHomogeneousUint8 a6 = a6Pointer.ref;
+  final a7Pointer = calloc<Struct19BytesHomogeneousUint8>();
+  final Struct19BytesHomogeneousUint8 a7 = a7Pointer.ref;
+  final a8Pointer = calloc<Struct19BytesHomogeneousUint8>();
+  final Struct19BytesHomogeneousUint8 a8 = a8Pointer.ref;
+  final a9Pointer = calloc<Struct19BytesHomogeneousUint8>();
+  final Struct19BytesHomogeneousUint8 a9 = a9Pointer.ref;
 
   a0.a0 = 1;
   a0.a1 = 2;
@@ -2691,16 +2821,16 @@
 
   Expect.equals(18145, result);
 
-  calloc.free(a0.addressOf);
-  calloc.free(a1.addressOf);
-  calloc.free(a2.addressOf);
-  calloc.free(a3.addressOf);
-  calloc.free(a4.addressOf);
-  calloc.free(a5.addressOf);
-  calloc.free(a6.addressOf);
-  calloc.free(a7.addressOf);
-  calloc.free(a8.addressOf);
-  calloc.free(a9.addressOf);
+  calloc.free(a0Pointer);
+  calloc.free(a1Pointer);
+  calloc.free(a2Pointer);
+  calloc.free(a3Pointer);
+  calloc.free(a4Pointer);
+  calloc.free(a5Pointer);
+  calloc.free(a6Pointer);
+  calloc.free(a7Pointer);
+  calloc.free(a8Pointer);
+  calloc.free(a9Pointer);
 }
 
 final passStruct20BytesHomogeneousInt32x10 = ffiTestFunctions.lookupFunction<
@@ -2732,26 +2862,26 @@
 /// The amount of arguments exhausts the number of integer registers, such that
 /// pointers to copies are also passed on the stack.
 void testPassStruct20BytesHomogeneousInt32x10() {
-  Struct20BytesHomogeneousInt32 a0 =
-      calloc<Struct20BytesHomogeneousInt32>().ref;
-  Struct20BytesHomogeneousInt32 a1 =
-      calloc<Struct20BytesHomogeneousInt32>().ref;
-  Struct20BytesHomogeneousInt32 a2 =
-      calloc<Struct20BytesHomogeneousInt32>().ref;
-  Struct20BytesHomogeneousInt32 a3 =
-      calloc<Struct20BytesHomogeneousInt32>().ref;
-  Struct20BytesHomogeneousInt32 a4 =
-      calloc<Struct20BytesHomogeneousInt32>().ref;
-  Struct20BytesHomogeneousInt32 a5 =
-      calloc<Struct20BytesHomogeneousInt32>().ref;
-  Struct20BytesHomogeneousInt32 a6 =
-      calloc<Struct20BytesHomogeneousInt32>().ref;
-  Struct20BytesHomogeneousInt32 a7 =
-      calloc<Struct20BytesHomogeneousInt32>().ref;
-  Struct20BytesHomogeneousInt32 a8 =
-      calloc<Struct20BytesHomogeneousInt32>().ref;
-  Struct20BytesHomogeneousInt32 a9 =
-      calloc<Struct20BytesHomogeneousInt32>().ref;
+  final a0Pointer = calloc<Struct20BytesHomogeneousInt32>();
+  final Struct20BytesHomogeneousInt32 a0 = a0Pointer.ref;
+  final a1Pointer = calloc<Struct20BytesHomogeneousInt32>();
+  final Struct20BytesHomogeneousInt32 a1 = a1Pointer.ref;
+  final a2Pointer = calloc<Struct20BytesHomogeneousInt32>();
+  final Struct20BytesHomogeneousInt32 a2 = a2Pointer.ref;
+  final a3Pointer = calloc<Struct20BytesHomogeneousInt32>();
+  final Struct20BytesHomogeneousInt32 a3 = a3Pointer.ref;
+  final a4Pointer = calloc<Struct20BytesHomogeneousInt32>();
+  final Struct20BytesHomogeneousInt32 a4 = a4Pointer.ref;
+  final a5Pointer = calloc<Struct20BytesHomogeneousInt32>();
+  final Struct20BytesHomogeneousInt32 a5 = a5Pointer.ref;
+  final a6Pointer = calloc<Struct20BytesHomogeneousInt32>();
+  final Struct20BytesHomogeneousInt32 a6 = a6Pointer.ref;
+  final a7Pointer = calloc<Struct20BytesHomogeneousInt32>();
+  final Struct20BytesHomogeneousInt32 a7 = a7Pointer.ref;
+  final a8Pointer = calloc<Struct20BytesHomogeneousInt32>();
+  final Struct20BytesHomogeneousInt32 a8 = a8Pointer.ref;
+  final a9Pointer = calloc<Struct20BytesHomogeneousInt32>();
+  final Struct20BytesHomogeneousInt32 a9 = a9Pointer.ref;
 
   a0.a0 = -1;
   a0.a1 = 2;
@@ -2811,16 +2941,16 @@
 
   Expect.equals(25, result);
 
-  calloc.free(a0.addressOf);
-  calloc.free(a1.addressOf);
-  calloc.free(a2.addressOf);
-  calloc.free(a3.addressOf);
-  calloc.free(a4.addressOf);
-  calloc.free(a5.addressOf);
-  calloc.free(a6.addressOf);
-  calloc.free(a7.addressOf);
-  calloc.free(a8.addressOf);
-  calloc.free(a9.addressOf);
+  calloc.free(a0Pointer);
+  calloc.free(a1Pointer);
+  calloc.free(a2Pointer);
+  calloc.free(a3Pointer);
+  calloc.free(a4Pointer);
+  calloc.free(a5Pointer);
+  calloc.free(a6Pointer);
+  calloc.free(a7Pointer);
+  calloc.free(a8Pointer);
+  calloc.free(a9Pointer);
 }
 
 final passStruct20BytesHomogeneousFloat = ffiTestFunctions.lookupFunction<
@@ -2830,8 +2960,8 @@
 
 /// Argument too big to go into FPU registers in hardfp and arm64.
 void testPassStruct20BytesHomogeneousFloat() {
-  Struct20BytesHomogeneousFloat a0 =
-      calloc<Struct20BytesHomogeneousFloat>().ref;
+  final a0Pointer = calloc<Struct20BytesHomogeneousFloat>();
+  final Struct20BytesHomogeneousFloat a0 = a0Pointer.ref;
 
   a0.a0 = -1.0;
   a0.a1 = 2.0;
@@ -2845,7 +2975,7 @@
 
   Expect.approxEquals(-3.0, result);
 
-  calloc.free(a0.addressOf);
+  calloc.free(a0Pointer);
 }
 
 final passStruct32BytesHomogeneousDoublex5 = ffiTestFunctions.lookupFunction<
@@ -2866,16 +2996,16 @@
 /// Arguments in FPU registers on arm64.
 /// 5 struct arguments will exhaust available registers.
 void testPassStruct32BytesHomogeneousDoublex5() {
-  Struct32BytesHomogeneousDouble a0 =
-      calloc<Struct32BytesHomogeneousDouble>().ref;
-  Struct32BytesHomogeneousDouble a1 =
-      calloc<Struct32BytesHomogeneousDouble>().ref;
-  Struct32BytesHomogeneousDouble a2 =
-      calloc<Struct32BytesHomogeneousDouble>().ref;
-  Struct32BytesHomogeneousDouble a3 =
-      calloc<Struct32BytesHomogeneousDouble>().ref;
-  Struct32BytesHomogeneousDouble a4 =
-      calloc<Struct32BytesHomogeneousDouble>().ref;
+  final a0Pointer = calloc<Struct32BytesHomogeneousDouble>();
+  final Struct32BytesHomogeneousDouble a0 = a0Pointer.ref;
+  final a1Pointer = calloc<Struct32BytesHomogeneousDouble>();
+  final Struct32BytesHomogeneousDouble a1 = a1Pointer.ref;
+  final a2Pointer = calloc<Struct32BytesHomogeneousDouble>();
+  final Struct32BytesHomogeneousDouble a2 = a2Pointer.ref;
+  final a3Pointer = calloc<Struct32BytesHomogeneousDouble>();
+  final Struct32BytesHomogeneousDouble a3 = a3Pointer.ref;
+  final a4Pointer = calloc<Struct32BytesHomogeneousDouble>();
+  final Struct32BytesHomogeneousDouble a4 = a4Pointer.ref;
 
   a0.a0 = -1.0;
   a0.a1 = 2.0;
@@ -2904,11 +3034,11 @@
 
   Expect.approxEquals(10.0, result);
 
-  calloc.free(a0.addressOf);
-  calloc.free(a1.addressOf);
-  calloc.free(a2.addressOf);
-  calloc.free(a3.addressOf);
-  calloc.free(a4.addressOf);
+  calloc.free(a0Pointer);
+  calloc.free(a1Pointer);
+  calloc.free(a2Pointer);
+  calloc.free(a3Pointer);
+  calloc.free(a4Pointer);
 }
 
 final passStruct40BytesHomogeneousDouble = ffiTestFunctions.lookupFunction<
@@ -2918,8 +3048,8 @@
 
 /// Argument too big to go into FPU registers in arm64.
 void testPassStruct40BytesHomogeneousDouble() {
-  Struct40BytesHomogeneousDouble a0 =
-      calloc<Struct40BytesHomogeneousDouble>().ref;
+  final a0Pointer = calloc<Struct40BytesHomogeneousDouble>();
+  final Struct40BytesHomogeneousDouble a0 = a0Pointer.ref;
 
   a0.a0 = -1.0;
   a0.a1 = 2.0;
@@ -2933,7 +3063,7 @@
 
   Expect.approxEquals(-3.0, result);
 
-  calloc.free(a0.addressOf);
+  calloc.free(a0Pointer);
 }
 
 final passStruct1024BytesHomogeneousUint64 = ffiTestFunctions.lookupFunction<
@@ -2943,8 +3073,8 @@
 
 /// Test 1kb struct.
 void testPassStruct1024BytesHomogeneousUint64() {
-  Struct1024BytesHomogeneousUint64 a0 =
-      calloc<Struct1024BytesHomogeneousUint64>().ref;
+  final a0Pointer = calloc<Struct1024BytesHomogeneousUint64>();
+  final Struct1024BytesHomogeneousUint64 a0 = a0Pointer.ref;
 
   a0.a0 = 1;
   a0.a1 = 2;
@@ -3081,7 +3211,7 @@
 
   Expect.equals(8256, result);
 
-  calloc.free(a0.addressOf);
+  calloc.free(a0Pointer);
 }
 
 final passFloatStruct16BytesHomogeneousFloatFloatStruct1 =
@@ -3110,17 +3240,17 @@
 /// Tests the alignment of structs in FPU registers and backfilling.
 void testPassFloatStruct16BytesHomogeneousFloatFloatStruct1() {
   double a0;
-  Struct16BytesHomogeneousFloat a1 =
-      calloc<Struct16BytesHomogeneousFloat>().ref;
+  final a1Pointer = calloc<Struct16BytesHomogeneousFloat>();
+  final Struct16BytesHomogeneousFloat a1 = a1Pointer.ref;
   double a2;
-  Struct16BytesHomogeneousFloat a3 =
-      calloc<Struct16BytesHomogeneousFloat>().ref;
+  final a3Pointer = calloc<Struct16BytesHomogeneousFloat>();
+  final Struct16BytesHomogeneousFloat a3 = a3Pointer.ref;
   double a4;
-  Struct16BytesHomogeneousFloat a5 =
-      calloc<Struct16BytesHomogeneousFloat>().ref;
+  final a5Pointer = calloc<Struct16BytesHomogeneousFloat>();
+  final Struct16BytesHomogeneousFloat a5 = a5Pointer.ref;
   double a6;
-  Struct16BytesHomogeneousFloat a7 =
-      calloc<Struct16BytesHomogeneousFloat>().ref;
+  final a7Pointer = calloc<Struct16BytesHomogeneousFloat>();
+  final Struct16BytesHomogeneousFloat a7 = a7Pointer.ref;
   double a8;
 
   a0 = -1.0;
@@ -3152,10 +3282,10 @@
 
   Expect.approxEquals(-11.0, result);
 
-  calloc.free(a1.addressOf);
-  calloc.free(a3.addressOf);
-  calloc.free(a5.addressOf);
-  calloc.free(a7.addressOf);
+  calloc.free(a1Pointer);
+  calloc.free(a3Pointer);
+  calloc.free(a5Pointer);
+  calloc.free(a7Pointer);
 }
 
 final passFloatStruct32BytesHomogeneousDoubleFloatStruct =
@@ -3184,17 +3314,17 @@
 /// Tests the alignment of structs in FPU registers and backfilling.
 void testPassFloatStruct32BytesHomogeneousDoubleFloatStruct() {
   double a0;
-  Struct32BytesHomogeneousDouble a1 =
-      calloc<Struct32BytesHomogeneousDouble>().ref;
+  final a1Pointer = calloc<Struct32BytesHomogeneousDouble>();
+  final Struct32BytesHomogeneousDouble a1 = a1Pointer.ref;
   double a2;
-  Struct32BytesHomogeneousDouble a3 =
-      calloc<Struct32BytesHomogeneousDouble>().ref;
+  final a3Pointer = calloc<Struct32BytesHomogeneousDouble>();
+  final Struct32BytesHomogeneousDouble a3 = a3Pointer.ref;
   double a4;
-  Struct32BytesHomogeneousDouble a5 =
-      calloc<Struct32BytesHomogeneousDouble>().ref;
+  final a5Pointer = calloc<Struct32BytesHomogeneousDouble>();
+  final Struct32BytesHomogeneousDouble a5 = a5Pointer.ref;
   double a6;
-  Struct32BytesHomogeneousDouble a7 =
-      calloc<Struct32BytesHomogeneousDouble>().ref;
+  final a7Pointer = calloc<Struct32BytesHomogeneousDouble>();
+  final Struct32BytesHomogeneousDouble a7 = a7Pointer.ref;
   double a8;
 
   a0 = -1.0;
@@ -3226,10 +3356,10 @@
 
   Expect.approxEquals(-11.0, result);
 
-  calloc.free(a1.addressOf);
-  calloc.free(a3.addressOf);
-  calloc.free(a5.addressOf);
-  calloc.free(a7.addressOf);
+  calloc.free(a1Pointer);
+  calloc.free(a3Pointer);
+  calloc.free(a5Pointer);
+  calloc.free(a7Pointer);
 }
 
 final passInt8Struct16BytesMixedInt8Struct16BytesMixedIn =
@@ -3254,13 +3384,17 @@
 /// Test backfilling of integer registers.
 void testPassInt8Struct16BytesMixedInt8Struct16BytesMixedIn() {
   int a0;
-  Struct16BytesMixed a1 = calloc<Struct16BytesMixed>().ref;
+  final a1Pointer = calloc<Struct16BytesMixed>();
+  final Struct16BytesMixed a1 = a1Pointer.ref;
   int a2;
-  Struct16BytesMixed a3 = calloc<Struct16BytesMixed>().ref;
+  final a3Pointer = calloc<Struct16BytesMixed>();
+  final Struct16BytesMixed a3 = a3Pointer.ref;
   int a4;
-  Struct16BytesMixed a5 = calloc<Struct16BytesMixed>().ref;
+  final a5Pointer = calloc<Struct16BytesMixed>();
+  final Struct16BytesMixed a5 = a5Pointer.ref;
   int a6;
-  Struct16BytesMixed a7 = calloc<Struct16BytesMixed>().ref;
+  final a7Pointer = calloc<Struct16BytesMixed>();
+  final Struct16BytesMixed a7 = a7Pointer.ref;
   int a8;
 
   a0 = -1;
@@ -3284,10 +3418,10 @@
 
   Expect.approxEquals(-7.0, result);
 
-  calloc.free(a1.addressOf);
-  calloc.free(a3.addressOf);
-  calloc.free(a5.addressOf);
-  calloc.free(a7.addressOf);
+  calloc.free(a1Pointer);
+  calloc.free(a3Pointer);
+  calloc.free(a5Pointer);
+  calloc.free(a7Pointer);
 }
 
 final passDoublex6Struct16BytesMixedx4Int32 = ffiTestFunctions.lookupFunction<
@@ -3326,10 +3460,14 @@
   double a3;
   double a4;
   double a5;
-  Struct16BytesMixed a6 = calloc<Struct16BytesMixed>().ref;
-  Struct16BytesMixed a7 = calloc<Struct16BytesMixed>().ref;
-  Struct16BytesMixed a8 = calloc<Struct16BytesMixed>().ref;
-  Struct16BytesMixed a9 = calloc<Struct16BytesMixed>().ref;
+  final a6Pointer = calloc<Struct16BytesMixed>();
+  final Struct16BytesMixed a6 = a6Pointer.ref;
+  final a7Pointer = calloc<Struct16BytesMixed>();
+  final Struct16BytesMixed a7 = a7Pointer.ref;
+  final a8Pointer = calloc<Struct16BytesMixed>();
+  final Struct16BytesMixed a8 = a8Pointer.ref;
+  final a9Pointer = calloc<Struct16BytesMixed>();
+  final Struct16BytesMixed a9 = a9Pointer.ref;
   int a10;
 
   a0 = -1.0;
@@ -3355,10 +3493,10 @@
 
   Expect.approxEquals(-8.0, result);
 
-  calloc.free(a6.addressOf);
-  calloc.free(a7.addressOf);
-  calloc.free(a8.addressOf);
-  calloc.free(a9.addressOf);
+  calloc.free(a6Pointer);
+  calloc.free(a7Pointer);
+  calloc.free(a8Pointer);
+  calloc.free(a9Pointer);
 }
 
 final passInt32x4Struct16BytesMixedx4Double = ffiTestFunctions.lookupFunction<
@@ -3383,10 +3521,14 @@
   int a1;
   int a2;
   int a3;
-  Struct16BytesMixed a4 = calloc<Struct16BytesMixed>().ref;
-  Struct16BytesMixed a5 = calloc<Struct16BytesMixed>().ref;
-  Struct16BytesMixed a6 = calloc<Struct16BytesMixed>().ref;
-  Struct16BytesMixed a7 = calloc<Struct16BytesMixed>().ref;
+  final a4Pointer = calloc<Struct16BytesMixed>();
+  final Struct16BytesMixed a4 = a4Pointer.ref;
+  final a5Pointer = calloc<Struct16BytesMixed>();
+  final Struct16BytesMixed a5 = a5Pointer.ref;
+  final a6Pointer = calloc<Struct16BytesMixed>();
+  final Struct16BytesMixed a6 = a6Pointer.ref;
+  final a7Pointer = calloc<Struct16BytesMixed>();
+  final Struct16BytesMixed a7 = a7Pointer.ref;
   double a8;
 
   a0 = -1;
@@ -3410,10 +3552,10 @@
 
   Expect.approxEquals(-7.0, result);
 
-  calloc.free(a4.addressOf);
-  calloc.free(a5.addressOf);
-  calloc.free(a6.addressOf);
-  calloc.free(a7.addressOf);
+  calloc.free(a4Pointer);
+  calloc.free(a5Pointer);
+  calloc.free(a6Pointer);
+  calloc.free(a7Pointer);
 }
 
 final passStruct40BytesHomogeneousDoubleStruct4BytesHomo =
@@ -3427,10 +3569,12 @@
 /// On various architectures, first struct is allocated on stack.
 /// Check that the other two arguments are allocated on registers.
 void testPassStruct40BytesHomogeneousDoubleStruct4BytesHomo() {
-  Struct40BytesHomogeneousDouble a0 =
-      calloc<Struct40BytesHomogeneousDouble>().ref;
-  Struct4BytesHomogeneousInt16 a1 = calloc<Struct4BytesHomogeneousInt16>().ref;
-  Struct8BytesHomogeneousFloat a2 = calloc<Struct8BytesHomogeneousFloat>().ref;
+  final a0Pointer = calloc<Struct40BytesHomogeneousDouble>();
+  final Struct40BytesHomogeneousDouble a0 = a0Pointer.ref;
+  final a1Pointer = calloc<Struct4BytesHomogeneousInt16>();
+  final Struct4BytesHomogeneousInt16 a1 = a1Pointer.ref;
+  final a2Pointer = calloc<Struct8BytesHomogeneousFloat>();
+  final Struct8BytesHomogeneousFloat a2 = a2Pointer.ref;
 
   a0.a0 = -1.0;
   a0.a1 = 2.0;
@@ -3448,9 +3592,9 @@
 
   Expect.approxEquals(-5.0, result);
 
-  calloc.free(a0.addressOf);
-  calloc.free(a1.addressOf);
-  calloc.free(a2.addressOf);
+  calloc.free(a0Pointer);
+  calloc.free(a1Pointer);
+  calloc.free(a2Pointer);
 }
 
 final passInt32x8Doublex8Int64Int8Struct1ByteIntInt64Int =
@@ -3558,28 +3702,36 @@
   double a15;
   int a16;
   int a17;
-  Struct1ByteInt a18 = calloc<Struct1ByteInt>().ref;
+  final a18Pointer = calloc<Struct1ByteInt>();
+  final Struct1ByteInt a18 = a18Pointer.ref;
   int a19;
   int a20;
-  Struct4BytesHomogeneousInt16 a21 = calloc<Struct4BytesHomogeneousInt16>().ref;
+  final a21Pointer = calloc<Struct4BytesHomogeneousInt16>();
+  final Struct4BytesHomogeneousInt16 a21 = a21Pointer.ref;
   int a22;
   int a23;
-  Struct8BytesInt a24 = calloc<Struct8BytesInt>().ref;
+  final a24Pointer = calloc<Struct8BytesInt>();
+  final Struct8BytesInt a24 = a24Pointer.ref;
   int a25;
   int a26;
-  Struct8BytesHomogeneousFloat a27 = calloc<Struct8BytesHomogeneousFloat>().ref;
+  final a27Pointer = calloc<Struct8BytesHomogeneousFloat>();
+  final Struct8BytesHomogeneousFloat a27 = a27Pointer.ref;
   int a28;
   int a29;
-  Struct8BytesMixed a30 = calloc<Struct8BytesMixed>().ref;
+  final a30Pointer = calloc<Struct8BytesMixed>();
+  final Struct8BytesMixed a30 = a30Pointer.ref;
   int a31;
   int a32;
-  StructAlignmentInt16 a33 = calloc<StructAlignmentInt16>().ref;
+  final a33Pointer = calloc<StructAlignmentInt16>();
+  final StructAlignmentInt16 a33 = a33Pointer.ref;
   int a34;
   int a35;
-  StructAlignmentInt32 a36 = calloc<StructAlignmentInt32>().ref;
+  final a36Pointer = calloc<StructAlignmentInt32>();
+  final StructAlignmentInt32 a36 = a36Pointer.ref;
   int a37;
   int a38;
-  StructAlignmentInt64 a39 = calloc<StructAlignmentInt64>().ref;
+  final a39Pointer = calloc<StructAlignmentInt64>();
+  final StructAlignmentInt64 a39 = a39Pointer.ref;
 
   a0 = -1;
   a1 = 2;
@@ -3680,14 +3832,14 @@
 
   Expect.approxEquals(26.0, result);
 
-  calloc.free(a18.addressOf);
-  calloc.free(a21.addressOf);
-  calloc.free(a24.addressOf);
-  calloc.free(a27.addressOf);
-  calloc.free(a30.addressOf);
-  calloc.free(a33.addressOf);
-  calloc.free(a36.addressOf);
-  calloc.free(a39.addressOf);
+  calloc.free(a18Pointer);
+  calloc.free(a21Pointer);
+  calloc.free(a24Pointer);
+  calloc.free(a27Pointer);
+  calloc.free(a30Pointer);
+  calloc.free(a33Pointer);
+  calloc.free(a36Pointer);
+  calloc.free(a39Pointer);
 }
 
 final passStructAlignmentInt16 = ffiTestFunctions.lookupFunction<
@@ -3696,7 +3848,8 @@
 
 /// Test alignment and padding of 16 byte int within struct.
 void testPassStructAlignmentInt16() {
-  StructAlignmentInt16 a0 = calloc<StructAlignmentInt16>().ref;
+  final a0Pointer = calloc<StructAlignmentInt16>();
+  final StructAlignmentInt16 a0 = a0Pointer.ref;
 
   a0.a0 = -1;
   a0.a1 = 2;
@@ -3708,7 +3861,7 @@
 
   Expect.equals(-2, result);
 
-  calloc.free(a0.addressOf);
+  calloc.free(a0Pointer);
 }
 
 final passStructAlignmentInt32 = ffiTestFunctions.lookupFunction<
@@ -3717,7 +3870,8 @@
 
 /// Test alignment and padding of 32 byte int within struct.
 void testPassStructAlignmentInt32() {
-  StructAlignmentInt32 a0 = calloc<StructAlignmentInt32>().ref;
+  final a0Pointer = calloc<StructAlignmentInt32>();
+  final StructAlignmentInt32 a0 = a0Pointer.ref;
 
   a0.a0 = -1;
   a0.a1 = 2;
@@ -3729,7 +3883,7 @@
 
   Expect.equals(-2, result);
 
-  calloc.free(a0.addressOf);
+  calloc.free(a0Pointer);
 }
 
 final passStructAlignmentInt64 = ffiTestFunctions.lookupFunction<
@@ -3738,7 +3892,8 @@
 
 /// Test alignment and padding of 64 byte int within struct.
 void testPassStructAlignmentInt64() {
-  StructAlignmentInt64 a0 = calloc<StructAlignmentInt64>().ref;
+  final a0Pointer = calloc<StructAlignmentInt64>();
+  final StructAlignmentInt64 a0 = a0Pointer.ref;
 
   a0.a0 = -1;
   a0.a1 = 2;
@@ -3750,7 +3905,7 @@
 
   Expect.equals(-2, result);
 
-  calloc.free(a0.addressOf);
+  calloc.free(a0Pointer);
 }
 
 final passStruct8BytesNestedIntx10 = ffiTestFunctions.lookupFunction<
@@ -3780,16 +3935,26 @@
 /// Simple nested struct. No alignment gaps on any architectures.
 /// 10 arguments exhaust registers on all platforms.
 void testPassStruct8BytesNestedIntx10() {
-  Struct8BytesNestedInt a0 = calloc<Struct8BytesNestedInt>().ref;
-  Struct8BytesNestedInt a1 = calloc<Struct8BytesNestedInt>().ref;
-  Struct8BytesNestedInt a2 = calloc<Struct8BytesNestedInt>().ref;
-  Struct8BytesNestedInt a3 = calloc<Struct8BytesNestedInt>().ref;
-  Struct8BytesNestedInt a4 = calloc<Struct8BytesNestedInt>().ref;
-  Struct8BytesNestedInt a5 = calloc<Struct8BytesNestedInt>().ref;
-  Struct8BytesNestedInt a6 = calloc<Struct8BytesNestedInt>().ref;
-  Struct8BytesNestedInt a7 = calloc<Struct8BytesNestedInt>().ref;
-  Struct8BytesNestedInt a8 = calloc<Struct8BytesNestedInt>().ref;
-  Struct8BytesNestedInt a9 = calloc<Struct8BytesNestedInt>().ref;
+  final a0Pointer = calloc<Struct8BytesNestedInt>();
+  final Struct8BytesNestedInt a0 = a0Pointer.ref;
+  final a1Pointer = calloc<Struct8BytesNestedInt>();
+  final Struct8BytesNestedInt a1 = a1Pointer.ref;
+  final a2Pointer = calloc<Struct8BytesNestedInt>();
+  final Struct8BytesNestedInt a2 = a2Pointer.ref;
+  final a3Pointer = calloc<Struct8BytesNestedInt>();
+  final Struct8BytesNestedInt a3 = a3Pointer.ref;
+  final a4Pointer = calloc<Struct8BytesNestedInt>();
+  final Struct8BytesNestedInt a4 = a4Pointer.ref;
+  final a5Pointer = calloc<Struct8BytesNestedInt>();
+  final Struct8BytesNestedInt a5 = a5Pointer.ref;
+  final a6Pointer = calloc<Struct8BytesNestedInt>();
+  final Struct8BytesNestedInt a6 = a6Pointer.ref;
+  final a7Pointer = calloc<Struct8BytesNestedInt>();
+  final Struct8BytesNestedInt a7 = a7Pointer.ref;
+  final a8Pointer = calloc<Struct8BytesNestedInt>();
+  final Struct8BytesNestedInt a8 = a8Pointer.ref;
+  final a9Pointer = calloc<Struct8BytesNestedInt>();
+  final Struct8BytesNestedInt a9 = a9Pointer.ref;
 
   a0.a0.a0 = -1;
   a0.a0.a1 = 2;
@@ -3839,16 +4004,16 @@
 
   Expect.equals(20, result);
 
-  calloc.free(a0.addressOf);
-  calloc.free(a1.addressOf);
-  calloc.free(a2.addressOf);
-  calloc.free(a3.addressOf);
-  calloc.free(a4.addressOf);
-  calloc.free(a5.addressOf);
-  calloc.free(a6.addressOf);
-  calloc.free(a7.addressOf);
-  calloc.free(a8.addressOf);
-  calloc.free(a9.addressOf);
+  calloc.free(a0Pointer);
+  calloc.free(a1Pointer);
+  calloc.free(a2Pointer);
+  calloc.free(a3Pointer);
+  calloc.free(a4Pointer);
+  calloc.free(a5Pointer);
+  calloc.free(a6Pointer);
+  calloc.free(a7Pointer);
+  calloc.free(a8Pointer);
+  calloc.free(a9Pointer);
 }
 
 final passStruct8BytesNestedFloatx10 = ffiTestFunctions.lookupFunction<
@@ -3878,16 +4043,26 @@
 /// Simple nested struct. No alignment gaps on any architectures.
 /// 10 arguments exhaust fpu registers on all platforms.
 void testPassStruct8BytesNestedFloatx10() {
-  Struct8BytesNestedFloat a0 = calloc<Struct8BytesNestedFloat>().ref;
-  Struct8BytesNestedFloat a1 = calloc<Struct8BytesNestedFloat>().ref;
-  Struct8BytesNestedFloat a2 = calloc<Struct8BytesNestedFloat>().ref;
-  Struct8BytesNestedFloat a3 = calloc<Struct8BytesNestedFloat>().ref;
-  Struct8BytesNestedFloat a4 = calloc<Struct8BytesNestedFloat>().ref;
-  Struct8BytesNestedFloat a5 = calloc<Struct8BytesNestedFloat>().ref;
-  Struct8BytesNestedFloat a6 = calloc<Struct8BytesNestedFloat>().ref;
-  Struct8BytesNestedFloat a7 = calloc<Struct8BytesNestedFloat>().ref;
-  Struct8BytesNestedFloat a8 = calloc<Struct8BytesNestedFloat>().ref;
-  Struct8BytesNestedFloat a9 = calloc<Struct8BytesNestedFloat>().ref;
+  final a0Pointer = calloc<Struct8BytesNestedFloat>();
+  final Struct8BytesNestedFloat a0 = a0Pointer.ref;
+  final a1Pointer = calloc<Struct8BytesNestedFloat>();
+  final Struct8BytesNestedFloat a1 = a1Pointer.ref;
+  final a2Pointer = calloc<Struct8BytesNestedFloat>();
+  final Struct8BytesNestedFloat a2 = a2Pointer.ref;
+  final a3Pointer = calloc<Struct8BytesNestedFloat>();
+  final Struct8BytesNestedFloat a3 = a3Pointer.ref;
+  final a4Pointer = calloc<Struct8BytesNestedFloat>();
+  final Struct8BytesNestedFloat a4 = a4Pointer.ref;
+  final a5Pointer = calloc<Struct8BytesNestedFloat>();
+  final Struct8BytesNestedFloat a5 = a5Pointer.ref;
+  final a6Pointer = calloc<Struct8BytesNestedFloat>();
+  final Struct8BytesNestedFloat a6 = a6Pointer.ref;
+  final a7Pointer = calloc<Struct8BytesNestedFloat>();
+  final Struct8BytesNestedFloat a7 = a7Pointer.ref;
+  final a8Pointer = calloc<Struct8BytesNestedFloat>();
+  final Struct8BytesNestedFloat a8 = a8Pointer.ref;
+  final a9Pointer = calloc<Struct8BytesNestedFloat>();
+  final Struct8BytesNestedFloat a9 = a9Pointer.ref;
 
   a0.a0.a0 = -1.0;
   a0.a1.a0 = 2.0;
@@ -3917,16 +4092,16 @@
 
   Expect.approxEquals(10.0, result);
 
-  calloc.free(a0.addressOf);
-  calloc.free(a1.addressOf);
-  calloc.free(a2.addressOf);
-  calloc.free(a3.addressOf);
-  calloc.free(a4.addressOf);
-  calloc.free(a5.addressOf);
-  calloc.free(a6.addressOf);
-  calloc.free(a7.addressOf);
-  calloc.free(a8.addressOf);
-  calloc.free(a9.addressOf);
+  calloc.free(a0Pointer);
+  calloc.free(a1Pointer);
+  calloc.free(a2Pointer);
+  calloc.free(a3Pointer);
+  calloc.free(a4Pointer);
+  calloc.free(a5Pointer);
+  calloc.free(a6Pointer);
+  calloc.free(a7Pointer);
+  calloc.free(a8Pointer);
+  calloc.free(a9Pointer);
 }
 
 final passStruct8BytesNestedFloat2x10 = ffiTestFunctions.lookupFunction<
@@ -3958,16 +4133,26 @@
 /// The nesting is irregular, testing homogenous float rules on arm and arm64,
 /// and the fpu register usage on x64.
 void testPassStruct8BytesNestedFloat2x10() {
-  Struct8BytesNestedFloat2 a0 = calloc<Struct8BytesNestedFloat2>().ref;
-  Struct8BytesNestedFloat2 a1 = calloc<Struct8BytesNestedFloat2>().ref;
-  Struct8BytesNestedFloat2 a2 = calloc<Struct8BytesNestedFloat2>().ref;
-  Struct8BytesNestedFloat2 a3 = calloc<Struct8BytesNestedFloat2>().ref;
-  Struct8BytesNestedFloat2 a4 = calloc<Struct8BytesNestedFloat2>().ref;
-  Struct8BytesNestedFloat2 a5 = calloc<Struct8BytesNestedFloat2>().ref;
-  Struct8BytesNestedFloat2 a6 = calloc<Struct8BytesNestedFloat2>().ref;
-  Struct8BytesNestedFloat2 a7 = calloc<Struct8BytesNestedFloat2>().ref;
-  Struct8BytesNestedFloat2 a8 = calloc<Struct8BytesNestedFloat2>().ref;
-  Struct8BytesNestedFloat2 a9 = calloc<Struct8BytesNestedFloat2>().ref;
+  final a0Pointer = calloc<Struct8BytesNestedFloat2>();
+  final Struct8BytesNestedFloat2 a0 = a0Pointer.ref;
+  final a1Pointer = calloc<Struct8BytesNestedFloat2>();
+  final Struct8BytesNestedFloat2 a1 = a1Pointer.ref;
+  final a2Pointer = calloc<Struct8BytesNestedFloat2>();
+  final Struct8BytesNestedFloat2 a2 = a2Pointer.ref;
+  final a3Pointer = calloc<Struct8BytesNestedFloat2>();
+  final Struct8BytesNestedFloat2 a3 = a3Pointer.ref;
+  final a4Pointer = calloc<Struct8BytesNestedFloat2>();
+  final Struct8BytesNestedFloat2 a4 = a4Pointer.ref;
+  final a5Pointer = calloc<Struct8BytesNestedFloat2>();
+  final Struct8BytesNestedFloat2 a5 = a5Pointer.ref;
+  final a6Pointer = calloc<Struct8BytesNestedFloat2>();
+  final Struct8BytesNestedFloat2 a6 = a6Pointer.ref;
+  final a7Pointer = calloc<Struct8BytesNestedFloat2>();
+  final Struct8BytesNestedFloat2 a7 = a7Pointer.ref;
+  final a8Pointer = calloc<Struct8BytesNestedFloat2>();
+  final Struct8BytesNestedFloat2 a8 = a8Pointer.ref;
+  final a9Pointer = calloc<Struct8BytesNestedFloat2>();
+  final Struct8BytesNestedFloat2 a9 = a9Pointer.ref;
 
   a0.a0.a0 = -1.0;
   a0.a1 = 2.0;
@@ -3997,16 +4182,16 @@
 
   Expect.approxEquals(10.0, result);
 
-  calloc.free(a0.addressOf);
-  calloc.free(a1.addressOf);
-  calloc.free(a2.addressOf);
-  calloc.free(a3.addressOf);
-  calloc.free(a4.addressOf);
-  calloc.free(a5.addressOf);
-  calloc.free(a6.addressOf);
-  calloc.free(a7.addressOf);
-  calloc.free(a8.addressOf);
-  calloc.free(a9.addressOf);
+  calloc.free(a0Pointer);
+  calloc.free(a1Pointer);
+  calloc.free(a2Pointer);
+  calloc.free(a3Pointer);
+  calloc.free(a4Pointer);
+  calloc.free(a5Pointer);
+  calloc.free(a6Pointer);
+  calloc.free(a7Pointer);
+  calloc.free(a8Pointer);
+  calloc.free(a9Pointer);
 }
 
 final passStruct8BytesNestedMixedx10 = ffiTestFunctions.lookupFunction<
@@ -4036,16 +4221,26 @@
 /// Simple nested struct. No alignment gaps on any architectures.
 /// 10 arguments exhaust all registers on all platforms.
 void testPassStruct8BytesNestedMixedx10() {
-  Struct8BytesNestedMixed a0 = calloc<Struct8BytesNestedMixed>().ref;
-  Struct8BytesNestedMixed a1 = calloc<Struct8BytesNestedMixed>().ref;
-  Struct8BytesNestedMixed a2 = calloc<Struct8BytesNestedMixed>().ref;
-  Struct8BytesNestedMixed a3 = calloc<Struct8BytesNestedMixed>().ref;
-  Struct8BytesNestedMixed a4 = calloc<Struct8BytesNestedMixed>().ref;
-  Struct8BytesNestedMixed a5 = calloc<Struct8BytesNestedMixed>().ref;
-  Struct8BytesNestedMixed a6 = calloc<Struct8BytesNestedMixed>().ref;
-  Struct8BytesNestedMixed a7 = calloc<Struct8BytesNestedMixed>().ref;
-  Struct8BytesNestedMixed a8 = calloc<Struct8BytesNestedMixed>().ref;
-  Struct8BytesNestedMixed a9 = calloc<Struct8BytesNestedMixed>().ref;
+  final a0Pointer = calloc<Struct8BytesNestedMixed>();
+  final Struct8BytesNestedMixed a0 = a0Pointer.ref;
+  final a1Pointer = calloc<Struct8BytesNestedMixed>();
+  final Struct8BytesNestedMixed a1 = a1Pointer.ref;
+  final a2Pointer = calloc<Struct8BytesNestedMixed>();
+  final Struct8BytesNestedMixed a2 = a2Pointer.ref;
+  final a3Pointer = calloc<Struct8BytesNestedMixed>();
+  final Struct8BytesNestedMixed a3 = a3Pointer.ref;
+  final a4Pointer = calloc<Struct8BytesNestedMixed>();
+  final Struct8BytesNestedMixed a4 = a4Pointer.ref;
+  final a5Pointer = calloc<Struct8BytesNestedMixed>();
+  final Struct8BytesNestedMixed a5 = a5Pointer.ref;
+  final a6Pointer = calloc<Struct8BytesNestedMixed>();
+  final Struct8BytesNestedMixed a6 = a6Pointer.ref;
+  final a7Pointer = calloc<Struct8BytesNestedMixed>();
+  final Struct8BytesNestedMixed a7 = a7Pointer.ref;
+  final a8Pointer = calloc<Struct8BytesNestedMixed>();
+  final Struct8BytesNestedMixed a8 = a8Pointer.ref;
+  final a9Pointer = calloc<Struct8BytesNestedMixed>();
+  final Struct8BytesNestedMixed a9 = a9Pointer.ref;
 
   a0.a0.a0 = -1;
   a0.a0.a1 = 2;
@@ -4085,16 +4280,16 @@
 
   Expect.approxEquals(15.0, result);
 
-  calloc.free(a0.addressOf);
-  calloc.free(a1.addressOf);
-  calloc.free(a2.addressOf);
-  calloc.free(a3.addressOf);
-  calloc.free(a4.addressOf);
-  calloc.free(a5.addressOf);
-  calloc.free(a6.addressOf);
-  calloc.free(a7.addressOf);
-  calloc.free(a8.addressOf);
-  calloc.free(a9.addressOf);
+  calloc.free(a0Pointer);
+  calloc.free(a1Pointer);
+  calloc.free(a2Pointer);
+  calloc.free(a3Pointer);
+  calloc.free(a4Pointer);
+  calloc.free(a5Pointer);
+  calloc.free(a6Pointer);
+  calloc.free(a7Pointer);
+  calloc.free(a8Pointer);
+  calloc.free(a9Pointer);
 }
 
 final passStruct16BytesNestedIntx2 = ffiTestFunctions.lookupFunction<
@@ -4104,8 +4299,10 @@
 
 /// Deeper nested struct to test recursive member access.
 void testPassStruct16BytesNestedIntx2() {
-  Struct16BytesNestedInt a0 = calloc<Struct16BytesNestedInt>().ref;
-  Struct16BytesNestedInt a1 = calloc<Struct16BytesNestedInt>().ref;
+  final a0Pointer = calloc<Struct16BytesNestedInt>();
+  final Struct16BytesNestedInt a0 = a0Pointer.ref;
+  final a1Pointer = calloc<Struct16BytesNestedInt>();
+  final Struct16BytesNestedInt a1 = a1Pointer.ref;
 
   a0.a0.a0.a0 = -1;
   a0.a0.a0.a1 = 2;
@@ -4130,8 +4327,8 @@
 
   Expect.equals(8, result);
 
-  calloc.free(a0.addressOf);
-  calloc.free(a1.addressOf);
+  calloc.free(a0Pointer);
+  calloc.free(a1Pointer);
 }
 
 final passStruct32BytesNestedIntx2 = ffiTestFunctions.lookupFunction<
@@ -4141,8 +4338,10 @@
 
 /// Even deeper nested struct to test recursive member access.
 void testPassStruct32BytesNestedIntx2() {
-  Struct32BytesNestedInt a0 = calloc<Struct32BytesNestedInt>().ref;
-  Struct32BytesNestedInt a1 = calloc<Struct32BytesNestedInt>().ref;
+  final a0Pointer = calloc<Struct32BytesNestedInt>();
+  final Struct32BytesNestedInt a0 = a0Pointer.ref;
+  final a1Pointer = calloc<Struct32BytesNestedInt>();
+  final Struct32BytesNestedInt a1 = a1Pointer.ref;
 
   a0.a0.a0.a0.a0 = -1;
   a0.a0.a0.a0.a1 = 2;
@@ -4183,8 +4382,8 @@
 
   Expect.equals(16, result);
 
-  calloc.free(a0.addressOf);
-  calloc.free(a1.addressOf);
+  calloc.free(a0Pointer);
+  calloc.free(a1Pointer);
 }
 
 final passStructNestedIntStructAlignmentInt16 = ffiTestFunctions.lookupFunction<
@@ -4194,8 +4393,8 @@
 
 /// Test alignment and padding of nested struct with 16 byte int.
 void testPassStructNestedIntStructAlignmentInt16() {
-  StructNestedIntStructAlignmentInt16 a0 =
-      calloc<StructNestedIntStructAlignmentInt16>().ref;
+  final a0Pointer = calloc<StructNestedIntStructAlignmentInt16>();
+  final StructNestedIntStructAlignmentInt16 a0 = a0Pointer.ref;
 
   a0.a0.a0 = -1;
   a0.a0.a1 = 2;
@@ -4210,7 +4409,7 @@
 
   Expect.equals(3, result);
 
-  calloc.free(a0.addressOf);
+  calloc.free(a0Pointer);
 }
 
 final passStructNestedIntStructAlignmentInt32 = ffiTestFunctions.lookupFunction<
@@ -4220,8 +4419,8 @@
 
 /// Test alignment and padding of nested struct with 32 byte int.
 void testPassStructNestedIntStructAlignmentInt32() {
-  StructNestedIntStructAlignmentInt32 a0 =
-      calloc<StructNestedIntStructAlignmentInt32>().ref;
+  final a0Pointer = calloc<StructNestedIntStructAlignmentInt32>();
+  final StructNestedIntStructAlignmentInt32 a0 = a0Pointer.ref;
 
   a0.a0.a0 = -1;
   a0.a0.a1 = 2;
@@ -4236,7 +4435,7 @@
 
   Expect.equals(3, result);
 
-  calloc.free(a0.addressOf);
+  calloc.free(a0Pointer);
 }
 
 final passStructNestedIntStructAlignmentInt64 = ffiTestFunctions.lookupFunction<
@@ -4246,8 +4445,8 @@
 
 /// Test alignment and padding of nested struct with 64 byte int.
 void testPassStructNestedIntStructAlignmentInt64() {
-  StructNestedIntStructAlignmentInt64 a0 =
-      calloc<StructNestedIntStructAlignmentInt64>().ref;
+  final a0Pointer = calloc<StructNestedIntStructAlignmentInt64>();
+  final StructNestedIntStructAlignmentInt64 a0 = a0Pointer.ref;
 
   a0.a0.a0 = -1;
   a0.a0.a1 = 2;
@@ -4262,7 +4461,7 @@
 
   Expect.equals(3, result);
 
-  calloc.free(a0.addressOf);
+  calloc.free(a0Pointer);
 }
 
 final passStructNestedIrregularEvenBiggerx4 = ffiTestFunctions.lookupFunction<
@@ -4280,14 +4479,14 @@
 
 /// Return big irregular struct as smoke test.
 void testPassStructNestedIrregularEvenBiggerx4() {
-  StructNestedIrregularEvenBigger a0 =
-      calloc<StructNestedIrregularEvenBigger>().ref;
-  StructNestedIrregularEvenBigger a1 =
-      calloc<StructNestedIrregularEvenBigger>().ref;
-  StructNestedIrregularEvenBigger a2 =
-      calloc<StructNestedIrregularEvenBigger>().ref;
-  StructNestedIrregularEvenBigger a3 =
-      calloc<StructNestedIrregularEvenBigger>().ref;
+  final a0Pointer = calloc<StructNestedIrregularEvenBigger>();
+  final StructNestedIrregularEvenBigger a0 = a0Pointer.ref;
+  final a1Pointer = calloc<StructNestedIrregularEvenBigger>();
+  final StructNestedIrregularEvenBigger a1 = a1Pointer.ref;
+  final a2Pointer = calloc<StructNestedIrregularEvenBigger>();
+  final StructNestedIrregularEvenBigger a2 = a2Pointer.ref;
+  final a3Pointer = calloc<StructNestedIrregularEvenBigger>();
+  final StructNestedIrregularEvenBigger a3 = a3Pointer.ref;
 
   a0.a0 = 1;
   a0.a1.a0.a0 = 2;
@@ -4432,10 +4631,10 @@
 
   Expect.approxEquals(1572.0, result);
 
-  calloc.free(a0.addressOf);
-  calloc.free(a1.addressOf);
-  calloc.free(a2.addressOf);
-  calloc.free(a3.addressOf);
+  calloc.free(a0Pointer);
+  calloc.free(a1Pointer);
+  calloc.free(a2Pointer);
+  calloc.free(a3Pointer);
 }
 
 final returnStruct1ByteInt = ffiTestFunctions.lookupFunction<
@@ -5865,7 +6064,8 @@
 /// Especially for ffi callbacks.
 /// Struct is passed in int registers in most ABIs.
 void testReturnStructArgumentStruct1ByteInt() {
-  Struct1ByteInt a0 = calloc<Struct1ByteInt>().ref;
+  final a0Pointer = calloc<Struct1ByteInt>();
+  final Struct1ByteInt a0 = a0Pointer.ref;
 
   a0.a0 = -1;
 
@@ -5875,7 +6075,7 @@
 
   Expect.equals(a0.a0, result.a0);
 
-  calloc.free(a0.addressOf);
+  calloc.free(a0Pointer);
 }
 
 final returnStructArgumentInt32x8Struct1ByteInt =
@@ -5897,7 +6097,8 @@
   int a5;
   int a6;
   int a7;
-  Struct1ByteInt a8 = calloc<Struct1ByteInt>().ref;
+  final a8Pointer = calloc<Struct1ByteInt>();
+  final Struct1ByteInt a8 = a8Pointer.ref;
 
   a0 = -1;
   a1 = 2;
@@ -5916,7 +6117,7 @@
 
   Expect.equals(a8.a0, result.a0);
 
-  calloc.free(a8.addressOf);
+  calloc.free(a8Pointer);
 }
 
 final returnStructArgumentStruct8BytesHomogeneousFloat =
@@ -5930,7 +6131,8 @@
 /// Especially for ffi callbacks.
 /// Struct is passed in float registers in most ABIs.
 void testReturnStructArgumentStruct8BytesHomogeneousFloat() {
-  Struct8BytesHomogeneousFloat a0 = calloc<Struct8BytesHomogeneousFloat>().ref;
+  final a0Pointer = calloc<Struct8BytesHomogeneousFloat>();
+  final Struct8BytesHomogeneousFloat a0 = a0Pointer.ref;
 
   a0.a0 = -1.0;
   a0.a1 = 2.0;
@@ -5942,7 +6144,7 @@
   Expect.approxEquals(a0.a0, result.a0);
   Expect.approxEquals(a0.a1, result.a1);
 
-  calloc.free(a0.addressOf);
+  calloc.free(a0Pointer);
 }
 
 final returnStructArgumentStruct20BytesHomogeneousInt32 =
@@ -5956,8 +6158,8 @@
 
 /// On arm64, both argument and return value are passed in by pointer.
 void testReturnStructArgumentStruct20BytesHomogeneousInt32() {
-  Struct20BytesHomogeneousInt32 a0 =
-      calloc<Struct20BytesHomogeneousInt32>().ref;
+  final a0Pointer = calloc<Struct20BytesHomogeneousInt32>();
+  final Struct20BytesHomogeneousInt32 a0 = a0Pointer.ref;
 
   a0.a0 = -1;
   a0.a1 = 2;
@@ -5975,7 +6177,7 @@
   Expect.equals(a0.a3, result.a3);
   Expect.equals(a0.a4, result.a4);
 
-  calloc.free(a0.addressOf);
+  calloc.free(a0Pointer);
 }
 
 final returnStructArgumentInt32x8Struct20BytesHomogeneou =
@@ -5997,8 +6199,8 @@
   int a5;
   int a6;
   int a7;
-  Struct20BytesHomogeneousInt32 a8 =
-      calloc<Struct20BytesHomogeneousInt32>().ref;
+  final a8Pointer = calloc<Struct20BytesHomogeneousInt32>();
+  final Struct20BytesHomogeneousInt32 a8 = a8Pointer.ref;
 
   a0 = -1;
   a1 = 2;
@@ -6025,7 +6227,7 @@
   Expect.equals(a8.a3, result.a3);
   Expect.equals(a8.a4, result.a4);
 
-  calloc.free(a8.addressOf);
+  calloc.free(a8Pointer);
 }
 
 final returnStructAlignmentInt16 = ffiTestFunctions.lookupFunction<
@@ -6105,8 +6307,10 @@
 
 /// Simple nested struct.
 void testReturnStruct8BytesNestedInt() {
-  Struct4BytesHomogeneousInt16 a0 = calloc<Struct4BytesHomogeneousInt16>().ref;
-  Struct4BytesHomogeneousInt16 a1 = calloc<Struct4BytesHomogeneousInt16>().ref;
+  final a0Pointer = calloc<Struct4BytesHomogeneousInt16>();
+  final Struct4BytesHomogeneousInt16 a0 = a0Pointer.ref;
+  final a1Pointer = calloc<Struct4BytesHomogeneousInt16>();
+  final Struct4BytesHomogeneousInt16 a1 = a1Pointer.ref;
 
   a0.a0 = -1;
   a0.a1 = 2;
@@ -6122,8 +6326,8 @@
   Expect.equals(a1.a0, result.a1.a0);
   Expect.equals(a1.a1, result.a1.a1);
 
-  calloc.free(a0.addressOf);
-  calloc.free(a1.addressOf);
+  calloc.free(a0Pointer);
+  calloc.free(a1Pointer);
 }
 
 final returnStruct8BytesNestedFloat = ffiTestFunctions.lookupFunction<
@@ -6133,8 +6337,10 @@
 
 /// Simple nested struct with floats.
 void testReturnStruct8BytesNestedFloat() {
-  Struct4BytesFloat a0 = calloc<Struct4BytesFloat>().ref;
-  Struct4BytesFloat a1 = calloc<Struct4BytesFloat>().ref;
+  final a0Pointer = calloc<Struct4BytesFloat>();
+  final Struct4BytesFloat a0 = a0Pointer.ref;
+  final a1Pointer = calloc<Struct4BytesFloat>();
+  final Struct4BytesFloat a1 = a1Pointer.ref;
 
   a0.a0 = -1.0;
   a1.a0 = 2.0;
@@ -6146,8 +6352,8 @@
   Expect.approxEquals(a0.a0, result.a0.a0);
   Expect.approxEquals(a1.a0, result.a1.a0);
 
-  calloc.free(a0.addressOf);
-  calloc.free(a1.addressOf);
+  calloc.free(a0Pointer);
+  calloc.free(a1Pointer);
 }
 
 final returnStruct8BytesNestedFloat2 = ffiTestFunctions.lookupFunction<
@@ -6158,7 +6364,8 @@
 /// The nesting is irregular, testing homogenous float rules on arm and arm64,
 /// and the fpu register usage on x64.
 void testReturnStruct8BytesNestedFloat2() {
-  Struct4BytesFloat a0 = calloc<Struct4BytesFloat>().ref;
+  final a0Pointer = calloc<Struct4BytesFloat>();
+  final Struct4BytesFloat a0 = a0Pointer.ref;
   double a1;
 
   a0.a0 = -1.0;
@@ -6171,7 +6378,7 @@
   Expect.approxEquals(a0.a0, result.a0.a0);
   Expect.approxEquals(a1, result.a1);
 
-  calloc.free(a0.addressOf);
+  calloc.free(a0Pointer);
 }
 
 final returnStruct8BytesNestedMixed = ffiTestFunctions.lookupFunction<
@@ -6182,8 +6389,10 @@
 
 /// Simple nested struct with mixed members.
 void testReturnStruct8BytesNestedMixed() {
-  Struct4BytesHomogeneousInt16 a0 = calloc<Struct4BytesHomogeneousInt16>().ref;
-  Struct4BytesFloat a1 = calloc<Struct4BytesFloat>().ref;
+  final a0Pointer = calloc<Struct4BytesHomogeneousInt16>();
+  final Struct4BytesHomogeneousInt16 a0 = a0Pointer.ref;
+  final a1Pointer = calloc<Struct4BytesFloat>();
+  final Struct4BytesFloat a1 = a1Pointer.ref;
 
   a0.a0 = -1;
   a0.a1 = 2;
@@ -6197,8 +6406,8 @@
   Expect.equals(a0.a1, result.a0.a1);
   Expect.approxEquals(a1.a0, result.a1.a0);
 
-  calloc.free(a0.addressOf);
-  calloc.free(a1.addressOf);
+  calloc.free(a0Pointer);
+  calloc.free(a1Pointer);
 }
 
 final returnStruct16BytesNestedInt = ffiTestFunctions.lookupFunction<
@@ -6209,8 +6418,10 @@
 
 /// Deeper nested struct to test recursive member access.
 void testReturnStruct16BytesNestedInt() {
-  Struct8BytesNestedInt a0 = calloc<Struct8BytesNestedInt>().ref;
-  Struct8BytesNestedInt a1 = calloc<Struct8BytesNestedInt>().ref;
+  final a0Pointer = calloc<Struct8BytesNestedInt>();
+  final Struct8BytesNestedInt a0 = a0Pointer.ref;
+  final a1Pointer = calloc<Struct8BytesNestedInt>();
+  final Struct8BytesNestedInt a1 = a1Pointer.ref;
 
   a0.a0.a0 = -1;
   a0.a0.a1 = 2;
@@ -6234,8 +6445,8 @@
   Expect.equals(a1.a1.a0, result.a1.a1.a0);
   Expect.equals(a1.a1.a1, result.a1.a1.a1);
 
-  calloc.free(a0.addressOf);
-  calloc.free(a1.addressOf);
+  calloc.free(a0Pointer);
+  calloc.free(a1Pointer);
 }
 
 final returnStruct32BytesNestedInt = ffiTestFunctions.lookupFunction<
@@ -6246,8 +6457,10 @@
 
 /// Even deeper nested struct to test recursive member access.
 void testReturnStruct32BytesNestedInt() {
-  Struct16BytesNestedInt a0 = calloc<Struct16BytesNestedInt>().ref;
-  Struct16BytesNestedInt a1 = calloc<Struct16BytesNestedInt>().ref;
+  final a0Pointer = calloc<Struct16BytesNestedInt>();
+  final Struct16BytesNestedInt a0 = a0Pointer.ref;
+  final a1Pointer = calloc<Struct16BytesNestedInt>();
+  final Struct16BytesNestedInt a1 = a1Pointer.ref;
 
   a0.a0.a0.a0 = -1;
   a0.a0.a0.a1 = 2;
@@ -6287,8 +6500,8 @@
   Expect.equals(a1.a1.a1.a0, result.a1.a1.a1.a0);
   Expect.equals(a1.a1.a1.a1, result.a1.a1.a1.a1);
 
-  calloc.free(a0.addressOf);
-  calloc.free(a1.addressOf);
+  calloc.free(a0Pointer);
+  calloc.free(a1Pointer);
 }
 
 final returnStructNestedIntStructAlignmentInt16 =
@@ -6300,8 +6513,10 @@
 
 /// Test alignment and padding of nested struct with 16 byte int.
 void testReturnStructNestedIntStructAlignmentInt16() {
-  StructAlignmentInt16 a0 = calloc<StructAlignmentInt16>().ref;
-  StructAlignmentInt16 a1 = calloc<StructAlignmentInt16>().ref;
+  final a0Pointer = calloc<StructAlignmentInt16>();
+  final StructAlignmentInt16 a0 = a0Pointer.ref;
+  final a1Pointer = calloc<StructAlignmentInt16>();
+  final StructAlignmentInt16 a1 = a1Pointer.ref;
 
   a0.a0 = -1;
   a0.a1 = 2;
@@ -6321,8 +6536,8 @@
   Expect.equals(a1.a1, result.a1.a1);
   Expect.equals(a1.a2, result.a1.a2);
 
-  calloc.free(a0.addressOf);
-  calloc.free(a1.addressOf);
+  calloc.free(a0Pointer);
+  calloc.free(a1Pointer);
 }
 
 final returnStructNestedIntStructAlignmentInt32 =
@@ -6334,8 +6549,10 @@
 
 /// Test alignment and padding of nested struct with 32 byte int.
 void testReturnStructNestedIntStructAlignmentInt32() {
-  StructAlignmentInt32 a0 = calloc<StructAlignmentInt32>().ref;
-  StructAlignmentInt32 a1 = calloc<StructAlignmentInt32>().ref;
+  final a0Pointer = calloc<StructAlignmentInt32>();
+  final StructAlignmentInt32 a0 = a0Pointer.ref;
+  final a1Pointer = calloc<StructAlignmentInt32>();
+  final StructAlignmentInt32 a1 = a1Pointer.ref;
 
   a0.a0 = -1;
   a0.a1 = 2;
@@ -6355,8 +6572,8 @@
   Expect.equals(a1.a1, result.a1.a1);
   Expect.equals(a1.a2, result.a1.a2);
 
-  calloc.free(a0.addressOf);
-  calloc.free(a1.addressOf);
+  calloc.free(a0Pointer);
+  calloc.free(a1Pointer);
 }
 
 final returnStructNestedIntStructAlignmentInt64 =
@@ -6368,8 +6585,10 @@
 
 /// Test alignment and padding of nested struct with 64 byte int.
 void testReturnStructNestedIntStructAlignmentInt64() {
-  StructAlignmentInt64 a0 = calloc<StructAlignmentInt64>().ref;
-  StructAlignmentInt64 a1 = calloc<StructAlignmentInt64>().ref;
+  final a0Pointer = calloc<StructAlignmentInt64>();
+  final StructAlignmentInt64 a0 = a0Pointer.ref;
+  final a1Pointer = calloc<StructAlignmentInt64>();
+  final StructAlignmentInt64 a1 = a1Pointer.ref;
 
   a0.a0 = -1;
   a0.a1 = 2;
@@ -6389,8 +6608,8 @@
   Expect.equals(a1.a1, result.a1.a1);
   Expect.equals(a1.a2, result.a1.a2);
 
-  calloc.free(a0.addressOf);
-  calloc.free(a1.addressOf);
+  calloc.free(a0Pointer);
+  calloc.free(a1Pointer);
 }
 
 final returnStructNestedIrregularEvenBigger = ffiTestFunctions.lookupFunction<
@@ -6405,8 +6624,10 @@
 /// Return big irregular struct as smoke test.
 void testReturnStructNestedIrregularEvenBigger() {
   int a0;
-  StructNestedIrregularBigger a1 = calloc<StructNestedIrregularBigger>().ref;
-  StructNestedIrregularBigger a2 = calloc<StructNestedIrregularBigger>().ref;
+  final a1Pointer = calloc<StructNestedIrregularBigger>();
+  final StructNestedIrregularBigger a1 = a1Pointer.ref;
+  final a2Pointer = calloc<StructNestedIrregularBigger>();
+  final StructNestedIrregularBigger a2 = a2Pointer.ref;
   double a3;
 
   a0 = 1;
@@ -6483,6 +6704,6 @@
   Expect.approxEquals(a2.a3, result.a2.a3);
   Expect.approxEquals(a3, result.a3);
 
-  calloc.free(a1.addressOf);
-  calloc.free(a2.addressOf);
+  calloc.free(a1Pointer);
+  calloc.free(a2Pointer);
 }
diff --git a/tests/ffi_2/generator/structs_by_value_tests_generator.dart b/tests/ffi_2/generator/structs_by_value_tests_generator.dart
index 7bd7c83..3c678d3 100644
--- a/tests/ffi_2/generator/structs_by_value_tests_generator.dart
+++ b/tests/ffi_2/generator/structs_by_value_tests_generator.dart
@@ -197,14 +197,18 @@
         return "${dartType} ${variableName};\n";
 
       case StructType:
-        return "${dartType} ${variableName} = calloc<$dartType>().ref;\n";
+        return """
+final ${variableName}Pointer = calloc<$dartType>();
+final ${dartType} ${variableName} = ${variableName}Pointer.ref;
+""";
     }
 
     throw Exception("Not implemented for ${this.runtimeType}");
   }
 
   /// A list of Dart statements allocating as zero or nullptr.
-  String dartAllocateZeroStatements(String variableName) {
+  String dartAllocateZeroStatements(String variableName,
+      {bool structsAsPointers = false}) {
     switch (this.runtimeType) {
       case FundamentalType:
         final this_ = this as FundamentalType;
@@ -214,7 +218,11 @@
         return "${dartType} ${variableName} = 0.0;\n";
 
       case StructType:
-        return "${dartType} ${variableName} = ${dartType}();\n";
+        if (structsAsPointers) {
+          return "Pointer<${dartType}> ${variableName}Pointer = nullptr;\n";
+        } else {
+          return "${dartType} ${variableName} = ${dartType}();\n";
+        }
     }
 
     throw Exception("Not implemented for ${this.runtimeType}");
@@ -229,7 +237,7 @@
   }
 
   /// A list of Dart statements as zero or nullptr.
-  String dartAllocateZeroStatements([String namePrefix = ""]) {
+  String dartAllocateZeroStatements(String namePrefix) {
     return map((m) => m.type.dartAllocateZeroStatements("$namePrefix${m.name}"))
         .join();
   }
@@ -243,7 +251,7 @@
         return "";
 
       case StructType:
-        return "calloc.free($variableName.addressOf);\n";
+        return "calloc.free(${variableName}Pointer);\n";
     }
 
     throw Exception("Not implemented for ${this.runtimeType}");
@@ -472,6 +480,8 @@
 
     final prints = arguments.map((a) => "\$\{${a.name}\}").join(", ");
 
+    bool structsAsPointers = false;
+    String assignReturnGlobal = "";
     String buildReturnValue = "";
     switch (testType) {
       case TestType.structArguments:
@@ -481,19 +491,24 @@
 
         ${arguments.addToResultStatements('${dartName}_')}
         """;
+        assignReturnGlobal = "${dartName}Result = result;";
         break;
       case TestType.structReturn:
         // Allocate a struct.
         buildReturnValue = """
-        ${returnValue.dartType} result = calloc<${returnValue.dartType}>().ref;
+        final resultPointer = calloc<${returnValue.dartType}>();
+        final result = resultPointer.ref;
 
         ${arguments.copyValueStatements("${dartName}_", "result.")}
         """;
+        assignReturnGlobal = "${dartName}ResultPointer = resultPointer;";
+        structsAsPointers = true;
         break;
       case TestType.structReturnArgument:
         buildReturnValue = """
         ${returnValue.cType} result = ${dartName}_${structReturnArgument.name};
         """;
+        assignReturnGlobal = "${dartName}Result = result;";
         break;
     }
 
@@ -542,12 +557,12 @@
     $globals
 
     // Result variable also global, so we can delete it after the callback.
-    ${returnValue.dartAllocateZeroStatements("${dartName}Result")}
+    ${returnValue.dartAllocateZeroStatements("${dartName}Result", structsAsPointers: structsAsPointers)}
 
     ${returnValue.dartType} ${dartName}CalculateResult() {
       $buildReturnValue
 
-      ${dartName}Result = result;
+      $assignReturnGlobal
 
       return result;
     }
diff --git a/tools/VERSION b/tools/VERSION
index 27f3915..6f30547 100644
--- a/tools/VERSION
+++ b/tools/VERSION
@@ -27,5 +27,5 @@
 MAJOR 2
 MINOR 12
 PATCH 0
-PRERELEASE 266
+PRERELEASE 267
 PRERELEASE_PATCH 0
\ No newline at end of file