user: 请将以下的汇编代码转换成C语言代码:

```asm
<accept_loop>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  lea    -0x4000(%rsp),%r11
L45:
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  cmp    %r11,%rsp
  jne    L45
  sub    $0x170,%rsp
  mov    %edi,-0x4164(%rbp)
  mov    %fs:0x28,%rax
  mov    %rax,-0x8(%rbp)
  xor    %eax,%eax
  movl   $0x0,-0x4150(%rbp)
  movq   $0x0,-0x4010(%rbp)
  movq   $0x0,-0x4008(%rbp)
  lea    -0x4000(%rbp),%rdx
  mov    $0x0,%eax
  mov    $0x1fe,%ecx
  mov    %rdx,%rdi
  rep stos %rax,%es:(%rdi)
  movq   $0x0,-0x3010(%rbp)
  movq   $0x0,-0x3008(%rbp)
  lea    -0x3000(%rbp),%rdx
  mov    $0x0,%eax
  mov    $0x1fe,%ecx
  mov    %rdx,%rdi
  rep stos %rax,%es:(%rdi)
  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)
  movl   $0x0,-0x414c(%rbp)
L4:
  movl   $0x8,-0x4154(%rbp)
  lea    -0x4154(%rbp),%rdx
  lea    -0x4118(%rbp),%rcx
  mov    -0x4164(%rbp),%eax
  mov    %rcx,%rsi
  mov    %eax,%edi
  call   <accept@plt>
  mov    %eax,-0x4148(%rbp)
  cmpl   $0x0,-0x4148(%rbp)
  jns    L6
  lea    D151(%rip),%rax
  mov    %rax,%rdi
  call   <perror@plt>
  movl   $0xffffffff,-0x4150(%rbp)
  nop
  mov    -0x4150(%rbp),%eax
  mov    -0x8(%rbp),%rdx
  sub    %fs:0x28,%rdx
  je     L27
  jmp    L26
L6:
  mov    -0x4114(%rbp),%eax
  mov    %eax,%edi
  call   <inet_ntoa@plt>
  mov    %rax,-0x4130(%rbp)
  mov    -0x4118(%rbp),%eax
  mov    %eax,%edi
  call   <ntohs@plt>
  mov    %eax,-0x4144(%rbp)
  mov    -0x4144(%rbp),%edx
  mov    -0x4130(%rbp),%rax
  mov    %rax,%rsi
  lea    D97(%rip),%rax
  mov    %rax,%rdi
  mov    $0x0,%eax
  call   <printf@plt>
  lea    -0x4010(%rbp),%rax
  mov    $0x1000,%edx
  mov    $0x0,%esi
  mov    %rax,%rdi
  call   <memset@plt>
  lea    -0x4010(%rbp),%rsi
  mov    -0x4148(%rbp),%eax
  mov    $0x0,%ecx
  mov    $0x1000,%edx
  mov    %eax,%edi
  call   <recv@plt>
  lea    D48(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  lea    -0x4010(%rbp),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  lea    D30(%rip),%rax
  mov    %rax,%rdi
  call   <puts@plt>
  mov    $0x0,%edi
  call   <time@plt>
  mov    %rax,-0x4140(%rbp)
  lea    -0x4140(%rbp),%rax
  mov    %rax,%rdi
  call   <gmtime@plt>
  mov    %rax,-0x4128(%rbp)
  mov    -0x4128(%rbp),%rdx
  lea    -0x4110(%rbp),%rax
  mov    %rdx,%rcx
  lea    D177(%rip),%rdx
  mov    $0x80,%esi
  mov    %rax,%rdi
  call   <strftime@plt>
  mov    -0x4140(%rbp),%rax
  add    $0x12c,%rax
  mov    %rax,-0x4138(%rbp)
  lea    -0x4138(%rbp),%rax
  mov    %rax,%rdi
  call   <gmtime@plt>
  mov    %rax,-0x4120(%rbp)
  mov    -0x4120(%rbp),%rdx
  lea    -0x4090(%rbp),%rax
  mov    %rdx,%rcx
  lea    D85(%rip),%rdx
  mov    $0x80,%esi
  mov    %rax,%rdi
  call   <strftime@plt>
  lea    -0x1010(%rbp),%rax
  lea    D125(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcpy@plt>
  lea    -0x1010(%rbp),%rax
  lea    D49(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcat@plt>
  lea    -0x1010(%rbp),%rax
  lea    D10(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcat@plt>
  lea    -0x1010(%rbp),%rax
  lea    D3(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcat@plt>
  lea    -0x1010(%rbp),%rax
  lea    D113(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcat@plt>
  lea    -0x1010(%rbp),%rax
  lea    D44(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcat@plt>
  lea    -0x1010(%rbp),%rax
  lea    D90(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcat@plt>
  lea    -0x1010(%rbp),%rax
  lea    D74(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcat@plt>
  lea    -0x1010(%rbp),%rax
  lea    D123(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcat@plt>
  lea    -0x1010(%rbp),%rax
  lea    D9(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcat@plt>
  lea    -0x2010(%rbp),%rax
  lea    D31(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcpy@plt>
  lea    -0x2010(%rbp),%rdx
  lea    -0x3010(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcpy@plt>
  lea    -0x3010(%rbp),%rax
  lea    D74(%rip),%rdx
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcat@plt>
  lea    -0x1010(%rbp),%rdx
  lea    -0x3010(%rbp),%rax
  mov    %rdx,%rsi
  mov    %rax,%rdi
  call   <strcat@plt>
  lea    -0x3010(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  mov    %eax,%edx
  lea    -0x3010(%rbp),%rsi
  mov    -0x4148(%rbp),%eax
  mov    $0x0,%ecx
  mov    %eax,%edi
  call   <send@plt>
  mov    -0x4148(%rbp),%eax
  mov    %eax,%edi
  call   <close@plt>
  jmp    L4
L26:
  call   <__stack_chk_fail@plt>
L27:
  leave
  ret
```

