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

```asm
<loosen_labels>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  mov    %edx,%r13d
  push   %r12
  mov    %rsi,%r12
  push   %rbp
  movslq %ecx,%rbp
  push   %rbx
  mov    %rdi,%rbx
  lea    0x0(,%rbp,4),%edi
  sub    $0x8,%rsp
  call   <malloc_or_die@plt>
  mov    %ebp,%edx
  mov    %rbx,%rsi
  mov    %r12,%rdi
  mov    %rax,%r14
  call   <memcpy@plt>
  movzbl (%rbx),%esi
  mov    $0x1,%eax
  movl   $0x1,(%r14)
  mov    $0x1,%edx
  cmp    $0x1,%ebp
  jg     L112
  jmp    L89
  nopl   0x0(%rax,%rax,1)
L133:
  cmp    %eax,%edx
  je     L88
  test   $0x1,%dl
  jne    L159
  mov    %edx,%esi
  shr    $0x1f,%esi
  add    %esi,%edx
  sar    %edx
  neg    %edx
  lea    (%rdx,%rax,1),%esi
  lea    -0x1(%rax,%rdx,1),%edx
  movslq %esi,%rsi
  movslq %edx,%rdx
  movl   $0x1,(%r14,%rsi,4)
  mov    %ecx,%esi
  movl   $0x1,(%r14,%rdx,4)
  mov    $0x1,%edx
L111:
  add    $0x1,%rax
  cmp    %rbp,%rax
  je     L149
L112:
  movzbl (%rbx,%rax,1),%ecx
  mov    %eax,%edi
  cmp    %sil,%cl
  jne    L133
  add    $0x1,%rax
  add    $0x1,%edx
  cmp    %rbp,%rax
  jne    L112
L149:
  lea    -0x1(%r13),%eax
  movzbl (%rbx),%edx
  lea    0x8(%r14,%r14,1),%r11
  xor    %r10d,%r10d
  lea    0x2(%r12,%rax,1),%rdi
  mov    $0x1,%r8d
  jmp    L129
  nopl   0x0(%rax)
L3:
  add    $0x1,%r8
  add    $0x1,%r10
  add    $0x1,%rdi
  add    $0x8,%r11
  cmp    %rbp,%r8
  je     L89
L129:
  movzbl (%rbx,%r8,1),%eax
  cmp    %dl,%al
  je     L3
  test   %r13d,%r13d
  jle    L135
  lea    (%r14,%r8,4),%rax
  lea    (%r12,%r8,1),%rdx
  lea    (%r12,%r10,1),%rcx
  lea    -0x4(%r11),%r9
  jmp    L90
  nopl   (%rax)
L46:
  mov    %r9,%rsi
  sub    %rax,%rsi
  mov    (%rsi),%esi
  test   %esi,%esi
  jne    L64
  movb   $0x2e,(%rdx)
  add    $0x1,%rdx
  add    $0x4,%rax
  sub    $0x1,%rcx
  movb   $0x2e,0x1(%rcx)
  cmp    %rdi,%rdx
  je     L64
L90:
  mov    (%rax),%r15d
  test   %r15d,%r15d
  je     L46
L64:
  movzbl (%rbx,%r8,1),%edx
  jmp    L3
  nopl   0x0(%rax,%rax,1)
L88:
  mov    %ecx,%esi
  mov    $0x1,%edx
  jmp    L111
  nopl   0x0(%rax)
L159:
  sar    %edx
  mov    %ecx,%esi
  add    $0x1,%edx
  sub    %edx,%edi
  mov    $0x1,%edx
  movslq %edi,%rdi
  movl   $0x1,(%r14,%rdi,4)
  jmp    L111
  cs nopw 0x0(%rax,%rax,1)
L89:
  add    $0x8,%rsp
  mov    %r14,%rdi
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  jmp    1070 <free@plt>
L135:
  mov    %eax,%edx
  jmp    L3
```

assistant: ```c
void loosen_labels(char *labels, char *loose_labels, int label_looseness, int seq_len) {
  int *locked_labels;
  int reg_len;
  int i, j;
  char cur;
  locked_labels = (int *)(malloc_or_die(seq_len * sizeof(int)));
  memcpy(loose_labels, labels, seq_len * sizeof(char));
  reg_len = 1;
  cur = labels[0];
  locked_labels[0] = 1;
  for (i = 1; i < seq_len; i++) {
    if (labels[i] != cur) {
      cur = labels[i];
      if (reg_len == i) {
      } else {
        if (reg_len % 2 == 1) {
          locked_labels[i - (reg_len / 2 + 1)] = 1;
        } else {
          locked_labels[i - reg_len / 2] = 1;
          locked_labels[i - (reg_len / 2 + 1)] = 1;
        }
      }
      reg_len = 1;
    } else {
      reg_len++;
    }
  }
  reg_len = 1;
  cur = labels[0];
  for (i = 1; i < seq_len; i++) {
    if (labels[i] != cur) {
      for (j = 0; j < label_looseness; j++) {
        if (locked_labels[i + j] == 0 && locked_labels[i - 1 - j] == 0) {
          loose_labels[i + j] = '.';
          loose_labels[i - 1 - j] = '.';
        } else {
          break;
        }
      }
      cur = labels[i];
      reg_len = 1;
    } else {
      reg_len++;
    }
  }
  free(locked_labels);
}
```