user: What is the c source code of the assembly code below?

```asm
<main>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x228,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x218(%rsp)
  xor    %eax,%eax
  cmp    $0x2,%edi
  jle    L88
  movslq %edi,%rax
  mov    %edi,%ebp
  lea    0xc(%rsp),%r12
  mov    %rsi,%r13
  lea    -0x8(%rsi,%rax,8),%r14
  mov    %r12,%rsi
  mov    (%r14),%rdi
  call   <stat@plt>
  test   %rax,%rax
  je     L10
L21:
  cmp    $0x3,%ebp
  jne    L108
  xor    %r15d,%r15d
L69:
  lea    -0x2(%rbp),%eax
  lea    0x8(%r13),%rbx
  lea    0x10(%rsp),%rbp
  lea    0x10(%r13,%rax,8),%r13
  jmp    L115
  cs nopw 0x0(%rax,%rax,1)
L19:
  mov    (%r14),%rsi
  mov    $0x1ff,%edx
  mov    %rbp,%rdi
  call   <strncpy@plt>
  test   %r15d,%r15d
  jne    L63
L2:
  mov    (%rbx),%rdi
  mov    %rbp,%rsi
  add    $0x8,%rbx
  call   <rename@plt>
  cmp    %r13,%rbx
  je     L27
L115:
  mov    (%rbx),%rdi
  mov    %r12,%rsi
  call   <stat@plt>
  test   %rax,%rax
  jns    L19
  mov    (%rbx),%rsi
  lea    D12(%rip),%rdi
  xor    %eax,%eax
  add    $0x8,%rbx
  call   <printf@plt>
  cmp    %r13,%rbx
  jne    L115
  nopw   0x0(%rax,%rax,1)
L27:
  mov    0x218(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L133
  add    $0x228,%rsp
  mov    $0x1,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L10:
  testb  $0x40,0xd(%rsp)
  je     L21
  mov    $0x1,%r15d
  jmp    L69
  nopl   0x0(%rax)
L63:
  mov    %rbp,%rdi
  call   <strlen@plt>
  mov    $0x1ff,%edx
  lea    D2(%rip),%rsi
  mov    %rbp,%rdi
  sub    %eax,%edx
  call   <strncat@plt>
  mov    %rbp,%rdi
  call   <strlen@plt>
  mov    $0x1ff,%ecx
  mov    (%rbx),%rsi
  mov    %rbp,%rdi
  sub    %eax,%ecx
  mov    %ecx,%edx
  call   <strncat@plt>
  jmp    L2
L88:
  lea    D7(%rip),%rdi
  call   <puts@plt>
  lea    D38(%rip),%rdi
  call   <puts@plt>
  jmp    L27
L108:
  mov    (%r14),%rsi
  lea    D14(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  jmp    L27
L133:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: data_label: D12
type_guessed: string
name: disassemble_data
arguments: data_label: D2
type_guessed: string
name: disassemble_data
arguments: data_label: D7
type_guessed: string
name: disassemble_data
arguments: data_label: D38
type_guessed: string
name: disassemble_data
arguments: data_label: D14
type_guessed: string

tool: D12: mv: cannot stat %s


tool: D2: /

tool: D7: mv: file1 file.. dest dir

tool: D38: mv: file1 file2

tool: D14: mv: for multiple files, dest %s should be a directory


assistant: ```c
int main(int argc, char *argv[]) {
  struct stat st;
  int dst_exists = 0, dst_isdir = 0;
  int i, err;
  char buf[512];
  if (argc < 3) {
    printf("mv: file1 file.. dest dir\n");
    printf("mv: file1 file2\n");
    return 1;
  }
  if (stat(argv[argc - 1], &st) == 0) {
    dst_exists = 1;
    if (st.st_mode & 0040000)
      dst_isdir = 1;
  }
  if (argc > 3 && (!dst_exists || !dst_isdir)) {
    printf("mv: for multiple files, dest %s should be a directory\n", argv[argc - 1]);
    return 1;
  }
  for (i = 1; i < argc; i++) {
    if (stat(argv[i], &st) < 0) {
      printf("mv: cannot stat %s\n", argv[i]);
      err++;
      continue;
    }
    strncpy(buf, argv[argc - 1], sizeof(buf) - 1);
    if (dst_isdir) {
      strncat(buf, "/", sizeof(buf) - strlen(buf) - 1);
      strncat(buf, argv[i], sizeof(buf) - strlen(buf) - 1);
    }
    if (rename(argv[i], buf) < 0)
      err++;
  }
  return err;
}
```