user: Converte this assembly snippet into its equivalent C code:

```asm
<test_glostr>:
  endbr64
  push   %r15
  lea    D1(%rip),%rax
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  movzbl (%rdi),%r11d
  movzbl 0x1(%rdi),%r15d
  movzbl 0x2(%rdi),%r10d
  mov    %r11,%rdx
  movzbl 0x3(%rdi),%r13d
  movzbl 0x4(%rdi),%ebp
  mov    %r11,%r14
  mov    %r15,%rcx
  and    $0x55,%edx
  movzbl 0x5(%rdi),%ebx
  movzbl 0x6(%rdi),%r9d
  and    $0x55,%ecx
  movzbl (%rax,%rdx,1),%edx
  movzbl 0x7(%rdi),%r12d
  xor    (%rax,%rcx,1),%dl
  mov    %r10,%rcx
  movzbl 0x8(%rdi),%r8d
  and    $0x5a,%ecx
  movzbl 0x9(%rdi),%esi
  movzbl 0xa(%rdi),%edi
  xor    (%rax,%rcx,1),%dl
  mov    %r13,%rcx
  and    $0xaa,%ecx
  xor    (%rax,%rcx,1),%dl
  mov    %rbp,%rcx
  and    $0xaa,%ecx
  xor    (%rax,%rcx,1),%dl
  mov    %rbx,%rcx
  and    $0xaa,%ecx
  xor    (%rax,%rcx,1),%dl
  mov    %r9,%rcx
  and    $0xb5,%ecx
  xor    (%rax,%rcx,1),%dl
  mov    %r12,%rcx
  and    $0x55,%ecx
  xor    (%rax,%rcx,1),%dl
  mov    %r8,%rcx
  and    $0x6a,%ecx
  xor    (%rax,%rcx,1),%dl
  mov    %rsi,%rcx
  and    $0xd8,%ecx
  xor    (%rax,%rcx,1),%dl
  mov    %rdi,%rcx
  and    $0x8,%ecx
  cmp    (%rax,%rcx,1),%dl
  mov    %r15,%rdx
  setne  %cl
  and    $0x66,%r14d
  and    $0x66,%edx
  movzbl (%rax,%rdx,1),%edx
  xor    (%rax,%r14,1),%dl
  mov    %r10,%r14
  movzbl %cl,%ecx
  and    $0x6c,%r14d
  xor    (%rax,%r14,1),%dl
  mov    %r13,%r14
  and    $0xcc,%r14d
  xor    (%rax,%r14,1),%dl
  mov    %rbp,%r14
  and    $0xcc,%r14d
  xor    (%rax,%r14,1),%dl
  mov    %rbx,%r14
  mov    %r15b,-0x10(%rsp)
  and    $0xcc,%r14d
  xor    (%rax,%r14,1),%dl
  mov    %r9,%r14
  and    $0xd9,%r14d
  xor    (%rax,%r14,1),%dl
  mov    %r12,%r14
  and    $0x99,%r14d
  xor    (%rax,%r14,1),%dl
  mov    %r8,%r14
  and    $0xb3,%r14d
  xor    (%rax,%r14,1),%dl
  mov    %rsi,%r14
  and    $0x68,%r14d
  xor    (%rax,%r14,1),%dl
  mov    %rdi,%r14
  and    $0x10,%r14d
  cmp    (%rax,%r14,1),%dl
  mov    %r11,%r14
  setne  %dl
  and    $0x87,%r14d
  movzbl %dl,%edx
  movzbl (%rax,%r14,1),%r14d
  add    %edx,%ecx
  mov    %r15,%rdx
  mov    %rbx,%r15
  and    $0x87,%edx
  and    $0xf,%r15d
  xor    (%rax,%rdx,1),%r14b
  mov    %r10,%rdx
  and    $0x8f,%edx
  xor    (%rax,%rdx,1),%r14b
  mov    %r13,%rdx
  and    $0xf,%edx
  xor    (%rax,%rdx,1),%r14b
  mov    %rbp,%rdx
  and    $0xf,%edx
  movzbl (%rax,%rdx,1),%edx
  xor    %edx,%r14d
  xor    (%rax,%r15,1),%r14b
  mov    %r9,%r15
  and    $0x1e,%r15d
  xor    (%rax,%r15,1),%r14b
  mov    %r12,%r15
  and    $0x1e,%r15d
  xor    (%rax,%r15,1),%r14b
  mov    %r8,%r15
  and    $0x3c,%r15d
  xor    (%rax,%r15,1),%r14b
  mov    %rsi,%r15
  and    $0x70,%r15d
  xor    (%rax,%r15,1),%r14b
  mov    %rdi,%r15
  and    $0x20,%r15d
  cmp    (%rax,%r15,1),%r14b
  setne  %r14b
  movzbl %r14b,%r14d
  add    %r14d,%ecx
  mov    %r10,%r14
  and    $0xf,%r14d
  movzbl (%rax,%r14,1),%r15d
  mov    %r11,%r14
  and    $0x7,%r14d
  xor    (%rax,%r14,1),%dl
  mov    -0x10(%rsp),%r14
  mov    %r15b,-0x1(%rsp)
  and    $0xf8,%r14d
  xor    (%rax,%r14,1),%dl
  mov    %r13,%r14
  movzbl (%rax,%r13,1),%r13d
  and    $0xf0,%r14d
  xor    %r15d,%edx
  mov    %r12,%r15
  xor    (%rax,%r14,1),%dl
  mov    %rbx,%r14
  and    $0xe0,%r15d
  and    $0xf0,%r14d
  xor    (%rax,%r14,1),%dl
  mov    %r9,%r14
  and    $0x1f,%r14d
  movzbl (%rax,%r14,1),%r14d
  xor    %r14d,%edx
  xor    (%rax,%r15,1),%dl
  mov    %r8,%r15
  and    $0x3f,%r15d
  xor    (%rax,%r15,1),%dl
  mov    %rsi,%r15
  and    $0x80,%r15d
  xor    (%rax,%r15,1),%dl
  mov    %rdi,%r15
  and    $0x40,%r15d
  cmp    (%rax,%r15,1),%dl
  setne  %dl
  movzbl %dl,%edx
  add    %edx,%ecx
  movzbl (%rax,%r12,1),%edx
  movzbl -0x1(%rsp),%r15d
  movzbl (%rax,%rbx,1),%ebx
  xor    %r13d,%edx
  mov    %r15d,%r12d
  xor    %edx,%r12d
  xor    %r14d,%r12d
  mov    %r11,%r14
  movzbl (%rax,%r11,1),%r11d
  and    $0xf8,%r14d
  xor    (%rax,%r14,1),%r12b
  mov    %rbp,%r14
  movzbl (%rax,%rbp,1),%ebp
  and    $0xf0,%r14d
  xor    (%rax,%r14,1),%r12b
  mov    %r8,%r14
  and    $0xc0,%r14d
  xor    (%rax,%r14,1),%r12b
  mov    %rdi,%r14
  and    $0x80,%r14d
  cmp    (%rax,%r14,1),%r12b
  setne  %r12b
  xor    %ebp,%r13d
  movzbl %r12b,%r12d
  add    %r12d,%ecx
  mov    %r13d,%r12d
  mov    %r9,%r13
  and    $0xe0,%r13d
  xor    %ebx,%r12d
  xor    %r15d,%r12d
  xor    (%rax,%r13,1),%r12b
  mov    %rsi,%r13
  and    $0x1,%r13d
  cmp    (%rax,%r13,1),%r12b
  setne  %r12b
  movzbl %r12b,%r12d
  add    %r12d,%ecx
  movzbl -0x10(%rsp),%r12d
  xor    (%rax,%r12,1),%r11b
  mov    %r10,%r12
  and    $0xf0,%r12d
  movzbl (%rax,%r12,1),%r13d
  mov    %rsi,%r12
  and    $0x2,%r12d
  xor    %r11d,%r13d
  cmp    (%rax,%r12,1),%r13b
  setne  %r12b
  xor    %ebp,%edx
  and    $0xf8,%edi
  xor    %ebx,%edx
  xor    (%rax,%r10,1),%dl
  xor    (%rax,%r9,1),%dl
  movzbl %r12b,%r12d
  xor    (%rax,%r8,1),%dl
  xor    (%rax,%rsi,1),%dl
  add    %r12d,%ecx
  movzbl (%rax,%rdi,1),%eax
  xor    %r11d,%edx
  cmp    %dl,%al
  je     L0
  add    $0x1,%ecx
L5:
  cmp    $0x2,%ecx
  pop    %rbx
  pop    %rbp
  sete   %cl
  cmp    %dl,%al
  pop    %r12
  pop    %r13
  setne  %al
  pop    %r14
  pop    %r15
  movzbl %al,%eax
  and    %ecx,%eax
  ret
L0:
  test   %ecx,%ecx
  jne    L5
  pop    %rbx
  mov    $0x1,%eax
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
```

tool_calls: name: read_data
arguments: tag: D1
type: string

tool: 

assistant: ```c
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;
  int i, j, 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);
}
```