unsigned char CHECKSUM(unsigned char *BYTE, int size_of_BYTE) {
  int BYTE_loop;
  unsigned char CRC;
  unsigned char BYTE_ARRAY[256] = {
      0,   94,  188, 226, 97,  63,  221, 131, 194, 156, 126, 32,  163, 253, 31,
      65,  157, 195, 33,  127, 252, 162, 64,  30,  95,  1,   227, 189, 62,  96,
      130, 220, 35,  125, 159, 193, 66,  28,  254, 160, 225, 191, 93,  3,   128,
      222, 60,  98,  190, 224, 2,   92,  223, 129, 99,  61,  124, 34,  192, 158,
      29,  67,  161, 255, 70,  24,  250, 164, 39,  121, 155, 197, 132, 218, 56,
      102, 229, 187, 89,  7,   219, 133, 103, 57,  186, 228, 6,   88,  25,  71,
      165, 251, 120, 38,  196, 154, 101, 59,  217, 135, 4,   90,  184, 230, 167,
      249, 27,  69,  198, 152, 122, 36,  248, 166, 68,  26,  153, 199, 37,  123,
      58,  100, 134, 216, 91,  5,   231, 185, 140, 210, 48,  110, 237, 179, 81,
      15,  78,  16,  242, 172, 47,  113, 147, 205, 17,  79,  173, 243, 112, 46,
      204, 146, 211, 141, 111, 49,  178, 236, 14,  80,  175, 241, 19,  77,  206,
      144, 114, 44,  109, 51,  209, 143, 12,  82,  176, 238, 50,  108, 142, 208,
      83,  13,  239, 177, 240, 174, 76,  18,  145, 207, 45,  115, 202, 148, 118,
      40,  171, 245, 23,  73,  8,   86,  180, 234, 105, 55,  213, 139, 87,  9,
      235, 181, 54,  104, 138, 212, 149, 203, 41,  119, 244, 170, 72,  22,  233,
      183, 85,  11,  136, 214, 52,  106, 43,  117, 151, 201, 74,  20,  246, 168,
      116, 42,  200, 150, 21,  75,  169, 247, 182, 232, 10,  84,  215, 137, 107,
      53};
  CRC = 0;
  for (BYTE_loop = 0; BYTE_loop < size_of_BYTE; BYTE_loop++) {
    CRC = BYTE_ARRAY[CRC ^ BYTE[BYTE_loop]];
  }
  return (CRC);
}


x86 assembly (clang, -O0):
<CHECKSUM>:
push   %rbp
mov    %rsp,%rbp
sub    $0x120,%rsp
mov    %rdi,-0x8(%rbp)
mov    %esi,-0xc(%rbp)
lea    -0x120(%rbp),%rdi
lea    0xed0(%rip),%rsi
mov    $0x100,%edx
call   1030 <memcpy@plt>
movb   $0x0,-0x11(%rbp)
movl   $0x0,-0x10(%rbp)
mov    -0x10(%rbp),%eax
cmp    -0xc(%rbp),%eax
jge    117d <CHECKSUM+0x6d>
movzbl -0x11(%rbp),%eax
mov    -0x8(%rbp),%rcx
movslq -0x10(%rbp),%rdx
movzbl (%rcx,%rdx,1),%ecx
xor    %ecx,%eax
cltq
mov    -0x120(%rbp,%rax,1),%al
mov    %al,-0x11(%rbp)
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1145 <CHECKSUM+0x35>
movzbl -0x11(%rbp),%eax
add    $0x120,%rsp
pop    %rbp
ret

x86 assembly (clang, -O2):
<CHECKSUM>:
test   %esi,%esi
jle    111e <CHECKSUM+0x1e>
mov    %esi,%r9d
lea    -0x1(%r9),%rax
mov    %r9d,%r8d
and    $0x3,%r8d
cmp    $0x3,%rax
jae    1121 <CHECKSUM+0x21>
xor    %edx,%edx
xor    %eax,%eax
jmp    1164 <CHECKSUM+0x64>
xor    %eax,%eax
ret
and    $0xfffffffc,%r9d
xor    %edx,%edx
lea    0xed2(%rip),%rsi
xor    %eax,%eax
xor    (%rdi,%rdx,1),%al
movzbl %al,%eax
movzbl 0x1(%rdi,%rdx,1),%ecx
xor    (%rax,%rsi,1),%cl
movzbl 0x2(%rdi,%rdx,1),%eax
movzbl %cl,%ecx
xor    (%rcx,%rsi,1),%al
movzbl %al,%eax
movzbl 0x3(%rdi,%rdx,1),%ecx
xor    (%rax,%rsi,1),%cl
movzbl %cl,%eax
movzbl (%rax,%rsi,1),%eax
add    $0x4,%rdx
cmp    %rdx,%r9
jne    1130 <CHECKSUM+0x30>
test   %r8,%r8
je     1193 <CHECKSUM+0x93>
add    %rdx,%rdi
xor    %ecx,%ecx
lea    0xe8b(%rip),%rdx
cs nopw 0x0(%rax,%rax,1)
nop
xor    (%rdi,%rcx,1),%al
movzbl %al,%eax
movzbl (%rax,%rdx,1),%eax
add    $0x1,%rcx
cmp    %rcx,%r8
jne    1180 <CHECKSUM+0x80>
ret

