ylfeng/ReF-Decompile-dataset huggingface dataset:
user: 请将以下的汇编代码转换成C语言代码:

```asm
<print_usage>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  lea    D2(%rip),%rax
  mov    %rax,%rdi
  call   <printf@plt>
  nop
  pop    %rbp
  ret
```

tool_calls: name: disassemble_data
arguments: label: D2
data_type: string

tool: D2: Copyright (c) 2001-2004, Roger Dingledine
Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson
Copyright (c) 2007-2013, The Tor Project, Inc.

tor -f <torrc> [args]
See man page for options, or https://www.torproject.org/ for documentation.


assistant: ```c
void print_usage(void) {
  printf("Copyright (c) 2001-2004, Roger Dingledine\n"
         "Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson\n"
         "Copyright (c) 2007-2013, The Tor Project, Inc.\n\n"
         "tor -f <torrc> [args]\n"
         "See man page for options, or https://www.torproject.org/ for "
         "documentation.\n");
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<print_usage>:
  endbr64
  sub    $0x8,%rsp
  lea    D0(%rip),%rdi
  call   <printf@plt>
  add    $0x8,%rsp
  ret
```

tool_calls: name: parse_data
arguments: data_label: D0
type_infered: string

tool: D0: Copyright (c) 2001-2004, Roger Dingledine
Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson
Copyright (c) 2007-2013, The Tor Project, Inc.

tor -f <torrc> [args]
See man page for options, or https://www.torproject.org/ for documentation.


assistant: ```c
void print_usage(void) {
  printf("Copyright (c) 2001-2004, Roger Dingledine\n"
         "Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson\n"
         "Copyright (c) 2007-2013, The Tor Project, Inc.\n\n"
         "tor -f <torrc> [args]\n"
         "See man page for options, or https://www.torproject.org/ for "
         "documentation.\n");
}
```
user: 请将以下的汇编代码转换成C语言代码：

```asm
<print_usage>:
  endbr64
  lea    D3(%rip),%rdi
  jmp    1050 <printf@plt>
```

tool_calls: name: read_data
arguments: data_label: D3
type_infered: string

tool: D3: Copyright (c) 2001-2004, Roger Dingledine
Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson
Copyright (c) 2007-2013, The Tor Project, Inc.

tor -f <torrc> [args]
See man page for options, or https://www.torproject.org/ for documentation.


assistant: ```c
void print_usage(void) {
  printf("Copyright (c) 2001-2004, Roger Dingledine\n"
         "Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson\n"
         "Copyright (c) 2007-2013, The Tor Project, Inc.\n\n"
         "tor -f <torrc> [args]\n"
         "See man page for options, or https://www.torproject.org/ for "
         "documentation.\n");
}
```
user: What is the c source code of the assembly code below?

```asm
<print_usage>:
  endbr64
  lea    D4(%rip),%rdi
  jmp    1050 <printf@plt>
```

tool_calls: name: read_data
arguments: data_label: D4
data_type: string

tool: D4: Copyright (c) 2001-2004, Roger Dingledine
Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson
Copyright (c) 2007-2013, The Tor Project, Inc.

tor -f <torrc> [args]
See man page for options, or https://www.torproject.org/ for documentation.


assistant: ```c
void print_usage(void) {
  printf("Copyright (c) 2001-2004, Roger Dingledine\n"
         "Copyright (c) 2004-2006, Roger Dingledine, Nick Mathewson\n"
         "Copyright (c) 2007-2013, The Tor Project, Inc.\n\n"
         "tor -f <torrc> [args]\n"
         "See man page for options, or https://www.torproject.org/ for "
         "documentation.\n");
}
```
user: 请将以下的汇编代码转换成C语言代码:

