user: 请将这段汇编代码片段转换成等效的C代码：

```asm
<execute_cgi>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  push   %r15
  lea    D45(%rip),%r15
  push   %r14
  lea    -0x440(%rbp),%r14
  push   %r13
  mov    %rdx,%r13
  push   %r12
  mov    %edi,%r12d
  mov    %rdx,%rdi
  push   %rbx
  lea    D41(%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    L107
L197:
  mov    %r14,%rsi
  mov    %rbx,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L63
  mov    $0x400,%edx
  mov    %r14,%rsi
  mov    %r12d,%edi
  call   <get_line@plt>
  test   %eax,%eax
  jg     L197
L63:
  movl   $0xffffffff,-0x764(%rbp)
L250:
  movdqa D74(%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     L327
  lea    -0x748(%rbp),%rdi
  call   <pipe@plt>
  test   %rax,%rax
  js     L327
  xor    %eax,%eax
  call   <fork@plt>
  mov    %rax,%rbx
  test   %rax,%rax
  js     L327
  jne    L358
  mov    -0x770(%rbp),%rbx
  mov    %rbx,%rdi
  call   <strlen@plt>
  cltq
  cmpb   $0x2e,-0x2(%rbx,%rax,1)
  je     L69
L117:
  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    D7(%rip),%rsi
  call   <sprintf@plt>
  mov    %r12,%rdi
  call   <putenv@plt>
  mov    %r15,%rsi
  mov    %r13,%rdi
  call   <strcasecmp@plt>
  test   %rax,%rax
  je     L321
  lea    D28(%rip),%rsi
  mov    %r13,%rdi
  call   <strcasecmp@plt>
  test   %rax,%rax
  je     L59
L3:
  mov    -0x770(%rbp),%rsi
  xor    %edx,%edx
  mov    %rsi,%rdi
  call   <execl@plt>
  xor    %edi,%edi
  call   <exit@plt>
  jmp    L41
  nopl   0x0(%rax,%rax,1)
L327:
  mov    %r12d,%edi
  call   <cannot_execute@plt>
L41:
  mov    -0x38(%rbp),%rax
  sub    %fs:0x28,%rax
  jne    L390
  lea    -0x28(%rbp),%rsp
  pop    %rbx
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  pop    %rbp
  ret
  nopw   0x0(%rax,%rax,1)
L107:
  lea    D28(%rip),%rsi
  mov    %r13,%rdi
  call   <strcasecmp@plt>
  test   %rax,%rax
  jne    L63
  mov    $0x400,%edx
  mov    %r14,%rsi
  mov    %r12d,%edi
  call   <get_line@plt>
  movl   $0xffffffff,-0x764(%rbp)
  test   %eax,%eax
  jg     L151
  jmp    L19
  nopl   0x0(%rax,%rax,1)
L162:
  mov    $0x400,%edx
  mov    %r14,%rsi
  mov    %r12d,%edi
  call   <get_line@plt>
  test   %eax,%eax
  jle    L201
L151:
  mov    %r14,%rsi
  mov    %rbx,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L201
  lea    D23(%rip),%rsi
  mov    %r14,%rdi
  movb   $0x0,-0x431(%rbp)
  call   <strcasecmp@plt>
  test   %rax,%rax
  jne    L162
  lea    -0x430(%rbp),%rdi
  call   <atoi@plt>
  mov    %eax,-0x764(%rbp)
  jmp    L162
  nopl   0x0(%rax,%rax,1)
L358:
  mov    -0x74c(%rbp),%edi
  call   <close@plt>
  mov    -0x748(%rbp),%edi
  call   <close@plt>
  lea    D28(%rip),%rsi
  mov    %r13,%rdi
  call   <strcasecmp@plt>
  test   %rax,%rax
  je     L206
L58:
  lea    -0x755(%rbp),%r13
  jmp    L303
  nopl   0x0(%rax,%rax,1)
L243:
  xor    %ecx,%ecx
  mov    $0x1,%edx
  mov    %r13,%rsi
  mov    %r12d,%edi
  call   <send@plt>
L303:
  mov    -0x750(%rbp),%edi
  mov    $0x1,%edx
  mov    %r13,%rsi
  call   <read@plt>
  test   %rax,%rax
  jg     L243
  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    L41
  xchg   %ax,%ax
L206:
  mov    -0x764(%rbp),%eax
  xor    %r14d,%r14d
  lea    -0x755(%rbp),%r13
  test   %eax,%eax
  jle    L58
  nopl   0x0(%rax)
L195:
  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    L195
  jmp    L303
  nop
L321:
  lea    -0x640(%rbp),%r12
  mov    -0x778(%rbp),%rdx
  lea    D109(%rip),%rsi
  mov    %r12,%rdi
  call   <sprintf@plt>
  mov    %r12,%rdi
  call   <putenv@plt>
  jmp    L3
  nopw   0x0(%rax,%rax,1)
L69:
  mov    -0x770(%rbp),%rbx
  mov    %rbx,%rdi
  call   <strlen@plt>
  cltq
  cmpb   $0x63,-0x1(%rbx,%rax,1)
  jne    L117
  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     L276
L15:
  sub    $0x1000,%rsp
  orq    $0x0,0xff8(%rsp)
  cmp    %rcx,%rsp
  jne    L15
L276:
  mov    %rdx,%rax
  and    $0xfff,%eax
  sub    %rax,%rsp
  test   %rax,%rax
  je     L70
  orq    $0x0,-0x8(%rsp,%rax,1)
L70:
  mov    %r15,%rsi
  mov    %r13,%rdi
  mov    %rsp,%r14
  call   <strcasecmp@plt>
  test   %rax,%rax
  jne    L295
  mov    -0x778(%rbp),%rsi
  lea    D112(%rip),%rdi
  call   <printf@plt>
L119:
  mov    -0x770(%rbp),%rdi
  lea    D48(%rip),%rsi
  call   <strcasecmp@plt>
  test   %rax,%rax
  je     L147
L2:
  mov    %rbx,%rsp
  jmp    L41
  nopl   (%rax)
L201:
  cmpl   $0xffffffff,-0x764(%rbp)
  jne    L250
L19:
  mov    %r12d,%edi
  call   <bad_request@plt>
  jmp    L41
L59:
  lea    -0x540(%rbp),%r12
  mov    -0x764(%rbp),%edx
  lea    D20(%rip),%rsi
  mov    %r12,%rdi
  call   <sprintf@plt>
  mov    %r12,%rdi
  call   <putenv@plt>
  jmp    L3
L295:
  lea    D28(%rip),%rsi
  mov    %r13,%rdi
  call   <strcasecmp@plt>
  test   %rax,%rax
  jne    L119
  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    L119
L147:
  mov    -0x764(%rbp),%esi
  mov    %r14,%rdi
  call   <processMotorControl@plt>
  jmp    L2
L390:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: disassemble_data
arguments: tag: D45
type: string
name: disassemble_data
arguments: tag: D41
type: string
name: disassemble_data
arguments: tag: D74
type: byte[16]
name: disassemble_data
arguments: tag: D7
type: string
name: disassemble_data
arguments: tag: D28
type: string
name: disassemble_data
arguments: tag: D23
type: string
name: disassemble_data
arguments: tag: D109
type: string
name: disassemble_data
arguments: tag: D112
type: string
name: disassemble_data
arguments: tag: D48
type: string
name: disassemble_data
arguments: tag: D20
type: string

tool: D45: GET

tool: D41: 


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

tool: D7: REQUEST_METHOD=%s

tool: D28: POST

tool: D23: Content-Length:

tool: D109: QUERY_STRING=%s

tool: D112: C GET: %s


tool: D48: htdocs/motor_control.c

tool: D20: 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);
  }
}
```