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

```asm
<main>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x428,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x418(%rsp)
  xor    %eax,%eax
  cmp    $0x1,%edi
  je     L176
  mov    %edi,%ebp
  mov    %rsi,%r12
  mov    0x8(%rsi),%rdi
  cmp    $0x2,%ebp
  je     L101
  cmp    $0x3,%ebp
  je     L193
  lea    D2(%rip),%rsi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L176
  call   <connect_to_daemon@plt>
  mov    %eax,%r14d
  cmp    $0xffffffff,%eax
  je     L138
  lea    D69(%rip),%rax
  lea    0x10(%rsp),%r15
  mov    0x8(%r12),%rdx
  mov    %rax,0x8(%rsp)
  mov    %rax,%rsi
  mov    %r15,%rdi
  xor    %eax,%eax
  call   <sprintf@plt>
  cmp    $0x2,%ebp
  jle    L33
  mov    $0x2,%ebx
  lea    D141(%rip),%r13
  cs nopw 0x0(%rax,%rax,1)
L257:
  mov    (%r12,%rbx,8),%rcx
  mov    %r15,%rdx
  mov    %r13,%rsi
  mov    %r15,%rdi
  xor    %eax,%eax
  add    $0x1,%rbx
  call   <sprintf@plt>
  cmp    %ebx,%ebp
  jg     L257
L33:
  mov    %r15,%rdi
  call   <strlen@plt>
  xor    %ecx,%ecx
  mov    %r15,%rsi
  mov    %r14d,%edi
  mov    %eax,%edx
  call   <send@plt>
  add    $0x1,%eax
  je     L138
  xor    %ecx,%ecx
  mov    $0x400,%edx
  mov    %r15,%rsi
  mov    %r14d,%edi
  call   <recv@plt>
  test   %eax,%eax
  jle    L105
  mov    0x8(%rsp),%rdi
  cltq
  mov    %r15,%rsi
  movb   $0x0,0x10(%rsp,%rax,1)
  xor    %eax,%eax
  call   <printf@plt>
  mov    %r14d,%edi
  call   <close@plt>
  xor    %eax,%eax
L246:
  mov    0x418(%rsp),%rdx
  sub    %fs:0x28,%rdx
  jne    L117
  add    $0x428,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L193:
  lea    D30(%rip),%rsi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L176
  xor    %eax,%eax
  call   <connect_to_daemon@plt>
  mov    %eax,%r14d
  cmp    $0xffffffff,%eax
  je     L138
  lea    0x10(%rsp),%r15
  mov    0x8(%r12),%rdx
  lea    D69(%rip),%rax
  mov    %rax,0x8(%rsp)
  mov    %rax,%rsi
  mov    %r15,%rdi
  xor    %eax,%eax
  call   <sprintf@plt>
  mov    0x10(%r12),%rcx
  mov    %r15,%rdx
  mov    %r15,%rdi
  lea    D141(%rip),%rsi
  xor    %eax,%eax
  call   <sprintf@plt>
  jmp    L33
L145:
  mov    0x8(%r12),%rdi
  lea    D129(%rip),%rsi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L174
  mov    0x8(%r12),%rdi
  lea    D124(%rip),%rsi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L174
  mov    0x8(%r12),%rdi
  lea    D142(%rip),%rsi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L174
  mov    0x8(%r12),%rdi
  lea    D37(%rip),%rsi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L174
  mov    0x8(%r12),%rdi
  lea    D77(%rip),%rsi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L174
  mov    0x8(%r12),%rdi
  lea    D62(%rip),%rsi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L174
L176:
  xor    %eax,%eax
  call   <print_usage@plt>
  mov    $0x1,%eax
  jmp    L246
L105:
  je     L67
  lea    D43(%rip),%rdi
  call   <perror@plt>
  mov    $0x1,%eax
  jmp    L246
L101:
  lea    D166(%rip),%rbp
  mov    %rbp,%rsi
  call   <strcmp@plt>
  test   %rax,%rax
  jne    L145
L174:
  xor    %eax,%eax
  call   <connect_to_daemon@plt>
  mov    %eax,%r14d
  cmp    $0xffffffff,%eax
  jne    L26
L197:
  mov    %rbp,%rdi
  call   <perror@plt>
  mov    $0x1,%eax
  jmp    L246
L138:
  lea    D166(%rip),%rbp
  jmp    L197
L67:
  lea    D165(%rip),%rdi
  call   <puts@plt>
  mov    $0x1,%eax
  jmp    L246
L26:
  lea    D69(%rip),%rax
  lea    0x10(%rsp),%r15
  mov    0x8(%r12),%rdx
  mov    %rax,0x8(%rsp)
  mov    %rax,%rsi
  mov    %r15,%rdi
  xor    %eax,%eax
  call   <sprintf@plt>
  jmp    L33
L117:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: read_data
arguments: data_label: D2
type_infered: string
name: read_data
arguments: data_label: D69
type_infered: string
name: read_data
arguments: data_label: D141
type_infered: string
name: read_data
arguments: data_label: D30
type_infered: string
name: read_data
arguments: data_label: D129
type_infered: string
name: read_data
arguments: data_label: D124
type_infered: string
name: read_data
arguments: data_label: D142
type_infered: string
name: read_data
arguments: data_label: D37
type_infered: string
name: read_data
arguments: data_label: D77
type_infered: string
name: read_data
arguments: data_label: D62
type_infered: string
name: read_data
arguments: data_label: D43
type_infered: string
name: read_data
arguments: data_label: D166
type_infered: string
name: read_data
arguments: data_label: D165
type_infered: string

tool: D2: a

tool: D69: %s

tool: D141: %s %s

tool: D30: d

tool: D129: l

tool: D124: i

tool: D142: s

tool: D37: r

tool: D77: 8

tool: D62: f

tool: D43: recv

tool: D166: q

tool: D165: Server closed connection

assistant: ```c
int main(int argc, char **argv) {
  int socket, t, i;
  char str[1024];
  if (argc == 1) {
    print_usage();
    return 1;
  } else if (argc == 2) {
    if (!(strcmp(argv[1], "q") == 0 || strcmp(argv[1], "l") == 0 || strcmp(argv[1], "i") == 0 || strcmp(argv[1], "s") == 0 || strcmp(argv[1], "r") == 0 || strcmp(argv[1], "8") == 0 || strcmp(argv[1], "f") == 0)) {
      print_usage();
      return 1;
    }
  } else if (argc == 3) {
    if (!(strcmp(argv[1], "d") == 0)) {
      print_usage();
      return 1;
    }
  } else if (!(strcmp(argv[1], "a") == 0)) {
    print_usage();
    return 1;
  }
  if ((socket = connect_to_daemon()) == -1) {
    perror("q");
    return 1;
  }
  sprintf(str, "%s", argv[1]);
  for (i = 2; i < argc; i++)
    sprintf(str, "%s %s", str, argv[i]);
  if (send(socket, str, strlen(str), 0) == -1) {
    perror("q");
    return 1;
  }
  if ((t = recv(socket, str, 1024, 0)) > 0) {
    str[t] = '\0';
    printf("%s", str);
  } else {
    if (t < 0) {
      perror("recv");
    } else {
      printf("Server closed connection\n");
    }
    return 1;
  }
  close(socket);
  return 0;
}
```