```asm
<memcpy2>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x18(%rbp)
  mov    %rsi,-0x20(%rbp)
  mov    %rdx,-0x28(%rbp)
  mov    -0x18(%rbp),%rax
  mov    %rax,-0x10(%rbp)
  mov    -0x20(%rbp),%rax
  mov    %rax,-0x8(%rbp)
  mov    -0x28(%rbp),%rax
  shr    %rax
  mov    %rax,-0x28(%rbp)
  jmp    L7
L17:
  mov    -0x8(%rbp),%rdx
  lea    0x2(%rdx),%rax
  mov    %rax,-0x8(%rbp)
  mov    -0x10(%rbp),%rax
  lea    0x2(%rax),%rcx
  mov    %rcx,-0x10(%rbp)
  movzwl (%rdx),%edx
  mov    %dx,(%rax)
L7:
  mov    -0x28(%rbp),%rax
  lea    -0x1(%rax),%rdx
  mov    %rdx,-0x28(%rbp)
  test   %rax,%rax
  jne    L17
  mov    -0x18(%rbp),%rax
  pop    %rbp
  ret
```

assistant: ```c
void *memcpy2(void *dest, const void *src, size_t count) {
  unsigned short *tmp = (unsigned short *)dest;
  unsigned short *s = (unsigned short *)src;
  count = count / 2;
  while (count--)
    *tmp++ = *s++;
  return dest;
}
```
user: 下面的汇编指令对应的C源代码是什么：

```asm
<memcpy2>:
  endbr64
  mov    %rdi,%rax
  mov    %rdx,%rdi
  shr    %rdi
  cmp    $0x1,%rdx
  jbe    L12
  mov    $0x0,%edx
L2:
  movzwl (%rsi,%rdx,2),%ecx
  mov    %cx,(%rax,%rdx,2)
  add    $0x1,%rdx
  cmp    %rdi,%rdx
  jne    L2
L12:
  ret
```

assistant: ```c
void *memcpy2(void *dest, const void *src, size_t count) {
  unsigned short *tmp = (unsigned short *)dest;
  unsigned short *s = (unsigned short *)src;
  count = count / 2;
  while (count--)
    *tmp++ = *s++;
  return dest;
}
```
user: Please show me the C implementation that matches the assembly code listed below:

```asm
<memcpy2>:
  endbr64
  shr    %rdx
  mov    %rdi,%rax
  je     L8
  add    %rdx,%rdx
  xor    %ecx,%ecx
  nopl   0x0(%rax)
L19:
  movzwl (%rsi,%rcx,1),%r8d
  mov    %r8w,(%rax,%rcx,1)
  add    $0x2,%rcx
  cmp    %rcx,%rdx
  jne    L19
L8:
  ret
```

assistant: ```c
void *memcpy2(void *dest, const void *src, size_t count) {
  unsigned short *tmp = (unsigned short *)dest;
  unsigned short *s = (unsigned short *)src;
  count = count / 2;
  while (count--)
    *tmp++ = *s++;
  return dest;
}
```
user: Demonstrate the C code that generates the assembly output below:

```asm
<memcpy2>:
  endbr64
  mov    %rsi,%rcx
  mov    %rdx,%rsi
  mov    %rdi,%r8
  shr    %rsi
  lea    -0x1(%rsi),%r9
  je     L15
  lea    0x2(%rcx),%rdi
  mov    %r8,%rax
  sub    %rdi,%rax
  cmp    $0xc,%rax
  jbe    L75
  cmp    $0x2,%r9
  jbe    L75
  cmp    $0x6,%r9
  jbe    L23
  mov    %rdx,%rdi
  xor    %eax,%eax
  and    $0xfffffffffffffff0,%rdx
  shr    $0x4,%rdi
  nop
L87:
  movdqu (%rcx,%rax,1),%xmm0
  movups %xmm0,(%r8,%rax,1)
  add    $0x10,%rax
  cmp    %rdx,%rax
  jne    L87
  mov    %rdi,%rax
  lea    0x0(,%rdi,8),%rdx
  shl    $0x4,%rax
  sub    %rdx,%r9
  lea    (%r8,%rax,1),%rdi
  add    %rcx,%rax
  cmp    %rdx,%rsi
  je     L15
  sub    %rdx,%rsi
  lea    -0x1(%rsi),%r10
  cmp    $0x2,%r10
  jbe    L27
L29:
  mov    (%rcx,%rdx,2),%rcx
  mov    %rcx,(%r8,%rdx,2)
  mov    %rsi,%rdx
  and    $0xfffffffffffffffc,%rdx
  lea    (%rdx,%rdx,1),%rcx
  sub    %rdx,%r9
  add    %rcx,%rdi
  add    %rcx,%rax
  cmp    %rsi,%rdx
  je     L15
L27:
  movzwl (%rax),%edx
  mov    %dx,(%rdi)
  test   %r9,%r9
  je     L15
  movzwl 0x2(%rax),%edx
  mov    %dx,0x2(%rdi)
  cmp    $0x1,%r9
  je     L15
  movzwl 0x4(%rax),%eax
  mov    %ax,0x4(%rdi)
L15:
  mov    %r8,%rax
  ret
  nopl   0x0(%rax)
L75:
  add    %rsi,%rsi
  xor    %eax,%eax
  nopl   (%rax)
L106:
  movzwl (%rcx,%rax,1),%edx
  mov    %dx,(%r8,%rax,1)
  add    $0x2,%rax
  cmp    %rsi,%rax
  jne    L106
  mov    %r8,%rax
  ret
L23:
  mov    %rcx,%rax
  mov    %r8,%rdi
  xor    %edx,%edx
  jmp    L29
```