LLVM IR (-O0):
@__const.CHECKSUM.BYTE_ARRAY = [256 x i8] c"\00^\BC\E2a?\DD\83\C2\9C~ \A3\FD\1FA\9D\C3!\7F\FC\A2@\1E_\01\E3\BD>`\82\DC#}\9F\C1B\1C\FE\A0\E1\BF]\03\80\DE<b\BE\E0\02\\\DF\81c=|\22\C0\9E\1DC\A1\FFF\18\FA\A4'y\9B\C5\84\DA8f\E5\BBY\07\DB\85g9\BA\E4\06X\19G\A5\FBx&\C4\9Ae;\D9\87\04Z\B8\E6\A7\F9\1BE\C6\98z$\F8\A6D\1A\99\C7%{:d\86\D8[\05\E7\B9\8C\D20n\ED\B3Q\0FN\10\F2\AC/q\93\CD\11O\AD\F3p.\CC\92\D3\8Do1\B2\EC\0EP\AF\F1\13M\CE\90r,m3\D1\8F\0CR\B0\EE2l\8E\D0S\0D\EF\B1\F0\AEL\12\91\CF-s\CA\94v(\AB\F5\17I\08V\B4\EAi7\D5\8BW\09\EB\B56h\8A\D4\95\CB)w\F4\AAH\16\E9\B7U\0B\88\D64j+u\97\C9J\14\F6\A8t*\C8\96\15K\A9\F7\B6\E8\0AT\D7\89k5"
define zeroext i8 @CHECKSUM(i8* %0, i32 %1) {
%3 = alloca i8*
%4 = alloca i32
%5 = alloca i32
%6 = alloca i8
%7 = alloca [256 x i8]
store i8* %0, i8** %3
store i32 %1, i32* %4
%8 = bitcast [256 x i8]* %7 to i8*
store i8 0, i8* %6
store i32 0, i32* %5
br label %9
9: ; preds = %26, %2
%10 = load i32, i32* %5
%11 = load i32, i32* %4
%12 = icmp slt i32 %10, %11
br i1 %12, label %13, label %29
13: ; preds = %9
%14 = load i8, i8* %6
%15 = zext i8 %14 to i32
%16 = load i8*, i8** %3
%17 = load i32, i32* %5
%18 = sext i32 %17 to i64
%19 = getelementptr inbounds i8, i8* %16, i64 %18
%20 = load i8, i8* %19
%21 = zext i8 %20 to i32
%22 = xor i32 %15, %21
%23 = sext i32 %22 to i64
%24 = getelementptr inbounds [256 x i8], [256 x i8]* %7, i64 0, i64 %23
%25 = load i8, i8* %24
store i8 %25, i8* %6
br label %26
26: ; preds = %13
%27 = load i32, i32* %5
%28 = add nsw i32 %27, 1
store i32 %28, i32* %5
br label %9
29: ; preds = %9
%30 = load i8, i8* %6
ret i8 %30
}

