extern int test_glostr(const unsigned char *buff) {
  static const unsigned char xor_8bit[256] = {
      0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0,
      0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1,
      0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0,
      0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0,
      0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0,
      0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1,
      0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1,
      1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1,
      0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 1, 0, 0, 1, 0, 1, 1, 0,
      0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0, 0, 1, 1, 0, 1, 0, 0, 1,
      0, 1, 1, 0, 1, 0, 0, 1, 1, 0, 0, 1, 0, 1, 1, 0};
  static const unsigned char mask_hamming[][12] = {
      {0x55, 0x55, 0x5A, 0xAA, 0xAA, 0xAA, 0xB5, 0x55, 0x6A, 0xD8, 0x08},
      {0x66, 0x66, 0x6C, 0xCC, 0xCC, 0xCC, 0xD9, 0x99, 0xB3, 0x68, 0x10},
      {0x87, 0x87, 0x8F, 0x0F, 0x0F, 0x0F, 0x1E, 0x1E, 0x3C, 0x70, 0x20},
      {0x07, 0xF8, 0x0F, 0xF0, 0x0F, 0xF0, 0x1F, 0xE0, 0x3F, 0x80, 0x40},
      {0xF8, 0x00, 0x0F, 0xFF, 0xF0, 0x00, 0x1F, 0xFF, 0xC0, 0x00, 0x80},
      {0x00, 0x00, 0x0F, 0xFF, 0xFF, 0xFF, 0xE0, 0x00, 0x00, 0x01, 0x00},
      {0xFF, 0xFF, 0xF0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0x00},
      {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xF8}};
  unsigned char cs = 0;
  int i = 0;
  int j = 0;
  int n = 0;
  for (i = 0; i < 8; ++i) {
    for (j = 0, cs = 0; j < 11; ++j) {
      cs ^= xor_8bit[buff[j] & mask_hamming[i][j]];
    }
    if (cs) {
      n++;
    }
  }
  return n == 0 || (n == 2 && cs);
}


