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

```asm
<cgi_check_strlen_x2>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  cmp    $0x41,%eax
  jle    L166
  mov    -0x18(%rbp),%rax
  mov    %rax,%rsi
  lea    D48(%rip),%rax
  mov    %rax,%rdi
  call   <cgi_error@plt>
  mov    $0x1,%eax
  jmp    L49
L166:
  movl   $0x0,-0x4(%rbp)
  movl   $0x0,-0xc(%rbp)
  movl   $0x0,-0x8(%rbp)
  jmp    L8
L129:
  mov    -0x4(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  cmp    $0x2f,%al
  jne    L94
  cmpl   $0x0,-0x8(%rbp)
  je     L125
  mov    -0x18(%rbp),%rax
  mov    %rax,%rsi
  lea    D49(%rip),%rax
  mov    %rax,%rdi
  call   <cgi_error@plt>
  mov    $0x1,%eax
  jmp    L49
L125:
  cmpl   $0x0,-0xc(%rbp)
  jne    L44
  mov    -0x18(%rbp),%rax
  mov    %rax,%rsi
  lea    D2(%rip),%rax
  mov    %rax,%rdi
  call   <cgi_error@plt>
  mov    $0x1,%eax
  jmp    L49
L44:
  mov    -0x18(%rbp),%rax
  mov    %rax,%rdi
  call   <strlen@plt>
  sub    $0x1,%eax
  cmp    %eax,-0x4(%rbp)
  jne    L68
  mov    -0x18(%rbp),%rax
  mov    %rax,%rsi
  lea    D24(%rip),%rax
  mov    %rax,%rdi
  call   <cgi_error@plt>
  mov    $0x1,%eax
  jmp    L49
L68:
  addl   $0x1,-0x8(%rbp)
L94:
  cmpl   $0x0,-0x8(%rbp)
  jne    L160
  addl   $0x1,-0xc(%rbp)
  jmp    L40
L160:
  addl   $0x1,-0x8(%rbp)
L40:
  cmpl   $0x20,-0xc(%rbp)
  jle    L130
  mov    -0x18(%rbp),%rax
  mov    %rax,%rsi
  lea    D36(%rip),%rax
  mov    %rax,%rdi
  call   <cgi_error@plt>
  mov    $0x1,%eax
  jmp    L49
L130:
  cmpl   $0x22,-0x8(%rbp)
  jle    L109
  mov    -0x18(%rbp),%rax
  mov    %rax,%rsi
  lea    D51(%rip),%rax
  mov    %rax,%rdi
  call   <cgi_error@plt>
  mov    $0x1,%eax
  jmp    L49
L109:
  addl   $0x1,-0x4(%rbp)
L8:
  mov    -0x4(%rbp),%eax
  movslq %eax,%rdx
  mov    -0x18(%rbp),%rax
  add    %rdx,%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L129
  mov    $0x0,%eax
L49:
  leave
  ret
```

tool_calls: name: extract_symbolic_data
arguments: tag: D48
type_infered: string
name: extract_symbolic_data
arguments: tag: D49
type_infered: string
name: extract_symbolic_data
arguments: tag: D2
type_infered: string
name: extract_symbolic_data
arguments: tag: D24
type_infered: string
name: extract_symbolic_data
arguments: tag: D36
type_infered: string
name: extract_symbolic_data
arguments: tag: D51
type_infered: string

tool: D48: Name exceeds 65 characters limit: %s

tool: D49: Zone or Family with base scope should have only one / : %s

tool: D2: Base part of the name is empty in %s

tool: D24: Zone or Family part of the name is empty in %s

tool: D36: Base part of the name exceed 32 chars limit: %s

tool: D51: Zone or Family part of the name exceed 32 chars limit: %s

assistant: ```c
int cgi_check_strlen_x2(char const *string) {
  int n1, n2, p;
  if (strlen(string) > 65) {
    cgi_error("Name exceeds 65 characters limit: %s", string);
    return 1;
  }
  p = 0;
  n1 = 0;
  n2 = 0;
  while (string[p]) {
    if (string[p] == '/') {
      if (n2 != 0) {
        cgi_error("Zone or Family with base scope should have only one / : %s", string);
        return 1;
      }
      if (n1 == 0) {
        cgi_error("Base part of the name is empty in %s", string);
        return 1;
      }
      if (p == strlen(string) - 1) {
        cgi_error("Zone or Family part of the name is empty in %s", string);
        return 1;
      }
      n2++;
    }
    if (!n2)
      n1++;
    else
      n2++;
    if (n1 > 32) {
      cgi_error("Base part of the name exceed 32 chars limit: %s", string);
      return 1;
    }
    if (n2 > 34) {
      cgi_error("Zone or Family part of the name exceed 32 chars limit: %s", string);
      return 1;
    }
    p++;
  }
  return 0;
}
```