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    L111
  mov    %rdx,%r13
  movzbl (%rax),%edx
  mov    %rdi,%rbx
  mov    %rcx,%r15
  mov    %r8,%r14
  mov    %r9,%rbp
  cmp    $0x6,%dl
  je     L149
  cmp    $0x7,%dl
  jne    L111
  xor    %edx,%edx
  cmpl   $0x1,(%r9)
  je     L2
L139:
  mov    %edx,0x0(%rbp)
  lea    0x2(%rax),%rdx
  mov    %rdx,(%rsp)
  cmpb   $0x2,0x1(%rax)
  jne    L65
  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     L1
  movl   $0x0,(%r14)
  mov    0x0(%r13),%eax
  cmp    $0x32415352,%eax
  je     L143
  ja     L101
  cmp    $0x31415352,%eax
  je     L79
  cmp    $0x31535344,%eax
  jne    L10
  movl   $0x1,(%r14)
L79:
  mov    0x0(%rbp),%r12d
  test   %r12d,%r12d
  je     L53
L190:
  mov    (%rsp),%rax
  mov    $0x1,%r12d
  mov    %rax,(%rbx)
L111:
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L157
  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)
L149:
  mov    (%r9),%r12d
  mov    $0x1,%edx
  test   %r12d,%r12d
  jne    L139
L53:
  mov    D59(%rip),%rax
  mov    (%rax),%edi
  call   <PEMerror@plt>
  jmp    L111
  nopl   0x0(%rax)
L65:
  mov    D5(%rip),%rax
  xor    %r12d,%r12d
  mov    (%rax),%edi
  call   <PEMerror@plt>
  jmp    L111
  nopl   0x0(%rax,%rax,1)
L101:
  cmp    $0x32535344,%eax
  jne    L10
  movl   $0x1,(%r14)
L143:
  cmpl   $0x1,0x0(%rbp)
  jne    L190
  mov    D11(%rip),%rax
  xor    %r12d,%r12d
  mov    (%rax),%edi
  call   <PEMerror@plt>
  jmp    L111
  xchg   %ax,%ax
L2:
  mov    D11(%rip),%rax
  mov    (%rax),%edi
  call   <PEMerror@plt>
  jmp    L111
  nopl   0x0(%rax,%rax,1)
L1:
  mov    D13(%rip),%rax
  xor    %r12d,%r12d
  mov    (%rax),%edi
  call   <PEMerror@plt>
  jmp    L111
  xchg   %ax,%ax
L10:
  mov    D28(%rip),%rax
  mov    $0xffffffff,%r12d
  mov    (%rax),%edi
  call   <PEMerror@plt>
  jmp    L111
L157:
  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;
}
```