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

```asm
<ffinttyp>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %rdx,0x8(%rsp)
  mov    (%rcx),%eax
  test   %eax,%eax
  jg     L50
  mov    %rdi,%rbp
  mov    %rsi,%r14
  mov    %rcx,%r12
  movl   $0x0,(%rsi)
  movl   $0x0,(%rdx)
  movzbl (%rdi),%eax
  cmp    $0x2b,%al
  je     L215
  cmp    $0x2d,%al
  je     L84
L127:
  cmpb   $0x30,0x0(%rbp)
  jne    L603
L612:
  add    $0x1,%rbp
  movzbl 0x0(%rbp),%eax
  cmp    $0x30,%al
  je     L612
  test   %al,%al
  je     L125
L603:
  mov    %rbp,%rdi
  call   <strlen@plt>
  mov    %eax,%r15d
  test   %eax,%eax
  jle    L196
  mov    %rbp,%rbx
  lea    -0x1(%rax),%eax
  lea    0x1(%rbp,%rax,1),%r13
L465:
  movsbl (%rbx),%edi
  call   <isdigit@plt>
  test   %eax,%eax
  je     L248
  add    $0x1,%rbx
  cmp    %r13,%rbx
  jne    L465
  cmp    $0x2,%r15d
  jg     L163
L396:
  movl   $0xc,(%r14)
  jmp    L384
L215:
  add    $0x1,%rbp
  jmp    L127
L84:
  add    $0x1,%rbp
  mov    0x8(%rsp),%rax
  movl   $0x1,(%rax)
  jmp    L127
L125:
  movl   $0xc,(%r14)
  mov    (%r12),%eax
  jmp    L50
L248:
  movl   $0x193,(%r12)
  mov    $0x193,%eax
  jmp    L50
L196:
  jne    L396
  movl   $0xcc,(%r12)
L384:
  mov    (%r12),%eax
L50:
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L163:
  cmp    $0x4,%r15d
  je     L333
  lea    -0x6(%r15),%eax
  cmp    $0x3,%eax
  ja     L309
  movl   $0x1f,(%r14)
  jmp    L384
L333:
  movl   $0x15,(%r14)
  jmp    L384
L309:
  lea    -0xb(%r15),%eax
  cmp    $0x7,%eax
  ja     L195
  movl   $0x51,(%r14)
  jmp    L384
L195:
  cmp    $0x14,%r15d
  jle    L6
  movl   $0x193,(%r12)
  jmp    L384
L6:
  mov    0x8(%rsp),%rax
  cmpl   $0x0,(%rax)
  jne    L472
  sub    $0x3,%r15d
  cmp    $0x11,%r15d
  ja     L384
  mov    %r15d,%r15d
  lea    D50(%rip),%rdx
  movslq (%rdx,%r15,4),%rax
  add    %rdx,%rax
  notrack jmp *%rax
  lea    D29(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jg     L495
  movl   $0xc,(%r14)
  jmp    L384
L495:
  lea    D6(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jle    L371
  movl   $0x15,(%r14)
  jmp    L384
L371:
  movl   $0xb,(%r14)
  jmp    L384
  lea    D124(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jg     L306
  movl   $0x15,(%r14)
  jmp    L384
L306:
  lea    D15(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jle    L428
  movl   $0x1f,(%r14)
  jmp    L384
L428:
  movl   $0x14,(%r14)
  jmp    L384
  lea    D48(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jg     L625
  movl   $0x1f,(%r14)
  jmp    L384
L625:
  lea    D32(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jle    L329
  movl   $0x51,(%r14)
  jmp    L384
L329:
  movl   $0x1e,(%r14)
  jmp    L384
  lea    D92(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jle    L366
  movl   $0x50,(%r14)
  jmp    L384
L366:
  movl   $0x51,(%r14)
  jmp    L384
  lea    D118(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jle    L256
  movl   $0x193,(%r12)
  jmp    L384
L256:
  movl   $0x50,(%r14)
  jmp    L384
L472:
  cmp    $0x3,%r15d
  je     L576
  cmp    $0x5,%r15d
  je     L8
  cmp    $0xa,%r15d
  je     L9
  cmp    $0x13,%r15d
  jne    L384
  lea    D85(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jle    L104
  movl   $0x193,(%r12)
  jmp    L384
L576:
  lea    D89(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jle    L323
  movl   $0x15,(%r14)
  jmp    L384
L323:
  movl   $0xc,(%r14)
  jmp    L384
L8:
  lea    D95(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jle    L522
  movl   $0x1f,(%r14)
  jmp    L384
L522:
  movl   $0x15,(%r14)
  jmp    L384
L9:
  lea    D16(%rip),%rsi
  mov    %rbp,%rdi
  call   <strcmp@plt>
  test   %rax,%rax
  jle    L92
  movl   $0x51,(%r14)
  jmp    L384
L92:
  movl   $0x1f,(%r14)
  jmp    L384
L104:
  movl   $0x51,(%r14)
  jmp    L384
```

