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

```asm
<execute_cgi>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r15
  lea    D4(%rip),%r15
  push   %r14
  lea    -0x440(%rbp),%r14
  push   %r13
  mov    %rdx,%r13
  push   %r12
  mov    %edi,%r12d
  mov    %rdx,%rdi
  push   %rbx
  lea    D80(%rip),%rbx
  sub    $0x758,%rsp
  mov    %rsi,-0x770(%rbp)
  mov    %r15,%rsi
  mov    %rcx,-0x778(%rbp)
  mov    $0x41,%ecx
  mov    %fs:0x28,%rax
  mov    %rax,-0x38(%rbp)
  xor    %eax,%eax
  mov    %cx,-0x440(%rbp)
  call   <strcasecmp@plt>
  test   %rax,%rax
  jne    L36
L391:
  mov    %r14,%rsi
  mov    %rbx,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L58
  mov    $0x400,%edx
  mov    %r14,%rsi
  mov    %r12d,%edi
  call   <get_line@plt>
  test   %eax,%eax
  jg     L391
L58:
  movl   $0xffffffff,-0x764(%rbp)
L294:
  movdqa D53(%rip),%xmm0
  mov    $0xa,%edx
  mov    %r14,%rdi
  mov    %dx,-0x430(%rbp)
  movaps %xmm0,-0x440(%rbp)
  call   <strlen@plt>
  xor    %ecx,%ecx
  mov    %r12d,%edi
  mov    %r14,%rsi
  mov    %eax,%edx
  call   <send@plt>
  lea    -0x750(%rbp),%rdi
  call   <pipe@plt>
  test   %rax,%rax
  js     L92
  lea    -0x748(%rbp),%rdi
  call   <pipe@plt>
  test   %rax,%rax
  js     L92
  xor    %eax,%eax
  call   <fork@plt>
  mov    %rax,%rbx
  test   %rax,%rax
  js     L92
  jne    L74
  mov    -0x770(%rbp),%rbx
  mov    %rbx,%rdi
  call   <strlen@plt>
  cltq
  cmpb   $0x2e,-0x2(%rbx,%rax,1)
  je     L146
L204:
  mov    -0x74c(%rbp),%edi
  mov    $0x1,%esi
  lea    -0x740(%rbp),%r12
  call   <dup2@plt>
  mov    -0x748(%rbp),%edi
  xor    %esi,%esi
  call   <dup2@plt>
  mov    -0x750(%rbp),%edi
  call   <close@plt>
  mov    -0x744(%rbp),%edi
  call   <close@plt>
  mov    %r13,%rdx
  mov    %r12,%rdi
  xor    %eax,%eax
  lea    D49(%rip),%rsi
  call   <sprintf@plt>
  mov    %r12,%rdi
  call   <putenv@plt>
  mov    %r15,%rsi
  mov    %r13,%rdi
  call   <strcasecmp@plt>
  test   %rax,%rax
  je     L184
  lea    D79(%rip),%rsi
  mov    %r13,%rdi
  call   <strcasecmp@plt>
  test   %rax,%rax
  je     L188
L107:
  mov    -0x770(%rbp),%rsi
  xor    %edx,%edx
  mov    %rsi,%rdi
  call   <execl@plt>
  xor    %edi,%edi
  call   <exit@plt>
  jmp    L73
  nopl   0x0(%rax,%rax,1)
L92:
  mov    %r12d,%edi
  call   <cannot_execute@plt>
L73:
  mov    -0x38(%rbp),%rax
  sub    %fs:0x28,%rax
  jne    L173
  lea    -0x28(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  pop    %rbp
  ret
  nopw   0x0(%rax,%rax,1)
L36:
  lea    D79(%rip),%rsi
  mov    %r13,%rdi
  call   <strcasecmp@plt>
  test   %rax,%rax
  jne    L58
  mov    $0x400,%edx
  mov    %r14,%rsi
  mov    %r12d,%edi
  call   <get_line@plt>
  movl   $0xffffffff,-0x764(%rbp)
  test   %eax,%eax
  jg     L326
  jmp    L295
  nopl   0x0(%rax,%rax,1)
L398:
  mov    $0x400,%edx
  mov    %r14,%rsi
  mov    %r12d,%edi
  call   <get_line@plt>
  test   %eax,%eax
  jle    L281
L326:
  mov    %r14,%rsi
  mov    %rbx,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L281
  lea    D32(%rip),%rsi
  mov    %r14,%rdi
  movb   $0x0,-0x431(%rbp)
  call   <strcasecmp@plt>
  test   %rax,%rax
  jne    L398
  lea    -0x430(%rbp),%rdi
  call   <atoi@plt>
  mov    %eax,-0x764(%rbp)
  jmp    L398
  nopl   0x0(%rax,%rax,1)
L74:
  mov    -0x74c(%rbp),%edi
  call   <close@plt>
  mov    -0x748(%rbp),%edi
  call   <close@plt>
  lea    D79(%rip),%rsi
  mov    %r13,%rdi
  call   <strcasecmp@plt>
  test   %rax,%rax
  je     L221
L133:
  lea    -0x755(%rbp),%r13
  jmp    L255
  nopl   0x0(%rax,%rax,1)
L164:
  xor    %ecx,%ecx
  mov    $0x1,%edx
  mov    %r13,%rsi
  mov    %r12d,%edi
  call   <send@plt>
L255:
  mov    -0x750(%rbp),%edi
  mov    $0x1,%edx
  mov    %r13,%rsi
  call   <read@plt>
  test   %rax,%rax
  jg     L164
  mov    -0x750(%rbp),%edi
  call   <close@plt>
  mov    -0x744(%rbp),%edi
  call   <close@plt>
  lea    -0x754(%rbp),%rsi
  xor    %edx,%edx
  mov    %rbx,%rdi
  call   <waitpid@plt>
  jmp    L73
  xchg   %ax,%ax
L221:
  mov    -0x764(%rbp),%eax
  xor    %r14d,%r14d
  lea    -0x755(%rbp),%r13
  test   %eax,%eax
  jle    L133
  nopl   0x0(%rax)
L62:
  xor    %ecx,%ecx
  mov    $0x1,%edx
  mov    %r13,%rsi
  mov    %r12d,%edi
  call   <recv@plt>
  mov    -0x744(%rbp),%edi
  mov    %r13,%rsi
  add    $0x1,%r14d
  mov    $0x1,%edx
  call   <write@plt>
  cmp    %r14d,-0x764(%rbp)
  jne    L62
  jmp    L255
  nop
L184:
  lea    -0x640(%rbp),%r12
  mov    -0x778(%rbp),%rdx
  lea    D34(%rip),%rsi
  mov    %r12,%rdi
  call   <sprintf@plt>
  mov    %r12,%rdi
  call   <putenv@plt>
  jmp    L107
  nopw   0x0(%rax,%rax,1)
L146:
  mov    -0x770(%rbp),%rbx
  mov    %rbx,%rdi
  call   <strlen@plt>
  cltq
  cmpb   $0x63,-0x1(%rbx,%rax,1)
  jne    L204
  mov    -0x764(%rbp),%eax
  mov    %rsp,%rcx
  mov    %rsp,%rbx
  lea    0x1(%rax),%r12d
  movslq %r12d,%rax
  add    $0xf,%rax
  mov    %rax,%rdx
  and    $0xfffffffffffff000,%rax
  sub    %rax,%rcx
  and    $0xfffffffffffffff0,%rdx
  cmp    %rcx,%rsp
  je     L249
L286:
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  cmp    %rcx,%rsp
  jne    L286
L249:
  mov    %rdx,%rax
  and    $0xfff,%eax
  sub    %rax,%rsp
  test   %rax,%rax
  je     L243
  orq    $0x0,-0x8(%rsp,%rax,1)
L243:
  mov    %r15,%rsi
  mov    %r13,%rdi
  mov    %rsp,%r14
  call   <strcasecmp@plt>
  test   %rax,%rax
  jne    L43
  mov    -0x778(%rbp),%rsi
  lea    D20(%rip),%rdi
  call   <printf@plt>
L280:
  mov    -0x770(%rbp),%rdi
  lea    D113(%rip),%rsi
  call   <strcasecmp@plt>
  test   %rax,%rax
  je     L63
L216:
  mov    %rbx,%rsp
  jmp    L73
  nopl   (%rax)
L281:
  cmpl   $0xffffffff,-0x764(%rbp)
  jne    L294
L295:
  mov    %r12d,%edi
  call   <bad_request@plt>
  jmp    L73
L188:
  lea    -0x540(%rbp),%r12
  mov    -0x764(%rbp),%edx
  lea    D60(%rip),%rsi
  mov    %r12,%rdi
  call   <sprintf@plt>
  mov    %r12,%rdi
  call   <putenv@plt>
  jmp    L107
L43:
  lea    D79(%rip),%rsi
  mov    %r13,%rdi
  call   <strcasecmp@plt>
  test   %rax,%rax
  jne    L280
  mov    %r12d,%edx
  xor    %esi,%esi
  mov    %rsp,%rdi
  call   <memset@plt>
  mov    -0x764(%rbp),%edx
  mov    -0x748(%rbp),%edi
  mov    %rsp,%rsi
  call   <read@plt>
  jmp    L280
L63:
  mov    -0x764(%rbp),%esi
  mov    %r14,%rdi
  call   <processMotorControl@plt>
  jmp    L216
L173:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: parse_data
arguments: data_label: D4
type_infered: string
name: parse_data
arguments: data_label: D80
type_infered: string
name: parse_data
arguments: data_label: D53
type_infered: byte[16]
name: parse_data
arguments: data_label: D49
type_infered: string
name: parse_data
arguments: data_label: D79
type_infered: string
name: parse_data
arguments: data_label: D32
type_infered: string
name: parse_data
arguments: data_label: D34
type_infered: string
name: parse_data
arguments: data_label: D20
type_infered: string
name: parse_data
arguments: data_label: D113
type_infered: string
name: parse_data
arguments: data_label: D60
type_infered: string

tool: D4: GET

tool: D80: 


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

tool: D49: REQUEST_METHOD=%s

tool: D79: POST

tool: D32: Content-Length:

tool: D34: QUERY_STRING=%s

tool: D20: C GET: %s


tool: D113: htdocs/motor_control.c

tool: D60: CONTENT_LENGTH=%d

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, sizeof(buf));
    }
  } else if (strcasecmp(method, "POST") == 0) {
    numchars = get_line(client, buf, sizeof(buf));
    while ((numchars > 0) && strcmp("\n", buf)) {
      buf[15] = '\0';
      if (strcasecmp(buf, "Content-Length:") == 0) {
        content_length = atoi(&(buf[16]));
      }
      numchars = get_line(client, buf, sizeof(buf));
    }
    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) {
    if (path[strlen(path) - 2] == '.' && path[strlen(path) - 1] == 'c') {
      char postContent[content_length + 1];
      if (strcasecmp(method, "GET") == 0) {
        printf("C GET: %s\n", query_string);
      } else if (strcasecmp(method, "POST") == 0) {
        memset(postContent, 0, content_length + 1);
        read(cgi_input[0], postContent, content_length);
      }
      if (0 == strcasecmp(path, "htdocs/motor_control.c")) {
        processMotorControl(postContent, content_length);
      }
    } else {
      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) {
        sprintf(query_env, "QUERY_STRING=%s", query_string);
        putenv(query_env);
      } else if (strcasecmp(method, "POST") == 0) {
        sprintf(length_env, "CONTENT_LENGTH=%d", content_length);
        putenv(length_env);
      }
      execl(path, path, NULL);
      exit(0);
    }
  } else {
    close(cgi_output[1]);
    close(cgi_input[0]);
    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);
  }
}
```