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

```asm
<xp_printf_get_type>:
  endbr64
  mov    (%rdi),%rax
  mov    $0x0,%ecx
  test   %rax,%rax
  je     L609
  add    %rax,%rdi
  cmpb   $0x25,(%rdi)
  jne    L609
  lea    0x2(%rdi),%rax
  lea    D10(%rip),%rdi
  jmp    L544
  add    $0x1,%rax
L544:
  lea    -0x1(%rax),%rsi
  movzbl -0x1(%rax),%edx
  lea    -0x20(%rdx),%ecx
  cmp    $0x10,%cl
  ja     L2
  movzbl %cl,%ecx
  movslq (%rdi,%rcx,4),%rcx
  add    %rdi,%rcx
  notrack jmp *%rcx
L2:
  mov    $0x1,%ecx
  cmp    $0x2a,%dl
  je     L609
  lea    -0x30(%rdx),%eax
  cmp    $0x9,%al
  ja     L288
L224:
  add    $0x1,%rsi
  movzbl (%rsi),%edx
  lea    -0x30(%rdx),%eax
  cmp    $0x9,%al
  jbe    L224
L288:
  cmp    $0x2e,%dl
  jne    L552
  lea    0x1(%rsi),%rax
  movzbl 0x1(%rsi),%edx
  mov    $0x1,%ecx
  cmp    $0x2a,%dl
  je     L609
  lea    -0x30(%rdx),%ecx
  cmp    $0x9,%cl
  ja     L373
L265:
  add    $0x1,%rax
  movzbl (%rax),%edx
  lea    -0x30(%rdx),%ecx
  cmp    $0x9,%cl
  jbe    L265
L373:
  sub    $0x4c,%edx
  cmp    $0x2e,%dl
  ja     L230
  movzbl %dl,%edx
  lea    D46(%rip),%rcx
  movslq (%rcx,%rdx,4),%rdx
  add    %rcx,%rdx
  notrack jmp *%rdx
  cmpb   $0x68,0x1(%rax)
  je     L517
  add    $0x1,%rax
  mov    $0x68,%edx
  jmp    L146
L517:
  add    $0x2,%rax
  mov    $0x6868,%edx
  jmp    L146
  movzbl 0x1(%rax),%edx
  cmp    $0x6c,%dl
  je     L408
  sub    $0x41,%edx
  cmp    $0x37,%dl
  ja     L501
  movzbl %dl,%edx
  lea    D5(%rip),%rcx
  movslq (%rcx,%rdx,4),%rax
  add    %rcx,%rax
  notrack jmp *%rax
L408:
  add    $0x2,%rax
  mov    $0x6c6c,%edx
  jmp    L42
  movzbl 0x1(%rax),%eax
  sub    $0x41,%eax
  cmp    $0x37,%al
  ja     L217
  movzbl %al,%eax
  lea    D36(%rip),%rdx
  movslq (%rdx,%rax,4),%rax
  add    %rdx,%rax
  notrack jmp *%rax
L217:
  mov    $0x0,%ecx
  jmp    L609
  add    $0x1,%rax
  mov    $0x74,%edx
L42:
  movzbl (%rax),%eax
  sub    $0x41,%eax
  cmp    $0x37,%al
  ja     L124
  movzbl %al,%eax
  lea    D25(%rip),%rcx
  movslq (%rcx,%rax,4),%rax
  add    %rcx,%rax
  notrack jmp *%rax
  add    $0x1,%rax
  mov    $0x7a,%edx
  jmp    L42
  add    $0x1,%rax
  mov    $0x4c,%edx
  jmp    L146
L230:
  mov    $0x0,%edx
L146:
  movzbl (%rax),%eax
  sub    $0x41,%eax
  cmp    $0x37,%al
  ja     L133
  movzbl %al,%eax
  lea    D9(%rip),%rcx
  movslq (%rcx,%rax,4),%rax
  add    %rcx,%rax
  notrack jmp *%rax
L133:
  mov    $0x0,%ecx
L609:
  mov    %ecx,%eax
  ret
  mov    $0xb,%ecx
  jmp    L609
  mov    $0x3,%ecx
  jmp    L609
  mov    $0x3,%ecx
  jmp    L609
  mov    $0x4,%ecx
  cmp    $0x7a,%edx
  je     L609
  jg     L382
  mov    $0xe,%ecx
  cmp    $0x74,%edx
  je     L609
  mov    $0x1,%ecx
  jg     L609
  cmp    $0x6a,%edx
  je     L181
  cmp    $0x6c,%edx
  sete   %cl
  movzbl %cl,%ecx
  lea    0x1(%rcx,%rcx,2),%ecx
  jmp    L609
L382:
  cmp    $0x6c6c,%edx
  sete   %cl
  movzbl %cl,%ecx
  lea    0x1(%rcx,%rcx,4),%ecx
  jmp    L609
  mov    $0x6a,%edx
L490:
  cmp    $0x74,%edx
  je     L447
  jle    L635
  mov    $0xf,%ecx
  cmp    $0x7a,%edx
  je     L609
  cmp    $0x6c6c,%edx
  sete   %cl
  movzbl %cl,%ecx
  lea    0x2(%rcx,%rcx,4),%ecx
  jmp    L609
  mov    $0x6c,%edx
  jmp    L490
L635:
  mov    $0xd,%ecx
  cmp    $0x6a,%edx
  je     L609
  cmp    $0x6c,%edx
  sete   %cl
  movzbl %cl,%ecx
  lea    0x2(%rcx,%rcx,2),%ecx
  jmp    L609
  mov    $0x6a,%edx
L391:
  cmp    $0x4c,%edx
  sete   %cl
  movzbl %cl,%ecx
  add    $0x9,%ecx
  jmp    L609
  mov    $0x6c,%edx
  jmp    L391
  mov    $0x3,%ecx
  jmp    L609
  mov    $0x3,%ecx
  jmp    L609
  mov    $0x8,%ecx
  jmp    L609
  mov    $0x8,%ecx
  jmp    L609
  mov    $0xb,%ecx
  jmp    L609
  mov    $0xc,%ecx
  jmp    L609
  mov    $0x8,%ecx
  jmp    L609
L181:
  mov    $0xc,%ecx
  jmp    L609
L447:
  mov    $0x5,%ecx
  jmp    L609
  mov    $0x8,%ecx
  jmp    L609
  mov    $0x8,%ecx
  jmp    L609
L124:
  mov    $0x0,%ecx
  jmp    L609
  mov    $0xb,%ecx
  jmp    L609
  mov    $0x3,%ecx
  jmp    L609
  mov    $0x3,%ecx
  jmp    L609
  mov    $0x9,%ecx
  jmp    L609
L501:
  mov    $0x0,%ecx
  jmp    L609
  mov    $0xb,%ecx
  jmp    L609
  mov    $0x4,%ecx
  jmp    L609
  mov    $0x3,%ecx
  jmp    L609
  mov    $0x3,%ecx
  jmp    L609
L552:
  movzbl (%rsi),%edx
  mov    %rsi,%rax
  jmp    L373
```

