user: Please show me the C implementation that matches the assembly code listed below:

```asm
<execute_cgi>:
  endbr64
  push   %r15
  lea    D3(%rip),%r15
  push   %r14
  push   %r13
  mov    %rdx,%r13
  push   %r12
  mov    %rsi,%r12
  mov    %r15,%rsi
  push   %rbp
  mov    %rdi,%rbp
  mov    %rdx,%rdi
  push   %rbx
  lea    D55(%rip),%rbx
  sub    $0xa28,%rsp
  mov    %rcx,0x8(%rsp)
  mov    $0x41,%ecx
  lea    0x210(%rsp),%r14
  mov    %fs:0x28,%rax
  mov    %rax,0xa18(%rsp)
  xor    %eax,%eax
  mov    %cx,0x210(%rsp)
  call   <strcasecmp@plt>
  test   %rax,%rax
  jne    L148
  nopl   (%rax)
L157:
  mov    %r14,%rsi
  mov    %rbx,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L205
  mov    $0x400,%edx
  mov    %r14,%rsi
  mov    %rbp,%rdi
  call   <get_line@plt>
  test   %rax,%rax
  jg     L157
L205:
  movq   $0xffffffffffffffff,(%rsp)
L171:
  movdqa D11(%rip),%xmm0
  mov    $0xa,%eax
  mov    %r14,%rdi
  mov    %ax,0x220(%rsp)
  movaps %xmm0,0x210(%rsp)
  call   <strlen@plt>
  xor    %ecx,%ecx
  mov    %r14,%rsi
  mov    %rbp,%rdi
  mov    %eax,%edx
  call   <send@plt>
  mov    %r12,%rdi
  call   <strlen@plt>
  cltq
  cmpb   $0x2e,-0x2(%r12,%rax,1)
  je     L52
L91:
  lea    0x10(%rsp),%rbp
  lea    D67(%rip),%rsi
  mov    %r13,%rdx
  xor    %eax,%eax
  mov    %rbp,%rdi
  call   <sprintf@plt>
  mov    %rbp,%rdi
  call   <putenv@plt>
  mov    %r15,%rsi
  mov    %r13,%rdi
  call   <strcasecmp@plt>
  test   %rax,%rax
  je     L255
  lea    D30(%rip),%rsi
  mov    %r13,%rdi
  call   <strcasecmp@plt>
  test   %rax,%rax
  je     L13
L28:
  mov    %r12,%rdi
  xor    %edx,%edx
  mov    %r12,%rsi
  call   <execl@plt>
  xor    %edi,%edi
  call   <exit@plt>
L6:
  mov    0xa18(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L32
  add    $0xa28,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  nopl   (%rax)
L255:
  lea    0x110(%rsp),%rbp
  mov    0x8(%rsp),%rdx
  lea    D29(%rip),%rsi
  mov    %rbp,%rdi
  call   <sprintf@plt>
  mov    %rbp,%rdi
  call   <putenv@plt>
  jmp    L28
  cs nopw 0x0(%rax,%rax,1)
L52:
  mov    %r12,%rdi
  call   <strlen@plt>
  cltq
  cmpb   $0x63,-0x1(%r12,%rax,1)
  jne    L91
  mov    %r15,%rsi
  mov    %r13,%rdi
  call   <strcasecmp@plt>
  test   %rax,%rax
  je     L39
  lea    D30(%rip),%rsi
  mov    %r13,%rdi
  call   <strcasecmp@plt>
  test   %rax,%rax
  je     L192
L242:
  lea    D79(%rip),%rsi
  mov    %r12,%rdi
  call   <strcasecmp@plt>
  test   %rax,%rax
  jne    L6
  lea    0x610(%rsp),%rdi
  call   <processMotorControl@plt>
  jmp    L6
  nopl   0x0(%rax)
L148:
  lea    D30(%rip),%rsi
  mov    %r13,%rdi
  call   <strcasecmp@plt>
  test   %rax,%rax
  jne    L205
  mov    $0x400,%edx
  mov    %r14,%rsi
  mov    %rbp,%rdi
  call   <get_line@plt>
  movq   $0xffffffffffffffff,(%rsp)
  test   %rax,%rax
  jg     L41
  jmp    L142
  nopw   0x0(%rax,%rax,1)
L251:
  mov    $0x400,%edx
  mov    %r14,%rsi
  mov    %rbp,%rdi
  call   <get_line@plt>
  test   %rax,%rax
  jle    L37
L41:
  mov    %r14,%rsi
  mov    %rbx,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  je     L37
  lea    D105(%rip),%rsi
  mov    %r14,%rdi
  movb   $0x0,0x21f(%rsp)
  call   <strcasecmp@plt>
  test   %rax,%rax
  jne    L251
  lea    0x220(%rsp),%rdi
  call   <atoi@plt>
  mov    %rax,(%rsp)
  jmp    L251
  nopl   0x0(%rax)
L13:
  lea    0x610(%rsp),%rbp
  mov    (%rsp),%rdx
  lea    D54(%rip),%rsi
  mov    %rbp,%rdi
  call   <sprintf@plt>
  mov    %rbp,%rdi
  call   <putenv@plt>
  jmp    L28
L37:
  cmpq   $0xffffffffffffffff,(%rsp)
  jne    L171
L142:
  mov    %rbp,%rdi
  call   <bad_request@plt>
  jmp    L6
L39:
  mov    0x8(%rsp),%rsi
  lea    D76(%rip),%rdi
  call   <printf@plt>
  jmp    L242
L192:
  lea    0x610(%rsp),%rbx
  mov    $0x400,%edx
  xor    %esi,%esi
  mov    %rbx,%rdi
  call   <memset@plt>
  mov    (%rsp),%rax
  test   %rax,%rax
  jle    L242
  add    %rbx,%rax
  mov    %rax,%r13
  nopl   0x0(%rax,%rax,1)
L262:
  mov    %rbx,%rsi
  xor    %ecx,%ecx
  mov    $0x1,%edx
  mov    %rbp,%rdi
  call   <recv@plt>
  add    $0x1,%rbx
  cmp    %r13,%rbx
  jne    L262
  jmp    L242
L32:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: retrieve_data
arguments: tag: D3
type: string
name: retrieve_data
arguments: tag: D55
type: string
name: retrieve_data
arguments: tag: D11
type: byte[16]
name: retrieve_data
arguments: tag: D67
type: string
name: retrieve_data
arguments: tag: D30
type: string
name: retrieve_data
arguments: tag: D29
type: string
name: retrieve_data
arguments: tag: D79
type: string
name: retrieve_data
arguments: tag: D105
type: string
name: retrieve_data
arguments: tag: D54
type: string
name: retrieve_data
arguments: tag: D76
type: string

tool: D3: GET

tool: D55: 


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

tool: D67: REQUEST_METHOD=%s

tool: D30: POST

tool: D29: QUERY_STRING=%s

tool: D79: htdocs/motor_control.c

tool: D105: Content-Length:

tool: D54: CONTENT_LENGTH=%d

tool: D76: C GET: %s


assistant: ```c
void execute_cgi(int32_t client, const char *path, const char *method, const char *query_string) {
  char buf[1024];
  int32_t i;
  int32_t numchars = 1;
  int32_t content_length = -1;
  char postContent[1024];
  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 (path[strlen(path) - 2] == '.' && path[strlen(path) - 1] == 'c') {
    if (strcasecmp(method, "GET") == 0) {
      printf("C GET: %s\n", query_string);
    } else if (strcasecmp(method, "POST") == 0) {
      memset(postContent, 0, sizeof(postContent));
      for (i = 0; i < content_length; i++) {
        recv(client, &postContent[i], 1, 0);
      }
    }
    if (0 == strcasecmp(path, "htdocs/motor_control.c")) {
      processMotorControl(postContent);
    }
  } else {
    char meth_env[255];
    char query_env[255];
    char length_env[255];
    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);
  }
}
```