tool_calls: name: unpack_data
arguments: data_label: D29
data_type: string
name: unpack_data
arguments: data_label: D6
data_type: string
name: unpack_data
arguments: data_label: D124
data_type: string
name: unpack_data
arguments: data_label: D15
data_type: string
name: unpack_data
arguments: data_label: D48
data_type: string
name: unpack_data
arguments: data_label: D32
data_type: string
name: unpack_data
arguments: data_label: D92
data_type: string
name: unpack_data
arguments: data_label: D118
data_type: string
name: unpack_data
arguments: data_label: D85
data_type: string
name: unpack_data
arguments: data_label: D89
data_type: string
name: unpack_data
arguments: data_label: D95
data_type: string
name: unpack_data
arguments: data_label: D16
data_type: string

tool: D29: 127

tool: D6: 255

tool: D124: 32767

tool: D15: 65535

tool: D48: 2147483647

tool: D32: 4294967295

tool: D92: 9223372036854775807

tool: D118: 18446744073709551615

tool: D85: 9223372036854775808

tool: D89: 128

tool: D95: 32768

tool: D16: 2147483648

assistant: ```c
int ffinttyp(char *cval, int *dtype, int *negative, int *status) {
  int ii, len;
  char *p;
  if (*status > 0)
    return (*status);
  *dtype = 0;
  *negative = 0;
  p = cval;
  if (*p == '+') {
    p++;
  } else if (*p == '-') {
    p++;
    *negative = 1;
  }
  if (*p == '0') {
    while (*p == '0')
      p++;
    if (*p == 0) {
      *dtype = 12;
      return (*status);
    }
  }
  len = strlen(p);
  for (ii = 0; ii < len; ii++) {
    if (!isdigit(*(p + ii))) {
      *status = 403;
      return (*status);
    }
  }
  if (len == 0) {
    *status = 204;
  } else if (len < 3) {
    *dtype = 12;
  } else if (len == 4) {
    *dtype = 21;
  } else if (len > 5 && len < 10) {
    *dtype = 31;
  } else if (len > 10 && len < 19) {
    *dtype = 81;
  } else if (len > 20) {
    *status = 403;
  } else {
    if (!(*negative)) {
      if (len == 3) {
        if (strcmp(p, "127") <= 0) {
          *dtype = 12;
        } else if (strcmp(p, "255") <= 0) {
          *dtype = 11;
        } else {
          *dtype = 21;
        }
      } else if (len == 5) {
        if (strcmp(p, "32767") <= 0) {
          *dtype = 21;
        } else if (strcmp(p, "65535") <= 0) {
          *dtype = 20;
        } else {
          *dtype = 31;
        }
      } else if (len == 10) {
        if (strcmp(p, "2147483647") <= 0) {
          *dtype = 31;
        } else if (strcmp(p, "4294967295") <= 0) {
          *dtype = 30;
        } else {
          *dtype = 81;
        }
      } else if (len == 19) {
        if (strcmp(p, "9223372036854775807") <= 0) {
          *dtype = 81;
        } else {
          *dtype = 80;
        }
      } else if (len == 20) {
        if (strcmp(p, "18446744073709551615") <= 0) {
          *dtype = 80;
        } else {
          *status = 403;
        }
      }
    } else {
      if (len == 3) {
        if (strcmp(p, "128") <= 0) {
          *dtype = 12;
        } else {
          *dtype = 21;
        }
      } else if (len == 5) {
        if (strcmp(p, "32768") <= 0) {
          *dtype = 21;
        } else {
          *dtype = 31;
        }
      } else if (len == 10) {
        if (strcmp(p, "2147483648") <= 0) {
          *dtype = 31;
        } else {
          *dtype = 81;
        }
      } else if (len == 19) {
        if (strcmp(p, "9223372036854775808") <= 0) {
          *dtype = 81;
        } else {
          *status = 403;
        }
      }
    }
  }
  return (*status);
}
```