tool_calls: name: unpack_data
arguments: data_label: D151
type_guessed: string
name: unpack_data
arguments: data_label: D97
type_guessed: string
name: unpack_data
arguments: data_label: D48
type_guessed: string
name: unpack_data
arguments: data_label: D30
type_guessed: string
name: unpack_data
arguments: data_label: D177
type_guessed: string
name: unpack_data
arguments: data_label: D85
type_guessed: string
name: unpack_data
arguments: data_label: D125
type_guessed: string
name: unpack_data
arguments: data_label: D49
type_guessed: string
name: unpack_data
arguments: data_label: D10
type_guessed: string
name: unpack_data
arguments: data_label: D3
type_guessed: string
name: unpack_data
arguments: data_label: D113
type_guessed: string
name: unpack_data
arguments: data_label: D44
type_guessed: string
name: unpack_data
arguments: data_label: D90
type_guessed: string
name: unpack_data
arguments: data_label: D74
type_guessed: string
name: unpack_data
arguments: data_label: D123
type_guessed: string
name: unpack_data
arguments: data_label: D9
type_guessed: string
name: unpack_data
arguments: data_label: D31
type_guessed: string

tool: D151: accept

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


tool: D48: ----- recv begin -----

tool: D30: ----- recv end -----

tool: D177: %Y/%m/%d %H:%M:%S %Z

tool: D85: %a, %d %b %Y %H:%M:%S %Z

tool: D125: <html>


tool: D49:   <head>


tool: D10:     <title>HTTP 401 Unauthorized</title>


tool: D3:   </head>


tool: D113:   <body>


tool: D44:     

tool: D90: HTTP 401 Unauthorized

tool: D74: 


tool: D123:   </body>


tool: D9: </html>


tool: D31: HTTP/1.1 401 Unauthorized


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};
  char response_header[4096] = {0};
  char response_body[4096] = {0};
  time_t t;
  struct tm *tm_ptr;
  char time_str[128];
  int content_length = 0;
  char content_length_str[128];
  time_t expires_t;
  struct tm *expires_tm_ptr;
  char expires_time_str[128];
  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");
    t = time(NULL);
    tm_ptr = gmtime(&t);
    strftime(time_str, sizeof(time_str), "%Y/%m/%d %H:%M:%S %Z", tm_ptr);
    expires_t = t + 5 * 60;
    expires_tm_ptr = gmtime(&expires_t);
    strftime(expires_time_str, sizeof(expires_time_str), "%a, %d %b %Y %H:%M:%S %Z", expires_tm_ptr);
    strcpy(response_body, "<html>\r\n");
    strcat(response_body, "  <head>\r\n");
    strcat(response_body, "    <title>HTTP 401 Unauthorized</title>\r\n");
    strcat(response_body, "  </head>\r\n");
    strcat(response_body, "  <body>\r\n");
    strcat(response_body, "    ");
    strcat(response_body, "HTTP 401 Unauthorized");
    strcat(response_body, "\r\n");
    strcat(response_body, "  </body>\r\n");
    strcat(response_body, "</html>\r\n");
    strcpy(response_header, "HTTP/1.1 401 Unauthorized\r\n");
    strcpy(send_buf, response_header);
    strcat(send_buf, "\r\n");
    strcat(send_buf, response_body);
    send(acc, send_buf, strlen(send_buf), 0);
    close(acc);
  }
  return ret;
}
```