510 {
511 if (typeof(TOther) == typeof(byte))
512 {
513 byte b = (byte)(
object)
value;
514 if (b <= 127)
515 {
516 return (sbyte)b;
517 }
518 return sbyte.MaxValue;
519 }
520 if (typeof(TOther) == typeof(char))
521 {
522 char c = (char)(
object)
value;
523 if (c <= '\u007f')
524 {
525 return (sbyte)c;
526 }
527 return sbyte.MaxValue;
528 }
529 if (typeof(TOther) == typeof(decimal))
530 {
531 decimal num = (decimal)(
object)
value;
532 if (!(num > 127m))
533 {
534 if (!(num < -128m))
535 {
536 return (sbyte)num;
537 }
538 return sbyte.MinValue;
539 }
540 return sbyte.MaxValue;
541 }
542 if (typeof(TOther) == typeof(double))
543 {
544 double num2 = (double)(
object)
value;
545 if (!(num2 > 127.0))
546 {
547 if (!(num2 < -128.0))
548 {
549 return (sbyte)num2;
550 }
551 return sbyte.MinValue;
552 }
553 return sbyte.MaxValue;
554 }
555 if (typeof(TOther) == typeof(short))
556 {
558 if (num3 <= 127)
559 {
560 if (num3 >= -128)
561 {
562 return (sbyte)num3;
563 }
564 return sbyte.MinValue;
565 }
566 return sbyte.MaxValue;
567 }
568 if (typeof(TOther) == typeof(int))
569 {
570 int num4 = (int)(
object)
value;
571 if (num4 <= 127)
572 {
573 if (num4 >= -128)
574 {
575 return (sbyte)num4;
576 }
577 return sbyte.MinValue;
578 }
579 return sbyte.MaxValue;
580 }
581 if (typeof(TOther) == typeof(long))
582 {
583 long num5 = (long)(
object)
value;
584 if (num5 <= 127)
585 {
586 if (num5 >= -128)
587 {
588 return (sbyte)num5;
589 }
590 return sbyte.MinValue;
591 }
592 return sbyte.MaxValue;
593 }
594 if (typeof(TOther) == typeof(IntPtr))
595 {
597 if ((nint)intPtr <= 127)
598 {
599 if ((nint)intPtr >= -128)
600 {
601 return (sbyte)(nint)intPtr;
602 }
603 return sbyte.MinValue;
604 }
605 return sbyte.MaxValue;
606 }
607 if (typeof(TOther) == typeof(sbyte))
608 {
609 return (sbyte)(object)
value;
610 }
611 if (typeof(TOther) == typeof(float))
612 {
613 float num6 = (float)(
object)
value;
614 if (!(num6 > 127f))
615 {
616 if (!(num6 < -128f))
617 {
618 return (sbyte)num6;
619 }
620 return sbyte.MinValue;
621 }
622 return sbyte.MaxValue;
623 }
624 if (typeof(TOther) == typeof(ushort))
625 {
626 ushort num7 = (ushort)(
object)
value;
627 if (num7 <= 127)
628 {
629 return (sbyte)num7;
630 }
631 return sbyte.MaxValue;
632 }
633 if (typeof(TOther) == typeof(uint))
634 {
635 uint num8 = (uint)(
object)
value;
636 if ((
long)num8 <= 127
L)
637 {
638 return (sbyte)num8;
639 }
640 return sbyte.MaxValue;
641 }
642 if (typeof(TOther) == typeof(ulong))
643 {
644 ulong num9 = (ulong)(
object)
value;
645 if (num9 <= 127)
646 {
647 return (sbyte)num9;
648 }
649 return sbyte.MaxValue;
650 }
651 if (typeof(TOther) == typeof(UIntPtr))
652 {
654 if ((nuint)uIntPtr <= 127)
655 {
656 return (sbyte)(nuint)uIntPtr;
657 }
658 return sbyte.MaxValue;
659 }
660 ThrowHelper.ThrowNotSupportedException();
661 return 0;
662 }