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

```asm
<bifidDecipher>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x50,%rsp
  mov    %rdi,-0x38(%rbp)
  mov    %esi,-0x3c(%rbp)
  mov    %rdx,-0x48(%rbp)
  mov    %rcx,-0x50(%rbp)
  mov    %r8d,-0x40(%rbp)
  movl   $0x0,-0x20(%rbp)
  jmp    L66
L60:
  mov    -0x20(%rbp),%edx
  mov    -0x3c(%rbp),%eax
  add    %edx,%eax
  cmp    %eax,-0x40(%rbp)
  jge    L33
  mov    -0x40(%rbp),%eax
  sub    -0x20(%rbp),%eax
  mov    %eax,-0x3c(%rbp)
L33:
  movl   $0x0,-0x1c(%rbp)
  jmp    L5
L56:
  mov    -0x1c(%rbp),%eax
  mov    %eax,%edx
  shr    $0x1f,%edx
  add    %edx,%eax
  sar    %eax
  mov    %eax,%edx
  mov    -0x20(%rbp),%eax
  add    %edx,%eax
  movslq %eax,%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  mov    %al,-0x22(%rbp)
  mov    -0x3c(%rbp),%edx
  mov    -0x1c(%rbp),%eax
  add    %edx,%eax
  mov    %eax,%edx
  shr    $0x1f,%edx
  add    %edx,%eax
  sar    %eax
  mov    %eax,%edx
  mov    -0x20(%rbp),%eax
  add    %edx,%eax
  movslq %eax,%rdx
  mov    -0x48(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  mov    %al,-0x21(%rbp)
  movsbl -0x22(%rbp),%edx
  mov    -0x38(%rbp),%rax
  mov    %edx,%esi
  mov    %rax,%rdi
  call   <index@plt>
  sub    -0x38(%rbp),%rax
  mov    %eax,-0x18(%rbp)
  movsbl -0x21(%rbp),%edx
  mov    -0x38(%rbp),%rax
  mov    %edx,%esi
  mov    %rax,%rdi
  call   <index@plt>
  sub    -0x38(%rbp),%rax
  mov    %eax,-0x14(%rbp)
  mov    -0x18(%rbp),%eax
  movslq %eax,%rdx
  imul   $0x66666667,%rdx,%rdx
  shr    $0x20,%rdx
  sar    %edx
  sar    $0x1f,%eax
  mov    %eax,%ecx
  mov    %edx,%eax
  sub    %ecx,%eax
  mov    %eax,-0x10(%rbp)
  mov    -0x14(%rbp),%eax
  movslq %eax,%rdx
  imul   $0x66666667,%rdx,%rdx
  shr    $0x20,%rdx
  sar    %edx
  sar    $0x1f,%eax
  mov    %eax,%ecx
  mov    %edx,%eax
  sub    %ecx,%eax
  mov    %eax,-0xc(%rbp)
  mov    -0x18(%rbp),%eax
  movslq %eax,%rdx
  imul   $0x66666667,%rdx,%rdx
  shr    $0x20,%rdx
  sar    %edx
  mov    %eax,%esi
  sar    $0x1f,%esi
  mov    %edx,%ecx
  sub    %esi,%ecx
  mov    %ecx,%edx
  shl    $0x2,%edx
  add    %ecx,%edx
  sub    %edx,%eax
  mov    %eax,-0x8(%rbp)
  mov    -0x14(%rbp),%eax
  movslq %eax,%rdx
  imul   $0x66666667,%rdx,%rdx
  shr    $0x20,%rdx
  sar    %edx
  mov    %eax,%esi
  sar    $0x1f,%esi
  mov    %edx,%ecx
  sub    %esi,%ecx
  mov    %ecx,%edx
  shl    $0x2,%edx
  add    %ecx,%edx
  sub    %edx,%eax
  mov    %eax,-0x4(%rbp)
  mov    -0x1c(%rbp),%eax
  and    $0x1,%eax
  test   %eax,%eax
  jne    L69
  mov    -0x10(%rbp),%edx
  mov    %edx,%eax
  shl    $0x2,%eax
  add    %eax,%edx
  mov    -0x4(%rbp),%eax
  add    %edx,%eax
  movslq %eax,%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  mov    -0x20(%rbp),%ecx
  mov    -0x1c(%rbp),%edx
  add    %ecx,%edx
  movslq %edx,%rcx
  mov    -0x50(%rbp),%rdx
  add    %rcx,%rdx
  movzbl (%rax),%eax
  mov    %al,(%rdx)
  jmp    L51
L69:
  mov    -0x8(%rbp),%edx
  mov    %edx,%eax
  shl    $0x2,%eax
  add    %eax,%edx
  mov    -0xc(%rbp),%eax
  add    %edx,%eax
  movslq %eax,%rdx
  mov    -0x38(%rbp),%rax
  add    %rdx,%rax
  mov    -0x20(%rbp),%ecx
  mov    -0x1c(%rbp),%edx
  add    %ecx,%edx
  movslq %edx,%rcx
  mov    -0x50(%rbp),%rdx
  add    %rcx,%rdx
  movzbl (%rax),%eax
  mov    %al,(%rdx)
L51:
  addl   $0x1,-0x1c(%rbp)
L5:
  mov    -0x1c(%rbp),%eax
  cmp    -0x3c(%rbp),%eax
  jl     L56
  mov    -0x3c(%rbp),%eax
  add    %eax,-0x20(%rbp)
L66:
  mov    -0x20(%rbp),%eax
  cmp    -0x40(%rbp),%eax
  jl     L60
  mov    -0x20(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x50(%rbp),%rax
  add    %rdx,%rax
  movb   $0x0,(%rax)
  mov    -0x50(%rbp),%rax
  leave
  ret
```

assistant: ```c
char *bifidDecipher(char *key, int period, char *text, char *result, int len) {
  int i, j;
  char a, b;
  int a_ind, b_ind;
  int a_row, b_row;
  int a_col, b_col;
  for (i = 0; i < len; i += period) {
    if (i + period > len) {
      period = len - i;
    }
    for (j = 0; j < period; j++) {
      a = text[i + (j / 2)];
      b = text[i + ((period + j) / 2)];
      a_ind = (int)(index(key, a) - key);
      b_ind = (int)(index(key, b) - key);
      a_row = a_ind / 5;
      b_row = b_ind / 5;
      a_col = a_ind % 5;
      b_col = b_ind % 5;
      if (j % 2 == 0) {
        result[i + j] = key[5 * a_row + b_col];
      } else {
        result[i + j] = key[5 * a_col + b_row];
      }
    }
  }
  result[i] = '\0';
  return result;
}
```