public static IILGenerator Ldarg(this IILGenerator gen, byte argIndex) { switch (argIndex) { case 0: gen.Ldarg_0(); break; case 1: gen.Ldarg_1(); break; case 2: gen.Ldarg_2(); break; case 3: gen.Ldarg_3(); break; default: gen.Ldarg_S(argIndex); break; } return(gen); }