// Microsoft (R) .NET Framework IL Disassembler. Version 2.0.50727.42 // Copyright (c) Microsoft Corporation. All rights reserved. // Metadata version: v2.0.50727 .assembly extern mscorlib { .publickeytoken = (B7 7A 5C 56 19 34 E0 89 ) // .z\V.4.. .ver 2:0:0:0 } .assembly benchmark { .custom instance void [mscorlib]System.Runtime.CompilerServices.CompilationRelaxationsAttribute::.ctor(int32) = ( 01 00 08 00 00 00 00 00 ) .custom instance void [mscorlib]System.Runtime.CompilerServices.RuntimeCompatibilityAttribute::.ctor() = ( 01 00 01 00 54 02 16 57 72 61 70 4E 6F 6E 45 78 // ....T..WrapNonEx 63 65 70 74 69 6F 6E 54 68 72 6F 77 73 01 ) // ceptionThrows. .hash algorithm 0x00008004 .ver 0:0:0:0 } .module benchmark.exe // MVID: {5C208453-0581-4B84-9D73-1ABB9CE3F030} .imagebase 0x00400000 .file alignment 0x00000200 .stackreserve 0x00100000 .subsystem 0x0003 // WINDOWS_CUI .corflags 0x00000001 // ILONLY // Image base: 0x00EB0000 // =============== CLASS MEMBERS DECLARATION =================== .class public auto ansi beforefieldinit BenchmarkAttribute extends [mscorlib]System.Attribute { .custom instance void [mscorlib]System.AttributeUsageAttribute::.ctor(valuetype [mscorlib]System.AttributeTargets) = ( 01 00 40 00 00 00 00 00 ) // ..@..... .method public hidebysig specialname rtspecialname instance void .ctor() cil managed { // Code size 7 (0x7) .maxstack 8 IL_0000: ldarg.0 IL_0001: call instance void [mscorlib]System.Attribute::.ctor() IL_0006: ret } // end of method BenchmarkAttribute::.ctor } // end of class BenchmarkAttribute .class public auto ansi beforefieldinit Benchmark extends [mscorlib]System.Object { .field private static int32 runIterations .method public hidebysig static void Main(string[] args) cil managed { .entrypoint // Code size 776 (0x308) .maxstack 7 .locals init (valuetype [mscorlib]System.Reflection.BindingFlags V_0, class [mscorlib]System.Type V_1, class [mscorlib]System.Reflection.MethodInfo V_2, class [mscorlib]System.Reflection.MethodInfo V_3, class [mscorlib]System.Reflection.MethodInfo V_4, class [mscorlib]System.Collections.ArrayList V_5, class [mscorlib]System.Reflection.MethodInfo V_6, class [mscorlib]System.Reflection.ParameterInfo[] V_7, class [mscorlib]System.Reflection.TargetInvocationException V_8, class [mscorlib]System.Exception V_9, string V_10, int32 V_11, valuetype [mscorlib]System.DateTime V_12, valuetype [mscorlib]System.DateTime V_13, bool V_14, class [mscorlib]System.Type[] V_15, int32 V_16, class [mscorlib]System.Type[] V_17, class [mscorlib]System.Reflection.MethodInfo[] V_18, int32 V_19, object[] V_20, class [mscorlib]System.Collections.IEnumerator V_21, class [mscorlib]System.IDisposable V_22) IL_0000: nop IL_0001: ldarg.0 IL_0002: call string[] Benchmark::ParseCommandLine(string[]) IL_0007: starg.s args IL_0009: ldarg.0 IL_000a: ldnull IL_000b: ceq IL_000d: ldc.i4.0 IL_000e: ceq IL_0010: stloc.s V_14 IL_0012: ldloc.s V_14 IL_0014: brtrue.s IL_001e IL_0016: ldc.i4.0 IL_0017: newarr [mscorlib]System.String IL_001c: starg.s args IL_001e: ldc.i4.s 24 IL_0020: stloc.0 IL_0021: nop IL_0022: call class [mscorlib]System.Reflection.Assembly [mscorlib]System.Reflection.Assembly::GetCallingAssembly() IL_0027: callvirt instance class [mscorlib]System.Type[] [mscorlib]System.Reflection.Assembly::GetTypes() IL_002c: stloc.s V_15 IL_002e: ldc.i4.0 IL_002f: stloc.s V_16 IL_0031: br IL_02f6 IL_0036: ldloc.s V_15 IL_0038: ldloc.s V_16 IL_003a: ldelem.ref IL_003b: stloc.1 IL_003c: nop IL_003d: ldloc.1 IL_003e: ldstr "Init" IL_0043: ldloc.0 IL_0044: ldnull IL_0045: ldc.i4.1 IL_0046: newarr [mscorlib]System.Type IL_004b: stloc.s V_17 IL_004d: ldloc.s V_17 IL_004f: ldc.i4.0 IL_0050: ldtoken string[] IL_0055: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle) IL_005a: stelem.ref IL_005b: ldloc.s V_17 IL_005d: ldnull IL_005e: callvirt instance class [mscorlib]System.Reflection.MethodInfo [mscorlib]System.Type::GetMethod(string, valuetype [mscorlib]System.Reflection.BindingFlags, class [mscorlib]System.Reflection.Binder, class [mscorlib]System.Type[], valuetype [mscorlib]System.Reflection.ParameterModifier[]) IL_0063: stloc.2 IL_0064: ldloc.1 IL_0065: ldstr "Reset" IL_006a: ldloc.0 IL_006b: ldnull IL_006c: ldc.i4.0 IL_006d: newarr [mscorlib]System.Type IL_0072: ldnull IL_0073: callvirt instance class [mscorlib]System.Reflection.MethodInfo [mscorlib]System.Type::GetMethod(string, valuetype [mscorlib]System.Reflection.BindingFlags, class [mscorlib]System.Reflection.Binder, class [mscorlib]System.Type[], valuetype [mscorlib]System.Reflection.ParameterModifier[]) IL_0078: stloc.3 IL_0079: ldloc.1 IL_007a: ldstr "Check" IL_007f: ldloc.0 IL_0080: ldnull IL_0081: ldc.i4.0 IL_0082: newarr [mscorlib]System.Type IL_0087: ldnull IL_0088: callvirt instance class [mscorlib]System.Reflection.MethodInfo [mscorlib]System.Type::GetMethod(string, valuetype [mscorlib]System.Reflection.BindingFlags, class [mscorlib]System.Reflection.Binder, class [mscorlib]System.Type[], valuetype [mscorlib]System.Reflection.ParameterModifier[]) IL_008d: stloc.s V_4 IL_008f: newobj instance void [mscorlib]System.Collections.ArrayList::.ctor() IL_0094: stloc.s V_5 IL_0096: nop IL_0097: ldloc.1 IL_0098: ldloc.0 IL_0099: callvirt instance class [mscorlib]System.Reflection.MethodInfo[] [mscorlib]System.Type::GetMethods(valuetype [mscorlib]System.Reflection.BindingFlags) IL_009e: stloc.s V_18 IL_00a0: ldc.i4.0 IL_00a1: stloc.s V_19 IL_00a3: br.s IL_00fc IL_00a5: ldloc.s V_18 IL_00a7: ldloc.s V_19 IL_00a9: ldelem.ref IL_00aa: stloc.s V_6 IL_00ac: nop IL_00ad: ldloc.s V_6 IL_00af: callvirt instance class [mscorlib]System.Reflection.ParameterInfo[] [mscorlib]System.Reflection.MethodBase::GetParameters() IL_00b4: stloc.s V_7 IL_00b6: ldloc.s V_7 IL_00b8: brfalse.s IL_00c3 IL_00ba: ldloc.s V_7 IL_00bc: ldlen IL_00bd: conv.i4 IL_00be: ldc.i4.0 IL_00bf: ceq IL_00c1: br.s IL_00c4 IL_00c3: ldc.i4.1 IL_00c4: stloc.s V_14 IL_00c6: ldloc.s V_14 IL_00c8: brtrue.s IL_00cc IL_00ca: br.s IL_00f6 IL_00cc: ldloc.s V_6 IL_00ce: ldtoken BenchmarkAttribute IL_00d3: call class [mscorlib]System.Type [mscorlib]System.Type::GetTypeFromHandle(valuetype [mscorlib]System.RuntimeTypeHandle) IL_00d8: ldc.i4.0 IL_00d9: callvirt instance object[] [mscorlib]System.Reflection.MemberInfo::GetCustomAttributes(class [mscorlib]System.Type, bool) IL_00de: ldlen IL_00df: conv.i4 IL_00e0: ldc.i4.0 IL_00e1: ceq IL_00e3: stloc.s V_14 IL_00e5: ldloc.s V_14 IL_00e7: brtrue.s IL_00f5 IL_00e9: nop IL_00ea: ldloc.s V_5 IL_00ec: ldloc.s V_6 IL_00ee: callvirt instance int32 [mscorlib]System.Collections.ArrayList::Add(object) IL_00f3: pop IL_00f4: nop IL_00f5: nop IL_00f6: ldloc.s V_19 IL_00f8: ldc.i4.1 IL_00f9: add IL_00fa: stloc.s V_19 IL_00fc: ldloc.s V_19 IL_00fe: ldloc.s V_18 IL_0100: ldlen IL_0101: conv.i4 IL_0102: clt IL_0104: stloc.s V_14 IL_0106: ldloc.s V_14 IL_0108: brtrue.s IL_00a5 IL_010a: ldloc.s V_5 IL_010c: callvirt instance int32 [mscorlib]System.Collections.ArrayList::get_Count() IL_0111: ldc.i4.0 IL_0112: ceq IL_0114: ldc.i4.0 IL_0115: ceq IL_0117: stloc.s V_14 IL_0119: ldloc.s V_14 IL_011b: brtrue.s IL_0122 IL_011d: br IL_02ef IL_0122: ldstr "Benchmarking type {0}" IL_0127: ldloc.1 IL_0128: callvirt instance string [mscorlib]System.Reflection.MemberInfo::get_Name() IL_012d: call void [mscorlib]System.Console::WriteLine(string, object) IL_0132: nop .try { IL_0133: nop IL_0134: ldloc.2 IL_0135: ldnull IL_0136: ceq IL_0138: stloc.s V_14 IL_013a: ldloc.s V_14 IL_013c: brtrue.s IL_0155 IL_013e: ldloc.2 IL_013f: ldnull IL_0140: ldc.i4.1 IL_0141: newarr [mscorlib]System.Object IL_0146: stloc.s V_20 IL_0148: ldloc.s V_20 IL_014a: ldc.i4.0 IL_014b: ldarg.0 IL_014c: stelem.ref IL_014d: ldloc.s V_20 IL_014f: callvirt instance object [mscorlib]System.Reflection.MethodBase::Invoke(object, object[]) IL_0154: pop IL_0155: nop IL_0156: leave.s IL_019b } // end .try catch [mscorlib]System.Reflection.TargetInvocationException { IL_0158: stloc.s V_8 IL_015a: nop IL_015b: ldloc.s V_8 IL_015d: callvirt instance class [mscorlib]System.Exception [mscorlib]System.Exception::get_InnerException() IL_0162: stloc.s V_9 IL_0164: ldloc.s V_9 IL_0166: brfalse.s IL_0171 IL_0168: ldloc.s V_9 IL_016a: callvirt instance string [mscorlib]System.Exception::get_Message() IL_016f: br.s IL_0172 IL_0171: ldnull IL_0172: stloc.s V_10 IL_0174: ldloc.s V_10 IL_0176: ldnull IL_0177: ceq IL_0179: ldc.i4.0 IL_017a: ceq IL_017c: stloc.s V_14 IL_017e: ldloc.s V_14 IL_0180: brtrue.s IL_0189 IL_0182: ldstr "(No message)" IL_0187: stloc.s V_10 IL_0189: ldstr "Init failed ({0})" IL_018e: ldloc.s V_10 IL_0190: call void [mscorlib]System.Console::WriteLine(string, object) IL_0195: nop IL_0196: leave IL_02ef } // end handler IL_019b: nop IL_019c: ldc.i4.0 IL_019d: stloc.s V_11 IL_019f: br IL_02dc IL_01a4: nop IL_01a5: ldsfld int32 Benchmark::runIterations IL_01aa: ldc.i4.1 IL_01ab: ceq IL_01ad: stloc.s V_14 IL_01af: ldloc.s V_14 IL_01b1: brtrue.s IL_01c7 IL_01b3: ldstr "Run #{0}" IL_01b8: ldloc.s V_11 IL_01ba: ldc.i4.1 IL_01bb: add IL_01bc: box [mscorlib]System.Int32 IL_01c1: call void [mscorlib]System.Console::WriteLine(string, object) IL_01c6: nop IL_01c7: nop IL_01c8: ldloc.s V_5 IL_01ca: callvirt instance class [mscorlib]System.Collections.IEnumerator [mscorlib]System.Collections.ArrayList::GetEnumerator() IL_01cf: stloc.s V_21 .try { IL_01d1: br IL_02a5 IL_01d6: ldloc.s V_21 IL_01d8: callvirt instance object [mscorlib]System.Collections.IEnumerator::get_Current() IL_01dd: castclass [mscorlib]System.Reflection.MethodInfo IL_01e2: stloc.s V_6 IL_01e4: nop .try { IL_01e5: nop IL_01e6: ldloc.3 IL_01e7: ldnull IL_01e8: ceq IL_01ea: stloc.s V_14 IL_01ec: ldloc.s V_14 IL_01ee: brtrue.s IL_01f9 IL_01f0: ldloc.3 IL_01f1: ldnull IL_01f2: ldnull IL_01f3: callvirt instance object [mscorlib]System.Reflection.MethodBase::Invoke(object, object[]) IL_01f8: pop IL_01f9: call void [mscorlib]System.GC::Collect() IL_01fe: nop IL_01ff: call void [mscorlib]System.GC::WaitForPendingFinalizers() IL_0204: nop IL_0205: call void [mscorlib]System.GC::Collect() IL_020a: nop IL_020b: call valuetype [mscorlib]System.DateTime [mscorlib]System.DateTime::get_Now() IL_0210: stloc.s V_12 IL_0212: ldloc.s V_6 IL_0214: ldnull IL_0215: ldnull IL_0216: callvirt instance object [mscorlib]System.Reflection.MethodBase::Invoke(object, object[]) IL_021b: pop IL_021c: call valuetype [mscorlib]System.DateTime [mscorlib]System.DateTime::get_Now() IL_0221: stloc.s V_13 IL_0223: ldloc.s V_4 IL_0225: ldnull IL_0226: ceq IL_0228: stloc.s V_14 IL_022a: ldloc.s V_14 IL_022c: brtrue.s IL_0238 IL_022e: ldloc.s V_4 IL_0230: ldnull IL_0231: ldnull IL_0232: callvirt instance object [mscorlib]System.Reflection.MethodBase::Invoke(object, object[]) IL_0237: pop IL_0238: ldstr " {0,-20} {1}" IL_023d: ldloc.s V_6 IL_023f: callvirt instance string [mscorlib]System.Reflection.MemberInfo::get_Name() IL_0244: ldloc.s V_13 IL_0246: ldloc.s V_12 IL_0248: call valuetype [mscorlib]System.TimeSpan [mscorlib]System.DateTime::op_Subtraction(valuetype [mscorlib]System.DateTime, valuetype [mscorlib]System.DateTime) IL_024d: box [mscorlib]System.TimeSpan IL_0252: call void [mscorlib]System.Console::WriteLine(string, object, object) IL_0257: nop IL_0258: nop IL_0259: leave.s IL_02a3 } // end .try catch [mscorlib]System.Reflection.TargetInvocationException { IL_025b: stloc.s V_8 IL_025d: nop IL_025e: ldloc.s V_8 IL_0260: callvirt instance class [mscorlib]System.Exception [mscorlib]System.Exception::get_InnerException() IL_0265: stloc.s V_9 IL_0267: ldloc.s V_9 IL_0269: brfalse.s IL_0274 IL_026b: ldloc.s V_9 IL_026d: callvirt instance string [mscorlib]System.Exception::get_Message() IL_0272: br.s IL_0275 IL_0274: ldnull IL_0275: stloc.s V_10 IL_0277: ldloc.s V_10 IL_0279: ldnull IL_027a: ceq IL_027c: ldc.i4.0 IL_027d: ceq IL_027f: stloc.s V_14 IL_0281: ldloc.s V_14 IL_0283: brtrue.s IL_028c IL_0285: ldstr "(No message)" IL_028a: stloc.s V_10 IL_028c: ldstr " {0}: Failed ({1})" IL_0291: ldloc.s V_6 IL_0293: callvirt instance string [mscorlib]System.Reflection.MemberInfo::get_Name() IL_0298: ldloc.s V_10 IL_029a: call void [mscorlib]System.Console::WriteLine(string, object, object) IL_029f: nop IL_02a0: nop IL_02a1: leave.s IL_02a3 } // end handler IL_02a3: nop IL_02a4: nop IL_02a5: ldloc.s V_21 IL_02a7: callvirt instance bool [mscorlib]System.Collections.IEnumerator::MoveNext() IL_02ac: stloc.s V_14 IL_02ae: ldloc.s V_14 IL_02b0: brtrue IL_01d6 IL_02b5: leave.s IL_02d4 } // end .try finally { IL_02b7: ldloc.s V_21 IL_02b9: isinst [mscorlib]System.IDisposable IL_02be: stloc.s V_22 IL_02c0: ldloc.s V_22 IL_02c2: ldnull IL_02c3: ceq IL_02c5: stloc.s V_14 IL_02c7: ldloc.s V_14 IL_02c9: brtrue.s IL_02d3 IL_02cb: ldloc.s V_22 IL_02cd: callvirt instance void [mscorlib]System.IDisposable::Dispose() IL_02d2: nop IL_02d3: endfinally } // end handler IL_02d4: nop IL_02d5: nop IL_02d6: ldloc.s V_11 IL_02d8: ldc.i4.1 IL_02d9: add IL_02da: stloc.s V_11 IL_02dc: ldloc.s V_11 IL_02de: ldsfld int32 Benchmark::runIterations IL_02e3: clt IL_02e5: stloc.s V_14 IL_02e7: ldloc.s V_14 IL_02e9: brtrue IL_01a4 IL_02ee: nop IL_02ef: nop IL_02f0: ldloc.s V_16 IL_02f2: ldc.i4.1 IL_02f3: add IL_02f4: stloc.s V_16 IL_02f6: ldloc.s V_16 IL_02f8: ldloc.s V_15 IL_02fa: ldlen IL_02fb: conv.i4 IL_02fc: clt IL_02fe: stloc.s V_14 IL_0300: ldloc.s V_14 IL_0302: brtrue IL_0036 IL_0307: ret } // end of method Benchmark::Main .method private hidebysig static string[] ParseCommandLine(string[] args) cil managed { // Code size 192 (0xc0) .maxstack 5 .locals init (int32 V_0, string[] V_1, string[] V_2, bool V_3, string V_4) IL_0000: nop IL_0001: ldarg.0 IL_0002: ldnull IL_0003: ceq IL_0005: ldc.i4.0 IL_0006: ceq IL_0008: stloc.3 IL_0009: ldloc.3 IL_000a: brtrue.s IL_0018 IL_000c: ldc.i4.0 IL_000d: newarr [mscorlib]System.String IL_0012: stloc.2 IL_0013: br IL_00be IL_0018: ldc.i4.0 IL_0019: stloc.0 IL_001a: br IL_00a8 IL_001f: nop IL_0020: ldarg.0 IL_0021: ldloc.0 IL_0022: ldelem.ref IL_0023: stloc.s V_4 IL_0025: ldloc.s V_4 IL_0027: brfalse.s IL_0086 IL_0029: ldloc.s V_4 IL_002b: ldstr "-runtwice" IL_0030: call bool [mscorlib]System.String::op_Equality(string, string) IL_0035: brtrue.s IL_0055 IL_0037: ldloc.s V_4 IL_0039: ldstr "-version" IL_003e: call bool [mscorlib]System.String::op_Equality(string, string) IL_0043: brtrue.s IL_005d IL_0045: ldloc.s V_4 IL_0047: ldstr "-endoptions" IL_004c: call bool [mscorlib]System.String::op_Equality(string, string) IL_0051: brtrue.s IL_0065 IL_0053: br.s IL_0086 IL_0055: ldc.i4.2 IL_0056: stsfld int32 Benchmark::runIterations IL_005b: br.s IL_00a3 IL_005d: call void Benchmark::PrintEnvironment() IL_0062: nop IL_0063: br.s IL_00a3 IL_0065: nop IL_0066: ldarg.0 IL_0067: ldlen IL_0068: conv.i4 IL_0069: ldloc.0 IL_006a: sub IL_006b: ldc.i4.1 IL_006c: sub IL_006d: newarr [mscorlib]System.String IL_0072: stloc.1 IL_0073: ldarg.0 IL_0074: ldloc.0 IL_0075: ldc.i4.1 IL_0076: add IL_0077: ldloc.1 IL_0078: ldc.i4.0 IL_0079: ldloc.1 IL_007a: ldlen IL_007b: conv.i4 IL_007c: call void [mscorlib]System.Array::Copy(class [mscorlib]System.Array, int32, class [mscorlib]System.Array, int32, int32) IL_0081: nop IL_0082: ldloc.1 IL_0083: stloc.2 IL_0084: br.s IL_00be IL_0086: nop IL_0087: ldarg.0 IL_0088: ldlen IL_0089: conv.i4 IL_008a: ldloc.0 IL_008b: sub IL_008c: newarr [mscorlib]System.String IL_0091: stloc.1 IL_0092: ldarg.0 IL_0093: ldloc.0 IL_0094: ldloc.1 IL_0095: ldc.i4.0 IL_0096: ldloc.1 IL_0097: ldlen IL_0098: conv.i4 IL_0099: call void [mscorlib]System.Array::Copy(class [mscorlib]System.Array, int32, class [mscorlib]System.Array, int32, int32) IL_009e: nop IL_009f: ldloc.1 IL_00a0: stloc.2 IL_00a1: br.s IL_00be IL_00a3: nop IL_00a4: ldloc.0 IL_00a5: ldc.i4.1 IL_00a6: add IL_00a7: stloc.0 IL_00a8: ldloc.0 IL_00a9: ldarg.0 IL_00aa: ldlen IL_00ab: conv.i4 IL_00ac: clt IL_00ae: stloc.3 IL_00af: ldloc.3 IL_00b0: brtrue IL_001f IL_00b5: ldc.i4.0 IL_00b6: newarr [mscorlib]System.String IL_00bb: stloc.2 IL_00bc: br.s IL_00be IL_00be: ldloc.2 IL_00bf: ret } // end of method Benchmark::ParseCommandLine .method private hidebysig static void PrintEnvironment() cil managed { // Code size 34 (0x22) .maxstack 8 IL_0000: nop IL_0001: ldstr "Operating System: {0}" IL_0006: call class [mscorlib]System.OperatingSystem [mscorlib]System.Environment::get_OSVersion() IL_000b: call void [mscorlib]System.Console::WriteLine(string, object) IL_0010: nop IL_0011: ldstr "Runtime version: {0}" IL_0016: call class [mscorlib]System.Version [mscorlib]System.Environment::get_Version() IL_001b: call void [mscorlib]System.Console::WriteLine(string, object) IL_0020: nop IL_0021: ret } // end of method Benchmark::PrintEnvironment .method public hidebysig specialname rtspecialname instance void .ctor() cil managed { // Code size 7 (0x7) .maxstack 8 IL_0000: ldarg.0 IL_0001: call instance void [mscorlib]System.Object::.ctor() IL_0006: ret } // end of method Benchmark::.ctor .method private hidebysig specialname rtspecialname static void .cctor() cil managed { // Code size 7 (0x7) .maxstack 8 IL_0000: ldc.i4.3 IL_0001: stsfld int32 Benchmark::runIterations IL_0006: ret } // end of method Benchmark::.cctor } // end of class Benchmark .class public auto ansi beforefieldinit TailCall extends [mscorlib]System.Object { .field private static literal int32 N = int32(0x00004E20) .method public hidebysig static int32 sum_loop(int32 n) cil managed { // Code size 30 (0x1e) .maxstack 2 .locals init (int32 V_0, int32 V_1, bool V_2) IL_0000: nop IL_0001: ldc.i4.0 IL_0002: stloc.0 IL_0003: br.s IL_0010 IL_0005: nop IL_0006: ldloc.0 IL_0007: ldarg.0 IL_0008: add IL_0009: stloc.0 IL_000a: ldarg.0 IL_000b: ldc.i4.1 IL_000c: sub IL_000d: starg.s n IL_000f: nop IL_0010: ldarg.0 IL_0011: ldc.i4.0 IL_0012: cgt IL_0014: stloc.2 IL_0015: ldloc.2 IL_0016: brtrue.s IL_0005 IL_0018: ldloc.0 IL_0019: stloc.1 IL_001a: br.s IL_001c IL_001c: ldloc.1 IL_001d: ret } // end of method TailCall::sum_loop .method public hidebysig static int32 sum_recursive(int32 n, int32 accumulator) cil managed { // Code size 32 (0x20) .maxstack 3 .locals init (int32 V_0, bool V_1) IL_0000: nop IL_0001: ldarg.0 IL_0002: ldc.i4.0 IL_0003: clt IL_0005: ldc.i4.0 IL_0006: ceq IL_0008: stloc.1 IL_0009: ldloc.1 IL_000a: brtrue.s IL_0010 IL_000c: ldarg.1 IL_000d: stloc.0 IL_000e: br.s IL_001e IL_0010: ldarg.0 IL_0011: ldc.i4.1 IL_0012: sub IL_0013: ldarg.1 IL_0014: ldarg.0 IL_0015: add IL_0016: call int32 TailCall::sum_recursive(int32, int32) IL_001b: stloc.0 IL_001c: br.s IL_001e IL_001e: ldloc.0 IL_001f: ret } // end of method TailCall::sum_recursive .method public hidebysig static int32 sum_tail_call(int32 n, int32 accumulator) cil managed { // Code size 32 (0x20) .maxstack 3 .locals init (int32 V_0, bool V_1) IL_0000: nop IL_0001: ldarg.0 IL_0002: ldc.i4.0 IL_0003: clt IL_0005: ldc.i4.0 IL_0006: ceq IL_0008: stloc.1 IL_0009: ldloc.1 IL_000a: brtrue.s IL_0010 IL_000c: ldarg.1 IL_000d: stloc.0 IL_000e: br.s IL_001e IL_001e: ldloc.0 IL_001f: ret IL_0010: ldarg.0 IL_0011: ldc.i4.1 IL_0012: sub IL_0013: ldarg.1 IL_0014: ldarg.0 IL_0015: add IL_0016: tail. call int32 TailCall::sum_tail_call(int32, int32) ret } // end of method TailCall::sum_tail_call .method public hidebysig static int32 loop() cil managed { .custom instance void BenchmarkAttribute::.ctor() = ( 01 00 00 00 ) // Code size 42 (0x2a) .maxstack 2 .locals init (int32 V_0, int32 V_1, int32 V_2, bool V_3) IL_0000: nop IL_0001: ldc.i4.0 IL_0002: stloc.0 IL_0003: ldc.i4.0 IL_0004: stloc.1 IL_0005: br.s IL_0018 IL_0007: ldloc.0 IL_0008: ldc.i4 0x4e20 IL_000d: call int32 TailCall::sum_loop(int32) IL_0012: add IL_0013: stloc.0 IL_0014: ldloc.1 IL_0015: ldc.i4.1 IL_0016: add IL_0017: stloc.1 IL_0018: ldloc.1 IL_0019: ldc.i4 0x4e20 IL_001e: clt IL_0020: stloc.3 IL_0021: ldloc.3 IL_0022: brtrue.s IL_0007 IL_0024: ldloc.0 IL_0025: stloc.2 IL_0026: br.s IL_0028 IL_0028: ldloc.2 IL_0029: ret } // end of method TailCall::loop .method public hidebysig static int32 recursive() cil managed { .custom instance void BenchmarkAttribute::.ctor() = ( 01 00 00 00 ) // Code size 43 (0x2b) .maxstack 3 .locals init (int32 V_0, int32 V_1, int32 V_2, bool V_3) IL_0000: nop IL_0001: ldc.i4.0 IL_0002: stloc.0 IL_0003: ldc.i4.0 IL_0004: stloc.1 IL_0005: br.s IL_0019 IL_0007: ldloc.0 IL_0008: ldc.i4 0x4e20 IL_000d: ldc.i4.0 IL_000e: call int32 TailCall::sum_recursive(int32, int32) IL_0013: add IL_0014: stloc.0 IL_0015: ldloc.1 IL_0016: ldc.i4.1 IL_0017: add IL_0018: stloc.1 IL_0019: ldloc.1 IL_001a: ldc.i4 0x4e20 IL_001f: clt IL_0021: stloc.3 IL_0022: ldloc.3 IL_0023: brtrue.s IL_0007 IL_0025: ldloc.0 IL_0026: stloc.2 IL_0027: br.s IL_0029 IL_0029: ldloc.2 IL_002a: ret } // end of method TailCall::recursive .method public hidebysig static int32 tail_call() cil managed { .custom instance void BenchmarkAttribute::.ctor() = ( 01 00 00 00 ) // Code size 54 (0x36) .maxstack 3 .locals init (int32 V_0, int32 V_1, int32 V_2, bool V_3) IL_0000: nop IL_000b: nop IL_000c: ldc.i4.0 IL_000d: stloc.0 IL_000e: ldc.i4.0 IL_000f: stloc.1 IL_0010: br.s IL_0024 IL_0012: ldloc.0 IL_0013: ldc.i4 0x4e20 IL_0018: ldc.i4.0 IL_0019: call int32 TailCall::sum_tail_call(int32, int32) IL_001e: add IL_001f: stloc.0 IL_0020: ldloc.1 IL_0021: ldc.i4.1 IL_0022: add IL_0023: stloc.1 IL_0024: ldloc.1 IL_0025: ldc.i4 0x4e20 IL_002a: clt IL_002c: stloc.3 IL_002d: ldloc.3 IL_002e: brtrue.s IL_0012 IL_0030: ldloc.0 IL_0031: stloc.2 IL_0032: br.s IL_0034 IL_0034: ldloc.2 IL_0035: ret } // end of method TailCall::tail_call .method public hidebysig specialname rtspecialname instance void .ctor() cil managed { // Code size 7 (0x7) .maxstack 8 IL_0000: ldarg.0 IL_0001: call instance void [mscorlib]System.Object::.ctor() IL_0006: ret } // end of method TailCall::.ctor } // end of class TailCall // ============================================================= // *********** DISASSEMBLY COMPLETE *********************** // WARNING: Created Win32 resource file tailcall.res