x86 assembly (clang, -O0):
<test_glostr>:
push   %rbp
mov    %rsp,%rbp
mov    %rdi,-0x8(%rbp)
movb   $0x0,-0x9(%rbp)
movl   $0x0,-0x10(%rbp)
movl   $0x0,-0x14(%rbp)
movl   $0x0,-0x18(%rbp)
movl   $0x0,-0x10(%rbp)
cmpl   $0x8,-0x10(%rbp)
jge    11ba <test_glostr+0xba>
movl   $0x0,-0x14(%rbp)
movb   $0x0,-0x9(%rbp)
cmpl   $0xb,-0x14(%rbp)
jge    1194 <test_glostr+0x94>
mov    -0x8(%rbp),%rax
movslq -0x14(%rbp),%rcx
movzbl (%rax,%rcx,1),%eax
movslq -0x10(%rbp),%rdx
lea    0xfa2(%rip),%rcx
imul   $0xc,%rdx,%rdx
add    %rdx,%rcx
movslq -0x14(%rbp),%rdx
movzbl (%rcx,%rdx,1),%ecx
and    %ecx,%eax
movslq %eax,%rcx
lea    0xe87(%rip),%rax
movzbl (%rax,%rcx,1),%ecx
movzbl -0x9(%rbp),%eax
xor    %ecx,%eax
mov    %al,-0x9(%rbp)
mov    -0x14(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x14(%rbp)
jmp    113d <test_glostr+0x3d>
cmpb   $0x0,-0x9(%rbp)
je     11a7 <test_glostr+0xa7>
mov    -0x18(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x18(%rbp)
jmp    11ac <test_glostr+0xac>
mov    -0x10(%rbp),%eax
add    $0x1,%eax
mov    %eax,-0x10(%rbp)
jmp    1128 <test_glostr+0x28>
mov    $0x1,%al
cmpl   $0x0,-0x18(%rbp)
mov    %al,-0x19(%rbp)
je     11eb <test_glostr+0xeb>
xor    %eax,%eax
cmpl   $0x2,-0x18(%rbp)
mov    %al,-0x1a(%rbp)
jne    11e5 <test_glostr+0xe5>
movzbl -0x9(%rbp),%eax
cmp    $0x0,%eax
setne  %al
mov    %al,-0x1a(%rbp)
mov    -0x1a(%rbp),%al
mov    %al,-0x19(%rbp)
mov    -0x19(%rbp),%al
and    $0x1,%al
movzbl %al,%eax
pop    %rbp
ret

x86 assembly (clang, -O2):
<test_glostr>:
push   %rbp
push   %r15
push   %r14
push   %r13
push   %r12
push   %rbx
movzbl 0x1(%rdi),%eax
mov    %rax,-0x8(%rsp)
movzbl 0x2(%rdi),%eax
mov    %rax,-0x10(%rsp)
movzbl 0x3(%rdi),%eax
mov    %rax,-0x18(%rsp)
movzbl 0x4(%rdi),%eax
mov    %rax,-0x20(%rsp)
movzbl 0x5(%rdi),%r14d
movzbl 0x6(%rdi),%r15d
movzbl 0x7(%rdi),%r12d
movzbl 0x8(%rdi),%r13d
movzbl 0x9(%rdi),%r10d
movzbl 0xa(%rdi),%r11d
movzbl (%rdi),%ecx
xor    %edi,%edi
mov    $0xa,%edx
lea    0xfa3(%rip),%rsi
lea    0xe9c(%rip),%rbp
cs nopw 0x0(%rax,%rax,1)
xchg   %ax,%ax
movzbl -0xa(%rdx,%rsi,1),%ebx
and    %ecx,%ebx
movzbl -0x9(%rdx,%rsi,1),%eax
and    -0x8(%rsp),%eax
movzbl (%rax,%rbp,1),%r8d
xor    (%rbx,%rbp,1),%r8b
movzbl -0x8(%rdx,%rsi,1),%eax
and    -0x10(%rsp),%eax
xor    (%rax,%rbp,1),%r8b
movzbl -0x7(%rdx,%rsi,1),%eax
and    -0x18(%rsp),%eax
xor    (%rax,%rbp,1),%r8b
movzbl -0x6(%rdx,%rsi,1),%eax
and    -0x20(%rsp),%eax
xor    (%rax,%rbp,1),%r8b
movzbl -0x5(%rdx,%rsi,1),%eax
and    %r14d,%eax
xor    (%rax,%rbp,1),%r8b
movzbl -0x4(%rdx,%rsi,1),%eax
and    %r15d,%eax
xor    (%rax,%rbp,1),%r8b
movzbl -0x3(%rdx,%rsi,1),%eax
and    %r12d,%eax
xor    (%rax,%rbp,1),%r8b
movzbl -0x2(%rdx,%rsi,1),%eax
and    %r13d,%eax
xor    (%rax,%rbp,1),%r8b
movzbl -0x1(%rdx,%rsi,1),%eax
and    %r10d,%eax
xor    (%rax,%rbp,1),%r8b
movzbl (%rdx,%rsi,1),%eax
and    %r11d,%eax
movzbl (%rax,%rbp,1),%r9d
xor    %eax,%eax
cmp    %r8b,%r9b
setne  %al
add    %eax,%edi
add    $0xc,%rdx
cmp    $0x6a,%rdx
jne    1170 <test_glostr+0x70>
cmp    %r8b,%r9b
setne  %al
test   %edi,%edi
sete   %cl
cmp    $0x2,%edi
sete   %dl
and    %al,%dl
or     %cl,%dl
movzbl %dl,%eax
pop    %rbx
pop    %r12
pop    %r13
pop    %r14
pop    %r15
pop    %rbp
ret

LLVM IR (-O0):
@test_glostr.xor_8bit = internal constant [256 x i8] c"\00\01\01\00\01\00\00\01\01\00\00\01\00\01\01\00\01\00\00\01\00\01\01\00\00\01\01\00\01\00\00\01\01\00\00\01\00\01\01\00\00\01\01\00\01\00\00\01\00\01\01\00\01\00\00\01\01\00\00\01\00\01\01\00\01\00\00\01\00\01\01\00\00\01\01\00\01\00\00\01\00\01\01\00\01\00\00\01\01\00\00\01\00\01\01\00\00\01\01\00\01\00\00\01\01\00\00\01\00\01\01\00\01\00\00\01\00\01\01\00\00\01\01\00\01\00\00\01\01\00\00\01\00\01\01\00\00\01\01\00\01\00\00\01\00\01\01\00\01\00\00\01\01\00\00\01\00\01\01\00\00\01\01\00\01\00\00\01\01\00\00\01\00\01\01\00\01\00\00\01\00\01\01\00\00\01\01\00\01\00\00\01\00\01\01\00\01\00\00\01\01\00\00\01\00\01\01\00\01\00\00\01\00\01\01\00\00\01\01\00\01\00\00\01\01\00\00\01\00\01\01\00\00\01\01\00\01\00\00\01\00\01\01\00\01\00\00\01\01\00\00\01\00\01\01\00"
@test_glostr.mask_hamming = internal constant [8 x [12 x i8]] [[12 x i8] c"UUZ\AA\AA\AA\B5Uj\D8\08\00", [12 x i8] c"ffl\CC\CC\CC\D9\99\B3h\10\00", [12 x i8] c"\87\87\8F\0F\0F\0F\1E\1E<p \00", [12 x i8] c"\07\F8\0F\F0\0F\F0\1F\E0?\80@\00", [12 x i8] c"\F8\00\0F\FF\F0\00\1F\FF\C0\00\80\00", [12 x i8] c"\00\00\0F\FF\FF\FF\E0\00\00\01\00\00", [12 x i8] c"\FF\FF\F0\00\00\00\00\00\00\02\00\00", [12 x i8] c"\FF\FF\FF\FF\FF\FF\FF\FF\FF\FF\F8\00"]
define i32 @test_glostr(i8* %0) {
%2 = alloca i8*
%3 = alloca i8
%4 = alloca i32
%5 = alloca i32
%6 = alloca i32
store i8* %0, i8** %2
store i8 0, i8* %3
store i32 0, i32* %4
store i32 0, i32* %5
store i32 0, i32* %6
store i32 0, i32* %4
br label %7
7: ; preds = %48, %1
%8 = load i32, i32* %4
%9 = icmp slt i32 %8, 8
br i1 %9, label %10, label %51
10: ; preds = %7
store i32 0, i32* %5
store i8 0, i8* %3
br label %11
11: ; preds = %38, %10
%12 = load i32, i32* %5
%13 = icmp slt i32 %12, 11
br i1 %13, label %14, label %41
14: ; preds = %11
%15 = load i8*, i8** %2
%16 = load i32, i32* %5
%17 = sext i32 %16 to i64
%18 = getelementptr inbounds i8, i8* %15, i64 %17
%19 = load i8, i8* %18
%20 = zext i8 %19 to i32
%21 = load i32, i32* %4
%22 = sext i32 %21 to i64
%23 = getelementptr inbounds [8 x [12 x i8]], [8 x [12 x i8]]* @test_glostr.mask_hamming, i64 0, i64 %22
%24 = load i32, i32* %5
%25 = sext i32 %24 to i64
%26 = getelementptr inbounds [12 x i8], [12 x i8]* %23, i64 0, i64 %25
%27 = load i8, i8* %26
%28 = zext i8 %27 to i32
%29 = and i32 %20, %28
%30 = sext i32 %29 to i64
%31 = getelementptr inbounds [256 x i8], [256 x i8]* @test_glostr.xor_8bit, i64 0, i64 %30
%32 = load i8, i8* %31
%33 = zext i8 %32 to i32
%34 = load i8, i8* %3
%35 = zext i8 %34 to i32
%36 = xor i32 %35, %33
%37 = trunc i32 %36 to i8
store i8 %37, i8* %3
br label %38
38: ; preds = %14
%39 = load i32, i32* %5
%40 = add nsw i32 %39, 1
store i32 %40, i32* %5
br label %11
41: ; preds = %11
%42 = load i8, i8* %3
%43 = icmp ne i8 %42, 0
br i1 %43, label %44, label %47
44: ; preds = %41
%45 = load i32, i32* %6
%46 = add nsw i32 %45, 1
store i32 %46, i32* %6
br label %47
47: ; preds = %44, %41
br label %48
48: ; preds = %47
%49 = load i32, i32* %4
%50 = add nsw i32 %49, 1
store i32 %50, i32* %4
br label %7
51: ; preds = %7
%52 = load i32, i32* %6
%53 = icmp eq i32 %52, 0
br i1 %53, label %63, label %54
54: ; preds = %51
%55 = load i32, i32* %6
%56 = icmp eq i32 %55, 2
br i1 %56, label %57, label %61
57: ; preds = %54
%58 = load i8, i8* %3
%59 = zext i8 %58 to i32
%60 = icmp ne i32 %59, 0
br label %61
61: ; preds = %57, %54
%62 = phi i1 [ false, %54 ], [ %60, %57 ]
br label %63
63: ; preds = %61, %51
%64 = phi i1 [ true, %51 ], [ %62, %61 ]
%65 = zext i1 %64 to i32
ret i32 %65
}

LLVM IR (-O2):
@test_glostr.xor_8bit = internal unnamed_addr constant [256 x i8] c"\00\01\01\00\01\00\00\01\01\00\00\01\00\01\01\00\01\00\00\01\00\01\01\00\00\01\01\00\01\00\00\01\01\00\00\01\00\01\01\00\00\01\01\00\01\00\00\01\00\01\01\00\01\00\00\01\01\00\00\01\00\01\01\00\01\00\00\01\00\01\01\00\00\01\01\00\01\00\00\01\00\01\01\00\01\00\00\01\01\00\00\01\00\01\01\00\00\01\01\00\01\00\00\01\01\00\00\01\00\01\01\00\01\00\00\01\00\01\01\00\00\01\01\00\01\00\00\01\01\00\00\01\00\01\01\00\00\01\01\00\01\00\00\01\00\01\01\00\01\00\00\01\01\00\00\01\00\01\01\00\00\01\01\00\01\00\00\01\01\00\00\01\00\01\01\00\01\00\00\01\00\01\01\00\00\01\01\00\01\00\00\01\00\01\01\00\01\00\00\01\01\00\00\01\00\01\01\00\01\00\00\01\00\01\01\00\00\01\01\00\01\00\00\01\01\00\00\01\00\01\01\00\00\01\01\00\01\00\00\01\00\01\01\00\01\00\00\01\01\00\00\01\00\01\01\00"
@test_glostr.mask_hamming = internal unnamed_addr constant [8 x [12 x i8]] [[12 x i8] c"UUZ\AA\AA\AA\B5Uj\D8\08\00", [12 x i8] c"ffl\CC\CC\CC\D9\99\B3h\10\00", [12 x i8] c"\87\87\8F\0F\0F\0F\1E\1E<p \00", [12 x i8] c"\07\F8\0F\F0\0F\F0\1F\E0?\80@\00", [12 x i8] c"\F8\00\0F\FF\F0\00\1F\FF\C0\00\80\00", [12 x i8] c"\00\00\0F\FF\FF\FF\E0\00\00\01\00\00", [12 x i8] c"\FF\FF\F0\00\00\00\00\00\00\02\00\00", [12 x i8] c"\FF\FF\FF\FF\FF\FF\FF\FF\FF\FF\F8\00"]
define i32 @test_glostr(i8* nocapture %0) {
%2 = getelementptr inbounds i8, i8* %0, i64 1
%3 = load i8, i8* %2
%4 = getelementptr inbounds i8, i8* %0, i64 2
%5 = load i8, i8* %4
%6 = getelementptr inbounds i8, i8* %0, i64 3
%7 = load i8, i8* %6
%8 = getelementptr inbounds i8, i8* %0, i64 4
%9 = load i8, i8* %8
%10 = getelementptr inbounds i8, i8* %0, i64 5
%11 = load i8, i8* %10
%12 = getelementptr inbounds i8, i8* %0, i64 6
%13 = load i8, i8* %12
%14 = getelementptr inbounds i8, i8* %0, i64 7
%15 = load i8, i8* %14
%16 = getelementptr inbounds i8, i8* %0, i64 8
%17 = load i8, i8* %16
%18 = getelementptr inbounds i8, i8* %0, i64 9
%19 = load i8, i8* %18
%20 = getelementptr inbounds i8, i8* %0, i64 10
%21 = load i8, i8* %20
%22 = load i8, i8* %0
br label %23
23: ; preds = %1, %23
%24 = phi i64 [ 0, %1 ], [ %104, %23 ]
%25 = phi i32 [ 0, %1 ], [ %103, %23 ]
%26 = getelementptr inbounds [8 x [12 x i8]], [8 x [12 x i8]]* @test_glostr.mask_hamming, i64 0, i64 %24, i64 0
%27 = load i8, i8* %26
%28 = and i8 %27, %22
%29 = zext i8 %28 to i64
%30 = getelementptr inbounds [256 x i8], [256 x i8]* @test_glostr.xor_8bit, i64 0, i64 %29
%31 = load i8, i8* %30
%32 = getelementptr inbounds [8 x [12 x i8]], [8 x [12 x i8]]* @test_glostr.mask_hamming, i64 0, i64 %24, i64 1
%33 = load i8, i8* %32
%34 = and i8 %33, %3
%35 = zext i8 %34 to i64
%36 = getelementptr inbounds [256 x i8], [256 x i8]* @test_glostr.xor_8bit, i64 0, i64 %35
%37 = load i8, i8* %36
%38 = xor i8 %37, %31
%39 = getelementptr inbounds [8 x [12 x i8]], [8 x [12 x i8]]* @test_glostr.mask_hamming, i64 0, i64 %24, i64 2
%40 = load i8, i8* %39
%41 = and i8 %40, %5
%42 = zext i8 %41 to i64
%43 = getelementptr inbounds [256 x i8], [256 x i8]* @test_glostr.xor_8bit, i64 0, i64 %42
%44 = load i8, i8* %43
%45 = xor i8 %44, %38
%46 = getelementptr inbounds [8 x [12 x i8]], [8 x [12 x i8]]* @test_glostr.mask_hamming, i64 0, i64 %24, i64 3
%47 = load i8, i8* %46
%48 = and i8 %47, %7
%49 = zext i8 %48 to i64
%50 = getelementptr inbounds [256 x i8], [256 x i8]* @test_glostr.xor_8bit, i64 0, i64 %49
%51 = load i8, i8* %50
%52 = xor i8 %51, %45
%53 = getelementptr inbounds [8 x [12 x i8]], [8 x [12 x i8]]* @test_glostr.mask_hamming, i64 0, i64 %24, i64 4
%54 = load i8, i8* %53
%55 = and i8 %54, %9
%56 = zext i8 %55 to i64
%57 = getelementptr inbounds [256 x i8], [256 x i8]* @test_glostr.xor_8bit, i64 0, i64 %56
%58 = load i8, i8* %57
%59 = xor i8 %58, %52
%60 = getelementptr inbounds [8 x [12 x i8]], [8 x [12 x i8]]* @test_glostr.mask_hamming, i64 0, i64 %24, i64 5
%61 = load i8, i8* %60
%62 = and i8 %61, %11
%63 = zext i8 %62 to i64
%64 = getelementptr inbounds [256 x i8], [256 x i8]* @test_glostr.xor_8bit, i64 0, i64 %63
%65 = load i8, i8* %64
%66 = xor i8 %65, %59
%67 = getelementptr inbounds [8 x [12 x i8]], [8 x [12 x i8]]* @test_glostr.mask_hamming, i64 0, i64 %24, i64 6
%68 = load i8, i8* %67
%69 = and i8 %68, %13
%70 = zext i8 %69 to i64
%71 = getelementptr inbounds [256 x i8], [256 x i8]* @test_glostr.xor_8bit, i64 0, i64 %70
%72 = load i8, i8* %71
%73 = xor i8 %72, %66
%74 = getelementptr inbounds [8 x [12 x i8]], [8 x [12 x i8]]* @test_glostr.mask_hamming, i64 0, i64 %24, i64 7
%75 = load i8, i8* %74
%76 = and i8 %75, %15
%77 = zext i8 %76 to i64
%78 = getelementptr inbounds [256 x i8], [256 x i8]* @test_glostr.xor_8bit, i64 0, i64 %77
%79 = load i8, i8* %78
%80 = xor i8 %79, %73
%81 = getelementptr inbounds [8 x [12 x i8]], [8 x [12 x i8]]* @test_glostr.mask_hamming, i64 0, i64 %24, i64 8
%82 = load i8, i8* %81
%83 = and i8 %82, %17
%84 = zext i8 %83 to i64
%85 = getelementptr inbounds [256 x i8], [256 x i8]* @test_glostr.xor_8bit, i64 0, i64 %84
%86 = load i8, i8* %85
%87 = xor i8 %86, %80
%88 = getelementptr inbounds [8 x [12 x i8]], [8 x [12 x i8]]* @test_glostr.mask_hamming, i64 0, i64 %24, i64 9
%89 = load i8, i8* %88
%90 = and i8 %89, %19
%91 = zext i8 %90 to i64
%92 = getelementptr inbounds [256 x i8], [256 x i8]* @test_glostr.xor_8bit, i64 0, i64 %91
%93 = load i8, i8* %92
%94 = xor i8 %93, %87
%95 = getelementptr inbounds [8 x [12 x i8]], [8 x [12 x i8]]* @test_glostr.mask_hamming, i64 0, i64 %24, i64 10
%96 = load i8, i8* %95
%97 = and i8 %96, %21
%98 = zext i8 %97 to i64
%99 = getelementptr inbounds [256 x i8], [256 x i8]* @test_glostr.xor_8bit, i64 0, i64 %98
%100 = load i8, i8* %99
%101 = icmp ne i8 %100, %94
%102 = zext i1 %101 to i32
%103 = add nuw nsw i32 %25, %102
%104 = add nuw nsw i64 %24, 1
%105 = icmp eq i64 %104, 8
br i1 %105, label %106, label %23
106: ; preds = %23
%107 = icmp eq i32 %103, 0
%108 = icmp eq i32 %103, 2
%109 = select i1 %108, i1 %101, i1 false
%110 = select i1 %107, i1 true, i1 %109
%111 = zext i1 %110 to i32
ret i32 %111
}