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

```asm
<accept_loop>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  sub    $0x40,%rsp
  mov    %edi,-0x2034(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movl   $0x0,-0x202c(%rbp)
  movq   $0x0,-0x2010(%rbp)
  movq   $0x0,-0x2008(%rbp)
  lea    -0x2000(%rbp),%rdx
  mov    $0x0,%eax
  mov    $0x1fe,%ecx
  mov    %rdx,%rdi
  rep stos %rax,%es:(%rdi)
  movq   $0x0,-0x1010(%rbp)
  movq   $0x0,-0x1008(%rbp)
  lea    -0x1000(%rbp),%rdx
  mov    $0x0,%eax
  mov    $0x1fe,%ecx
  mov    %rdx,%rdi
  rep stos %rax,%es:(%rdi)
L16:
  movl   $0x8,-0x2030(%rbp)
  lea    -0x2030(%rbp),%rdx
  lea    -0x2018(%rbp),%rcx
  mov    -0x2034(%rbp),%eax
  mov    %rcx,%rsi
  mov    %eax,%edi
  call   <accept@plt>
  mov    %eax,-0x2028(%rbp)
  cmpl   $0x0,-0x2028(%rbp)
  jns    L24
  lea    D55(%rip),%rax
  mov    %rax,%rdi
  call   <perror@plt>
  movl   $0xffffffff,-0x202c(%rbp)
  nop
  mov    -0x202c(%rbp),%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L4
  jmp    L17
L24:
  mov    -0x2014(%rbp),%eax
  mov    %eax,%edi
  call   <inet_ntoa@plt>
  mov    %rax,-0x2020(%rbp)
  mov    -0x2018(%rbp),%eax
  mov    %eax,%edi
  call   <ntohs@plt>
  mov    %eax,-0x2024(%rbp)
  mov    -0x2024(%rbp),%edx
  mov    -0x2020(%rbp),%rax
  mov    %rax,%rsi
  lea    D38(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  lea    -0x2010(%rbp),%rax
  mov    $0x1000,%edx
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <memset@plt>
  lea    -0x2010(%rbp),%rsi
  mov    -0x2028(%rbp),%eax
  mov    $0x0,%ecx
  mov    $0x1000,%edx
  mov    %eax,%edi
  call   <recv@plt>
  lea    D42(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  lea    -0x2010(%rbp),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  lea    D49(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  lea    -0x1010(%rbp),%rax
  lea    D39(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcpy@plt>
  lea    -0x1010(%rbp),%rax
  lea    D48(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcat@plt>
  lea    -0x1010(%rbp),%rax
  lea    D43(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcat@plt>
  lea    -0x1010(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %eax,%edx
  lea    -0x1010(%rbp),%rsi
  mov    -0x2028(%rbp),%eax
  mov    $0x0,%ecx
  mov    %eax,%edi
  call   <send@plt>
  mov    -0x2028(%rbp),%eax
  mov    %eax,%edi
  call   <close@plt>
  jmp    L16
L17:
  call   <__stack_chk_fail@plt>
L4:
  leave
  ret
```

tool_calls: name: unpack_data
arguments: tag: D55
type_infered: string
name: unpack_data
arguments: tag: D38
type_infered: string
name: unpack_data
arguments: tag: D42
type_infered: string
name: unpack_data
arguments: tag: D49
type_infered: string
name: unpack_data
arguments: tag: D39
type_infered: string
name: unpack_data
arguments: tag: D48
type_infered: string
name: unpack_data
arguments: tag: D43
type_infered: string

tool: D55: accept

tool: D38: accept!(IPAddress = %s, Port = %hu)


tool: D42: ----- recv begin -----

tool: D49: ----- recv end -----

tool: D39: HTTP/1.0 301 Moved Permanently


tool: D48: Location: http://bgstation0.com/classic1/


tool: D43: 


assistant: ```c
int accept_loop(int soc) {
  struct sockaddr_in client_addr;
  int client_addr_len;
  int acc;
  char *client_ip_addr_str;
  u_short client_port;
  int ret = 0;
  char recv_buf[4096] = {0};
  char send_buf[4096] = {0};
  while (1) {
    client_addr_len = sizeof(client_addr);
    acc = accept(soc, (struct sockaddr *)&client_addr, &client_addr_len);
    if (acc < 0) {
      perror("accept");
      ret = -1;
      break;
    }
    client_ip_addr_str = inet_ntoa(client_addr.sin_addr);
    client_port = ntohs(client_addr.sin_port);
    printf("accept!(IPAddress = %s, Port = %hu)\n", client_ip_addr_str, client_port);
    memset(recv_buf, 0, sizeof(char) * 4096);
    recv(acc, recv_buf, sizeof(recv_buf), 0);
    printf("----- recv begin -----\n");
    printf("%s\n", recv_buf);
    printf("----- recv end -----\n");
    strcpy(send_buf, "HTTP/1.0 301 Moved Permanently\r\n");
    strcat(send_buf, "Location: http://bgstation0.com/classic1/\r\n");
    strcat(send_buf, "\r\n");
    send(acc, send_buf, strlen(send_buf), 0);
    close(acc);
  }
  return ret;
}
```