assistant: ```c
void *memcpy2(void *dest, const void *src, size_t count) {
  unsigned short *tmp = (unsigned short *)dest;
  unsigned short *s = (unsigned short *)src;
  count = count / 2;
  while (count--)
    *tmp++ = *s++;
  return dest;
}
```
user: What is the c source code of the assembly code below?

```asm
<solcon_retrieve_standard_solution>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x30,%rsp
  mov    %edi,-0x14(%rbp)
  mov    %esi,-0x18(%rbp)
  mov    %rdx,-0x20(%rbp)
  mov    %rcx,-0x28(%rbp)
  mov    -0x28(%rbp),%rcx
  mov    -0x20(%rbp),%rdx
  lea    -0x18(%rbp),%rax
  mov    %rax,%rsi
  mov    $0x22,%edi
  call   <_ada_use_c2phc@plt>
  mov    %eax,-0x4(%rbp)
  mov    -0x4(%rbp),%eax
  leave
  ret
```

assistant: ```c
int solcon_retrieve_standard_solution(int n, int k, int *m, double *sol) {
  int fail;
  fail = _ada_use_c2phc(34, &k, m, sol);
  return fail;
}
```
user: What would the C source look like for the assembly code provided here?

```asm
<solcon_retrieve_standard_solution>:
  endbr64
  sub    $0x18,%rsp
  mov    %esi,0xc(%rsp)
  lea    0xc(%rsp),%rsi
  mov    $0x22,%edi
  call   <_ada_use_c2phc@plt>
  add    $0x18,%rsp
  ret
```

assistant: ```c
int solcon_retrieve_standard_solution(int n, int k, int *m, double *sol) {
  int fail;
  fail = _ada_use_c2phc(34, &k, m, sol);
  return fail;
}
```
user: 这段汇编代码用C语言表示是什么样的：

```asm
<solcon_retrieve_standard_solution>:
  endbr64
  sub    $0x18,%rsp
  mov    $0x22,%edi
  mov    %esi,0xc(%rsp)
  lea    0xc(%rsp),%rsi
  call   <_ada_use_c2phc@plt>
  add    $0x18,%rsp
  ret
```

assistant: ```c
int solcon_retrieve_standard_solution(int n, int k, int *m, double *sol) {
  int fail;
  fail = _ada_use_c2phc(34, &k, m, sol);
  return fail;
}
```
user: What is the c source code of the assembly code below?

```asm
<solcon_retrieve_standard_solution>:
  endbr64
  sub    $0x18,%rsp
  mov    $0x22,%edi
  mov    %esi,0xc(%rsp)
  lea    0xc(%rsp),%rsi
  call   <_ada_use_c2phc@plt>
  add    $0x18,%rsp
  ret
```

