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

```asm
<get_pid_query>:
  endbr64
  push   %r12
  push   %rbp
  mov    %rdi,%rbp
  sub    $0x8,%rsp
  call   <strlen@plt>
  mov    %eax,%r12d
  sub    $0x28,%eax
  cmp    $0x3c0,%eax
  ja     L110
  cmpb   $0x47,0x0(%rbp)
  jne    L112
  cmpb   $0x45,0x1(%rbp)
  jne    L112
  cmpb   $0x54,0x2(%rbp)
  jne    L112
  cmpb   $0x3f,0x5(%rbp)
  jne    L68
  cmpb   $0x0,0x6(%rbp)
  jne    L68
L191:
  lea    D3(%rip),%rdi
  call   <log_all@plt>
  add    $0x8,%rsp
  xor    %eax,%eax
  pop    %rbp
  pop    %r12
  ret
  nopl   0x0(%rax,%rax,1)
L112:
  lea    D56(%rip),%rdi
  call   <log_all@plt>
L254:
  add    $0x8,%rsp
  xor    %eax,%eax
  pop    %rbp
  pop    %r12
  ret
  cs nopw 0x0(%rax,%rax,1)
L68:
  cmpb   $0x70,0x6(%rbp)
  je     L83
L137:
  cmpb   $0x69,0x7(%rbp)
  je     L85
L178:
  cmpb   $0x64,0x8(%rbp)
  je     L129
L130:
  cmpb   $0x3d,0x9(%rbp)
  jne    L277
  cmpb   $0x0,0xa(%rbp)
  je     L191
L277:
  mov    %rbp,%rdi
  lea    D31(%rip),%rsi
  call   <strstr@plt>
  mov    %rax,%rbp
  test   %rax,%rax
  je     L139
  mov    $0x8,%edi
  call   <malloc@plt>
  mov    %rax,%r12
  movzbl 0x4(%rbp),%eax
  cmp    $0x20,%al
  je     L65
  mov    %al,(%r12)
  movzbl 0x5(%rbp),%eax
  cmp    $0x20,%al
  je     L65
  mov    %al,0x1(%r12)
  movzbl 0x6(%rbp),%eax
  cmp    $0x20,%al
  je     L65
  mov    %al,0x2(%r12)
  movzbl 0x7(%rbp),%eax
  cmp    $0x20,%al
  je     L65
  mov    %al,0x3(%r12)
  movzbl 0x8(%rbp),%eax
  cmp    $0x20,%al
  je     L65
  mov    %al,0x4(%r12)
  movzbl 0x9(%rbp),%eax
  cmp    $0x20,%al
  je     L65
  mov    %al,0x5(%r12)
  movzbl 0xa(%rbp),%eax
  cmp    $0x20,%al
  je     L65
  mov    %al,0x6(%r12)
  movzbl 0xb(%rbp),%eax
  cmp    $0x20,%al
  je     L65
  mov    %al,0x7(%r12)
L65:
  mov    %r12,%rdi
  call   <strlen@plt>
  add    $0x8,%rsp
  mov    %r12,%rdi
  pop    %rbp
  mov    %eax,%esi
  pop    %r12
  jmp    10d0 <realloc@plt>
  nopw   0x0(%rax,%rax,1)
L83:
  cmpb   $0x0,0x7(%rbp)
  jne    L137
  jmp    L191
  nopw   0x0(%rax,%rax,1)
L85:
  cmpb   $0x0,0x8(%rbp)
  jne    L178
  jmp    L191
  nop
L129:
  cmpb   $0x0,0x9(%rbp)
  jne    L130
  jmp    L191
  nop
L110:
  lea    D1(%rip),%rdi
  call   <log_all@plt>
  mov    %r12d,%esi
  lea    D8(%rip),%rdi
  call   <printf@plt>
  jmp    L254
L139:
  lea    D57(%rip),%rdi
  call   <log_all@plt>
  jmp    L254
```

tool_calls: name: disassemble_data
arguments: data_tag: D3
type: string
name: disassemble_data
arguments: data_tag: D56
type: string
name: disassemble_data
arguments: data_tag: D31
type: string
name: disassemble_data
arguments: data_tag: D1
type: string
name: disassemble_data
arguments: data_tag: D8
type: string
name: disassemble_data
arguments: data_tag: D57
type: string

tool: D3: String contains no PID query

tool: D56: String contains no GET specification

tool: D31: pid=

tool: D1: String is out of bounds

tool: D8: %d


tool: D57: Could not locate substring in request

assistant: ```c
char *get_pid_query(char *req) {
  int headers_len = strlen(req);
  if (headers_len > 1000 || headers_len < 40) {
    log_all("String is out of bounds");
    printf("%d\n", headers_len);
    return NULL;
  } else {
    if (req[0] != 'G' || req[1] != 'E' || req[2] != 'T') {
      log_all("String contains no GET specification");
      return NULL;
    } else if (!strcmp(&req[5], "?") || !strcmp(&req[6], "p") || !strcmp(&req[7], "i") || !strcmp(&req[8], "d") || !strcmp(&req[9], "=")) {
      log_all("String contains no PID query");
      return NULL;
    } else {
      char *sreq = strstr(req, "pid=");
      if (sreq != NULL) {
        char *pid = malloc(8);
        int i = 4;
        while ((sreq + i)[0] != ' ' && i < 12) {
          pid[i - 4] = sreq[i];
          i++;
        }
        int pidlen = strlen(pid);
        if (pidlen > 3 || pidlen < 8) {
          pid = realloc(pid, pidlen);
          return pid;
        } else {
          free(pid);
          return NULL;
        }
      } else {
        log_all("Could not locate substring in request");
        return NULL;
      }
    }
  }
}
```