user: 请从给定的汇编指令推导出C源代码：

```asm
<get_dt_part>:
  endbr64
  push   %r15
  mov    %ecx,%r15d
  push   %r14
  mov    %ecx,%r14d
  push   %r13
  mov    %rdx,%r13
  push   %r12
  mov    %rdi,%r12
  mov    %rdx,%rdi
  push   %rbp
  mov    %rsi,%rbp
  movsbl %cl,%esi
  push   %rbx
  mov    %r8d,%ebx
  sub    $0x8,%rsp
  call   <strchr@plt>
  test   %rax,%rax
  je     L22
  cmp    (%rax),%r15b
  jne    L10
  test   %ebx,%ebx
  jle    L22
  movslq %ebx,%r8
  xor    %edx,%edx
  jmp    L179
L196:
  add    $0x1,%rdx
  cmp    %r8,%rdx
  je     L22
L179:
  mov    %edx,%esi
  mov    %edx,%ecx
  cmp    %r14b,0x1(%rax,%rdx,1)
  je     L196
  sub    %r13,%rax
  mov    %rbp,%r8
  movslq %eax,%rdi
  mov    %eax,%edx
  lea    0x1(%r12,%rdi,1),%r9
  sub    %r9,%r8
  cmp    $0xe,%r8
  jbe    L218
  cmp    $0x6,%esi
  jbe    L218
  lea    0x1(%rsi),%r10d
  cmp    $0xe,%esi
  jbe    L8
  mov    %r10d,%r8d
  add    %r12,%rdi
  xor    %edx,%edx
  shr    $0x4,%r8d
  shl    $0x4,%r8
  nopl   0x0(%rax,%rax,1)
L127:
  movdqu (%rdi,%rdx,1),%xmm0
  movups %xmm0,0x0(%rbp,%rdx,1)
  add    $0x10,%rdx
  cmp    %rdx,%r8
  jne    L127
  mov    %r10d,%r9d
  and    $0xfffffff0,%r9d
  mov    %r9d,%r8d
  lea    (%r9,%rax,1),%edx
  cmp    %r9d,%r10d
  je     L187
  sub    %r9d,%esi
  lea    0x1(%rsi),%eax
  cmp    $0x6,%esi
  jbe    L47
L178:
  mov    (%rdi,%r9,1),%rsi
  mov    %rsi,0x0(%rbp,%r9,1)
  mov    %eax,%esi
  and    $0xfffffff8,%esi
  add    %esi,%r8d
  add    %esi,%edx
  cmp    %esi,%eax
  je     L187
L47:
  movslq %edx,%rax
  movzbl (%r12,%rax,1),%esi
  movslq %r8d,%rax
  mov    %sil,0x0(%rbp,%rax,1)
  lea    0x1(%rdx),%eax
  lea    0x1(%r8),%esi
  cmp    %r8d,%ecx
  jle    L187
  cltq
  movzbl (%r12,%rax,1),%edi
  movslq %esi,%rax
  mov    %dil,0x0(%rbp,%rax,1)
  lea    0x2(%rdx),%eax
  lea    0x2(%r8),%edi
  cmp    %esi,%ecx
  jle    L187
  cltq
  movzbl (%r12,%rax,1),%esi
  movslq %edi,%rax
  mov    %sil,0x0(%rbp,%rax,1)
  lea    0x3(%rdx),%eax
  lea    0x3(%r8),%esi
  cmp    %edi,%ecx
  jle    L187
  cltq
  movzbl (%r12,%rax,1),%edi
  movslq %esi,%rax
  mov    %dil,0x0(%rbp,%rax,1)
  lea    0x4(%rdx),%eax
  lea    0x4(%r8),%edi
  cmp    %esi,%ecx
  jle    L187
  cltq
  movzbl (%r12,%rax,1),%esi
  movslq %edi,%rax
  mov    %sil,0x0(%rbp,%rax,1)
  lea    0x5(%rdx),%eax
  lea    0x5(%r8),%esi
  cmp    %edi,%ecx
  jle    L187
  cltq
  add    $0x6,%edx
  add    $0x6,%r8d
  movzbl (%r12,%rax,1),%edi
  movslq %esi,%rax
  mov    %dil,0x0(%rbp,%rax,1)
  cmp    %esi,%ecx
  jle    L187
  movslq %edx,%rdx
  movslq %r8d,%r8
  movzbl (%r12,%rdx,1),%eax
  mov    %al,0x0(%rbp,%r8,1)
L187:
  add    $0x1,%ecx
  movslq %ecx,%rcx
  add    %rcx,%rbp
L10:
  movb   $0x0,0x0(%rbp)
  add    $0x8,%rsp
  mov    $0x1,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax,%rax,1)
L22:
  add    $0x8,%rsp
  mov    $0xffffffff,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L218:
  add    $0x1,%esi
  xor    %eax,%eax
  add    %r12,%rdi
  nopl   0x0(%rax)
L89:
  movzbl (%rdi,%rax,1),%edx
  mov    %dl,0x0(%rbp,%rax,1)
  add    $0x1,%rax
  cmp    %rsi,%rax
  jne    L89
  jmp    L187
L8:
  mov    %r10d,%eax
  xor    %r9d,%r9d
  xor    %r8d,%r8d
  add    %r12,%rdi
  jmp    L178
```

assistant: ```c
int get_dt_part(char *dt, char *dest, char *tmpl, char part, int max) {
  int i, j, relp;
  char *p;
  if ((p = strchr(tmpl, part)) == NULL)
    return -1;
  for (i = 0; *(p + i) == part; i++) {
    if (i >= max)
      return -1;
  }
  for (j = 0, relp = p - tmpl; j < i; relp++, j++)
    dest[j] = dt[relp];
  dest[j] = '\0';
  return 1;
}
```