user: 请将以下的汇编代码转换成C语言代码:

```asm
<substr>:
  endbr64
  push   %r13
  push   %r12
  mov    %rdi,%r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  cmp    %rsi,%rdx
  jb     L65
  add    $0x8,%rsp
  mov    %r12,%rax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nopl   0x0(%rax)
L65:
  lea    0x1(%rsi),%edi
  mov    %rdx,%rbx
  mov    %rsi,%r13
  sub    %edx,%edi
  call   <malloc@plt>
  xor    %edi,%edi
  test   %rax,%rax
  mov    %rax,%rbp
  setne  %dil
  call   <assert@plt>
  mov    %r13,%rdx
  lea    0x1(%r12,%rbx,1),%rsi
  mov    %rbp,%rcx
  sub    %rbx,%rdx
  sub    %rsi,%rcx
  lea    -0x1(%rdx),%rax
  cmp    $0xe,%rcx
  jbe    L123
  cmp    $0x6,%rax
  jbe    L123
  cmp    $0xe,%rax
  jbe    L34
  mov    %rdx,%rsi
  mov    %rbx,%rcx
  mov    %rbp,%rax
  and    $0xfffffffffffffff0,%rsi
  sub    %rbp,%rcx
  add    %rbp,%rsi
  add    %r12,%rcx
  nopw   0x0(%rax,%rax,1)
L156:
  movdqu (%rax,%rcx,1),%xmm0
  add    $0x10,%rax
  movups %xmm0,-0x10(%rax)
  cmp    %rsi,%rax
  jne    L156
  mov    %rdx,%rsi
  and    $0xfffffffffffffff0,%rsi
  lea    (%rbx,%rsi,1),%rax
  mov    %esi,%ecx
  cmp    %rsi,%rdx
  je     L154
  sub    %rsi,%rdx
  lea    -0x1(%rdx),%rdi
  cmp    $0x6,%rdi
  jbe    L44
L112:
  lea    (%r12,%rsi,1),%rdi
  mov    (%rdi,%rbx,1),%rdi
  mov    %rdi,0x0(%rbp,%rsi,1)
  mov    %rdx,%rsi
  and    $0xfffffffffffffff8,%rsi
  add    %rsi,%rax
  add    %esi,%ecx
  cmp    %rsi,%rdx
  je     L154
L44:
  movzbl (%r12,%rax,1),%esi
  movslq %ecx,%rdx
  mov    %sil,0x0(%rbp,%rdx,1)
  lea    0x1(%rax),%rsi
  lea    0x1(%rcx),%edx
  cmp    %rsi,%r13
  jbe    L154
  movzbl 0x1(%r12,%rax,1),%esi
  movslq %edx,%rdx
  mov    %sil,0x0(%rbp,%rdx,1)
  lea    0x2(%rax),%rsi
  lea    0x2(%rcx),%edx
  cmp    %rsi,%r13
  jbe    L154
  movzbl 0x2(%r12,%rax,1),%esi
  movslq %edx,%rdx
  mov    %sil,0x0(%rbp,%rdx,1)
  lea    0x3(%rax),%rsi
  lea    0x3(%rcx),%edx
  cmp    %rsi,%r13
  jbe    L154
  movzbl 0x3(%r12,%rax,1),%esi
  movslq %edx,%rdx
  mov    %sil,0x0(%rbp,%rdx,1)
  lea    0x4(%rax),%rsi
  lea    0x4(%rcx),%edx
  cmp    %rsi,%r13
  jbe    L154
  movzbl 0x4(%r12,%rax,1),%esi
  movslq %edx,%rdx
  mov    %sil,0x0(%rbp,%rdx,1)
  lea    0x5(%rax),%rsi
  lea    0x5(%rcx),%edx
  cmp    %rsi,%r13
  jbe    L154
  movzbl 0x5(%r12,%rax,1),%esi
  movslq %edx,%rdx
  add    $0x6,%ecx
  mov    %sil,0x0(%rbp,%rdx,1)
  lea    0x6(%rax),%rdx
  cmp    %rdx,%r13
  jbe    L154
  movzbl 0x6(%r12,%rax,1),%eax
  movslq %ecx,%rcx
  mov    %al,0x0(%rbp,%rcx,1)
L154:
  movb   $0x0,0x0(%rbp,%r13,1)
  mov    %rbp,%r12
  add    $0x8,%rsp
  pop    %rbx
  mov    %r12,%rax
  pop    %rbp
  pop    %r12
  pop    %r13
  ret
  nopw   0x0(%rax,%rax,1)
L123:
  sub    %rbp,%rbx
  add    %rbp,%rdx
  mov    %rbp,%rax
  add    %r12,%rbx
  nopl   0x0(%rax)
L105:
  movzbl (%rbx,%rax,1),%ecx
  add    $0x1,%rax
  mov    %cl,-0x1(%rax)
  cmp    %rdx,%rax
  jne    L105
  jmp    L154
L34:
  mov    %rbx,%rax
  xor    %esi,%esi
  xor    %ecx,%ecx
  jmp    L112
```

assistant: ```c
char *substr(const char *s, size_t len, size_t offset) {
  int i, size;
  if (offset >= len) {
    return (char *)s;
  }
  size = len - offset + 1;
  char *res = (char *)malloc(size);
  assert(res != NULL);
  for (i = 0; offset < len; offset++, i++) {
    res[i] = s[offset];
  }
  res[len] = '\0';
  return res;
}
```