assistant: ```c
int solcon_retrieve_standard_solution(int n, int k, int *m, double *sol) {
  int fail;
  fail = _ada_use_c2phc(34, &k, m, sol);
  return fail;
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<readlinkat>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %edi,-0x4(%rbp)
  mov    %rsi,-0x10(%rbp)
  mov    %rdx,-0x18(%rbp)
  mov    %rcx,-0x20(%rbp)
  cmpq   $0x0,-0x10(%rbp)
  jne    L54
  mov    D11(%rip),%rax
  mov    (%rax),%eax
  mov    %eax,%edi
  call   <__set_errno@plt>
  mov    $0xffffffff,%eax
  jmp    L18
L54:
  mov    D18(%rip),%rax
  mov    (%rax),%eax
  cmp    %eax,-0x4(%rbp)
  je     L16
  cmpl   $0x0,-0x4(%rbp)
  jns    L16
  mov    -0x10(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2f,%al
  je     L16
  mov    D15(%rip),%rax
  mov    (%rax),%eax
  mov    %eax,%edi
  call   <__set_errno@plt>
  mov    $0xffffffff,%eax
  jmp    L18
L16:
  mov    D22(%rip),%rax
  mov    (%rax),%eax
  mov    %eax,%edi
  call   <__set_errno@plt>
  mov    $0xffffffff,%eax
L18:
  leave
  ret
```

assistant: ```c
ssize_t readlinkat(int fd, const char *path, char *buf, size_t len) {
  if (path == NULL) {
    __set_errno(EINVAL);
    return -1;
  }
  if (fd != AT_FDCWD && fd < 0 && *path != '/') {
    __set_errno(EBADF);
    return -1;
  }
  __set_errno(ENOSYS);
  return -1;
}
```
user: What would the C source look like for the assembly code provided here:

```asm
<readlinkat>:
  endbr64
  sub    $0x8,%rsp
  test   %rsi,%rsi
  je     L34
  mov    D15(%rip),%rax
  cmp    %edi,(%rax)
  je     L7
  test   %edi,%edi
  js     L42
L7:
  mov    D30(%rip),%rax
  mov    (%rax),%edi
  call   <__set_errno@plt>
L24:
  mov    $0xffffffff,%eax
  add    $0x8,%rsp
  ret
L34:
  mov    D26(%rip),%rax
  mov    (%rax),%edi
  call   <__set_errno@plt>
  jmp    L24
L42:
  cmpb   $0x2f,(%rsi)
  je     L7
  mov    D2(%rip),%rax
  mov    (%rax),%edi
  call   <__set_errno@plt>
  jmp    L24
```

assistant: ```c
ssize_t readlinkat(int fd, const char *path, char *buf, size_t len) {
  if (path == NULL) {
    __set_errno(EINVAL);
    return -1;
  }
  if (fd != AT_FDCWD && fd < 0 && *path != '/') {
    __set_errno(EBADF);
    return -1;
  }
  __set_errno(ENOSYS);
  return -1;
}
```
user: 提供的汇编代码用C语言表示会是什么样子:

```asm
<readlinkat>:
  endbr64
  sub    $0x8,%rsp
  test   %rsi,%rsi
  je     L14
  mov    D36(%rip),%rax
  cmp    %edi,(%rax)
  je     L0
  test   %edi,%edi
  js     L42
L0:
  mov    D4(%rip),%rax
  mov    (%rax),%edi
  call   <__set_errno@plt>
L21:
  mov    $0xffffffff,%eax
  add    $0x8,%rsp
  ret
  nopl   0x0(%rax)
L42:
  cmpb   $0x2f,(%rsi)
  je     L0
  mov    D26(%rip),%rax
  mov    (%rax),%edi
  call   <__set_errno@plt>
  jmp    L21
  nopl   (%rax)
L14:
  mov    D17(%rip),%rax
  mov    (%rax),%edi
  call   <__set_errno@plt>
  jmp    L21
```

assistant: ```c
ssize_t readlinkat(int fd, const char *path, char *buf, size_t len) {
  if (path == NULL) {
    __set_errno(EINVAL);
    return -1;
  }
  if (fd != AT_FDCWD && fd < 0 && *path != '/') {
    __set_errno(EBADF);
    return -1;
  }
  __set_errno(ENOSYS);
  return -1;
}
```
user: 请从给定的汇编指令推导出C源代码：

