﻿.class private abstract auto ansi sealed beforefieldinit Costura.AssemblyLoader
extends [System.Private.CoreLib]System.Object
{
.class abstract auto ansi sealed nested private beforefieldinit '<>O'
extends [System.Private.CoreLib]System.Object
{
.field public static class [System.Private.CoreLib]System.Func`3<class [System.Runtime.Loader]System.Runtime.Loader.AssemblyLoadContext,class [System.Runtime]System.Reflection.AssemblyName,class [System.Runtime]System.Reflection.Assembly> '<0>__ResolveAssembly'
}
.field private static object nullCacheLock
.field private static class [System.Private.CoreLib]System.Collections.Generic.Dictionary`2<string,bool> nullCache
.field private static string tempBasePath
.field private static class [System.Private.CoreLib]System.Collections.Generic.List`1<string> preloadList
.field private static class [System.Private.CoreLib]System.Collections.Generic.List`1<string> preloadWinX86List
.field private static class [System.Private.CoreLib]System.Collections.Generic.List`1<string> preloadWinX64List
.field private static class [System.Private.CoreLib]System.Collections.Generic.List`1<string> preloadWinArm64List
.field private static class [System.Private.CoreLib]System.Collections.Generic.Dictionary`2<string,string> checksums
.field private static int32 isAttached
.method private hidebysig static string
CultureToString(class [System.Private.CoreLib]System.Globalization.CultureInfo culture) cil managed
{
.maxstack  2
.locals init (bool V_0,
string V_1)
IL_0000:  nop
IL_0001:  ldarg.0
IL_0002:  ldnull
IL_0003:  ceq
IL_0005:  stloc.0
IL_0006:  ldloc.0
IL_0007:  brfalse.s  IL_0012
IL_0009:  nop
IL_000a:  ldsfld     string [System.Private.CoreLib]System.String::Empty
IL_000f:  stloc.1
IL_0010:  br.s       IL_001b
IL_0012:  ldarg.0
IL_0013:  callvirt   instance string [System.Private.CoreLib]System.Globalization.CultureInfo::get_Name()
IL_0018:  stloc.1
IL_0019:  br.s       IL_001b
IL_001b:  ldloc.1
IL_001c:  ret
}
.method private hidebysig static void  Log(string format,
object[] args) cil managed
{
.maxstack  8
IL_0000:  nop
IL_0001:  ldstr      "=== COSTURA === "
IL_0006:  ldarg.0
IL_0007:  ldarg.1
IL_0008:  call       string [System.Private.CoreLib]System.String::Format(string,
object[])
IL_000d:  call       string [System.Private.CoreLib]System.String::Concat(string,
string)
IL_0012:  call       void [System.Private.CoreLib]System.Diagnostics.Debug::WriteLine(string)
IL_0017:  nop
IL_0018:  ret
}
.method private hidebysig static class [System.Private.CoreLib]System.Reflection.Assembly
ReadExistingAssembly(class [System.Private.CoreLib]System.Reflection.AssemblyName name) cil managed
{
.maxstack  5
.locals init (class [System.Private.CoreLib]System.AppDomain V_0,
class [System.Private.CoreLib]System.Reflection.Assembly[] V_1,
class [System.Private.CoreLib]System.Reflection.Assembly[] V_2,
int32 V_3,
class [System.Private.CoreLib]System.Reflection.Assembly V_4,
class [System.Private.CoreLib]System.Reflection.AssemblyName V_5,
bool V_6,
class [System.Private.CoreLib]System.Runtime.Loader.AssemblyLoadContext V_7,
bool V_8,
bool V_9,
bool V_10,
bool V_11,
class [System.Private.CoreLib]System.Reflection.Assembly V_12)
IL_0000:  nop
IL_0001:  call       class [System.Private.CoreLib]System.AppDomain [System.Private.CoreLib]System.AppDomain::get_CurrentDomain()
IL_0006:  stloc.0
IL_0007:  ldloc.0
IL_0008:  callvirt   instance class [System.Private.CoreLib]System.Reflection.Assembly[] [System.Private.CoreLib]System.AppDomain::GetAssemblies()
IL_000d:  stloc.1
IL_000e:  nop
IL_000f:  ldloc.1
IL_0010:  stloc.2
IL_0011:  ldc.i4.0
IL_0012:  stloc.3
IL_0013:  br         IL_00e6
IL_0018:  ldloc.2
IL_0019:  ldloc.3
IL_001a:  ldelem.ref
IL_001b:  stloc.s    V_4
IL_001d:  nop
IL_001e:  ldloc.s    V_4
IL_0020:  callvirt   instance class [System.Private.CoreLib]System.Reflection.AssemblyName [System.Private.CoreLib]System.Reflection.Assembly::GetName()
IL_0025:  stloc.s    V_5
IL_0027:  ldloc.s    V_5
IL_0029:  callvirt   instance string [System.Private.CoreLib]System.Reflection.AssemblyName::get_Name()
IL_002e:  ldarg.0
IL_002f:  callvirt   instance string [System.Private.CoreLib]System.Reflection.AssemblyName::get_Name()
IL_0034:  ldc.i4.3
IL_0035:  call       bool [System.Private.CoreLib]System.String::Equals(string,
string,
valuetype [System.Private.CoreLib]System.StringComparison)
IL_003a:  brfalse.s  IL_005b
IL_003c:  ldloc.s    V_5
IL_003e:  callvirt   instance class [System.Private.CoreLib]System.Globalization.CultureInfo [System.Private.CoreLib]System.Reflection.AssemblyName::get_CultureInfo()
IL_0043:  call       string Costura.AssemblyLoader::CultureToString(class [System.Private.CoreLib]System.Globalization.CultureInfo)
IL_0048:  ldarg.0
IL_0049:  callvirt   instance class [System.Private.CoreLib]System.Globalization.CultureInfo [System.Private.CoreLib]System.Reflection.AssemblyName::get_CultureInfo()
IL_004e:  call       string Costura.AssemblyLoader::CultureToString(class [System.Private.CoreLib]System.Globalization.CultureInfo)
IL_0053:  ldc.i4.3
IL_0054:  call       bool [System.Private.CoreLib]System.String::Equals(string,
string,
valuetype [System.Private.CoreLib]System.StringComparison)
IL_0059:  br.s       IL_005c
IL_005b:  ldc.i4.0
IL_005c:  stloc.s    V_6
IL_005e:  ldloc.s    V_6
IL_0060:  brfalse.s  IL_00e1
IL_0062:  nop
IL_0063:  ldloc.s    V_4
IL_0065:  call       class [System.Private.CoreLib]System.Runtime.Loader.AssemblyLoadContext [System.Private.CoreLib]System.Runtime.Loader.AssemblyLoadContext::GetLoadContext(class [System.Private.CoreLib]System.Reflection.Assembly)
IL_006a:  stloc.s    V_7
IL_006c:  ldloc.s    V_7
IL_006e:  call       class [System.Private.CoreLib]System.Runtime.Loader.AssemblyLoadContext [System.Private.CoreLib]System.Runtime.Loader.AssemblyLoadContext::get_Default()
IL_0073:  ceq
IL_0075:  stloc.s    V_8
IL_0077:  ldloc.s    V_8
IL_0079:  ldc.i4.0
IL_007a:  ceq
IL_007c:  stloc.s    V_9
IL_007e:  ldloc.s    V_9
IL_0080:  brfalse.s  IL_00c0
IL_0082:  nop
IL_0083:  ldstr      "System.Runtime.Loader.IndividualAssemblyLoadContext"
IL_0088:  ldloc.s    V_7
IL_008a:  callvirt   instance class [System.Private.CoreLib]System.Type [System.Private.CoreLib]System.Object::GetType()
IL_008f:  callvirt   instance string [System.Private.CoreLib]System.Type::get_FullName()
IL_0094:  call       bool [System.Private.CoreLib]System.String::op_Equality(string,
string)
IL_0099:  stloc.s    V_10
IL_009b:  ldloc.s    V_10
IL_009d:  ldc.i4.0
IL_009e:  ceq
IL_00a0:  stloc.s    V_11
IL_00a2:  ldloc.s    V_11
IL_00a4:  brfalse.s  IL_00bf
IL_00a6:  nop
IL_00a7:  ldstr      "Assembly Context is not valid '{0}'"
IL_00ac:  ldc.i4.1
IL_00ad:  newarr     [System.Private.CoreLib]System.Object
IL_00b2:  dup
IL_00b3:  ldc.i4.0
IL_00b4:  ldloc.s    V_7
IL_00b6:  stelem.ref
IL_00b7:  call       void Costura.AssemblyLoader::Log(string,
object[])
IL_00bc:  nop
IL_00bd:  br.s       IL_00e2
IL_00bf:  nop
IL_00c0:  ldstr      "Assembly '{0}' already loaded, returning existing "
+ "assembly"
IL_00c5:  ldc.i4.1
IL_00c6:  newarr     [System.Private.CoreLib]System.Object
IL_00cb:  dup
IL_00cc:  ldc.i4.0
IL_00cd:  ldloc.s    V_4
IL_00cf:  callvirt   instance string [System.Private.CoreLib]System.Reflection.Assembly::get_FullName()
IL_00d4:  stelem.ref
IL_00d5:  call       void Costura.AssemblyLoader::Log(string,
object[])
IL_00da:  nop
IL_00db:  ldloc.s    V_4
IL_00dd:  stloc.s    V_12
IL_00df:  br.s       IL_00f4
IL_00e1:  nop
IL_00e2:  ldloc.3
IL_00e3:  ldc.i4.1
IL_00e4:  add
IL_00e5:  stloc.3
IL_00e6:  ldloc.3
IL_00e7:  ldloc.2
IL_00e8:  ldlen
IL_00e9:  conv.i4
IL_00ea:  blt        IL_0018
IL_00ef:  ldnull
IL_00f0:  stloc.s    V_12
IL_00f2:  br.s       IL_00f4
IL_00f4:  ldloc.s    V_12
IL_00f6:  ret
}
.method private hidebysig static string
GetAssemblyResourceName(class [System.Private.CoreLib]System.Reflection.AssemblyName requestedAssemblyName) cil managed
{
.maxstack  3
.locals init (string V_0,
bool V_1,
string V_2)
IL_0000:  nop
IL_0001:  ldarg.0
IL_0002:  callvirt   instance string [System.Private.CoreLib]System.Reflection.AssemblyName::get_Name()
IL_0007:  callvirt   instance string [System.Private.CoreLib]System.String::ToLowerInvariant()
IL_000c:  stloc.0
IL_000d:  ldarg.0
IL_000e:  callvirt   instance class [System.Private.CoreLib]System.Globalization.CultureInfo [System.Private.CoreLib]System.Reflection.AssemblyName::get_CultureInfo()
IL_0013:  brfalse.s  IL_002a
IL_0015:  ldarg.0
IL_0016:  callvirt   instance class [System.Private.CoreLib]System.Globalization.CultureInfo [System.Private.CoreLib]System.Reflection.AssemblyName::get_CultureInfo()
IL_001b:  callvirt   instance string [System.Private.CoreLib]System.Globalization.CultureInfo::get_Name()
IL_0020:  call       bool [System.Private.CoreLib]System.String::IsNullOrEmpty(string)
IL_0025:  ldc.i4.0
IL_0026:  ceq
IL_0028:  br.s       IL_002b
IL_002a:  ldc.i4.0
IL_002b:  stloc.1
IL_002c:  ldloc.1
IL_002d:  brfalse.s  IL_004d
IL_002f:  nop
IL_0030:  ldarg.0
IL_0031:  callvirt   instance class [System.Private.CoreLib]System.Globalization.CultureInfo [System.Private.CoreLib]System.Reflection.AssemblyName::get_CultureInfo()
IL_0036:  call       string Costura.AssemblyLoader::CultureToString(class [System.Private.CoreLib]System.Globalization.CultureInfo)
IL_003b:  ldstr      "."
IL_0040:  ldloc.0
IL_0041:  call       string [System.Private.CoreLib]System.String::Concat(string,
string,
string)
IL_0046:  callvirt   instance string [System.Private.CoreLib]System.String::ToLowerInvariant()
IL_004b:  stloc.0
IL_004c:  nop
IL_004d:  ldloc.0
IL_004e:  stloc.2
IL_004f:  br.s       IL_0051
IL_0051:  ldloc.2
IL_0052:  ret
}
.method private hidebysig static string
GetPlatformName() cil managed
{
.maxstack  3
.locals init (string V_0,
valuetype [System.Private.CoreLib]System.Runtime.InteropServices.Architecture V_1,
bool V_2,
valuetype [System.Private.CoreLib]System.Runtime.InteropServices.Architecture V_3,
valuetype [System.Private.CoreLib]System.Runtime.InteropServices.Architecture V_4,
string V_5)
IL_0000:  nop
IL_0001:  ldstr      "win"
IL_0006:  stloc.0
IL_0007:  call       valuetype [System.Private.CoreLib]System.Runtime.InteropServices.OSPlatform [System.Private.CoreLib]System.Runtime.InteropServices.OSPlatform::get_Windows()
IL_000c:  call       bool [System.Private.CoreLib]System.Runtime.InteropServices.RuntimeInformation::IsOSPlatform(valuetype [System.Private.CoreLib]System.Runtime.InteropServices.OSPlatform)
IL_0011:  ldc.i4.0
IL_0012:  ceq
IL_0014:  stloc.2
IL_0015:  ldloc.2
IL_0016:  brfalse.s  IL_0024
IL_0018:  nop
IL_0019:  ldstr      "Platform is not (yet) supported"
IL_001e:  newobj     instance void [System.Private.CoreLib]System.NotSupportedException::.ctor(string)
IL_0023:  throw
IL_0024:  call       valuetype [System.Private.CoreLib]System.Runtime.InteropServices.Architecture [System.Private.CoreLib]System.Runtime.InteropServices.RuntimeInformation::get_ProcessArchitecture()
IL_0029:  stloc.1
IL_002a:  ldloc.1
IL_002b:  stloc.s    V_4
IL_002d:  ldloc.s    V_4
IL_002f:  stloc.3
IL_0030:  ldloc.3
IL_0031:  switch     (
IL_005c,
IL_0070,
IL_0084,
IL_0048)
IL_0046:  br.s       IL_0084
IL_0048:  ldstr      "{0}-{1}"
IL_004d:  ldloc.0
IL_004e:  ldstr      "arm64"
IL_0053:  call       string [System.Private.CoreLib]System.String::Format(string,
object,
object)
IL_0058:  stloc.s    V_5
IL_005a:  br.s       IL_009a
IL_005c:  ldstr      "{0}-{1}"
IL_0061:  ldloc.0
IL_0062:  ldstr      "x86"
IL_0067:  call       string [System.Private.CoreLib]System.String::Format(string,
object,
object)
IL_006c:  stloc.s    V_5
IL_006e:  br.s       IL_009a
IL_0070:  ldstr      "{0}-{1}"
IL_0075:  ldloc.0
IL_0076:  ldstr      "x64"
IL_007b:  call       string [System.Private.CoreLib]System.String::Format(string,
object,
object)
IL_0080:  stloc.s    V_5
IL_0082:  br.s       IL_009a
IL_0084:  ldstr      "Architecture '{0}' not supported"
IL_0089:  ldloc.1
IL_008a:  box        [System.Private.CoreLib]System.Runtime.InteropServices.Architecture
IL_008f:  call       string [System.Private.CoreLib]System.String::Format(string,
object)
IL_0094:  newobj     instance void [System.Private.CoreLib]System.NotSupportedException::.ctor(string)
IL_0099:  throw
IL_009a:  ldloc.s    V_5
IL_009c:  ret
}
.method private hidebysig static class [System.Private.CoreLib]System.Reflection.Assembly
ReadFromDiskCache(string tempBasePath,
class [System.Private.CoreLib]System.Reflection.AssemblyName requestedAssemblyName) cil managed
{
.maxstack  3
.locals init (string V_0,
string V_1,
string V_2,
bool V_3,
class [System.Private.CoreLib]System.Reflection.Assembly V_4,
bool V_5,
bool V_6,
bool V_7)
IL_0000:  nop
IL_0001:  ldarg.1
IL_0002:  call       string Costura.AssemblyLoader::GetAssemblyResourceName(class [System.Private.CoreLib]System.Reflection.AssemblyName)
IL_0007:  stloc.0
IL_0008:  call       string Costura.AssemblyLoader::GetPlatformName()
IL_000d:  stloc.1
IL_000e:  ldarg.0
IL_000f:  ldloc.0
IL_0010:  ldstr      ".dll"
IL_0015:  call       string [System.Private.CoreLib]System.String::Concat(string,
string)
IL_001a:  call       string [System.Private.CoreLib]System.IO.Path::Combine(string,
string)
IL_001f:  stloc.2
IL_0020:  ldloc.2
IL_0021:  call       bool [System.Private.CoreLib]System.IO.File::Exists(string)
IL_0026:  stloc.3
IL_0027:  ldloc.3
IL_0028:  brfalse.s  IL_0035
IL_002a:  nop
IL_002b:  ldloc.2
IL_002c:  call       class [System.Private.CoreLib]System.Reflection.Assembly [System.Private.CoreLib]System.Reflection.Assembly::LoadFile(string)
IL_0031:  stloc.s    V_4
IL_0033:  br.s       IL_00af
IL_0035:  ldloc.2
IL_0036:  ldstr      "exe"
IL_003b:  call       string [System.Private.CoreLib]System.IO.Path::ChangeExtension(string,
string)
IL_0040:  stloc.2
IL_0041:  ldloc.2
IL_0042:  call       bool [System.Private.CoreLib]System.IO.File::Exists(string)
IL_0047:  stloc.s    V_5
IL_0049:  ldloc.s    V_5
IL_004b:  brfalse.s  IL_0058
IL_004d:  nop
IL_004e:  ldloc.2
IL_004f:  call       class [System.Private.CoreLib]System.Reflection.Assembly [System.Private.CoreLib]System.Reflection.Assembly::LoadFile(string)
IL_0054:  stloc.s    V_4
IL_0056:  br.s       IL_00af
IL_0058:  ldarg.0
IL_0059:  ldloc.1
IL_005a:  call       string [System.Private.CoreLib]System.IO.Path::Combine(string,
string)
IL_005f:  ldloc.0
IL_0060:  ldstr      ".dll"
IL_0065:  call       string [System.Private.CoreLib]System.String::Concat(string,
string)
IL_006a:  call       string [System.Private.CoreLib]System.IO.Path::Combine(string,
string)
IL_006f:  stloc.2
IL_0070:  ldloc.2
IL_0071:  call       bool [System.Private.CoreLib]System.IO.File::Exists(string)
IL_0076:  stloc.s    V_6
IL_0078:  ldloc.s    V_6
IL_007a:  brfalse.s  IL_0087
IL_007c:  nop
IL_007d:  ldloc.2
IL_007e:  call       class [System.Private.CoreLib]System.Reflection.Assembly [System.Private.CoreLib]System.Reflection.Assembly::LoadFile(string)
IL_0083:  stloc.s    V_4
IL_0085:  br.s       IL_00af
IL_0087:  ldloc.2
IL_0088:  ldstr      "exe"
IL_008d:  call       string [System.Private.CoreLib]System.IO.Path::ChangeExtension(string,
string)
IL_0092:  stloc.2
IL_0093:  ldloc.2
IL_0094:  call       bool [System.Private.CoreLib]System.IO.File::Exists(string)
IL_0099:  stloc.s    V_7
IL_009b:  ldloc.s    V_7
IL_009d:  brfalse.s  IL_00aa
IL_009f:  nop
IL_00a0:  ldloc.2
IL_00a1:  call       class [System.Private.CoreLib]System.Reflection.Assembly [System.Private.CoreLib]System.Reflection.Assembly::LoadFile(string)
IL_00a6:  stloc.s    V_4
IL_00a8:  br.s       IL_00af
IL_00aa:  ldnull
IL_00ab:  stloc.s    V_4
IL_00ad:  br.s       IL_00af
IL_00af:  ldloc.s    V_4
IL_00b1:  ret
}
.method public hidebysig static class [System.Private.CoreLib]System.Reflection.Assembly
ResolveAssembly(class [System.Private.CoreLib]System.Runtime.Loader.AssemblyLoadContext assemblyLoadContext,
class [System.Private.CoreLib]System.Reflection.AssemblyName assemblyName) cil managed
{
.maxstack  5
.locals init (string V_0,
class [System.Private.CoreLib]System.Reflection.AssemblyName V_1,
class [System.Private.CoreLib]System.Reflection.Assembly V_2,
object V_3,
bool V_4,
bool V_5,
class [System.Private.CoreLib]System.Reflection.Assembly V_6,
bool V_7,
bool V_8,
object V_9,
bool V_10,
bool V_11)
IL_0000:  nop
IL_0001:  ldarg.1
IL_0002:  callvirt   instance string [System.Private.CoreLib]System.Reflection.AssemblyName::get_Name()
IL_0007:  stloc.0
IL_0008:  ldsfld     object Costura.AssemblyLoader::nullCacheLock
IL_000d:  stloc.3
IL_000e:  ldc.i4.0
IL_000f:  stloc.s    V_4
.try
{
IL_0011:  ldloc.3
IL_0012:  ldloca.s   V_4
IL_0014:  call       void [System.Private.CoreLib]System.Threading.Monitor::Enter(object,
bool&)
IL_0019:  nop
IL_001a:  nop
IL_001b:  ldsfld     class [System.Private.CoreLib]System.Collections.Generic.Dictionary`2<string,bool> Costura.AssemblyLoader::nullCache
IL_0020:  ldloc.0
IL_0021:  callvirt   instance bool class [System.Private.CoreLib]System.Collections.Generic.Dictionary`2<string,bool>::ContainsKey(!0)
IL_0026:  stloc.s    V_5
IL_0028:  ldloc.s    V_5
IL_002a:  brfalse.s  IL_0035
IL_002c:  nop
IL_002d:  ldnull
IL_002e:  stloc.s    V_6
IL_0030:  leave      IL_00e7
IL_0035:  nop
IL_0036:  leave.s    IL_0044
}  // end .try
finally
{
IL_0038:  ldloc.s    V_4
IL_003a:  brfalse.s  IL_0043
IL_003c:  ldloc.3
IL_003d:  call       void [System.Private.CoreLib]System.Threading.Monitor::Exit(object)
IL_0042:  nop
IL_0043:  endfinally
}  // end handler
IL_0044:  ldloc.0
IL_0045:  newobj     instance void [System.Private.CoreLib]System.Reflection.AssemblyName::.ctor(string)
IL_004a:  stloc.1
IL_004b:  ldloc.1
IL_004c:  call       class [System.Private.CoreLib]System.Reflection.Assembly Costura.AssemblyLoader::ReadExistingAssembly(class [System.Private.CoreLib]System.Reflection.AssemblyName)
IL_0051:  stloc.2
IL_0052:  ldloc.2
IL_0053:  ldnull
IL_0054:  cgt.un
IL_0056:  stloc.s    V_7
IL_0058:  ldloc.s    V_7
IL_005a:  brfalse.s  IL_0065
IL_005c:  nop
IL_005d:  ldloc.2
IL_005e:  stloc.s    V_6
IL_0060:  br         IL_00e7
IL_0065:  ldstr      "Loading assembly '{0}' into the AppDomain"
IL_006a:  ldc.i4.1
IL_006b:  newarr     [System.Private.CoreLib]System.Object
IL_0070:  dup
IL_0071:  ldc.i4.0
IL_0072:  ldloc.1
IL_0073:  stelem.ref
IL_0074:  call       void Costura.AssemblyLoader::Log(string,
object[])
IL_0079:  nop
IL_007a:  ldsfld     string Costura.AssemblyLoader::tempBasePath
IL_007f:  ldloc.1
IL_0080:  call       class [System.Private.CoreLib]System.Reflection.Assembly Costura.AssemblyLoader::ReadFromDiskCache(string,
class [System.Private.CoreLib]System.Reflection.AssemblyName)
IL_0085:  stloc.2
IL_0086:  ldloc.2
IL_0087:  ldnull
IL_0088:  ceq
IL_008a:  stloc.s    V_8
IL_008c:  ldloc.s    V_8
IL_008e:  brfalse.s  IL_00e2
IL_0090:  nop
IL_0091:  ldsfld     object Costura.AssemblyLoader::nullCacheLock
IL_0096:  stloc.s    V_9
IL_0098:  ldc.i4.0
IL_0099:  stloc.s    V_10
.try
{
IL_009b:  ldloc.s    V_9
IL_009d:  ldloca.s   V_10
IL_009f:  call       void [System.Private.CoreLib]System.Threading.Monitor::Enter(object,
bool&)
IL_00a4:  nop
IL_00a5:  nop
IL_00a6:  ldsfld     class [System.Private.CoreLib]System.Collections.Generic.Dictionary`2<string,bool> Costura.AssemblyLoader::nullCache
IL_00ab:  ldloc.0
IL_00ac:  ldc.i4.1
IL_00ad:  callvirt   instance void class [System.Private.CoreLib]System.Collections.Generic.Dictionary`2<string,bool>::set_Item(!0,
!1)
IL_00b2:  nop
IL_00b3:  nop
IL_00b4:  leave.s    IL_00c3
}  // end .try
finally
{
IL_00b6:  ldloc.s    V_10
IL_00b8:  brfalse.s  IL_00c2
IL_00ba:  ldloc.s    V_9
IL_00bc:  call       void [System.Private.CoreLib]System.Threading.Monitor::Exit(object)
IL_00c1:  nop
IL_00c2:  endfinally
}  // end handler
IL_00c3:  ldloc.1
IL_00c4:  callvirt   instance valuetype [System.Private.CoreLib]System.Reflection.AssemblyNameFlags [System.Private.CoreLib]System.Reflection.AssemblyName::get_Flags()
IL_00c9:  ldc.i4     0x100
IL_00ce:  and
IL_00cf:  ldc.i4.0
IL_00d0:  cgt.un
IL_00d2:  stloc.s    V_11
IL_00d4:  ldloc.s    V_11
IL_00d6:  brfalse.s  IL_00e1
IL_00d8:  nop
IL_00d9:  ldloc.1
IL_00da:  call       class [System.Private.CoreLib]System.Reflection.Assembly [System.Private.CoreLib]System.Reflection.Assembly::Load(class [System.Private.CoreLib]System.Reflection.AssemblyName)
IL_00df:  stloc.2
IL_00e0:  nop
IL_00e1:  nop
IL_00e2:  ldloc.2
IL_00e3:  stloc.s    V_6
IL_00e5:  br.s       IL_00e7
IL_00e7:  ldloc.s    V_6
IL_00e9:  ret
}
.method private hidebysig specialname rtspecialname static
void  .cctor() cil managed
{
.maxstack  3
IL_0000:  newobj     instance void [System.Private.CoreLib]System.Object::.ctor()
IL_0005:  stsfld     object Costura.AssemblyLoader::nullCacheLock
IL_000a:  newobj     instance void class [System.Private.CoreLib]System.Collections.Generic.Dictionary`2<string,bool>::.ctor()
IL_000f:  stsfld     class [System.Private.CoreLib]System.Collections.Generic.Dictionary`2<string,bool> Costura.AssemblyLoader::nullCache
IL_0014:  newobj     instance void class [System.Private.CoreLib]System.Collections.Generic.List`1<string>::.ctor()
IL_0019:  stsfld     class [System.Private.CoreLib]System.Collections.Generic.List`1<string> Costura.AssemblyLoader::preloadList
IL_001e:  newobj     instance void class [System.Private.CoreLib]System.Collections.Generic.List`1<string>::.ctor()
IL_0023:  stsfld     class [System.Private.CoreLib]System.Collections.Generic.List`1<string> Costura.AssemblyLoader::preloadWinX86List
IL_0028:  newobj     instance void class [System.Private.CoreLib]System.Collections.Generic.List`1<string>::.ctor()
IL_002d:  stsfld     class [System.Private.CoreLib]System.Collections.Generic.List`1<string> Costura.AssemblyLoader::preloadWinX64List
IL_0032:  newobj     instance void class [System.Private.CoreLib]System.Collections.Generic.List`1<string>::.ctor()
IL_0037:  stsfld     class [System.Private.CoreLib]System.Collections.Generic.List`1<string> Costura.AssemblyLoader::preloadWinArm64List
IL_003c:  newobj     instance void class [System.Private.CoreLib]System.Collections.Generic.Dictionary`2<string,string>::.ctor()
IL_0041:  stsfld     class [System.Private.CoreLib]System.Collections.Generic.Dictionary`2<string,string> Costura.AssemblyLoader::checksums
IL_0046:  ldsfld     class [System.Private.CoreLib]System.Collections.Generic.Dictionary`2<string,string> Costura.AssemblyLoader::checksums
IL_004b:  ldstr      "costura.assemblytoreference.dll.compressed"
IL_0050:  ldstr      "[CHECKSUM]"
IL_0055:  callvirt   instance void class [System.Private.CoreLib]System.Collections.Generic.Dictionary`2<string,string>::Add(!0,
!1)
IL_005a:  ldsfld     class [System.Private.CoreLib]System.Collections.Generic.Dictionary`2<string,string> Costura.AssemblyLoader::checksums
IL_005f:  ldstr      "costura.assemblytoreference.pdb.compressed"
IL_0064:  ldstr      "[CHECKSUM]"
IL_0069:  callvirt   instance void class [System.Private.CoreLib]System.Collections.Generic.Dictionary`2<string,string>::Add(!0,
!1)
IL_006e:  ldsfld     class [System.Private.CoreLib]System.Collections.Generic.Dictionary`2<string,string> Costura.AssemblyLoader::checksums
IL_0073:  ldstr      "costura.assemblytoreferencepreembedded.dll"
IL_0078:  ldstr      "[CHECKSUM]"
IL_007d:  callvirt   instance void class [System.Private.CoreLib]System.Collections.Generic.Dictionary`2<string,string>::Add(!0,
!1)
IL_0082:  ldsfld     class [System.Private.CoreLib]System.Collections.Generic.Dictionary`2<string,string> Costura.AssemblyLoader::checksums
IL_0087:  ldstr      "costura.assemblytoreferencepreembedded.pdb.compres"
+ "sed"
IL_008c:  ldstr      "[CHECKSUM]"
IL_0091:  callvirt   instance void class [System.Private.CoreLib]System.Collections.Generic.Dictionary`2<string,string>::Add(!0,
!1)
IL_0096:  ldsfld     class [System.Private.CoreLib]System.Collections.Generic.Dictionary`2<string,string> Costura.AssemblyLoader::checksums
IL_009b:  ldstr      "costura.exetoreference.exe.compressed"
IL_00a0:  ldstr      "[CHECKSUM]"
IL_00a5:  callvirt   instance void class [System.Private.CoreLib]System.Collections.Generic.Dictionary`2<string,string>::Add(!0,
!1)
IL_00aa:  ldsfld     class [System.Private.CoreLib]System.Collections.Generic.Dictionary`2<string,string> Costura.AssemblyLoader::checksums
IL_00af:  ldstr      "costura.exetoreference.pdb.compressed"
IL_00b4:  ldstr      "[CHECKSUM]"
IL_00b9:  callvirt   instance void class [System.Private.CoreLib]System.Collections.Generic.Dictionary`2<string,string>::Add(!0,
!1)
IL_00be:  ldsfld     class [System.Private.CoreLib]System.Collections.Generic.List`1<string> Costura.AssemblyLoader::preloadList
IL_00c3:  ldstr      "costura.assemblytoreference.dll.compressed"
IL_00c8:  callvirt   instance void class [System.Private.CoreLib]System.Collections.Generic.List`1<string>::Add(!0)
IL_00cd:  ldsfld     class [System.Private.CoreLib]System.Collections.Generic.List`1<string> Costura.AssemblyLoader::preloadList
IL_00d2:  ldstr      "costura.assemblytoreference.pdb.compressed"
IL_00d7:  callvirt   instance void class [System.Private.CoreLib]System.Collections.Generic.List`1<string>::Add(!0)
IL_00dc:  ldsfld     class [System.Private.CoreLib]System.Collections.Generic.List`1<string> Costura.AssemblyLoader::preloadList
IL_00e1:  ldstr      "costura.assemblytoreferencepreembedded.dll"
IL_00e6:  callvirt   instance void class [System.Private.CoreLib]System.Collections.Generic.List`1<string>::Add(!0)
IL_00eb:  ldsfld     class [System.Private.CoreLib]System.Collections.Generic.List`1<string> Costura.AssemblyLoader::preloadList
IL_00f0:  ldstr      "costura.assemblytoreferencepreembedded.pdb.compres"
+ "sed"
IL_00f5:  callvirt   instance void class [System.Private.CoreLib]System.Collections.Generic.List`1<string>::Add(!0)
IL_00fa:  ldsfld     class [System.Private.CoreLib]System.Collections.Generic.List`1<string> Costura.AssemblyLoader::preloadList
IL_00ff:  ldstr      "costura.exetoreference.exe.compressed"
IL_0104:  callvirt   instance void class [System.Private.CoreLib]System.Collections.Generic.List`1<string>::Add(!0)
IL_0109:  ldsfld     class [System.Private.CoreLib]System.Collections.Generic.List`1<string> Costura.AssemblyLoader::preloadList
IL_010e:  ldstr      "costura.exetoreference.pdb.compressed"
IL_0113:  callvirt   instance void class [System.Private.CoreLib]System.Collections.Generic.List`1<string>::Add(!0)
IL_0118:  ret
}
.method private hidebysig static class [System.Private.CoreLib]System.Collections.Generic.List`1<string>
GetUnmanagedAssemblies() cil managed
{
.maxstack  2
.locals init (valuetype [System.Private.CoreLib]System.Runtime.InteropServices.Architecture V_0,
bool V_1,
valuetype [System.Private.CoreLib]System.Runtime.InteropServices.Architecture V_2,
valuetype [System.Private.CoreLib]System.Runtime.InteropServices.Architecture V_3,
class [System.Private.CoreLib]System.Collections.Generic.List`1<string> V_4)
IL_0000:  nop
IL_0001:  call       valuetype [System.Private.CoreLib]System.Runtime.InteropServices.Architecture [System.Private.CoreLib]System.Runtime.InteropServices.RuntimeInformation::get_ProcessArchitecture()
IL_0006:  stloc.0
IL_0007:  call       valuetype [System.Private.CoreLib]System.Runtime.InteropServices.OSPlatform [System.Private.CoreLib]System.Runtime.InteropServices.OSPlatform::get_Windows()
IL_000c:  call       bool [System.Private.CoreLib]System.Runtime.InteropServices.RuntimeInformation::IsOSPlatform(valuetype [System.Private.CoreLib]System.Runtime.InteropServices.OSPlatform)
IL_0011:  stloc.1
IL_0012:  ldloc.1
IL_0013:  brfalse.s  IL_0063
IL_0015:  nop
IL_0016:  ldloc.0
IL_0017:  stloc.3
IL_0018:  ldloc.3
IL_0019:  stloc.2
IL_001a:  ldloc.2
IL_001b:  switch     (
IL_003b,
IL_0044,
IL_004d,
IL_0032)
IL_0030:  br.s       IL_004d
IL_0032:  ldsfld     class [System.Private.CoreLib]System.Collections.Generic.List`1<string> Costura.AssemblyLoader::preloadWinArm64List
IL_0037:  stloc.s    V_4
IL_0039:  br.s       IL_006e
IL_003b:  ldsfld     class [System.Private.CoreLib]System.Collections.Generic.List`1<string> Costura.AssemblyLoader::preloadWinX86List
IL_0040:  stloc.s    V_4
IL_0042:  br.s       IL_006e
IL_0044:  ldsfld     class [System.Private.CoreLib]System.Collections.Generic.List`1<string> Costura.AssemblyLoader::preloadWinX64List
IL_0049:  stloc.s    V_4
IL_004b:  br.s       IL_006e
IL_004d:  ldstr      "Architecture '{0}' not supported"
IL_0052:  ldloc.0
IL_0053:  box        [System.Private.CoreLib]System.Runtime.InteropServices.Architecture
IL_0058:  call       string [System.Private.CoreLib]System.String::Format(string,
object)
IL_005d:  newobj     instance void [System.Private.CoreLib]System.NotSupportedException::.ctor(string)
IL_0062:  throw
IL_0063:  ldstr      "Platform is not (yet) supported"
IL_0068:  newobj     instance void [System.Private.CoreLib]System.NotSupportedException::.ctor(string)
IL_006d:  throw
IL_006e:  ldloc.s    V_4
IL_0070:  ret
}
.method private hidebysig static void  CreateDirectory(string tempBasePath) cil managed
{
.maxstack  2
.locals init (bool V_0)
IL_0000:  nop
IL_0001:  ldarg.0
IL_0002:  call       bool [System.Private.CoreLib]System.IO.Directory::Exists(string)
IL_0007:  ldc.i4.0
IL_0008:  ceq
IL_000a:  stloc.0
IL_000b:  ldloc.0
IL_000c:  brfalse.s  IL_0017
IL_000e:  nop
IL_000f:  ldarg.0
IL_0010:  call       class [System.Private.CoreLib]System.IO.DirectoryInfo [System.Private.CoreLib]System.IO.Directory::CreateDirectory(string)
IL_0015:  pop
IL_0016:  nop
IL_0017:  ret
}
.method private hidebysig static string
ResourceNameToPath(string lib) cil managed
{
.maxstack  4
.locals init (string V_0,
string V_1,
string V_2,
string V_3,
bool V_4,
bool V_5,
bool V_6,
string V_7)
IL_0000:  nop
IL_0001:  call       string Costura.AssemblyLoader::GetPlatformName()
IL_0006:  stloc.0
IL_0007:  ldarg.0
IL_0008:  stloc.1
IL_0009:  ldstr      "costura-"
IL_000e:  ldloc.0
IL_000f:  ldstr      "."
IL_0014:  call       string [System.Private.CoreLib]System.String::Concat(string,
string,
string)
IL_0019:  ldstr      "-"
IL_001e:  ldstr      "_"
IL_0023:  callvirt   instance string [System.Private.CoreLib]System.String::Replace(string,
string)
IL_0028:  stloc.2
IL_0029:  ldstr      "costura."
IL_002e:  stloc.3
IL_002f:  ldarg.0
IL_0030:  ldloc.2
IL_0031:  callvirt   instance bool [System.Private.CoreLib]System.String::StartsWith(string)
IL_0036:  stloc.s    V_4
IL_0038:  ldloc.s    V_4
IL_003a:  brfalse.s  IL_0053
IL_003c:  nop
IL_003d:  ldloc.0
IL_003e:  ldarg.0
IL_003f:  ldloc.2
IL_0040:  callvirt   instance int32 [System.Private.CoreLib]System.String::get_Length()
IL_0045:  callvirt   instance string [System.Private.CoreLib]System.String::Substring(int32)
IL_004a:  call       string [System.Private.CoreLib]System.IO.Path::Combine(string,
string)
IL_004f:  stloc.1
IL_0050:  nop
IL_0051:  br.s       IL_006f
IL_0053:  ldarg.0
IL_0054:  ldloc.3
IL_0055:  callvirt   instance bool [System.Private.CoreLib]System.String::StartsWith(string)
IL_005a:  stloc.s    V_5
IL_005c:  ldloc.s    V_5
IL_005e:  brfalse.s  IL_006f
IL_0060:  nop
IL_0061:  ldarg.0
IL_0062:  ldloc.3
IL_0063:  callvirt   instance int32 [System.Private.CoreLib]System.String::get_Length()
IL_0068:  callvirt   instance string [System.Private.CoreLib]System.String::Substring(int32)
IL_006d:  stloc.1
IL_006e:  nop
IL_006f:  ldloc.1
IL_0070:  ldstr      ".compressed"
IL_0075:  callvirt   instance bool [System.Private.CoreLib]System.String::EndsWith(string)
IL_007a:  stloc.s    V_6
IL_007c:  ldloc.s    V_6
IL_007e:  brfalse.s  IL_0093
IL_0080:  nop
IL_0081:  ldloc.1
IL_0082:  ldc.i4.0
IL_0083:  ldloc.1
IL_0084:  callvirt   instance int32 [System.Private.CoreLib]System.String::get_Length()
IL_0089:  ldc.i4.s   11
IL_008b:  sub
IL_008c:  callvirt   instance string [System.Private.CoreLib]System.String::Substring(int32,
int32)
IL_0091:  stloc.1
IL_0092:  nop
IL_0093:  ldloc.1
IL_0094:  stloc.s    V_7
IL_0096:  br.s       IL_0098
IL_0098:  ldloc.s    V_7
IL_009a:  ret
}
.method private hidebysig static string
CalculateChecksum(string filename) cil managed
{
.maxstack  4
.locals init (class [System.Private.CoreLib]System.IO.FileStream V_0,
class [System.Private.CoreLib]System.IO.BufferedStream V_1,
class [System.Security.Cryptography]System.Security.Cryptography.SHA1 V_2,
uint8[] V_3,
class [System.Private.CoreLib]System.Text.StringBuilder V_4,
uint8[] V_5,
int32 V_6,
uint8 V_7,
string V_8)
IL_0000:  nop
IL_0001:  ldarg.0
IL_0002:  ldc.i4.3
IL_0003:  ldc.i4.1
IL_0004:  ldc.i4.7
IL_0005:  newobj     instance void [System.Private.CoreLib]System.IO.FileStream::.ctor(string,
valuetype [System.Private.CoreLib]System.IO.FileMode,
valuetype [System.Private.CoreLib]System.IO.FileAccess,
valuetype [System.Private.CoreLib]System.IO.FileShare)
IL_000a:  stloc.0
.try
{
IL_000b:  ldloc.0
IL_000c:  newobj     instance void [System.Private.CoreLib]System.IO.BufferedStream::.ctor(class [System.Private.CoreLib]System.IO.Stream)
IL_0011:  stloc.1
.try
{
IL_0012:  call       class [System.Security.Cryptography]System.Security.Cryptography.SHA1 [System.Security.Cryptography]System.Security.Cryptography.SHA1::Create()
IL_0017:  stloc.2
.try
{
IL_0018:  nop
IL_0019:  ldloc.2
IL_001a:  ldloc.1
IL_001b:  callvirt   instance uint8[] [System.Security.Cryptography]System.Security.Cryptography.HashAlgorithm::ComputeHash(class [System.Runtime]System.IO.Stream)
IL_0020:  stloc.3
IL_0021:  ldc.i4.2
IL_0022:  ldloc.3
IL_0023:  ldlen
IL_0024:  conv.i4
IL_0025:  mul
IL_0026:  newobj     instance void [System.Private.CoreLib]System.Text.StringBuilder::.ctor(int32)
IL_002b:  stloc.s    V_4
IL_002d:  nop
IL_002e:  ldloc.3
IL_002f:  stloc.s    V_5
IL_0031:  ldc.i4.0
IL_0032:  stloc.s    V_6
IL_0034:  br.s       IL_0059
IL_0036:  ldloc.s    V_5
IL_0038:  ldloc.s    V_6
IL_003a:  ldelem.u1
IL_003b:  stloc.s    V_7
IL_003d:  nop
IL_003e:  ldloc.s    V_4
IL_0040:  ldstr      "{0:X2}"
IL_0045:  ldloc.s    V_7
IL_0047:  box        [System.Private.CoreLib]System.Byte
IL_004c:  callvirt   instance class [System.Private.CoreLib]System.Text.StringBuilder [System.Private.CoreLib]System.Text.StringBuilder::AppendFormat(string,
object)
IL_0051:  pop
IL_0052:  nop
IL_0053:  ldloc.s    V_6
IL_0055:  ldc.i4.1
IL_0056:  add
IL_0057:  stloc.s    V_6
IL_0059:  ldloc.s    V_6
IL_005b:  ldloc.s    V_5
IL_005d:  ldlen
IL_005e:  conv.i4
IL_005f:  blt.s      IL_0036
IL_0061:  ldloc.s    V_4
IL_0063:  callvirt   instance string [System.Private.CoreLib]System.Object::ToString()
IL_0068:  stloc.s    V_8
IL_006a:  leave.s    IL_008d
}  // end .try
finally
{
IL_006c:  ldloc.2
IL_006d:  brfalse.s  IL_0076
IL_006f:  ldloc.2
IL_0070:  callvirt   instance void [System.Private.CoreLib]System.IDisposable::Dispose()
IL_0075:  nop
IL_0076:  endfinally
}  // end handler
}  // end .try
finally
{
IL_0077:  ldloc.1
IL_0078:  brfalse.s  IL_0081
IL_007a:  ldloc.1
IL_007b:  callvirt   instance void [System.Private.CoreLib]System.IDisposable::Dispose()
IL_0080:  nop
IL_0081:  endfinally
}  // end handler
}  // end .try
finally
{
IL_0082:  ldloc.0
IL_0083:  brfalse.s  IL_008c
IL_0085:  ldloc.0
IL_0086:  callvirt   instance void [System.Private.CoreLib]System.IDisposable::Dispose()
IL_008b:  nop
IL_008c:  endfinally
}  // end handler
IL_008d:  ldloc.s    V_8
IL_008f:  ret
}
.method private hidebysig static void  CopyTo(class [System.Private.CoreLib]System.IO.Stream source,
class [System.Private.CoreLib]System.IO.Stream destination) cil managed
{
.maxstack  4
.locals init (uint8[] V_0,
int32 V_1,
bool V_2)
IL_0000:  nop
IL_0001:  ldc.i4     0x14000
IL_0006:  newarr     [System.Private.CoreLib]System.Byte
IL_000b:  stloc.0
IL_000c:  br.s       IL_001a
IL_000e:  nop
IL_000f:  ldarg.1
IL_0010:  ldloc.0
IL_0011:  ldc.i4.0
IL_0012:  ldloc.1
IL_0013:  callvirt   instance void [System.Private.CoreLib]System.IO.Stream::Write(uint8[],
int32,
int32)
IL_0018:  nop
IL_0019:  nop
IL_001a:  ldarg.0
IL_001b:  ldloc.0
IL_001c:  ldc.i4.0
IL_001d:  ldloc.0
IL_001e:  ldlen
IL_001f:  conv.i4
IL_0020:  callvirt   instance int32 [System.Private.CoreLib]System.IO.Stream::Read(uint8[],
int32,
int32)
IL_0025:  dup
IL_0026:  stloc.1
IL_0027:  ldc.i4.0
IL_0028:  cgt.un
IL_002a:  stloc.2
IL_002b:  ldloc.2
IL_002c:  brtrue.s   IL_000e
IL_002e:  ret
}
.method private hidebysig static class [System.Private.CoreLib]System.IO.Stream
LoadStream(string fullName) cil managed
{
.maxstack  2
.locals init (class [System.Private.CoreLib]System.Reflection.Assembly V_0,
bool V_1,
class [System.Private.CoreLib]System.IO.Stream V_2,
class [System.IO.Compression]System.IO.Compression.DeflateStream V_3,
class [System.Private.CoreLib]System.IO.MemoryStream V_4,
class [System.Private.CoreLib]System.IO.Stream V_5)
IL_0000:  nop
IL_0001:  call       class [System.Private.CoreLib]System.Reflection.Assembly [System.Private.CoreLib]System.Reflection.Assembly::GetExecutingAssembly()
IL_0006:  stloc.0
IL_0007:  ldarg.0
IL_0008:  ldstr      ".compressed"
IL_000d:  callvirt   instance bool [System.Private.CoreLib]System.String::EndsWith(string)
IL_0012:  stloc.1
IL_0013:  ldloc.1
IL_0014:  brfalse.s  IL_005e
IL_0016:  nop
IL_0017:  ldloc.0
IL_0018:  ldarg.0
IL_0019:  callvirt   instance class [System.Private.CoreLib]System.IO.Stream [System.Private.CoreLib]System.Reflection.Assembly::GetManifestResourceStream(string)
IL_001e:  stloc.2
.try
{
IL_001f:  ldloc.2
IL_0020:  ldc.i4.0
IL_0021:  newobj     instance void [System.IO.Compression]System.IO.Compression.DeflateStream::.ctor(class [System.Runtime]System.IO.Stream,
valuetype [System.IO.Compression]System.IO.Compression.CompressionMode)
IL_0026:  stloc.3
.try
{
IL_0027:  nop
IL_0028:  newobj     instance void [System.Private.CoreLib]System.IO.MemoryStream::.ctor()
IL_002d:  stloc.s    V_4
IL_002f:  ldloc.3
IL_0030:  ldloc.s    V_4
IL_0032:  call       void Costura.AssemblyLoader::CopyTo(class [System.Private.CoreLib]System.IO.Stream,
class [System.Private.CoreLib]System.IO.Stream)
IL_0037:  nop
IL_0038:  ldloc.s    V_4
IL_003a:  ldc.i4.0
IL_003b:  conv.i8
IL_003c:  callvirt   instance void [System.Private.CoreLib]System.IO.Stream::set_Position(int64)
IL_0041:  nop
IL_0042:  ldloc.s    V_4
IL_0044:  stloc.s    V_5
IL_0046:  leave.s    IL_0069
}  // end .try
finally
{
IL_0048:  ldloc.3
IL_0049:  brfalse.s  IL_0052
IL_004b:  ldloc.3
IL_004c:  callvirt   instance void [System.Private.CoreLib]System.IDisposable::Dispose()
IL_0051:  nop
IL_0052:  endfinally
}  // end handler
}  // end .try
finally
{
IL_0053:  ldloc.2
IL_0054:  brfalse.s  IL_005d
IL_0056:  ldloc.2
IL_0057:  callvirt   instance void [System.Private.CoreLib]System.IDisposable::Dispose()
IL_005c:  nop
IL_005d:  endfinally
}  // end handler
IL_005e:  ldloc.0
IL_005f:  ldarg.0
IL_0060:  callvirt   instance class [System.Private.CoreLib]System.IO.Stream [System.Private.CoreLib]System.Reflection.Assembly::GetManifestResourceStream(string)
IL_0065:  stloc.s    V_5
IL_0067:  br.s       IL_0069
IL_0069:  ldloc.s    V_5
IL_006b:  ret
}
.method private hidebysig static pinvokeimpl("kernel32.dll" winapi)
uint32  SetErrorMode(uint32 uMode) cil managed preservesig
{
}
.method private hidebysig static pinvokeimpl("kernel32" unicode lasterr winapi)
native int  LoadLibraryEx(string lpFileName,
native int hReservedNull,
uint32 dwFlags) cil managed preservesig
{
}
.method private hidebysig static void  InternalPreloadUnmanagedLibraries(string tempBasePath,
class [System.Private.CoreLib]System.Collections.Generic.IList`1<string> libs,
class [System.Private.CoreLib]System.Collections.Generic.Dictionary`2<string,string> checksums) cil managed
{
.maxstack  5
.locals init (string V_0,
uint32 V_1,
uint32 V_2,
class [System.Private.CoreLib]System.Collections.Generic.IEnumerator`1<string> V_3,
string V_4,
string V_5,
bool V_6,
string V_7,
bool V_8,
bool V_9,
class [System.Private.CoreLib]System.IO.Stream V_10,
class [System.Private.CoreLib]System.IO.FileStream V_11,
class [System.Private.CoreLib]System.Collections.Generic.IEnumerator`1<string> V_12,
string V_13,
bool V_14,
string V_15)
IL_0000:  nop
IL_0001:  nop
IL_0002:  ldarg.1
IL_0003:  callvirt   instance class [System.Private.CoreLib]System.Collections.Generic.IEnumerator`1<!0> class [System.Private.CoreLib]System.Collections.Generic.IEnumerable`1<string>::GetEnumerator()
IL_0008:  stloc.3
.try
{
IL_0009:  br         IL_00c8
IL_000e:  ldloc.3
IL_000f:  callvirt   instance !0 class [System.Private.CoreLib]System.Collections.Generic.IEnumerator`1<string>::get_Current()
IL_0014:  stloc.s    V_4
IL_0016:  nop
IL_0017:  ldloc.s    V_4
IL_0019:  call       string Costura.AssemblyLoader::ResourceNameToPath(string)
IL_001e:  stloc.0
IL_001f:  ldarg.0
IL_0020:  ldloc.0
IL_0021:  call       string [System.Private.CoreLib]System.IO.Path::Combine(string,
string)
IL_0026:  stloc.s    V_5
IL_0028:  ldstr      "Preloading unmanaged library '{0}' to '{1}'"
IL_002d:  ldc.i4.2
IL_002e:  newarr     [System.Private.CoreLib]System.Object
IL_0033:  dup
IL_0034:  ldc.i4.0
IL_0035:  ldloc.0
IL_0036:  stelem.ref
IL_0037:  dup
IL_0038:  ldc.i4.1
IL_0039:  ldloc.s    V_5
IL_003b:  stelem.ref
IL_003c:  call       void Costura.AssemblyLoader::Log(string,
object[])
IL_0041:  nop
IL_0042:  ldloc.s    V_5
IL_0044:  call       bool [System.Private.CoreLib]System.IO.File::Exists(string)
IL_0049:  stloc.s    V_6
IL_004b:  ldloc.s    V_6
IL_004d:  brfalse.s  IL_0079
IL_004f:  nop
IL_0050:  ldloc.s    V_5
IL_0052:  call       string Costura.AssemblyLoader::CalculateChecksum(string)
IL_0057:  stloc.s    V_7
IL_0059:  ldloc.s    V_7
IL_005b:  ldarg.2
IL_005c:  ldloc.s    V_4
IL_005e:  callvirt   instance !1 class [System.Private.CoreLib]System.Collections.Generic.Dictionary`2<string,string>::get_Item(!0)
IL_0063:  call       bool [System.Private.CoreLib]System.String::op_Inequality(string,
string)
IL_0068:  stloc.s    V_8
IL_006a:  ldloc.s    V_8
IL_006c:  brfalse.s  IL_0078
IL_006e:  nop
IL_006f:  ldloc.s    V_5
IL_0071:  call       void [System.Private.CoreLib]System.IO.File::Delete(string)
IL_0076:  nop
IL_0077:  nop
IL_0078:  nop
IL_0079:  ldloc.s    V_5
IL_007b:  call       bool [System.Private.CoreLib]System.IO.File::Exists(string)
IL_0080:  ldc.i4.0
IL_0081:  ceq
IL_0083:  stloc.s    V_9
IL_0085:  ldloc.s    V_9
IL_0087:  brfalse.s  IL_00c7
IL_0089:  nop
IL_008a:  ldloc.s    V_4
IL_008c:  call       class [System.Private.CoreLib]System.IO.Stream Costura.AssemblyLoader::LoadStream(string)
IL_0091:  stloc.s    V_10
.try
{
IL_0093:  ldloc.s    V_5
IL_0095:  call       class [System.Private.CoreLib]System.IO.FileStream [System.Private.CoreLib]System.IO.File::OpenWrite(string)
IL_009a:  stloc.s    V_11
.try
{
IL_009c:  nop
IL_009d:  ldloc.s    V_10
IL_009f:  ldloc.s    V_11
IL_00a1:  call       void Costura.AssemblyLoader::CopyTo(class [System.Private.CoreLib]System.IO.Stream,
class [System.Private.CoreLib]System.IO.Stream)
IL_00a6:  nop
IL_00a7:  nop
IL_00a8:  leave.s    IL_00b7
}  // end .try
finally
{
IL_00aa:  ldloc.s    V_11
IL_00ac:  brfalse.s  IL_00b6
IL_00ae:  ldloc.s    V_11
IL_00b0:  callvirt   instance void [System.Private.CoreLib]System.IDisposable::Dispose()
IL_00b5:  nop
IL_00b6:  endfinally
}  // end handler
IL_00b7:  leave.s    IL_00c6
}  // end .try
finally
{
IL_00b9:  ldloc.s    V_10
IL_00bb:  brfalse.s  IL_00c5
IL_00bd:  ldloc.s    V_10
IL_00bf:  callvirt   instance void [System.Private.CoreLib]System.IDisposable::Dispose()
IL_00c4:  nop
IL_00c5:  endfinally
}  // end handler
IL_00c6:  nop
IL_00c7:  nop
IL_00c8:  ldloc.3
IL_00c9:  callvirt   instance bool [System.Private.CoreLib]System.Collections.IEnumerator::MoveNext()
IL_00ce:  brtrue     IL_000e
IL_00d3:  leave.s    IL_00e0
}  // end .try
finally
{
IL_00d5:  ldloc.3
IL_00d6:  brfalse.s  IL_00df
IL_00d8:  ldloc.3
IL_00d9:  callvirt   instance void [System.Private.CoreLib]System.IDisposable::Dispose()
IL_00de:  nop
IL_00df:  endfinally
}  // end handler
IL_00e0:  ldc.i4     0x8003
IL_00e5:  stloc.1
IL_00e6:  ldloc.1
IL_00e7:  call       uint32 Costura.AssemblyLoader::SetErrorMode(uint32)
IL_00ec:  stloc.2
IL_00ed:  nop
IL_00ee:  ldarg.1
IL_00ef:  callvirt   instance class [System.Private.CoreLib]System.Collections.Generic.IEnumerator`1<!0> class [System.Private.CoreLib]System.Collections.Generic.IEnumerable`1<string>::GetEnumerator()
IL_00f4:  stloc.s    V_12
.try
{
IL_00f6:  br.s       IL_0135
IL_00f8:  ldloc.s    V_12
IL_00fa:  callvirt   instance !0 class [System.Private.CoreLib]System.Collections.Generic.IEnumerator`1<string>::get_Current()
IL_00ff:  stloc.s    V_13
IL_0101:  nop
IL_0102:  ldloc.s    V_13
IL_0104:  call       string Costura.AssemblyLoader::ResourceNameToPath(string)
IL_0109:  stloc.0
IL_010a:  ldloc.0
IL_010b:  ldstr      ".dll"
IL_0110:  callvirt   instance bool [System.Private.CoreLib]System.String::EndsWith(string)
IL_0115:  stloc.s    V_14
IL_0117:  ldloc.s    V_14
IL_0119:  brfalse.s  IL_0134
IL_011b:  nop
IL_011c:  ldarg.0
IL_011d:  ldloc.0
IL_011e:  call       string [System.Private.CoreLib]System.IO.Path::Combine(string,
string)
IL_0123:  stloc.s    V_15
IL_0125:  ldloc.s    V_15
IL_0127:  ldsfld     native int [System.Private.CoreLib]System.IntPtr::Zero
IL_012c:  ldc.i4.8
IL_012d:  call       native int Costura.AssemblyLoader::LoadLibraryEx(string,
native int,
uint32)
IL_0132:  pop
IL_0133:  nop
IL_0134:  nop
IL_0135:  ldloc.s    V_12
IL_0137:  callvirt   instance bool [System.Private.CoreLib]System.Collections.IEnumerator::MoveNext()
IL_013c:  brtrue.s   IL_00f8
IL_013e:  leave.s    IL_014d
}  // end .try
finally
{
IL_0140:  ldloc.s    V_12
IL_0142:  brfalse.s  IL_014c
IL_0144:  ldloc.s    V_12
IL_0146:  callvirt   instance void [System.Private.CoreLib]System.IDisposable::Dispose()
IL_014b:  nop
IL_014c:  endfinally
}  // end handler
IL_014d:  ldloc.2
IL_014e:  call       uint32 Costura.AssemblyLoader::SetErrorMode(uint32)
IL_0153:  pop
IL_0154:  ret
}
.method private hidebysig static void  PreloadUnmanagedLibraries(string hash,
string tempBasePath,
class [System.Private.CoreLib]System.Collections.Generic.List`1<string> libs,
class [System.Private.CoreLib]System.Collections.Generic.Dictionary`2<string,string> checksums) cil managed
{
.maxstack  5
.locals init (string V_0,
class [System.Private.CoreLib]System.Threading.Mutex V_1,
bool V_2,
string V_3,
string V_4,
bool V_5,
bool V_6)
IL_0000:  nop
IL_0001:  ldstr      "Costura"
IL_0006:  ldarg.0
IL_0007:  call       string [System.Private.CoreLib]System.String::Concat(string,
string)
IL_000c:  stloc.0
IL_000d:  ldc.i4.0
IL_000e:  ldloc.0
IL_000f:  newobj     instance void [System.Private.CoreLib]System.Threading.Mutex::.ctor(bool,
string)
IL_0014:  stloc.1
.try
{
IL_0015:  nop
IL_0016:  ldc.i4.0
IL_0017:  stloc.2
.try
{
IL_0018:  nop
.try
{
IL_0019:  nop
IL_001a:  ldloc.1
IL_001b:  ldc.i4     0xea60
IL_0020:  ldc.i4.0
IL_0021:  callvirt   instance bool [System.Private.CoreLib]System.Threading.WaitHandle::WaitOne(int32,
bool)
IL_0026:  stloc.2
IL_0027:  ldloc.2
IL_0028:  ldc.i4.0
IL_0029:  ceq
IL_002b:  stloc.s    V_5
IL_002d:  ldloc.s    V_5
IL_002f:  brfalse.s  IL_003d
IL_0031:  nop
IL_0032:  ldstr      "Timeout waiting for exclusive access"
IL_0037:  newobj     instance void [System.Private.CoreLib]System.TimeoutException::.ctor(string)
IL_003c:  throw
IL_003d:  nop
IL_003e:  leave.s    IL_0047
}  // end .try
catch [System.Private.CoreLib]System.Threading.AbandonedMutexException
{
IL_0040:  pop
IL_0041:  nop
IL_0042:  ldc.i4.1
IL_0043:  stloc.2
IL_0044:  nop
IL_0045:  leave.s    IL_0047
}  // end handler
IL_0047:  call       string Costura.AssemblyLoader::GetPlatformName()
IL_004c:  stloc.3
IL_004d:  ldarg.1
IL_004e:  ldloc.3
IL_004f:  call       string [System.Private.CoreLib]System.IO.Path::Combine(string,
string)
IL_0054:  stloc.s    V_4
IL_0056:  ldstr      "Preloading unmanaged libraries to '{0}'"
IL_005b:  ldc.i4.1
IL_005c:  newarr     [System.Private.CoreLib]System.Object
IL_0061:  dup
IL_0062:  ldc.i4.0
IL_0063:  ldloc.s    V_4
IL_0065:  stelem.ref
IL_0066:  call       void Costura.AssemblyLoader::Log(string,
object[])
IL_006b:  nop
IL_006c:  ldloc.s    V_4
IL_006e:  call       void Costura.AssemblyLoader::CreateDirectory(string)
IL_0073:  nop
IL_0074:  ldarg.1
IL_0075:  ldarg.2
IL_0076:  ldarg.3
IL_0077:  call       void Costura.AssemblyLoader::InternalPreloadUnmanagedLibraries(string,
class [System.Private.CoreLib]System.Collections.Generic.IList`1<string>,
class [System.Private.CoreLib]System.Collections.Generic.Dictionary`2<string,string>)
IL_007c:  nop
IL_007d:  nop
IL_007e:  leave.s    IL_0093
}  // end .try
finally
{
IL_0080:  nop
IL_0081:  ldloc.2
IL_0082:  stloc.s    V_6
IL_0084:  ldloc.s    V_6
IL_0086:  brfalse.s  IL_0091
IL_0088:  nop
IL_0089:  ldloc.1
IL_008a:  callvirt   instance void [System.Private.CoreLib]System.Threading.Mutex::ReleaseMutex()
IL_008f:  nop
IL_0090:  nop
IL_0091:  nop
IL_0092:  endfinally
}  // end handler
IL_0093:  nop
IL_0094:  leave.s    IL_00a1
}  // end .try
finally
{
IL_0096:  ldloc.1
IL_0097:  brfalse.s  IL_00a0
IL_0099:  ldloc.1
IL_009a:  callvirt   instance void [System.Private.CoreLib]System.IDisposable::Dispose()
IL_009f:  nop
IL_00a0:  endfinally
}  // end handler
IL_00a1:  ret
}
.method public hidebysig static void  Attach(bool subscribe) cil managed
{
.maxstack  4
.locals init (string V_0,
string V_1,
class [System.Private.CoreLib]System.Collections.Generic.List`1<string> V_2,
class [System.Private.CoreLib]System.Collections.Generic.List`1<string> V_3,
bool V_4,
bool V_5)
IL_0000:  nop
IL_0001:  ldsflda    int32 Costura.AssemblyLoader::isAttached
IL_0006:  ldc.i4.1
IL_0007:  call       int32 [System.Private.CoreLib]System.Threading.Interlocked::Exchange(int32&,
int32)
IL_000c:  ldc.i4.1
IL_000d:  ceq
IL_000f:  stloc.s    V_4
IL_0011:  ldloc.s    V_4
IL_0013:  brfalse.s  IL_001b
IL_0015:  nop
IL_0016:  br         IL_009e
IL_001b:  ldstr      "[CHECKSUM]"
IL_0020:  stloc.0
IL_0021:  call       string [System.Private.CoreLib]System.IO.Path::GetTempPath()
IL_0026:  ldstr      "Costura"
IL_002b:  call       string [System.Private.CoreLib]System.IO.Path::Combine(string,
string)
IL_0030:  stloc.1
IL_0031:  ldloc.1
IL_0032:  ldloc.0
IL_0033:  call       string [System.Private.CoreLib]System.IO.Path::Combine(string,
string)
IL_0038:  stsfld     string Costura.AssemblyLoader::tempBasePath
IL_003d:  call       class [System.Private.CoreLib]System.Collections.Generic.List`1<string> Costura.AssemblyLoader::GetUnmanagedAssemblies()
IL_0042:  stloc.2
IL_0043:  newobj     instance void class [System.Private.CoreLib]System.Collections.Generic.List`1<string>::.ctor()
IL_0048:  stloc.3
IL_0049:  ldloc.3
IL_004a:  ldloc.2
IL_004b:  callvirt   instance void class [System.Private.CoreLib]System.Collections.Generic.List`1<string>::AddRange(class [System.Private.CoreLib]System.Collections.Generic.IEnumerable`1<!0>)
IL_0050:  nop
IL_0051:  ldloc.3
IL_0052:  ldsfld     class [System.Private.CoreLib]System.Collections.Generic.List`1<string> Costura.AssemblyLoader::preloadList
IL_0057:  callvirt   instance void class [System.Private.CoreLib]System.Collections.Generic.List`1<string>::AddRange(class [System.Private.CoreLib]System.Collections.Generic.IEnumerable`1<!0>)
IL_005c:  nop
IL_005d:  ldloc.0
IL_005e:  ldsfld     string Costura.AssemblyLoader::tempBasePath
IL_0063:  ldloc.3
IL_0064:  ldsfld     class [System.Private.CoreLib]System.Collections.Generic.Dictionary`2<string,string> Costura.AssemblyLoader::checksums
IL_0069:  call       void Costura.AssemblyLoader::PreloadUnmanagedLibraries(string,
string,
class [System.Private.CoreLib]System.Collections.Generic.List`1<string>,
class [System.Private.CoreLib]System.Collections.Generic.Dictionary`2<string,string>)
IL_006e:  nop
IL_006f:  ldarg.0
IL_0070:  stloc.s    V_5
IL_0072:  ldloc.s    V_5
IL_0074:  brfalse.s  IL_009e
IL_0076:  nop
IL_0077:  call       class [System.Private.CoreLib]System.Runtime.Loader.AssemblyLoadContext [System.Private.CoreLib]System.Runtime.Loader.AssemblyLoadContext::get_Default()
IL_007c:  ldsfld     class [System.Private.CoreLib]System.Func`3<class [System.Runtime.Loader]System.Runtime.Loader.AssemblyLoadContext,class [System.Runtime]System.Reflection.AssemblyName,class [System.Runtime]System.Reflection.Assembly> Costura.AssemblyLoader/'<>O'::'<0>__ResolveAssembly'
IL_0081:  dup
IL_0082:  brtrue.s   IL_0097
IL_0084:  pop
IL_0085:  ldnull
IL_0086:  ldftn      class [System.Private.CoreLib]System.Reflection.Assembly Costura.AssemblyLoader::ResolveAssembly(class [System.Private.CoreLib]System.Runtime.Loader.AssemblyLoadContext,
class [System.Private.CoreLib]System.Reflection.AssemblyName)
IL_008c:  newobj     instance void class [System.Private.CoreLib]System.Func`3<class [System.Runtime.Loader]System.Runtime.Loader.AssemblyLoadContext,class [System.Runtime]System.Reflection.AssemblyName,class [System.Runtime]System.Reflection.Assembly>::.ctor(object,
native int)
IL_0091:  dup
IL_0092:  stsfld     class [System.Private.CoreLib]System.Func`3<class [System.Runtime.Loader]System.Runtime.Loader.AssemblyLoadContext,class [System.Runtime]System.Reflection.AssemblyName,class [System.Runtime]System.Reflection.Assembly> Costura.AssemblyLoader/'<>O'::'<0>__ResolveAssembly'
IL_0097:  callvirt   instance void [System.Private.CoreLib]System.Runtime.Loader.AssemblyLoadContext::add_Resolving(class [System.Private.CoreLib]System.Func`3<class [System.Private.CoreLib]System.Runtime.Loader.AssemblyLoadContext,class [System.Private.CoreLib]System.Reflection.AssemblyName,class [System.Private.CoreLib]System.Reflection.Assembly>)
IL_009c:  nop
IL_009d:  nop
IL_009e:  ret
}
}