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

```asm
<parse_1st_msg>:
  endbr64
  push   %rbp
  mov    %rsp,%rbp
  sub    $0x20,%rsp
  mov    %rdi,-0x18(%rbp)
  mov    -0x18(%rbp),%rax
  mov    (%rax),%rax
  test   %rax,%rax
  jne    L96
  lea    D34(%rip),%rax
  mov    %rax,%rsi
  lea    D8(%rip),%rax
  mov    %rax,%rdi
  call   <fatal_error@plt>
L96:
  mov    -0x18(%rbp),%rax
  add    $0x30,%rax
  movq   $0x0,(%rax)
  mov    -0x18(%rbp),%rdx
  add    $0x10,%rdx
  mov    (%rax),%rax
  mov    %rax,(%rdx)
  mov    -0x18(%rbp),%rax
  add    $0x48,%rax
  movq   $0x0,(%rax)
  mov    -0x18(%rbp),%rax
  mov    (%rax),%rax
  add    $0x10,%rax
  mov    %rax,-0x8(%rbp)
  jmp    L32
L93:
  mov    -0x8(%rbp),%rax
  add    $0x4,%rax
  movzbl (%rax),%eax
  cmp    $0x8,%al
  jbe    L29
  mov    -0x8(%rbp),%rax
  add    $0x4,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  mov    %eax,%esi
  lea    D87(%rip),%rax
  mov    %rax,%rdi
  call   <fatal_error_i@plt>
L29:
  mov    -0x8(%rbp),%rax
  add    $0x4,%rax
  movzbl (%rax),%eax
  movzbl %al,%eax
  lea    0x0(,%rax,8),%rdx
  mov    -0x18(%rbp),%rax
  add    %rax,%rdx
  mov    -0x8(%rbp),%rax
  mov    %rax,(%rdx)
  mov    -0x8(%rbp),%rax
  add    $0x4,%rax
  movzbl (%rax),%eax
  cmp    $0x6,%al
  jne    L73
  mov    -0x8(%rbp),%rax
  add    $0x5,%rax
  movzbl (%rax),%eax
  test   %al,%al
  jne    L67
  mov    -0x18(%rbp),%rax
  lea    0x48(%rax),%rdx
  mov    -0x8(%rbp),%rax
  mov    %rax,(%rdx)
  jmp    L73
L67:
  mov    -0x8(%rbp),%rax
  add    $0x5,%rax
  movzbl (%rax),%eax
  test   %al,%al
  je     L26
  mov    -0x8(%rbp),%rax
  add    $0x5,%rax
  movzbl (%rax),%eax
  cmp    $0xfd,%al
  ja     L26
  lea    D34(%rip),%rax
  mov    %rax,%rsi
  lea    D57(%rip),%rax
  mov    %rax,%rdi
  call   <fatal_error@plt>
  jmp    L73
L26:
  mov    -0x8(%rbp),%rax
  add    $0x5,%rax
  movzbl (%rax),%eax
  cmp    $0xfe,%al
  jne    L73
  lea    D34(%rip),%rax
  mov    %rax,%rsi
  lea    D15(%rip),%rax
  mov    %rax,%rdi
  call   <fatal_error@plt>
L73:
  mov    -0x8(%rbp),%rax
  add    $0x4,%rax
  movzbl (%rax),%eax
  cmp    $0x7,%al
  jne    L75
  mov    $0x0,%eax
  jmp    L115
L75:
  mov    -0x8(%rbp),%rax
  mov    %rax,%rdi
  call   <uint4@plt>
  cltq
  add    %rax,-0x8(%rbp)
L32:
  mov    -0x18(%rbp),%rax
  add    $0x40,%rax
  mov    (%rax),%rax
  sub    -0x8(%rbp),%rax
  test   %rax,%rax
  jg     L93
  lea    D34(%rip),%rax
  mov    %rax,%rsi
  lea    D38(%rip),%rax
  mov    %rax,%rdi
  call   <fatal_error@plt>
  mov    $0x1,%eax
L115:
  leave
  ret
```

tool_calls: name: unpack_data
arguments: tag: D34
datatype: string
name: unpack_data
arguments: tag: D8
datatype: string
name: unpack_data
arguments: tag: D87
datatype: string
name: unpack_data
arguments: tag: D57
datatype: string
name: unpack_data
arguments: tag: D15
datatype: string
name: unpack_data
arguments: tag: D38
datatype: string

tool: 

tool: D8: parse_1st_msg .. sec[0] == NULL

tool: D87: parse_1st_msg illegal section %d

tool: D57: parse_1st_msg: predefined bitmaps are not handled

tool: D15: parse_1st_msg: illegal grib msg, bitmap not defined code, table 6.0=254

tool: D38: parse_1st_msg illegally format grib

assistant: ```c
int parse_1st_msg(unsigned char **sec) {
  unsigned char *p;
  if (sec[0] == NULL)
    fatal_error("parse_1st_msg .. sec[0] == NULL", "");
  sec[2] = sec[6] = NULL;
  sec[9] = NULL;
  p = sec[0] + 16;
  while (sec[8] - p > 0) {
    if (p[4] > 8)
      fatal_error_i("parse_1st_msg illegal section %d", (int)p[4]);
    sec[p[4]] = p;
    if (p[4] == 6) {
      if (p[5] == 0) {
        sec[9] = p;
      } else if (p[5] >= 1 && p[5] <= 253) {
        fatal_error("parse_1st_msg: predefined bitmaps are not handled", "");
      } else if (p[5] == 254) {
        fatal_error("parse_1st_msg: illegal grib msg, bitmap not defined code, table 6.0=254", "");
      }
    }
    if (p[4] == 7) {
      return 0;
    }
    p += uint4(p);
  }
  fatal_error("parse_1st_msg illegally format grib", "");
  return 1;
}
```