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

```asm
<do_blob_header>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  xor    %r12d,%r12d
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  mov    (%rdi),%rax
  mov    %rax,(%rsp)
  cmp    $0xf,%esi
  jbe    L136
  mov    %rdx,%r13
  movzbl (%rax),%edx
  mov    %rdi,%rbx
  mov    %rcx,%r15
  mov    %r8,%r14
  mov    %r9,%rbp
  cmp    $0x6,%dl
  je     L128
  cmp    $0x7,%dl
  jne    L136
  xor    %edx,%edx
  cmpl   $0x1,(%r9)
  je     L16
L155:
  mov    %edx,0x0(%rbp)
  lea    0x2(%rax),%rdx
  mov    %rdx,(%rsp)
  cmpb   $0x2,0x1(%rax)
  jne    L153
  mov    %rsp,%r12
  add    $0x8,%rax
  mov    %r12,%rdi
  mov    %rax,(%rsp)
  call   <read_ledword@plt>
  mov    %r12,%rdi
  mov    %eax,0x0(%r13)
  call   <read_ledword@plt>
  mov    %eax,(%r15)
  cmp    $0x10000,%eax
  ja     L15
  movl   $0x0,(%r14)
  mov    0x0(%r13),%eax
  cmp    $0x32415352,%eax
  je     L127
  ja     L73
  cmp    $0x31415352,%eax
  je     L14
  cmp    $0x31535344,%eax
  jne    L0
  movl   $0x1,(%r14)
L14:
  mov    0x0(%rbp),%r12d
  test   %r12d,%r12d
  je     L45
L124:
  mov    (%rsp),%rax
  mov    $0x1,%r12d
  mov    %rax,(%rbx)
L136:
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L195
  add    $0x18,%rsp
  mov    %r12d,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
  cs nopw 0x0(%rax,%rax,1)
L128:
  mov    (%r9),%r12d
  mov    $0x1,%edx
  test   %r12d,%r12d
  jne    L155
L45:
  mov    D28(%rip),%rax
  mov    (%rax),%edi
  call   <PEMerror@plt>
  jmp    L136
  nopl   0x0(%rax)
L153:
  mov    D21(%rip),%rax
  xor    %r12d,%r12d
  mov    (%rax),%edi
  call   <PEMerror@plt>
  jmp    L136
  nopl   0x0(%rax,%rax,1)
L73:
  cmp    $0x32535344,%eax
  jne    L0
  movl   $0x1,(%r14)
L127:
  cmpl   $0x1,0x0(%rbp)
  jne    L124
  mov    D18(%rip),%rax
  xor    %r12d,%r12d
  mov    (%rax),%edi
  call   <PEMerror@plt>
  jmp    L136
  xchg   %ax,%ax
L16:
  mov    D18(%rip),%rax
  mov    (%rax),%edi
  call   <PEMerror@plt>
  jmp    L136
  nopl   0x0(%rax,%rax,1)
L15:
  mov    D29(%rip),%rax
  xor    %r12d,%r12d
  mov    (%rax),%edi
  call   <PEMerror@plt>
  jmp    L136
  xchg   %ax,%ax
L0:
  mov    D57(%rip),%rax
  mov    $0xffffffff,%r12d
  mov    (%rax),%edi
  call   <PEMerror@plt>
  jmp    L136
L195:
  call   <__stack_chk_fail@plt>
```

assistant: ```c
int do_blob_header(const unsigned char **in, unsigned int length, unsigned int *pmagic, unsigned int *pbitlen, int *pisdss, int *pispub) {
  const unsigned char *p = *in;
  if (length < 16)
    return 0;
  if (*p == 0x6) {
    if (*pispub == 0) {
      PEMerror(PEM_R_EXPECTING_PRIVATE_KEY_BLOB);
      return 0;
    }
    *pispub = 1;
  } else if (*p == 0x7) {
    if (*pispub == 1) {
      PEMerror(PEM_R_EXPECTING_PUBLIC_KEY_BLOB);
      return 0;
    }
    *pispub = 0;
  } else
    return 0;
  p++;
  if (*p++ != 0x2) {
    PEMerror(PEM_R_BAD_VERSION_NUMBER);
    return 0;
  }
  p += 6;
  *pmagic = read_ledword(&p);
  *pbitlen = read_ledword(&p);
  if (*pbitlen > 65536) {
    PEMerror(PEM_R_INCONSISTENT_HEADER);
    return 0;
  }
  *pisdss = 0;
  switch (*pmagic) {
  case 0x31535344L:
    *pisdss = 1;
  case 0x31415352L:
    if (*pispub == 0) {
      PEMerror(PEM_R_EXPECTING_PRIVATE_KEY_BLOB);
      return 0;
    }
    break;
  case 0x32535344L:
    *pisdss = 1;
  case 0x32415352L:
    if (*pispub == 1) {
      PEMerror(PEM_R_EXPECTING_PUBLIC_KEY_BLOB);
      return 0;
    }
    break;
  default:
    PEMerror(PEM_R_BAD_MAGIC_NUMBER);
    return -1;
  }
  *in = p;
  return 1;
}
```