user: What is the c source code of the assembly code below?

```asm
<do_blob_header>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x18,%rsp
  mov    %fs:0x28,%rax
  mov    %rax,0x8(%rsp)
  xor    %eax,%eax
  mov    (%rdi),%rax
  mov    %rax,(%rsp)
  mov    $0x0,%r12d
  cmp    $0xf,%esi
  jbe    L78
  mov    %rdi,%rbx
  mov    %rdx,%r13
  mov    %rcx,%r15
  mov    %r8,%r14
  mov    %r9,%rbp
  movzbl (%rax),%edx
  cmp    $0x6,%dl
  je     L48
  mov    $0x0,%r12d
  cmp    $0x7,%dl
  jne    L78
  mov    $0x0,%edx
  cmpl   $0x1,(%r9)
  je     L61
L104:
  mov    %edx,0x0(%rbp)
  lea    0x2(%rax),%rdx
  mov    %rdx,(%rsp)
  cmpb   $0x2,0x1(%rax)
  je     L212
  mov    D30(%rip),%rax
  mov    (%rax),%edi
  call   <PEMerror@plt>
  mov    $0x0,%r12d
L78:
  mov    0x8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L69
  mov    %r12d,%eax
  add    $0x18,%rsp
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L48:
  mov    (%r9),%r12d
  mov    $0x1,%edx
  test   %r12d,%r12d
  jne    L104
  mov    D62(%rip),%rax
  mov    (%rax),%edi
  call   <PEMerror@plt>
  jmp    L78
L61:
  mov    D17(%rip),%rax
  mov    (%rax),%edi
  call   <PEMerror@plt>
  jmp    L78
L212:
  add    $0x8,%rax
  mov    %rax,(%rsp)
  mov    %rsp,%r12
  mov    %r12,%rdi
  call   <read_ledword@plt>
  mov    %eax,0x0(%r13)
  mov    %r12,%rdi
  call   <read_ledword@plt>
  mov    %eax,(%r15)
  cmp    $0x10000,%eax
  ja     L97
  movl   $0x0,(%r14)
  mov    0x0(%r13),%eax
  cmp    $0x32415352,%eax
  je     L211
  ja     L57
  cmp    $0x31415352,%eax
  je     L87
  cmp    $0x31535344,%eax
  jne    L89
  movl   $0x1,(%r14)
L87:
  mov    0x0(%rbp),%r12d
  test   %r12d,%r12d
  jne    L67
  mov    D62(%rip),%rax
  mov    (%rax),%edi
  call   <PEMerror@plt>
  jmp    L78
L97:
  mov    D41(%rip),%rax
  mov    (%rax),%edi
  call   <PEMerror@plt>
  mov    $0x0,%r12d
  jmp    L78
L57:
  cmp    $0x32535344,%eax
  jne    L89
  movl   $0x1,(%r14)
L211:
  cmpl   $0x1,0x0(%rbp)
  je     L50
L67:
  mov    (%rsp),%rax
  mov    %rax,(%rbx)
  mov    $0x1,%r12d
  jmp    L78
L50:
  mov    D17(%rip),%rax
  mov    (%rax),%edi
  call   <PEMerror@plt>
  mov    $0x0,%r12d
  jmp    L78
L89:
  mov    D65(%rip),%rax
  mov    (%rax),%edi
  call   <PEMerror@plt>
  mov    $0xffffffff,%r12d
  jmp    L78
L69:
  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;
}
```