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

```asm
<calc_block>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x90,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x88(%rsp)
  xor    %eax,%eax
  lea    0x20(%rsp),%r12
  mov    %rsp,%r13
  call   <translate_area@plt>
  mov    %r12,%rbp
  mov    %eax,%edx
  mov    %eax,%esi
  mov    %eax,%ecx
  mov    %eax,%edi
  shr    $0x6,%edx
  shr    $0xc,%esi
  movd   %eax,%xmm0
  mov    %eax,%ebx
  shr    $0x12,%ecx
  movd   %edx,%xmm4
  movd   %esi,%xmm1
  mov    %eax,%edx
  movd   %ecx,%xmm3
  punpckldq %xmm4,%xmm0
  mov    %eax,%ecx
  mov    %eax,%esi
  shr    $0xd,%ecx
  punpckldq %xmm3,%xmm1
  shr    %esi
  shr    $0x7,%edx
  punpcklqdq %xmm1,%xmm0
  movd   %ecx,%xmm2
  mov    %eax,%ecx
  movdqa D4(%rip),%xmm1
  shr    $0x13,%ecx
  movd   %edx,%xmm6
  mov    %eax,%edx
  shr    $0x8,%edx
  movd   %ecx,%xmm5
  mov    %eax,%ecx
  shr    $0xe,%edi
  pand   %xmm1,%xmm0
  punpckldq %xmm5,%xmm2
  shr    $0x14,%ecx
  movd   %edx,%xmm3
  movaps %xmm0,0x20(%rsp)
  movd   %esi,%xmm0
  mov    %eax,%esi
  movd   %ecx,%xmm7
  punpckldq %xmm6,%xmm0
  shr    $0x2,%esi
  mov    %eax,%edx
  mov    %eax,%ecx
  shr    $0x9,%edx
  punpcklqdq %xmm2,%xmm0
  movd   %edi,%xmm2
  mov    %eax,%edi
  pand   %xmm1,%xmm0
  punpckldq %xmm7,%xmm2
  shr    $0xf,%edi
  movd   %edx,%xmm5
  movaps %xmm0,0x30(%rsp)
  movd   %esi,%xmm0
  mov    %eax,%esi
  shr    $0x15,%ecx
  punpckldq %xmm3,%xmm0
  shr    $0x3,%esi
  movd   %ecx,%xmm4
  mov    %eax,%edx
  shr    $0xa,%edx
  punpcklqdq %xmm2,%xmm0
  movd   %edi,%xmm2
  mov    %eax,%ecx
  pand   %xmm1,%xmm0
  punpckldq %xmm4,%xmm2
  mov    %eax,%edi
  shr    $0x16,%ecx
  movaps %xmm0,0x40(%rsp)
  movd   %esi,%xmm0
  mov    %eax,%esi
  shr    $0x10,%edi
  punpckldq %xmm5,%xmm0
  shr    $0x4,%esi
  movd   %edx,%xmm7
  movd   %ecx,%xmm6
  punpcklqdq %xmm2,%xmm0
  movd   %edi,%xmm2
  mov    %eax,%edx
  shr    $0x5,%ebx
  pand   %xmm1,%xmm0
  punpckldq %xmm6,%xmm2
  shr    $0xb,%edx
  movaps %xmm0,0x50(%rsp)
  movd   %esi,%xmm0
  mov    %eax,%esi
  shr    $0x17,%eax
  punpckldq %xmm7,%xmm0
  shr    $0x11,%esi
  movd   %eax,%xmm3
  movd   %edx,%xmm4
  punpcklqdq %xmm2,%xmm0
  movd   %esi,%xmm2
  pand   %xmm1,%xmm0
  punpckldq %xmm3,%xmm2
  movaps %xmm0,0x60(%rsp)
  movd   %ebx,%xmm0
  mov    $0x1,%ebx
  punpckldq %xmm4,%xmm0
  punpcklqdq %xmm2,%xmm0
  pand   %xmm1,%xmm0
  movaps %xmm0,0x70(%rsp)
L63:
  mov    $0x1,%edx
  mov    %ebx,%esi
  mov    %r12,%rdi
  mov    %ebx,%r14d
  call   <count_neighbors@plt>
  cmp    $0x2,%eax
  je     L120
  cmp    $0x3,%eax
  sete   %al
  movzbl %al,%eax
L34:
  mov    $0x2,%edx
  mov    %r14d,%esi
  mov    %r12,%rdi
  mov    %eax,-0x8(%r13,%rbx,8)
  call   <count_neighbors@plt>
  cmp    $0x2,%eax
  je     L91
  cmp    $0x3,%eax
  sete   %al
  movzbl %al,%eax
L87:
  mov    %eax,-0x4(%r13,%rbx,8)
  add    $0x1,%rbx
  add    $0x10,%rbp
  cmp    $0x5,%rbx
  jne    L63
  cmpl   $0x1,(%rsp)
  sete   %al
  cmpl   $0x1,0x4(%rsp)
  jne    L86
  or     $0x10,%eax
L86:
  cmpl   $0x1,0x8(%rsp)
  jne    L77
  or     $0x2,%eax
L77:
  cmpl   $0x1,0xc(%rsp)
  jne    L53
  or     $0x20,%eax
L53:
  cmpl   $0x1,0x10(%rsp)
  jne    L64
  or     $0x4,%eax
L64:
  cmpl   $0x1,0x14(%rsp)
  jne    L100
  or     $0x40,%eax
L100:
  cmpl   $0x1,0x18(%rsp)
  jne    L25
  or     $0x8,%eax
L25:
  cmpl   $0x1,0x1c(%rsp)
  jne    L107
  or     $0xffffff80,%eax
L107:
  mov    0x88(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L46
  add    $0x90,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  nop
L91:
  mov    0x18(%rbp),%edx
  xor    %eax,%eax
  test   %edx,%edx
  setne  %al
  jmp    L87
  nop
L120:
  mov    0x14(%rbp),%ecx
  xor    %eax,%eax
  test   %ecx,%ecx
  setne  %al
  jmp    L34
L46:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: parse_data
arguments: label: D4
type_guessed: byte[16]

tool: {"D4": [0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00,0x01,0x00,0x00,0x00]}

assistant: ```c
char calc_block(unsigned int opt_area) {
  unsigned int input_area;
  int input_cell[6][4];
  char result_block;
  int result_cell[4][2];
  int x, y, i;
  input_area = translate_area(opt_area);
  for (x = 0; x < 6; x++) {
    for (y = 0; y < 4; y++) {
      if ((input_area >> (y * 6 + x)) & 0x1) {
        input_cell[x][y] = 1;
      } else {
        input_cell[x][y] = 0;
      }
    }
  }
  for (x = 1; x < 5; x++) {
    for (y = 1; y < 3; y++) {
      switch (count_neighbors(input_cell, x, y)) {
      case 3:
        result_cell[x - 1][y - 1] = 1;
        break;
      case 2:
        if (input_cell[x][y]) {
          result_cell[x - 1][y - 1] = 1;
        } else {
          result_cell[x - 1][y - 1] = 0;
        }
        break;
      default:
        result_cell[x - 1][y - 1] = 0;
        break;
      }
    }
  }
  result_block = 0;
  for (x = 0; x < 4; x++) {
    for (y = 0; y < 2; y++) {
      if (result_cell[x][y] == 1) {
        result_block |= (0x1 << y * 4 + x);
      }
    }
  }
  return (result_block);
}
```