```asm
<readlinkat>:
  endbr64
  sub    $0x8,%rsp
  test   %rsi,%rsi
  je     L31
  mov    D27(%rip),%rax
  cmp    %edi,(%rax)
  je     L35
  test   %edi,%edi
  js     L55
L35:
  mov    D6(%rip),%rax
  mov    (%rax),%edi
  call   <__set_errno@plt>
L58:
  mov    $0xffffffff,%eax
  add    $0x8,%rsp
  ret
  nopl   0x0(%rax)
L55:
  cmpb   $0x2f,(%rsi)
  je     L35
  mov    D12(%rip),%rax
  mov    (%rax),%edi
  call   <__set_errno@plt>
  jmp    L58
  nopl   (%rax)
L31:
  mov    D3(%rip),%rax
  mov    (%rax),%edi
  call   <__set_errno@plt>
  jmp    L58
```

assistant: ```c
ssize_t readlinkat(int fd, const char *path, char *buf, size_t len) {
  if (path == NULL) {
    __set_errno(EINVAL);
    return -1;
  }
  if (fd != AT_FDCWD && fd < 0 && *path != '/') {
    __set_errno(EBADF);
    return -1;
  }
  __set_errno(ENOSYS);
  return -1;
}
```
user: Converte this assembly snippet into its equivalent C code:

```asm
<convert_name>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %rbx
  sub    $0x38,%rsp
  mov    %rdi,-0x38(%rbp)
  mov    %rsi,-0x40(%rbp)
  movq   $0x0,-0x18(%rbp)
  mov    -0x40(%rbp),%rax
  mov    %rax,-0x20(%rbp)
  jmp    L25
L86:
  mov    -0x20(%rbp),%rax
  movzbl (%rax),%eax
  cmp    $0x2e,%al
  jne    L74
  cmpq   $0x0,-0x18(%rbp)
  jne    L3
  mov    -0x20(%rbp),%rax
  mov    %rax,-0x18(%rbp)
  jmp    L117
L74:
  mov    -0x20(%rbp),%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    %eax,%edi
  call   <valid_char@plt>
  test   %eax,%eax
  je     L30
L117:
  addq   $0x1,-0x20(%rbp)
L25:
  mov    -0x20(%rbp),%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L86
  mov    -0x18(%rbp),%rax
  sub    -0x40(%rbp),%rax
  cmp    $0x8,%rax
  jg     L110
  cmpq   $0x0,-0x18(%rbp)
  je     L53
  mov    -0x18(%rbp),%rax
  lea    0x1(%rax),%rdx
  mov    -0x20(%rbp),%rax
  sub    %rdx,%rax
  cmp    $0x3,%rax
  jg     L6
L53:
  mov    -0x38(%rbp),%rax
  mov    $0xb,%edx
  mov    $0x20,%esi
  mov    %rax,%rdi
  call   <memset@plt>
  cmpq   $0x0,-0x18(%rbp)
  jne    L131
  mov    -0x20(%rbp),%rax
  mov    %rax,-0x18(%rbp)
L131:
  movl   $0x0,-0x24(%rbp)
  jmp    L14
L109:
  mov    -0x24(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    -0x24(%rbp),%edx
  movslq %edx,%rcx
  mov    -0x38(%rbp),%rdx
  lea    (%rcx,%rdx,1),%rbx
  mov    %eax,%edi
  call   <toupper@plt>
  mov    %al,(%rbx)
  addl   $0x1,-0x24(%rbp)
L14:
  mov    -0x24(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  sub    -0x40(%rbp),%rax
  cmp    %rax,%rdx
  jl     L109
  movl   $0x0,-0x24(%rbp)
  jmp    L105
L28:
  mov    -0x24(%rbp),%eax
  add    $0x1,%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  movsbl %al,%eax
  mov    -0x24(%rbp),%edx
  add    $0x8,%edx
  movslq %edx,%rcx
  mov    -0x38(%rbp),%rdx
  lea    (%rcx,%rdx,1),%rbx
  mov    %eax,%edi
  call   <toupper@plt>
  mov    %al,(%rbx)
  addl   $0x1,-0x24(%rbp)
L105:
  mov    -0x24(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x20(%rbp),%rax
  sub    -0x18(%rbp),%rax
  cmp    %rax,%rdx
  jl     L28
  mov    $0x0,%eax
  jmp    L68
L3:
  nop
  jmp    L13
L30:
  nop
  jmp    L13
L110:
  nop
  jmp    L13
L6:
  nop
L13:
  mov    $0x1,%eax
L68:
  mov    -0x8(%rbp),%rbx
  leave
  ret
```

