user: 请将这段汇编代码片段转换成等效的C代码:

```asm
<str_sub>:
  endbr64
  test   %esi,%esi
  js     L76
  push   %r13
  push   %r12
  mov    %rdi,%r12
  push   %rbp
  mov    %edx,%ebp
  push   %rbx
  mov    %esi,%ebx
  sub    $0x8,%rsp
  call   <str_len@plt>
  cmp    %ebp,%eax
  cmovg  %ebp,%eax
  cmp    %ebx,%eax
  jl     L70
  mov    %r12,%rdi
  call   <str_len@plt>
  cmp    %ebp,%eax
  jl     L70
  mov    %ebp,%r13d
  sub    %ebx,%r13d
  lea    0x1(%r13),%edi
  call   <malloc@plt>
  movslq %ebx,%rdx
  lea    (%r12,%rdx,1),%rcx
  mov    %rax,%r8
  mov    %rcx,%rax
  cmp    %ebp,%ebx
  jge    L69
  lea    0x1(%r12,%rdx,1),%r9
  mov    %r8,%rdx
  lea    -0x1(%r13),%esi
  mov    %r13d,%edi
  sub    %r9,%rdx
  cmp    $0xe,%rdx
  jbe    L80
  cmp    $0x6,%esi
  jbe    L80
  cmp    $0xe,%esi
  jbe    L148
  mov    %r13d,%edx
  mov    %rcx,%rdi
  mov    %r8,%rax
  shr    $0x4,%edx
  sub    %r8,%rdi
  shl    $0x4,%rdx
  add    %r8,%rdx
  nopw   0x0(%rax,%rax,1)
L202:
  movdqu (%rax,%rdi,1),%xmm0
  add    $0x10,%rax
  movups %xmm0,-0x10(%rax)
  cmp    %rdx,%rax
  jne    L202
  mov    %r13d,%r10d
  and    $0xfffffff0,%r10d
  mov    %r10d,%r9d
  add    %r10d,%ebx
  lea    (%rcx,%r9,1),%rax
  lea    (%r8,%r9,1),%rdx
  cmp    %r10d,%r13d
  je     L108
  mov    %r13d,%edi
  sub    %r10d,%edi
  lea    -0x1(%rdi),%r10d
  cmp    $0x6,%r10d
  jbe    L32
L94:
  mov    (%rcx,%r9,1),%rcx
  mov    %rcx,(%r8,%r9,1)
  mov    %edi,%ecx
  and    $0xfffffff8,%ecx
  mov    %ecx,%r9d
  add    %ecx,%ebx
  add    %r9,%rax
  add    %r9,%rdx
  cmp    %ecx,%edi
  je     L108
L32:
  movzbl (%rax),%ecx
  mov    %cl,(%rdx)
  lea    0x1(%rbx),%ecx
  cmp    %ecx,%ebp
  jle    L108
  movzbl 0x1(%rax),%ecx
  mov    %cl,0x1(%rdx)
  lea    0x2(%rbx),%ecx
  cmp    %ecx,%ebp
  jle    L108
  movzbl 0x2(%rax),%ecx
  mov    %cl,0x2(%rdx)
  lea    0x3(%rbx),%ecx
  cmp    %ecx,%ebp
  jle    L108
  movzbl 0x3(%rax),%ecx
  mov    %cl,0x3(%rdx)
  lea    0x4(%rbx),%ecx
  cmp    %ecx,%ebp
  jle    L108
  movzbl 0x4(%rax),%ecx
  mov    %cl,0x4(%rdx)
  lea    0x5(%rbx),%ecx
  cmp    %ecx,%ebp
  jle    L108
  movzbl 0x5(%rax),%ecx
  add    $0x6,%ebx
  mov    %cl,0x5(%rdx)
  cmp    %ebx,%ebp
  jle    L108
  movzbl 0x6(%rax),%eax
  mov    %al,0x6(%rdx)
L108:
  mov    %esi,%esi
  lea    0x1(%r8,%rsi,1),%rax
L126:
  movb   $0x0,(%rax)
  add    $0x8,%rsp
  mov    %r8,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nopl   (%rax)
L70:
  add    $0x8,%rsp
  xor    %r8d,%r8d
  pop    %rbx
  mov    %r8,%rax
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nopl   0x0(%rax)
L76:
  xor    %eax,%eax
  ret
  nopl   0x0(%rax,%rax,1)
L80:
  sub    $0x1,%ebp
  mov    %r8,%rax
  sub    %r8,%rcx
  sub    %ebx,%ebp
  lea    0x1(%r8,%rbp,1),%rdi
L153:
  movzbl (%rax,%rcx,1),%edx
  add    $0x1,%rax
  mov    %dl,-0x1(%rax)
  cmp    %rdi,%rax
  jne    L153
  jmp    L108
  nopw   0x0(%rax,%rax,1)
L69:
  mov    %r8,%rax
  jmp    L126
L148:
  mov    %r8,%rdx
  xor    %r9d,%r9d
  jmp    L94
```

assistant: ```c
char *str_sub(char *str, int in, int la) {
  if (in < 0 || in > str_len(str) || la < in || la < 0 || la > str_len(str)) {
    return NULL;
  }
  char *it;
  char *buffer = (char *)malloc(la - in + 1);
  char *itr;
  itr = buffer;
  it = (str + in);
  int i;
  for (i = in; i < la; i++) {
    *itr = *it;
    itr++;
    it++;
  }
  *itr = '\0';
  return buffer;
}
```