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

```asm
<partname>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    %esi,-0x1c(%rbp)
  mov    %edx,-0x20(%rbp)
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %eax,-0x10(%rbp)
  lea    D44(%rip),%rax
  mov    %rax,-0x8(%rbp)
  mov    -0x10(%rbp),%eax
  cltq
  lea    -0x1(%rax),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  sub    $0x30,%eax
  cmp    $0x9,%eax
  ja     L8
  lea    D25(%rip),%rax
  mov    %rax,-0x8(%rbp)
L8:
  mov    -0x10(%rbp),%eax
  cltq
  lea    -0x4(%rax),%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  lea    D26(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcmp@plt>
  test   %eax,%eax
  jne    L32
  subl   $0x4,-0x10(%rbp)
  lea    D75(%rip),%rax
  mov    %rax,-0x8(%rbp)
L32:
  mov    -0x18(%rbp),%rax
  mov    $0xf,%edx
  lea    D30(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strncmp@plt>
  test   %eax,%eax
  je     L58
  mov    -0x18(%rbp),%rax
  mov    $0x11,%edx
  lea    D54(%rip),%rcx
  mov    %rcx,%rsi
  mov    %rax,%rdi
  call   <strncmp@plt>
  test   %eax,%eax
  jne    L59
L58:
  lea    D13(%rip),%rax
  mov    %rax,-0x8(%rbp)
L59:
  mov    -0x8(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %eax,-0xc(%rbp)
  cmpl   $0x0,-0x20(%rbp)
  je     L41
  mov    -0x20(%rbp),%eax
  sub    -0xc(%rbp),%eax
  sub    $0x2,%eax
  mov    -0x18(%rbp),%rsi
  mov    -0x10(%rbp),%ecx
  mov    -0x1c(%rbp),%edx
  push   %rdx
  push   -0x8(%rbp)
  mov    %rsi,%r9
  mov    %ecx,%r8d
  mov    %eax,%ecx
  lea    D59(%rip),%rax
  mov    %rax,%rdx
  mov    $0x50,%esi
  lea    D48(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <snprintf@plt>
  add    $0x10,%rsp
  jmp    L39
L41:
  mov    -0x8(%rbp),%rsi
  mov    -0x18(%rbp),%rcx
  mov    -0x10(%rbp),%eax
  sub    $0x8,%rsp
  mov    -0x1c(%rbp),%edx
  push   %rdx
  mov    %rsi,%r9
  mov    %rcx,%r8
  mov    %eax,%ecx
  lea    D77(%rip),%rax
  mov    %rax,%rdx
  mov    $0x50,%esi
  lea    D48(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <snprintf@plt>
  add    $0x10,%rsp
L39:
  lea    D48(%rip),%rax
  leave
  ret
```

tool_calls: name: extract_symbolic_data
arguments: tag: D44
type_infered: string
name: extract_symbolic_data
arguments: tag: D25
type_infered: string
name: extract_symbolic_data
arguments: tag: D26
type_infered: string
name: extract_symbolic_data
arguments: tag: D75
type_infered: string
name: extract_symbolic_data
arguments: tag: D30
type_infered: string
name: extract_symbolic_data
arguments: tag: D54
type_infered: string
name: extract_symbolic_data
arguments: tag: D13
type_infered: string
name: extract_symbolic_data
arguments: tag: D59
type_infered: string
name: extract_symbolic_data
arguments: tag: D77
type_infered: string

tool: 

tool: D25: p

tool: D26: disc

tool: D75: part

tool: D30: /dev/disk/by-id

tool: D54: /dev/disk/by-path

tool: D13: -part

tool: D59: %*.*s%s%-2u

tool: D77: %.*s%s%-2u

assistant: ```c
char *partname(char *dev, int pno, int lth) {
  static char bufp[80];
  char *p;
  int w, wp;
  w = strlen(dev);
  p = "";
  if (isdigit(dev[w - 1]))
    p = "p";
  if (strcmp(dev + w - 4, "disc") == 0) {
    w -= 4;
    p = "part";
  }
  if ((strncmp(dev, "/dev/disk/by-id", strlen("/dev/disk/by-id")) == 0) || strncmp(dev, "/dev/disk/by-path", strlen("/dev/disk/by-path")) == 0) {
    p = "-part";
  }
  wp = strlen(p);
  if (lth) {
    snprintf(bufp, sizeof(bufp), "%*.*s%s%-2u", lth - wp - 2, w, dev, p, pno);
  } else {
    snprintf(bufp, sizeof(bufp), "%.*s%s%-2u", w, dev, p, pno);
  }
  return bufp;
}
```