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

```asm
<accept_loop>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  sub    $0x28,%rsp
  mov    $0x1fe,%ecx
  pxor   %xmm0,%xmm0
  lea    D13(%rip),%r15
  mov    %fs:0x28,%rax
  mov    %rax,0x2018(%rsp)
  xor    %eax,%eax
  mov    %edi,%ebx
  lea    0x20(%rsp),%rdi
  movaps %xmm0,0x10(%rsp)
  movaps %xmm0,0x1010(%rsp)
  lea    0x4(%rsp),%r12
  lea    0x8(%rsp),%rbp
  rep stos %rax,%es:(%rdi)
  lea    0x1020(%rsp),%rdi
  mov    $0x1fe,%ecx
  rep stos %rax,%es:(%rdi)
  jmp    L12
  nopl   0x0(%rax,%rax,1)
L5:
  mov    0xc(%rsp),%edi
  call   <inet_ntoa@plt>
  mov    0x8(%rsp),%edi
  mov    %rax,%r14
  call   <ntohs@plt>
  mov    %r14,%rsi
  mov    %r15,%rdi
  lea    0x10(%rsp),%r14
  mov    %eax,%edx
  xor    %eax,%eax
  call   <printf@plt>
  mov    %r14,%rdi
  mov    $0x1000,%edx
  xor    %esi,%esi
  call   <memset@plt>
  xor    %ecx,%ecx
  mov    $0x1000,%edx
  mov    %r14,%rsi
  mov    %r13d,%edi
  call   <recv@plt>
  lea    D1(%rip),%rdi
  call   <puts@plt>
  mov    %r14,%rdi
  lea    0x1010(%rsp),%r14
  call   <puts@plt>
  lea    D69(%rip),%rdi
  call   <puts@plt>
  lea    D60(%rip),%rsi
  mov    %r14,%rdi
  call   <strcpy@plt>
  lea    D55(%rip),%rsi
  mov    %r14,%rdi
  call   <strcat@plt>
  lea    D57(%rip),%rsi
  mov    %r14,%rdi
  call   <strcat@plt>
  mov    %r14,%rdi
  call   <strlen@plt>
  mov    %r13d,%edi
  xor    %ecx,%ecx
  mov    %r14,%rsi
  mov    %eax,%edx
  call   <send@plt>
  mov    %r13d,%edi
  call   <close@plt>
L12:
  mov    %r12,%rdx
  mov    %rbp,%rsi
  mov    %ebx,%edi
  movl   $0x8,0x4(%rsp)
  call   <accept@plt>
  mov    %eax,%r13d
  test   %eax,%eax
  jns    L5
  lea    D51(%rip),%rdi
  call   <perror@plt>
  mov    0x2018(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L3
  add    $0x2028,%rsp
  mov    $0xffffffff,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L3:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: extract_symbolic_data
arguments: data_label: D13
data_type: string
name: extract_symbolic_data
arguments: data_label: D1
data_type: string
name: extract_symbolic_data
arguments: data_label: D69
data_type: string
name: extract_symbolic_data
arguments: data_label: D60
data_type: string
name: extract_symbolic_data
arguments: data_label: D55
data_type: string
name: extract_symbolic_data
arguments: data_label: D57
data_type: string
name: extract_symbolic_data
arguments: data_label: D51
data_type: string

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


tool: D1: ----- recv begin -----

tool: D69: ----- recv end -----

tool: D60: HTTP/1.0 301 Moved Permanently


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


tool: D57: 


tool: D51: accept

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;
}
```