assistant: ```c
int xp_printf_get_type(const char *format) {
  const char *p;
  int modifier = 0;
  int j;
  int correct_type = 0;
  if (!*(size_t *)format)
    return (0);
  p = format + *(size_t *)format;
  if (*p != '%')
    return (0);
  p++;
  j = 1;
  while (j) {
    switch (*p) {
    case '#':
      p++;
      break;
    case '-':
      p++;
      break;
    case '+':
      p++;
      break;
    case ' ':
      p++;
      break;
    case '0':
      p++;
      break;
    case '\'':
      p++;
      break;
    default:
      j = 0;
      break;
    }
  }
  if (*p == '*')
    return (1);
  while (*p >= '0' && *p <= '9')
    p++;
  if (*p == '.') {
    p++;
    if (*p == '*')
      return (1);
  }
  while (*p >= '0' && *p <= '9')
    p++;
  switch (*p) {
  case 'h':
    modifier = 'h';
    p++;
    if (*p == 'h') {
      p++;
      modifier += 'h' << 8;
    }
    break;
  case 'l':
    modifier = 'l';
    p++;
    if (*p == 'l') {
      p++;
      modifier += 'l' << 8;
    }
    break;
  case 'j':
    modifier = 'j';
    p++;
    break;
  case 't':
    modifier = 't';
    p++;
    break;
  case 'z':
    modifier = 'z';
    p++;
    break;
  case 'L':
    modifier = 'L';
    p++;
    break;
  }
  switch (*p) {
  case 'd':
  case 'i':
    switch (modifier) {
    case 'h' | 'h' << 8:
      correct_type = 1;
      break;
    case 'h':
      correct_type = 1;
      break;
    case 'l':
      correct_type = 4;
      break;
    case 'l' | 'l' << 8:
      correct_type = 6;
      break;
    case 'j':
      correct_type = 12;
      break;
    case 't':
      correct_type = 14;
      break;
    case 'z':
      correct_type = 4;
      break;
    default:
      correct_type = 1;
      break;
    }
    break;
  case 'o':
  case 'u':
  case 'x':
  case 'X':
    switch (modifier) {
    case 'h' | 'h' << 8:
      correct_type = 2;
      break;
    case 'h':
      correct_type = 2;
      break;
    case 'l':
      correct_type = 5;
      break;
    case 'l' | 'l' << 8:
      correct_type = 7;
      break;
    case 'j':
      correct_type = 13;
      break;
    case 't':
      correct_type = 5;
      break;
    case 'z':
      correct_type = 15;
      break;
    default:
      correct_type = 2;
      break;
    }
    break;
  case 'a':
  case 'A':
  case 'e':
  case 'E':
  case 'f':
  case 'F':
  case 'g':
  case 'G':
    switch (modifier) {
    case 'L':
      correct_type = 10;
      break;
    case 'l':
    default:
      correct_type = 9;
      break;
    }
    break;
  case 'C':
    correct_type = 3;
    break;
  case 'c':
    switch (modifier) {
    case 'l':
    default:
      correct_type = 3;
    }
    break;
  case 'S':
    correct_type = 8;
    break;
  case 's':
    switch (modifier) {
    case 'l':
    default:
      correct_type = 8;
    }
    break;
  case 'p':
    correct_type = 11;
    break;
  }
  return (correct_type);
}
```