LLVM IR (-O2):
@__const.CHECKSUM.BYTE_ARRAY = [256 x i8] c"\00^\BC\E2a?\DD\83\C2\9C~ \A3\FD\1FA\9D\C3!\7F\FC\A2@\1E_\01\E3\BD>`\82\DC#}\9F\C1B\1C\FE\A0\E1\BF]\03\80\DE<b\BE\E0\02\\\DF\81c=|\22\C0\9E\1DC\A1\FFF\18\FA\A4'y\9B\C5\84\DA8f\E5\BBY\07\DB\85g9\BA\E4\06X\19G\A5\FBx&\C4\9Ae;\D9\87\04Z\B8\E6\A7\F9\1BE\C6\98z$\F8\A6D\1A\99\C7%{:d\86\D8[\05\E7\B9\8C\D20n\ED\B3Q\0FN\10\F2\AC/q\93\CD\11O\AD\F3p.\CC\92\D3\8Do1\B2\EC\0EP\AF\F1\13M\CE\90r,m3\D1\8F\0CR\B0\EE2l\8E\D0S\0D\EF\B1\F0\AEL\12\91\CF-s\CA\94v(\AB\F5\17I\08V\B4\EAi7\D5\8BW\09\EB\B56h\8A\D4\95\CB)w\F4\AAH\16\E9\B7U\0B\88\D64j+u\97\C9J\14\F6\A8t*\C8\96\15K\A9\F7\B6\E8\0AT\D7\89k5"
define zeroext i8 @CHECKSUM(i8* nocapture %0, i32 %1) {
%3 = icmp sgt i32 %1, 0
br i1 %3, label %4, label %63
4: ; preds = %2
%5 = zext i32 %1 to i64
%6 = add nsw i64 %5, -1
%7 = and i64 %5, 3
%8 = icmp ult i64 %6, 3
br i1 %8, label %45, label %9
9: ; preds = %4
%10 = and i64 %5, 4294967292
br label %11
11: ; preds = %11, %9
%12 = phi i64 [ 0, %9 ], [ %42, %11 ]
%13 = phi i8 [ 0, %9 ], [ %41, %11 ]
%14 = phi i64 [ 0, %9 ], [ %43, %11 ]
%15 = getelementptr inbounds i8, i8* %0, i64 %12
%16 = load i8, i8* %15
%17 = xor i8 %16, %13
%18 = zext i8 %17 to i64
%19 = getelementptr inbounds [256 x i8], [256 x i8]* @__const.CHECKSUM.BYTE_ARRAY, i64 0, i64 %18
%20 = load i8, i8* %19
%21 = or i64 %12, 1
%22 = getelementptr inbounds i8, i8* %0, i64 %21
%23 = load i8, i8* %22
%24 = xor i8 %23, %20
%25 = zext i8 %24 to i64
%26 = getelementptr inbounds [256 x i8], [256 x i8]* @__const.CHECKSUM.BYTE_ARRAY, i64 0, i64 %25
%27 = load i8, i8* %26
%28 = or i64 %12, 2
%29 = getelementptr inbounds i8, i8* %0, i64 %28
%30 = load i8, i8* %29
%31 = xor i8 %30, %27
%32 = zext i8 %31 to i64
%33 = getelementptr inbounds [256 x i8], [256 x i8]* @__const.CHECKSUM.BYTE_ARRAY, i64 0, i64 %32
%34 = load i8, i8* %33
%35 = or i64 %12, 3
%36 = getelementptr inbounds i8, i8* %0, i64 %35
%37 = load i8, i8* %36
%38 = xor i8 %37, %34
%39 = zext i8 %38 to i64
%40 = getelementptr inbounds [256 x i8], [256 x i8]* @__const.CHECKSUM.BYTE_ARRAY, i64 0, i64 %39
%41 = load i8, i8* %40
%42 = add nuw nsw i64 %12, 4
%43 = add i64 %14, 4
%44 = icmp eq i64 %43, %10
br i1 %44, label %45, label %11
45: ; preds = %11, %4
%46 = phi i8 [ undef, %4 ], [ %41, %11 ]
%47 = phi i64 [ 0, %4 ], [ %42, %11 ]
%48 = phi i8 [ 0, %4 ], [ %41, %11 ]
%49 = icmp eq i64 %7, 0
br i1 %49, label %63, label %50
50: ; preds = %45, %50
%51 = phi i64 [ %60, %50 ], [ %47, %45 ]
%52 = phi i8 [ %59, %50 ], [ %48, %45 ]
%53 = phi i64 [ %61, %50 ], [ 0, %45 ]
%54 = getelementptr inbounds i8, i8* %0, i64 %51
%55 = load i8, i8* %54
%56 = xor i8 %55, %52
%57 = zext i8 %56 to i64
%58 = getelementptr inbounds [256 x i8], [256 x i8]* @__const.CHECKSUM.BYTE_ARRAY, i64 0, i64 %57
%59 = load i8, i8* %58
%60 = add nuw nsw i64 %51, 1
%61 = add i64 %53, 1
%62 = icmp eq i64 %61, %7
br i1 %62, label %63, label %50
63: ; preds = %45, %50, %2
%64 = phi i8 [ 0, %2 ], [ %46, %45 ], [ %59, %50 ]
ret i8 %64
}