assistant: ```c
int convert_name(char *short_name, const char *long_name) {
  int i;
  const char *s;
  const char *dot;
  int c;
  dot = NULL;
  for (s = long_name; *s; s++) {
    if (*s == '.') {
      if (dot) {
        goto short_fail;
      } else {
        dot = s;
      }
    } else if (!valid_char(*s)) {
      goto short_fail;
    }
  }
  if (dot - long_name > 8) {
    goto short_fail;
  }
  if (dot && (s - (dot + 1) > 3)) {
    goto short_fail;
  }
  memset(short_name, ' ', 11);
  if (!dot) {
    dot = s;
  }
  for (i = 0; i < dot - long_name; i++) {
    short_name[i] = toupper(long_name[i]);
  }
  for (i = 0; i < s - dot; i++) {
    short_name[8 + i] = toupper(dot[1 + i]);
  }
  return 0;
short_fail:
  return 1;
}
```
user: 请显示与下面列出的汇编代码相匹配的C语言实现:

```asm
<convert_name>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  mov    %rdi,%r12
  mov    %rsi,%r13
  movzbl (%rsi),%edi
  test   %dil,%dil
  je     L33
  mov    %rsi,%rbx
  mov    $0x0,%ebp
  jmp    L154
L182:
  movsbl %dil,%edi
  call   <valid_char@plt>
  test   %eax,%eax
  je     L160
L180:
  lea    0x1(%rbx),%r14
  movzbl 0x1(%rbx),%edi
  test   %dil,%dil
  je     L46
  mov    %r14,%rbx
L154:
  cmp    $0x2e,%dil
  jne    L182
  test   %rbp,%rbp
  jne    L132
  mov    %rbx,%rbp
  jmp    L180
L46:
  mov    %rbp,%r15
  sub    %r13,%r15
  mov    $0x1,%eax
  cmp    $0x8,%r15
  jg     L34
  test   %rbp,%rbp
  je     L143
  sub    %rbp,%rbx
  cmp    $0x3,%rbx
  jg     L34
  mov    $0xb,%edx
  mov    $0x20,%esi
  mov    %r12,%rdi
  call   <memset@plt>
  test   %r15,%r15
  jle    L71
L68:
  mov    $0x0,%ebx
L101:
  movsbl 0x0(%r13,%rbx,1),%edi
  call   <toupper@plt>
  mov    %al,(%r12,%rbx,1)
  add    $0x1,%rbx
  cmp    %rbx,%r15
  jg     L101
L71:
  sub    %rbp,%r14
  test   %r14,%r14
  jle    L183
  add    $0x1,%rbp
  add    $0x8,%r12
  add    %rbp,%r14
L56:
  movsbl 0x0(%rbp),%edi
  call   <toupper@plt>
  mov    %al,(%r12)
  add    $0x1,%rbp
  add    $0x1,%r12
  cmp    %r14,%rbp
  jne    L56
  mov    $0x0,%eax
  jmp    L34
L132:
  mov    $0x1,%eax
L34:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L160:
  mov    $0x1,%eax
  jmp    L34
L183:
  mov    $0x0,%eax
  jmp    L34
L143:
  mov    %r14,%rbp
L67:
  mov    $0xb,%edx
  mov    $0x20,%esi
  mov    %r12,%rdi
  call   <memset@plt>
  mov    %rbp,%r15
  sub    %r13,%r15
  mov    %rbp,%r14
  mov    $0x0,%eax
  test   %r15,%r15
  jg     L68
  jmp    L34
L33:
  mov    $0x1,%eax
  mov    %rsi,%rbp
  cmp    $0xfffffffffffffff8,%rsi
  jge    L67
  jmp    L34
```

