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

```asm
<execute_cgi>:
  endbr64
  push   %r15
  push   %r14
  lea    D147(%rip),%r14
  push   %r13
  mov    %rdx,%r13
  push   %r12
  mov    %edi,%r12d
  mov    %rdx,%rdi
  push   %rbp
  push   %rbx
  lea    D90(%rip),%rbx
  sub    $0x758,%rsp
  mov    %rsi,0x8(%rsp)
  lea    D85(%rip),%rsi
  lea    0x340(%rsp),%rbp
  mov    %rcx,0x10(%rsp)
  mov    $0x41,%ecx
  mov    %fs:0x28,%rax
  mov    %rax,0x748(%rsp)
  xor    %eax,%eax
  mov    %cx,0x340(%rsp)
  call   <strcasecmp@plt>
  test   %rax,%rax
  jne    L18
  nopl   0x0(%rax,%rax,1)
L166:
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L6
  mov    %rbp,%rdi
  call   <strlen@plt>
  mov    %rbp,%rsi
  mov    %r12d,%edi
  mov    %eax,%edx
  call   <get_line@plt>
  mov    %rbp,%rsi
  mov    %r14,%rdi
  mov    %eax,%r15d
  xor    %eax,%eax
  call   <printf@plt>
  test   %r15d,%r15d
  jg     L166
L6:
  movl   $0xffffffff,0x18(%rsp)
L58:
  movdqa D119(%rip),%xmm0
  mov    $0xa,%edx
  mov    %rbp,%rdi
  mov    %dx,0x350(%rsp)
  movaps %xmm0,0x340(%rsp)
  call   <strlen@plt>
  xor    %ecx,%ecx
  mov    %r12d,%edi
  mov    %rbp,%rsi
  mov    %eax,%edx
  call   <send@plt>
  lea    0x30(%rsp),%rdi
  call   <pipe@plt>
  test   %rax,%rax
  js     L215
  lea    0x38(%rsp),%rdi
  call   <pipe@plt>
  test   %rax,%rax
  js     L215
  xor    %eax,%eax
  call   <fork@plt>
  mov    %rax,%rbp
  test   %rax,%rax
  js     L215
  jne    L8
  mov    0x34(%rsp),%edi
  mov    $0x1,%esi
  lea    0x40(%rsp),%rbp
  call   <dup2@plt>
  mov    0x38(%rsp),%edi
  xor    %esi,%esi
  call   <dup2@plt>
  mov    0x30(%rsp),%edi
  call   <close@plt>
  mov    0x3c(%rsp),%edi
  call   <close@plt>
  mov    %r13,%rdx
  mov    %rbp,%rdi
  xor    %eax,%eax
  lea    D61(%rip),%rsi
  call   <sprintf@plt>
  mov    %rbp,%rdi
  call   <putenv@plt>
  lea    D85(%rip),%rsi
  mov    %r13,%rdi
  call   <strcasecmp@plt>
  test   %rax,%rax
  je     L264
  mov    0x18(%rsp),%edx
  lea    0x240(%rsp),%rdi
  lea    D159(%rip),%rsi
  xor    %eax,%eax
  call   <sprintf@plt>
L55:
  mov    0x8(%rsp),%rsi
  xor    %edx,%edx
  mov    %rsi,%rdi
  call   <execl@plt>
  test   %rax,%rax
  js     L227
L2:
  lea    D113(%rip),%rdi
  call   <puts@plt>
  xor    %edi,%edi
  call   <exit@plt>
  jmp    L94
  nopl   0x0(%rax,%rax,1)
L215:
  mov    %r12d,%edi
  call   <cannot_execute@plt>
L94:
  mov    0x748(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L200
  add    $0x758,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   0x0(%rax)
L18:
  mov    %rbp,%rdi
  lea    D25(%rip),%r15
  lea    D18(%rip),%r14
  call   <strlen@plt>
  mov    %rbp,%rsi
  mov    %r12d,%edi
  mov    %eax,%edx
  call   <get_line@plt>
  mov    %rbp,%rsi
  lea    D24(%rip),%rdi
  mov    %eax,0x1c(%rsp)
  xor    %eax,%eax
  call   <printf@plt>
  mov    0x1c(%rsp),%edx
  lea    0x350(%rsp),%rax
  movl   $0xffffffff,0x18(%rsp)
  mov    %rax,(%rsp)
  test   %edx,%edx
  jg     L138
  jmp    L25
  nopl   0x0(%rax)
L190:
  mov    %rbp,%rdi
  call   <strlen@plt>
  mov    %rbp,%rsi
  mov    %r12d,%edi
  mov    %eax,%edx
  call   <get_line@plt>
  test   %eax,%eax
  jle    L244
L138:
  mov    %rbp,%rsi
  mov    %rbx,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L244
  mov    %rbp,%rsi
  mov    %r15,%rdi
  xor    %eax,%eax
  movb   $0x0,0x34f(%rsp)
  call   <printf@plt>
  mov    %r14,%rsi
  mov    %rbp,%rdi
  call   <strcasecmp@plt>
  test   %rax,%rax
  jne    L190
  mov    (%rsp),%rdi
  call   <atoi@plt>
  mov    %eax,0x18(%rsp)
  jmp    L190
  nopl   (%rax)
L244:
  lea    D23(%rip),%rdi
  call   <puts@plt>
  cmpl   $0xffffffff,0x18(%rsp)
  jne    L58
L20:
  mov    %r12d,%edi
  call   <bad_request@plt>
  jmp    L94
  nopl   0x0(%rax)
L8:
  lea    D141(%rip),%rsi
  mov    %r13,%rdi
  call   <strcasecmp@plt>
  test   %rax,%rax
  je     L272
L107:
  lea    0x2b(%rsp),%rbx
  jmp    L9
  nopl   0x0(%rax,%rax,1)
L64:
  xor    %ecx,%ecx
  mov    $0x1,%edx
  mov    %rbx,%rsi
  mov    %r12d,%edi
  call   <send@plt>
L9:
  mov    0x30(%rsp),%edi
  mov    $0x1,%edx
  mov    %rbx,%rsi
  call   <read@plt>
  test   %rax,%rax
  jg     L64
  mov    0x30(%rsp),%edi
  call   <close@plt>
  mov    0x3c(%rsp),%edi
  call   <close@plt>
  lea    0x2c(%rsp),%rsi
  xor    %edx,%edx
  mov    %rbp,%rdi
  call   <waitpid@plt>
  jmp    L94
  xchg   %ax,%ax
L272:
  mov    0x18(%rsp),%eax
  xor    %r13d,%r13d
  lea    0x2b(%rsp),%rbx
  test   %eax,%eax
  jle    L107
L274:
  xor    %ecx,%ecx
  mov    $0x1,%edx
  mov    %rbx,%rsi
  mov    %r12d,%edi
  call   <recv@plt>
  mov    0x3c(%rsp),%edi
  mov    %rbx,%rsi
  add    $0x1,%r13d
  mov    $0x1,%edx
  call   <write@plt>
  cmp    %r13d,0x18(%rsp)
  jne    L274
  jmp    L9
L264:
  lea    0x140(%rsp),%rbp
  mov    0x10(%rsp),%rdx
  lea    D51(%rip),%rsi
  mov    %rbp,%rdi
  call   <snprintf@plt>
  mov    %rbp,%rdi
  call   <putenv@plt>
  jmp    L55
L227:
  lea    D138(%rip),%rdi
  call   <puts@plt>
  jmp    L2
L25:
  lea    D23(%rip),%rdi
  call   <puts@plt>
  jmp    L20
L200:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: label: D147
datatype: string
name: retrieve_data
arguments: label: D90
datatype: string
name: retrieve_data
arguments: label: D85
datatype: string
name: retrieve_data
arguments: label: D119
datatype: byte[16]
name: retrieve_data
arguments: label: D61
datatype: string
name: retrieve_data
arguments: label: D159
datatype: string
name: retrieve_data
arguments: label: D113
datatype: string
name: retrieve_data
arguments: label: D25
datatype: string
name: retrieve_data
arguments: label: D18
datatype: string
name: retrieve_data
arguments: label: D24
datatype: string
name: retrieve_data
arguments: label: D23
datatype: string
name: retrieve_data
arguments: label: D141
datatype: string
name: retrieve_data
arguments: label: D51
datatype: string
name: retrieve_data
arguments: label: D138
datatype: string

tool: D147: header: %s 


tool: D90: 


tool: D85: GET

tool: {"D119": [0x48,0x54,0x54,0x50,0x2f,0x31,0x2e,0x30,0x20,0x32,0x30,0x30,0x20,0x4f,0x4b,0x0d]}

tool: D61: REQUEST_METHOD=%s

tool: D159: CONTENT_LENGTH=%d

tool: D113: <p>come on cgi</p>

tool: D25: buf:%s 


tool: D18: Content-Length:

tool: D24: buf: %s


tool: D23: before bad_request 

tool: D141: POST

tool: D51: QUERY_STRING=%s

tool: D138: execl error

assistant: ```c
void execute_cgi(int client, const char *path, const char *method, const char *query_string) {
  char buf[1024];
  int cgi_output[2];
  int cgi_input[2];
  pid_t pid;
  int status;
  int i;
  char c;
  int numchars = 1;
  int content_length = -1;
  buf[0] = 'A';
  buf[1] = '\0';
  if (strcasecmp(method, "GET") == 0)
    while ((numchars > 0) && strcmp("\n", buf)) {
      numchars = get_line(client, buf, strlen(buf));
      printf("header: %s \n", buf);
    }
  else {
    numchars = get_line(client, buf, strlen(buf));
    printf("buf: %s\n", buf);
    while ((numchars > 0) && strcmp("\n", buf)) {
      buf[15] = '\0';
      printf("buf:%s \n", buf);
      if (strcasecmp(buf, "Content-Length:") == 0) {
        content_length = atoi(&buf[16]);
      }
      numchars = get_line(client, buf, strlen(buf));
    }
    printf("before bad_request \n");
    if (content_length == -1) {
      bad_request(client);
      return;
    }
  }
  sprintf(buf, "HTTP/1.0 200 OK\r\n");
  send(client, buf, strlen(buf), 0);
  if (pipe(cgi_output) < 0) {
    cannot_execute(client);
    return;
  }
  if (pipe(cgi_input) < 0) {
    cannot_execute(client);
    return;
  }
  if ((pid = fork()) < 0) {
    cannot_execute(client);
    return;
  }
  if (pid == 0) {
    char meth_env[255];
    char query_env[255];
    char length_env[255];
    dup2(cgi_output[1], 1);
    dup2(cgi_input[0], 0);
    close(cgi_output[0]);
    close(cgi_input[1]);
    sprintf(meth_env, "REQUEST_METHOD=%s", method);
    putenv(meth_env);
    if (strcasecmp(method, "GET") == 0) {
      snprintf(query_env, "QUERY_STRING=%s", query_string);
      putenv(query_env);
    } else {
      sprintf(length_env, "CONTENT_LENGTH=%d", content_length);
    }
    if (execl(path, path, NULL) < 0) {
      printf("execl error\n");
    }
    printf("<p>come on cgi</p>\n");
    exit(0);
  } else {
    if (strcasecmp(method, "POST") == 0)
      for (i = 0; i < content_length; i++) {
        recv(client, &c, 1, 0);
        write(cgi_input[1], &c, 1);
      }
    while (read(cgi_output[0], &c, 1) > 0)
      send(client, &c, 1, 0);
    close(cgi_output[0]);
    close(cgi_input[1]);
    waitpid(pid, &status, 0);
  }
}
```