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

```asm
<XCheckNVStruct>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  mov    %rdi,-0x58(%rbp)
  mov    %rsi,-0x60(%rbp)
  mov    %rdx,-0x68(%rbp)
  mov    %rcx,-0x70(%rbp)
  movq   $0x0,-0x40(%rbp)
  movq   $0x0,-0x38(%rbp)
  mov    -0x58(%rbp),%rax
  mov    %rax,-0x18(%rbp)
  mov    -0x60(%rbp),%rax
  mov    %rax,-0x10(%rbp)
  movq   $0x4,-0x40(%rbp)
  movq   $0x0,-0x38(%rbp)
  mov    -0x18(%rbp),%rdx
  mov    -0x40(%rbp),%rax
  add    %rdx,%rax
  mov    %rax,-0x30(%rbp)
  movq   $0x0,-0x28(%rbp)
  movq   $0x0,-0x20(%rbp)
  movw   $0x0,-0x44(%rbp)
  jmp    L209
L126:
  mov    -0x30(%rbp),%rax
  movzwl (%rax),%eax
  mov    %ax,-0x42(%rbp)
  addq   $0x2,-0x30(%rbp)
  mov    -0x30(%rbp),%rax
  movzwl (%rax),%eax
  movzwl %ax,%eax
  mov    %rax,-0x38(%rbp)
  cmpw   $0x5,-0x42(%rbp)
  jne    L127
  cmpq   $0x8,-0x38(%rbp)
  je     L205
  mov    $0x0,%eax
  jmp    L178
L205:
  movq   $0x1,-0x28(%rbp)
  jmp    L83
L127:
  cmpw   $0x2,-0x42(%rbp)
  jne    L83
  mov    -0x30(%rbp),%rax
  movzwl 0x2(%rax),%eax
  mov    %ax,-0x44(%rbp)
  cmpw   $0xff0a,-0x44(%rbp)
  ja     L35
  cmpw   $0xff09,-0x44(%rbp)
  ja     L6
L35:
  mov    $0x0,%eax
  jmp    L178
L6:
  movq   $0x1,-0x20(%rbp)
L83:
  cmpw   $0xffff,-0x42(%rbp)
  jne    L100
  cmpq   $0x0,-0x28(%rbp)
  je     L131
  cmpq   $0x0,-0x20(%rbp)
  jne    L72
L131:
  mov    $0x0,%eax
  jmp    L178
L72:
  mov    $0x1,%eax
  jmp    L178
L100:
  cmpw   $0x0,-0x42(%rbp)
  je     L17
  cmpq   $0x0,-0x38(%rbp)
  je     L17
  addq   $0x2,-0x30(%rbp)
  addq   $0x4,-0x40(%rbp)
  mov    -0x38(%rbp),%rax
  and    $0x3,%eax
  mov    %rax,-0x8(%rbp)
  cmpq   $0x0,-0x8(%rbp)
  je     L27
  mov    -0x38(%rbp),%rax
  sub    -0x8(%rbp),%rax
  add    $0x4,%rax
  mov    %rax,-0x38(%rbp)
L27:
  mov    -0x38(%rbp),%rax
  add    %rax,-0x40(%rbp)
  mov    -0x38(%rbp),%rax
  add    %rax,-0x30(%rbp)
  mov    -0x40(%rbp),%rax
  cmp    -0x10(%rbp),%rax
  jne    L209
  cmpq   $0x0,-0x28(%rbp)
  je     L163
  cmpq   $0x0,-0x20(%rbp)
  jne    L189
L163:
  mov    $0x0,%eax
  jmp    L178
L189:
  mov    $0x1,%eax
  jmp    L178
L209:
  mov    -0x40(%rbp),%rax
  cmp    -0x10(%rbp),%rax
  jb     L126
L17:
  mov    $0x0,%eax
L178:
  pop    %rbp
  ret
```

assistant: ```c
unsigned long XCheckNVStruct(unsigned char *lpPhoBuf, unsigned long dwPhoSize, unsigned long bBigEndian, unsigned long bModule) {
  unsigned long dwOffset = 0, dwLength = 0, bRet;
  unsigned char *lpCode = lpPhoBuf;
  unsigned long dwCodeSize = dwPhoSize;
  unsigned short wCurID;
  dwOffset = 4;
  dwLength = 0;
  unsigned char *pTemp = lpCode + dwOffset;
  unsigned long bIMEI = 0;
  unsigned long bGSMCali = 0;
  unsigned short wGSMCaliVer = 0;
  while (dwOffset < dwCodeSize) {
    wCurID = *(unsigned short *)pTemp;
    pTemp += 2;
    dwLength = *(unsigned short *)pTemp;
    if (wCurID == (0x5)) {
      if (dwLength != (8)) {
        return 0;
      } else {
        bIMEI = 1;
      }
    } else if (wCurID == (0x2)) {
      wGSMCaliVer = *(unsigned short *)(pTemp + 2);
      if ((wGSMCaliVer > 0xFF0A) || (wGSMCaliVer < 0xFF0A)) {
        return 0;
      } else {
        bGSMCali = 1;
      }
    }
    if (wCurID == 0xFFFF) {
      if (!bIMEI || !bGSMCali) {
        return 0;
      }
      return 1;
    }
    if (wCurID == 0 || dwLength == 0) {
      break;
    }
    pTemp += 2;
    dwOffset += 4;
    bRet = dwLength % 4;
    if (bRet != 0) {
      dwLength += 4 - bRet;
    }
    dwOffset += dwLength;
    pTemp += dwLength;
    if (dwOffset == dwCodeSize) {
      if (!bIMEI || !bGSMCali) {
        return 0;
      }
      return 1;
    }
  }
  return 0;
}
```