assistant: ```c
int convert_name(char *short_name, const char *long_name) {
  int i;
  const char *s;
  const char *dot;
  int c;
  dot = NULL;
  for (s = long_name; *s; s++) {
    if (*s == '.') {
      if (dot) {
        goto short_fail;
      } else {
        dot = s;
      }
    } else if (!valid_char(*s)) {
      goto short_fail;
    }
  }
  if (dot - long_name > 8) {
    goto short_fail;
  }
  if (dot && (s - (dot + 1) > 3)) {
    goto short_fail;
  }
  memset(short_name, ' ', 11);
  if (!dot) {
    dot = s;
  }
  for (i = 0; i < dot - long_name; i++) {
    short_name[i] = toupper(long_name[i]);
  }
  for (i = 0; i < s - dot; i++) {
    short_name[8 + i] = toupper(dot[1 + i]);
  }
  return 0;
short_fail:
  return 1;
}
```
user: 请从给定的汇编指令推导出C源代码:

```asm
<convert_name>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  mov    %rdi,%r13
  push   %r12
  mov    %rsi,%r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  movsbl (%rsi),%edi
  test   %dil,%dil
  je     L87
  mov    %rsi,%rbx
  xor    %ebp,%ebp
  jmp    L85
  nopl   0x0(%rax,%rax,1)
L11:
  test   %rbp,%rbp
  jne    L41
  mov    %rbx,%rbp
L69:
  movsbl 0x1(%rbx),%edi
  lea    0x1(%rbx),%r14
  test   %dil,%dil
  je     L119
  mov    %r14,%rbx
L85:
  cmp    $0x2e,%dil
  je     L11
  call   <valid_char@plt>
  test   %eax,%eax
  jne    L69
L41:
  add    $0x8,%rsp
  mov    $0x1,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax,%rax,1)
L119:
  mov    %rbp,%r15
  sub    %r12,%r15
  cmp    $0x8,%r15
  jg     L41
  test   %rbp,%rbp
  je     L66
  sub    %rbp,%rbx
  cmp    $0x3,%rbx
  jg     L41
  mov    $0xb,%edx
  mov    $0x20,%esi
  mov    %r13,%rdi
  sub    %rbp,%r14
  call   <memset@plt>
  test   %r15,%r15
  jle    L94
L71:
  mov    %r13,%rbx
  add    %r12,%r15
  xchg   %ax,%ax
L111:
  movsbl (%r12),%edi
  add    $0x1,%r12
  add    $0x1,%rbx
  call   <toupper@plt>
  mov    %al,-0x1(%rbx)
  cmp    %r15,%r12
  jne    L111
L94:
  test   %r14,%r14
  jle    L46
  lea    0x1(%rbp),%rbx
  add    $0x8,%r13
  add    %rbp,%r14
  nopw   0x0(%rax,%rax,1)
L43:
  movsbl (%rbx),%edi
  add    $0x1,%r13
  call   <toupper@plt>
  mov    %al,-0x1(%r13)
  mov    %rbx,%rax
  add    $0x1,%rbx
  cmp    %rax,%r14
  jne    L43
L46:
  xor    %eax,%eax
L88:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L87:
  cmp    $0xfffffffffffffff8,%rsi
  jl     L41
  mov    $0xb,%edx
  mov    $0x20,%esi
  mov    %r13,%rdi
  call   <memset@plt>
  xor    %eax,%eax
  jmp    L88
L66:
  mov    %r14,%r15
  mov    $0xb,%edx
  mov    $0x20,%esi
  mov    %r13,%rdi
  call   <memset@plt>
  sub    %r12,%r15
  mov    %r14,%rbp
  xor    %r14d,%r14d
  test   %r15,%r15
  jg     L71
  xor    %eax,%eax
  jmp    L88
```

assistant: ```c
int convert_name(char *short_name, const char *long_name) {
  int i;
  const char *s;
  const char *dot;
  int c;
  dot = NULL;
  for (s = long_name; *s; s++) {
    if (*s == '.') {
      if (dot) {
        goto short_fail;
      } else {
        dot = s;
      }
    } else if (!valid_char(*s)) {
      goto short_fail;
    }
  }
  if (dot - long_name > 8) {
    goto short_fail;
  }
  if (dot && (s - (dot + 1) > 3)) {
    goto short_fail;
  }
  memset(short_name, ' ', 11);
  if (!dot) {
    dot = s;
  }
  for (i = 0; i < dot - long_name; i++) {
    short_name[i] = toupper(long_name[i]);
  }
  for (i = 0; i < s - dot; i++) {
    short_name[8 + i] = toupper(dot[1 + i]);
  }
  return 0;
short_fail:
  return 1;
}
```
user: 这段汇编代码用C语言表示是什么样的?

