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

```asm
<next>:
  endbr64
  push   %r14
  push   %r13
  push   %r12
  mov    %rdi,%r12
  push   %rbp
  mov    %esi,%ebp
  push   %rbx
  call   <strlen@plt>
  mov    %rax,%r14
  lea    0x1(%rax),%rdi
  lea    -0x1(%rax),%r13
  cmp    $0x1,%bpl
  jle    L42
  call   <malloc@plt>
  xor    %edx,%edx
  movb   $0x0,(%rax,%r14,1)
  mov    %rax,%rbx
  movzbl (%r12),%eax
  mov    %al,-0x1(%rbx,%r14,1)
  xor    %eax,%eax
  test   %r13,%r13
  je     L60
  nopl   0x0(%rax,%rax,1)
L166:
  movzbl 0x1(%r12,%rax,1),%ecx
  add    $0x1,%edx
  mov    %cl,(%rbx,%rax,1)
  movsbq %dl,%rax
  cmp    %r13,%rax
  jb     L166
L60:
  mov    %rbx,%rdi
  call   <strlen@plt>
  mov    %rax,%r14
  lea    0x1(%rax),%rdi
  lea    -0x1(%rax),%r13
  cmp    $0x2,%bpl
  je     L16
  call   <malloc@plt>
  xor    %edx,%edx
  movb   $0x0,(%rax,%r14,1)
  mov    %rax,%r12
  movzbl (%rbx),%eax
  mov    %al,-0x1(%r12,%r14,1)
  xor    %eax,%eax
  test   %r13,%r13
  je     L69
L29:
  movzbl 0x1(%rbx,%rax,1),%ecx
  add    $0x1,%edx
  mov    %cl,(%r12,%rax,1)
  movsbq %dl,%rax
  cmp    %r13,%rax
  jb     L29
L69:
  mov    %r12,%rdi
  call   <strlen@plt>
  mov    %rax,%r14
  lea    0x1(%rax),%rdi
  lea    -0x1(%rax),%rbx
  cmp    $0x3,%bpl
  je     L142
  call   <malloc@plt>
  xor    %edx,%edx
  movb   $0x0,(%rax,%r14,1)
  mov    %rax,%r13
  movzbl (%r12),%eax
  mov    %al,-0x1(%r13,%r14,1)
  xor    %eax,%eax
  test   %rbx,%rbx
  je     L152
  nopw   0x0(%rax,%rax,1)
L188:
  movzbl 0x1(%r12,%rax,1),%ecx
  add    $0x1,%edx
  mov    %cl,0x0(%r13,%rax,1)
  movsbq %dl,%rax
  cmp    %rax,%rbx
  ja     L188
L152:
  cmp    $0x4,%bpl
  je     L149
  mov    %r13,%rdi
  mov    $0x1,%esi
  call   <next>
  lea    -0x4(%rbp),%esi
  pop    %rbx
  pop    %rbp
  mov    %rax,%rdi
  pop    %r12
  movzbl %sil,%esi
  pop    %r13
  pop    %r14
  jmp    1140 <next>
  nopl   (%rax)
L42:
  call   <malloc@plt>
  movb   $0x0,(%rax,%r14,1)
  movzbl (%r12),%edx
  mov    %dl,-0x1(%rax,%r14,1)
  test   %r13,%r13
  je     L139
  xor    %ecx,%ecx
  xor    %edx,%edx
  nopl   (%rax)
L150:
  movzbl 0x1(%r12,%rdx,1),%esi
  add    $0x1,%ecx
  mov    %sil,(%rax,%rdx,1)
  movsbq %cl,%rdx
  cmp    %r13,%rdx
  jb     L150
L139:
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  nop
L142:
  call   <malloc@plt>
  movb   $0x0,(%rax,%r14,1)
  movzbl (%r12),%edx
  mov    %dl,-0x1(%rax,%r14,1)
  test   %rbx,%rbx
  je     L139
  xor    %ecx,%ecx
  xor    %edx,%edx
  nopl   (%rax)
L168:
  movzbl 0x1(%r12,%rdx,1),%esi
  add    $0x1,%ecx
  mov    %sil,(%rax,%rdx,1)
  movsbq %cl,%rdx
  cmp    %rbx,%rdx
  jb     L168
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  nop
L16:
  call   <malloc@plt>
  movb   $0x0,(%rax,%r14,1)
  movzbl (%rbx),%edx
  mov    %dl,-0x1(%rax,%r14,1)
  test   %r13,%r13
  je     L139
  xor    %ecx,%ecx
  xor    %edx,%edx
  nopl   0x0(%rax,%rax,1)
L79:
  movzbl 0x1(%rbx,%rdx,1),%esi
  add    $0x1,%ecx
  mov    %sil,(%rax,%rdx,1)
  movsbq %cl,%rdx
  cmp    %r13,%rdx
  jb     L79
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  ret
  xchg   %ax,%ax
L149:
  mov    %r13,%rdi
  call   <strlen@plt>
  lea    0x1(%rax),%rdi
  mov    %rax,%rbx
  call   <malloc@plt>
  mov    %rbx,%rsi
  movb   $0x0,(%rax,%rbx,1)
  movzbl 0x0(%r13),%edx
  mov    %dl,-0x1(%rax,%rbx,1)
  sub    $0x1,%rsi
  je     L139
  xor    %ecx,%ecx
  xor    %edx,%edx
  nopw   0x0(%rax,%rax,1)
L47:
  movzbl 0x1(%r13,%rdx,1),%edi
  add    $0x1,%ecx
  mov    %dil,(%rax,%rdx,1)
  movsbq %cl,%rdx
  cmp    %rdx,%rsi
  ja     L47
  jmp    L139
```

assistant: ```c
char *next(const char *original, char times) {
  if (times <= 1) {
    char i, *transformed;
    size_t len;
    len = strlen(original);
    transformed = (char *)malloc(len + 1);
    transformed[len] = '\0';
    transformed[len - 1] = original[0];
    for (i = 0; i < len - 1; i += 1) {
      transformed[i] = original[i + 1];
    }
    return transformed;
  }
  return next(next(original, 1), times - 1);
}
```