```asm
<convert_name>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  mov    %rdi,%r13
  push   %r12
  mov    %rsi,%r12
  push   %rbp
  push   %rbx
  sub    $0x8,%rsp
  movsbl (%rsi),%edi
  test   %dil,%dil
  je     L107
  mov    %rsi,%rbx
  xor    %ebp,%ebp
  jmp    L39
  nopl   0x0(%rax,%rax,1)
L96:
  test   %rbp,%rbp
  jne    L57
  mov    %rbx,%rbp
L30:
  movsbl 0x1(%rbx),%edi
  lea    0x1(%rbx),%r14
  test   %dil,%dil
  je     L41
  mov    %r14,%rbx
L39:
  cmp    $0x2e,%dil
  je     L96
  call   <valid_char@plt>
  test   %eax,%eax
  jne    L30
L57:
  add    $0x8,%rsp
  mov    $0x1,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax,%rax,1)
L41:
  mov    %rbp,%r15
  sub    %r12,%r15
  cmp    $0x8,%r15
  jg     L57
  test   %rbp,%rbp
  je     L138
  sub    %rbp,%rbx
  cmp    $0x3,%rbx
  jg     L57
  mov    $0xb,%edx
  mov    $0x20,%esi
  mov    %r13,%rdi
  sub    %rbp,%r14
  call   <memset@plt>
  test   %r15,%r15
  jle    L78
L22:
  mov    %r13,%rbx
  add    %r12,%r15
  xchg   %ax,%ax
L160:
  movsbl (%r12),%edi
  add    $0x1,%r12
  add    $0x1,%rbx
  call   <toupper@plt>
  mov    %al,-0x1(%rbx)
  cmp    %r15,%r12
  jne    L160
L78:
  test   %r14,%r14
  jle    L62
  lea    0x1(%rbp),%rbx
  add    $0x8,%r13
  add    %rbp,%r14
  nopw   0x0(%rax,%rax,1)
L28:
  movsbl (%rbx),%edi
  add    $0x1,%r13
  call   <toupper@plt>
  mov    %al,-0x1(%r13)
  mov    %rbx,%rax
  add    $0x1,%rbx
  cmp    %rax,%r14
  jne    L28
L62:
  xor    %eax,%eax
L131:
  add    $0x8,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L107:
  cmp    $0xfffffffffffffff8,%rsi
  jl     L57
  mov    $0xb,%edx
  mov    $0x20,%esi
  mov    %r13,%rdi
  call   <memset@plt>
  xor    %eax,%eax
  jmp    L131
L138:
  mov    %r14,%r15
  mov    $0xb,%edx
  mov    $0x20,%esi
  mov    %r13,%rdi
  call   <memset@plt>
  sub    %r12,%r15
  mov    %r14,%rbp
  xor    %r14d,%r14d
  test   %r15,%r15
  jg     L22
  xor    %eax,%eax
  jmp    L131
```

assistant: ```c
int convert_name(char *short_name, const char *long_name) {
  int i;
  const char *s;
  const char *dot;
  int c;
  dot = NULL;
  for (s = long_name; *s; s++) {
    if (*s == '.') {
      if (dot) {
        goto short_fail;
      } else {
        dot = s;
      }
    } else if (!valid_char(*s)) {
      goto short_fail;
    }
  }
  if (dot - long_name > 8) {
    goto short_fail;
  }
  if (dot && (s - (dot + 1) > 3)) {
    goto short_fail;
  }
  memset(short_name, ' ', 11);
  if (!dot) {
    dot = s;
  }
  for (i = 0; i < dot - long_name; i++) {
    short_name[i] = toupper(long_name[i]);
  }
  for (i = 0; i < s - dot; i++) {
    short_name[8 + i] = toupper(dot[1 + i]);
  }
  return 0;
short_fail:
  return 1;
}
```