user: What would the C source look like for the assembly code provided here?

```asm
<main>:
  endbr64
  push   %r15
  push   %r14
  push   %r13
  push   %r12
  push   %rbp
  push   %rbx
  sub    $0x1000,%rsp
  orq    $0x0,(%rsp)
  sub    $0xfe8,%rsp
  lea    D328(%rip),%rbp
  lea    D216(%rip),%rdi
  mov    %rbp,%rsi
  lea    D41(%rip),%r13
  mov    %fs:0x28,%rax
  mov    %rax,0x1fd8(%rsp)
  xor    %eax,%eax
  call   <fopen@plt>
  mov    %rbp,%rsi
  lea    D15(%rip),%rdi
  mov    %rax,%r15
  mov    %rax,0x18(%rsp)
  call   <fopen@plt>
  mov    %rbp,%rsi
  lea    D284(%rip),%rdi
  lea    D140(%rip),%rbp
  mov    %rax,%r14
  mov    %rax,0x8(%rsp)
  call   <fopen@plt>
  mov    %r15,%rcx
  mov    $0x42,%edx
  mov    $0x1,%esi
  lea    D79(%rip),%rdi
  mov    %rax,%rbx
  call   <fwrite@plt>
  mov    %r15,%rcx
  mov    $0x42,%edx
  mov    $0x1,%esi
  lea    D163(%rip),%rdi
  call   <fwrite@plt>
  mov    %r15,%rcx
  mov    $0x29,%edx
  mov    $0x1,%esi
  lea    D326(%rip),%rdi
  call   <fwrite@plt>
  mov    %rbp,%rdi
  mov    %r15,%rcx
  mov    $0x3,%edx
  mov    $0x1,%esi
  call   <fwrite@plt>
  mov    %r15,%rcx
  mov    $0x42,%edx
  mov    $0x1,%esi
  lea    D197(%rip),%rdi
  call   <fwrite@plt>
  mov    %r15,%rcx
  mov    $0x3a,%edx
  mov    $0x1,%esi
  lea    D120(%rip),%rdi
  call   <fwrite@plt>
  mov    %r15,%rcx
  mov    $0x1b,%edx
  mov    $0x1,%esi
  lea    D224(%rip),%rdi
  call   <fwrite@plt>
  mov    %rbp,%rdi
  mov    %r15,%rcx
  mov    $0x3,%edx
  mov    $0x1,%esi
  lea    D271(%rip),%rbp
  call   <fwrite@plt>
  mov    %r15,%rcx
  mov    $0x4,%edx
  mov    $0x1,%esi
  lea    D84(%rip),%rdi
  call   <fwrite@plt>
  mov    %r14,%rcx
  mov    $0x41,%edx
  mov    $0x1,%esi
  lea    D543(%rip),%rdi
  call   <fwrite@plt>
  mov    %r14,%rcx
  mov    $0x41,%edx
  mov    $0x1,%esi
  lea    D319(%rip),%rdi
  call   <fwrite@plt>
  mov    %r14,%rcx
  mov    $0x26,%edx
  mov    $0x1,%esi
  lea    D559(%rip),%rdi
  call   <fwrite@plt>
  mov    %r14,%rcx
  mov    %rbp,%rdi
  mov    $0x2,%edx
  mov    $0x1,%esi
  call   <fwrite@plt>
  mov    %r14,%rcx
  mov    $0x41,%edx
  mov    $0x1,%esi
  lea    D335(%rip),%rdi
  call   <fwrite@plt>
  mov    %r14,%rcx
  mov    $0x39,%edx
  mov    $0x1,%esi
  lea    D432(%rip),%rdi
  call   <fwrite@plt>
  mov    %r14,%rcx
  mov    $0x1a,%edx
  mov    $0x1,%esi
  lea    D495(%rip),%rdi
  call   <fwrite@plt>
  mov    %r14,%rcx
  mov    %rbp,%rdi
  mov    $0x2,%edx
  lea    D348(%rip),%rbp
  mov    $0x1,%esi
  lea    D316(%rip),%r14
  call   <fwrite@plt>
  mov    %rbp,%rdi
  mov    %rbx,%rcx
  mov    $0x2,%edx
  mov    $0x1,%esi
  call   <fwrite@plt>
  mov    %rbx,%rcx
  mov    $0x21,%edx
  mov    $0x1,%esi
  lea    D536(%rip),%rdi
  call   <fwrite@plt>
  mov    %rbp,%rdi
  mov    %rbx,%rcx
  mov    $0x2,%edx
  mov    $0x1,%esi
  call   <fwrite@plt>
  mov    %rbx,%rcx
  mov    $0x3e,%edx
  mov    $0x1,%esi
  lea    D435(%rip),%rdi
  call   <fwrite@plt>
  mov    %rbx,%rcx
  mov    $0x1d,%edx
  mov    $0x1,%esi
  lea    D333(%rip),%rdi
  call   <fwrite@plt>
  mov    %rbp,%rdi
  mov    %rbx,%rcx
  mov    $0x2,%edx
  mov    $0x1,%esi
  call   <fwrite@plt>
  mov    %rbp,%rdi
  mov    %rbx,%rcx
  mov    $0x2,%edx
  mov    $0x1,%esi
  call   <fwrite@plt>
  mov    %rbx,%rcx
  mov    $0x41,%edx
  mov    $0x1,%esi
  lea    D377(%rip),%rdi
  call   <fwrite@plt>
  mov    %rbx,%rcx
  mov    $0x39,%edx
  mov    $0x1,%esi
  lea    D74(%rip),%rdi
  call   <fwrite@plt>
  mov    %rbx,%rcx
  mov    $0x1a,%edx
  mov    $0x1,%esi
  lea    D587(%rip),%rdi
  call   <fwrite@plt>
  mov    %rbp,%rdi
  mov    %rbx,%rcx
  mov    $0x2,%edx
  mov    $0x1,%esi
  call   <fwrite@plt>
  mov    %rbp,%rdi
  mov    %rbx,%rcx
  mov    $0x2,%edx
  mov    $0x1,%esi
  lea    0x60(%rsp),%rbp
  call   <fwrite@plt>
  lea    D83(%rip),%rsi
  lea    D498(%rip),%rdi
  call   <fopen@plt>
  mov    %rax,%r12
  jmp    L285
  nopl   0x0(%rax,%rax,1)
L198:
  mov    %r12,%rdx
  mov    $0x7d0,%esi
  mov    %rbp,%rdi
  call   <fgets@plt>
  mov    $0x6,%edx
  mov    %r13,%rsi
  mov    %rbp,%rdi
  call   <strncmp@plt>
  test   %rax,%rax
  je     L143
  mov    $0x6,%edx
  mov    %r14,%rsi
  mov    %rbp,%rdi
  call   <strncmp@plt>
  test   %rax,%rax
  je     L29
L285:
  mov    %r12,%rdx
  mov    $0x7d0,%esi
  mov    %rbp,%rdi
  call   <fgets@plt>
  test   %rax,%rax
  jne    L198
L209:
  lea    D392(%rip),%rdi
  call   <puts@plt>
  lea    D417(%rip),%rdi
  call   <puts@plt>
L129:
  lea    D92(%rip),%rdi
  call   <puts@plt>
  lea    D479(%rip),%rdi
  call   <puts@plt>
  lea    D312(%rip),%rdi
  call   <puts@plt>
  mov    0x1fd8(%rsp),%rax
  sub    %fs:0x28,%rax
  jne    L290
  add    $0x1fe8,%rsp
  xor    %eax,%eax
  pop    %rbx
  pop    %rbp
  pop    %r12
  pop    %r13
  pop    %r14
  pop    %r15
  ret
L143:
  mov    $0xfffffffffffefffe,%rdx
L302:
  lea    0x66(%rsp),%rax
  mov    %rbx,0x10(%rsp)
  mov    %rdx,%rbx
  mov    %rax,0x28(%rsp)
  lea    0x840(%rsp),%rax
  mov    %rax,(%rsp)
L27:
  mov    (%rsp),%r15
  mov    0x28(%rsp),%rsi
  mov    %r15,%rdi
  call   <strcpy@plt>
  mov    %r15,%rdi
  call   <strlen@plt>
  test   %eax,%eax
  je     L318
  sub    $0x1,%eax
  cltq
  cmpb   $0xa,0x840(%rsp,%rax,1)
  jne    L318
  movb   $0x0,0x840(%rsp,%rax,1)
  nopw   0x0(%rax,%rax,1)
L318:
  mov    %r12,%rdx
  mov    $0x7d0,%esi
  mov    %rbp,%rdi
  call   <fgets@plt>
  test   %rax,%rax
  je     L209
  mov    $0x9,%edx
  lea    D291(%rip),%rsi
  mov    %rbp,%rdi
  call   <strncmp@plt>
  test   %rax,%rax
  jne    L23
  lea    0x40(%rsp),%r14
  lea    0x69(%rsp),%rsi
  mov    %r14,%rdi
  call   <strcpy@plt>
  lea    0x3c(%rsp),%rdx
  lea    D557(%rip),%rsi
  mov    %r14,%rdi
  call   <sscanf@plt>
  movslq 0x3c(%rsp),%rax
  cmp    %rbx,%rax
  jne    L156
  mov    %r12,%rdx
  mov    $0x7d0,%esi
  mov    %rbp,%rdi
  sub    $0x1,%rbx
  call   <fgets@plt>
  test   %rax,%rax
  je     L209
  mov    $0x7,%edx
  lea    D535(%rip),%rsi
  mov    %rbp,%rdi
  call   <strncmp@plt>
  test   %rax,%rax
  jne    L56
  lea    0x1020(%rsp),%r14
  lea    0x67(%rsp),%rsi
  mov    %r14,%rdi
  call   <strcpy@plt>
  mov    %r14,%rdi
  call   <strlen@plt>
  test   %eax,%eax
  je     L109
  sub    $0x1,%eax
  cltq
  cmpb   $0xa,0x1020(%rsp,%rax,1)
  jne    L109
  movb   $0x0,0x1020(%rsp,%rax,1)
  nopl   0x0(%rax)
L109:
  mov    %r12,%rdx
  mov    $0x7d0,%esi
  mov    %rbp,%rdi
  call   <fgets@plt>
  test   %rax,%rax
  je     L209
  mov    $0xa,%edx
  lea    D544(%rip),%rsi
  mov    %rbp,%rdi
  call   <strncmp@plt>
  test   %rax,%rax
  jne    L323
  lea    0x1800(%rsp),%r15
  lea    0x6a(%rsp),%rsi
  mov    %r15,%rdi
  call   <strcpy@plt>
  mov    %r15,%rdi
  call   <strlen@plt>
  test   %eax,%eax
  je     L144
  sub    $0x1,%eax
  cltq
  cmpb   $0xa,0x1800(%rsp,%rax,1)
  jne    L144
  movb   $0x0,0x1800(%rsp,%rax,1)
  xchg   %ax,%ax
L144:
  mov    (%rsp),%r15
  mov    0x3c(%rsp),%ecx
  lea    D523(%rip),%rsi
  xor    %eax,%eax
  mov    0x18(%rsp),%rdi
  mov    %r15,%rdx
  call   <fprintf@plt>
  mov    0x8(%rsp),%rdi
  mov    %r15,%rdx
  xor    %eax,%eax
  lea    D308(%rip),%rsi
  call   <fprintf@plt>
  mov    0x8(%rsp),%rdi
  mov    0x3c(%rsp),%ecx
  xor    %eax,%eax
  mov    %r15,%rdx
  lea    D549(%rip),%rsi
  mov    %r15,(%rsp)
  call   <fprintf@plt>
  mov    %r12,%rdx
  mov    $0x7d0,%esi
  mov    %rbp,%rdi
  call   <fgets@plt>
  test   %rax,%rax
  je     L209
  lea    D96(%rip),%r15
  mov    $0x6,%edx
  mov    %rbp,%rdi
  mov    %r15,%rsi
  call   <strncmp@plt>
  test   %rax,%rax
  jne    L300
  mov    (%rsp),%rdx
  mov    0x10(%rsp),%rdi
  mov    %r14,%rcx
  lea    D161(%rip),%rsi
  lea    D570(%rip),%r15
  lea    D439(%rip),%r14
  call   <fprintf@plt>
  mov    %rbx,0x20(%rsp)
  mov    0x10(%rsp),%rbx
  jmp    L294
  nopl   (%rax)
L216:
  mov    $0x2,%edx
  mov    %r14,%rsi
  mov    %rbp,%rdi
  call   <strncmp@plt>
  test   %rax,%rax
  je     L320
  mov    %rbx,%rsi
  mov    %rbp,%rdi
  call   <fputs@plt>
L294:
  mov    %r15,%rsi
  mov    %rbp,%rdi
  call   <strcpy@plt>
  mov    %r12,%rdx
  mov    $0x7d0,%esi
  mov    %rbp,%rdi
  call   <fgets@plt>
  test   %rax,%rax
  jne    L216
L320:
  mov    $0x2,%edx
  mov    %r14,%rsi
  mov    %rbp,%rdi
  mov    0x20(%rsp),%rbx
  call   <strncmp@plt>
  test   %rax,%rax
  je     L182
  jmp    L313
  nop
L180:
  mov    %r12,%rdx
  mov    $0x7d0,%esi
  mov    %rbp,%rdi
  sub    $0x1,%rbx
  call   <fgets@plt>
  test   %rax,%rax
  je     L313
L182:
  mov    $0x6,%edx
  mov    %r13,%rsi
  mov    %rbp,%rdi
  call   <strncmp@plt>
  test   %rax,%rax
  je     L180
  lea    D316(%rip),%r15
  mov    $0x6,%edx
  mov    %rbp,%rdi
  mov    %r15,%rsi
  call   <strncmp@plt>
  test   %rax,%rax
  je     L27
L300:
  lea    D16(%rip),%rdi
  call   <puts@plt>
  mov    %r15,%rsi
  lea    D407(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    %rbp,%rsi
  lea    D314(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  jmp    L129
L313:
  mov    %r12,%rdi
  lea    D175(%rip),%rbp
  lea    D261(%rip),%r12
  call   <fclose@plt>
  mov    0x18(%rsp),%rdi
  call   <fclose@plt>
  mov    0x8(%rsp),%rdi
  call   <fclose@plt>
  mov    %rbp,%rdi
  call   <puts@plt>
  mov    %r12,%rdi
  call   <puts@plt>
  lea    D405(%rip),%rdi
  call   <puts@plt>
  lea    D313(%rip),%rdi
  call   <puts@plt>
  mov    %r12,%rdi
  call   <puts@plt>
  mov    %rbp,%rdi
  call   <puts@plt>
  xor    %edi,%edi
  call   <exit@plt>
  jmp    L209
L29:
  mov    $0xfffffffffffeffff,%rdx
  jmp    L302
L156:
  lea    D569(%rip),%rdi
  xor    %eax,%eax
  call   <printf@plt>
  mov    0x3c(%rsp),%esi
  mov    %rbx,%rdx
  xor    %eax,%eax
  lea    D507(%rip),%rdi
  call   <printf@plt>
  jmp    L129
L23:
  lea    D291(%rip),%r15
  jmp    L300
L56:
  lea    D535(%rip),%r15
  jmp    L300
L323:
  lea    D544(%rip),%r15
  jmp    L300
L290:
  call   <__stack_chk_fail@plt>
```

tool_calls: name: parse_data
arguments: data_tag: D328
data_type: string
name: parse_data
arguments: data_tag: D216
data_type: string
name: parse_data
arguments: data_tag: D41
data_type: string
name: parse_data
arguments: data_tag: D15
data_type: string
name: parse_data
arguments: data_tag: D284
data_type: string
name: parse_data
arguments: data_tag: D140
data_type: string
name: parse_data
arguments: data_tag: D79
data_type: string
name: parse_data
arguments: data_tag: D163
data_type: string
name: parse_data
arguments: data_tag: D326
data_type: string
name: parse_data
arguments: data_tag: D197
data_type: string
name: parse_data
arguments: data_tag: D120
data_type: string
name: parse_data
arguments: data_tag: D224
data_type: string
name: parse_data
arguments: data_tag: D271
data_type: string
name: parse_data
arguments: data_tag: D84
data_type: string
name: parse_data
arguments: data_tag: D543
data_type: string
name: parse_data
arguments: data_tag: D319
data_type: string
name: parse_data
arguments: data_tag: D559
data_type: string
name: parse_data
arguments: data_tag: D335
data_type: string
name: parse_data
arguments: data_tag: D432
data_type: string
name: parse_data
arguments: data_tag: D495
data_type: string
name: parse_data
arguments: data_tag: D348
data_type: string
name: parse_data
arguments: data_tag: D316
data_type: string
name: parse_data
arguments: data_tag: D536
data_type: string
name: parse_data
arguments: data_tag: D435
data_type: string
name: parse_data
arguments: data_tag: D333
data_type: string
name: parse_data
arguments: data_tag: D377
data_type: string
name: parse_data
arguments: data_tag: D74
data_type: string
name: parse_data
arguments: data_tag: D587
data_type: string
name: parse_data
arguments: data_tag: D83
data_type: string
name: parse_data
arguments: data_tag: D498
data_type: string
name: parse_data
arguments: data_tag: D392
data_type: string
name: parse_data
arguments: data_tag: D417
data_type: string
name: parse_data
arguments: data_tag: D92
data_type: string
name: parse_data
arguments: data_tag: D479
data_type: string
name: parse_data
arguments: data_tag: D312
data_type: string
name: parse_data
arguments: data_tag: D291
data_type: string
name: parse_data
arguments: data_tag: D557
data_type: string
name: parse_data
arguments: data_tag: D535
data_type: string
name: parse_data
arguments: data_tag: D544
data_type: string
name: parse_data
arguments: data_tag: D523
data_type: string
name: parse_data
arguments: data_tag: D308
data_type: string
name: parse_data
arguments: data_tag: D549
data_type: string
name: parse_data
arguments: data_tag: D96
data_type: string
name: parse_data
arguments: data_tag: D161
data_type: string
name: parse_data
arguments: data_tag: D570
data_type: string
name: parse_data
arguments: data_tag: D439
data_type: string
name: parse_data
arguments: data_tag: D16
data_type: string
name: parse_data
arguments: data_tag: D407
data_type: string
name: parse_data
arguments: data_tag: D314
data_type: string
name: parse_data
arguments: data_tag: D175
data_type: string
name: parse_data
arguments: data_tag: D261
data_type: string
name: parse_data
arguments: data_tag: D405
data_type: string
name: parse_data
arguments: data_tag: D313
data_type: string
name: parse_data
arguments: data_tag: D569
data_type: string
name: parse_data
arguments: data_tag: D507
data_type: string

tool: D328: w

tool: D216: verrdefs.h

tool: D41: %%SKIP

tool: D15: verrdefs.fin

tool: D284: vrdifac.msg

tool: D140:  *


tool: D79: /* VERRDEFS -- Definition of all symbolic names for VRDI internal


tool: D163:  * errors.  This module is used by application programs to define


tool: D326:  * symbolic names for the VRDI errors.  


tool: D197:  *	NOTE :  This file is built by VRDIERRORS.COM.  It should never


tool: D120:  *		be modified directly.  To make changes to the source,


tool: D224:  *		change VRDIERRORS.COM.


tool: D271: C


tool: D84:  */


tool: D543: C VERRDEFS -- Definition of all symbolic names for VRDI internal


tool: D319: C errors.  This module is used by application programs to define


tool: D559: C symbolic names for the VRDI errors.


tool: D335: C	NOTE :  This file is built by VRDIERRORS.COM.  It should never


tool: D432: C		be modified directly.  To make changes to the source,


tool: D495: C		change VRDIERRORS.COM.


tool: D348: !


tool: D316: %%KEY 

tool: D536: !	Message file for facility VIC2


tool: D435: !  This file contains the message id's and detailed texts for


tool: D333: !  the VRDI internal errors.


tool: D377: !	NOTE :  This file is built by VRDIERRORS.COM.  It should never


tool: D74: !		be modified directly.  To make changes to the source,


tool: D587: !		change VRDIERRORS.COM.


tool: D83: r

tool: D498: vrdierrs.dat

tool: D392: **** Premature end of file encountered processing VRDIERRS.DAT

tool: D417: **** Check file contents

tool: 

tool: D479: Please see documentation in ERRORBLD.COM and fix

tool: D312: ERROR file build aborted

tool: D291: %%NUMBER 

tool: D557:  %d

tool: D535: %%NAME 

tool: D544: %%MESSAGE 

tool: D523: #define %s %d


tool: D308:       INTEGER %s


tool: D549:       PARAMETER (%s = %d)


tool: D96: %%HELP

tool: D161: .KEY %s	! %s


tool: D570:   

tool: D439: %%

tool: D16: **** Bad directive in VRDIERRS.DAT

tool: D407: **** Expected %s


tool: D314: **** Found %s


tool: D175: ****************************************

tool: D261: *                                      *

tool: D405: * VRDIERRORS.COM:                      *

tool: D313: * All files successfully created       *

tool: D569: **** Numbering sequence in VRDIERRS.DAT is bad

tool: D507: **** Found %d when expecting %ld


assistant: ```c
main() {
  FILE *vrdierrs_dat;
  FILE *verrordefs_h;
  FILE *verrdefs_fin;
  FILE *vrdifac_msg;
  char *expected;
  long cur_num;
  int len;
  char number_str[25];
  int number;
  char in_record[2001];
  char key[2001];
  char name[2001];
  char fname[2001];
  char message[2001];
  verrordefs_h = fopen("verrdefs.h", "w");
  verrdefs_fin = fopen("verrdefs.fin", "w");
  vrdifac_msg = fopen("vrdifac.msg", "w");
  fputs("/* VERRDEFS -- Definition of all symbolic names for VRDI internal\n", verrordefs_h);
  fputs(" * errors.  This module is used by application programs to define\n", verrordefs_h);
  fputs(" * symbolic names for the VRDI errors.  \n", verrordefs_h);
  fputs(" *\n", verrordefs_h);
  fputs(" *\tNOTE :  This file is built by VRDIERRORS.COM.  It should never\n", verrordefs_h);
  fputs(" *\t\tbe modified directly.  To make changes to the source,\n", verrordefs_h);
  fputs(" *\t\tchange VRDIERRORS.COM.\n", verrordefs_h);
  fputs(" *\n", verrordefs_h);
  fputs(" */\n", verrordefs_h);
  fputs("C VERRDEFS -- Definition of all symbolic names for VRDI internal\n", verrdefs_fin);
  fputs("C errors.  This module is used by application programs to define\n", verrdefs_fin);
  fputs("C symbolic names for the VRDI errors.\n", verrdefs_fin);
  fputs("C\n", verrdefs_fin);
  fputs("C\tNOTE :  This file is built by VRDIERRORS.COM.  It should never\n", verrdefs_fin);
  fputs("C\t\tbe modified directly.  To make changes to the source,\n", verrdefs_fin);
  fputs("C\t\tchange VRDIERRORS.COM.\n", verrdefs_fin);
  fputs("C\n", verrdefs_fin);
  fputs("!\n", vrdifac_msg);
  fputs("!\tMessage file for facility VIC2\n", vrdifac_msg);
  fputs("!\n", vrdifac_msg);
  fputs("!  This file contains the message id's and detailed texts for\n", vrdifac_msg);
  fputs("!  the VRDI internal errors.\n", vrdifac_msg);
  fputs("!\n", vrdifac_msg);
  fputs("!\n", vrdifac_msg);
  fputs("!\tNOTE :  This file is built by VRDIERRORS.COM.  It should never\n", vrdifac_msg);
  fputs("!\t\tbe modified directly.  To make changes to the source,\n", vrdifac_msg);
  fputs("!\t\tchange VRDIERRORS.COM.\n", vrdifac_msg);
  fputs("!\n", vrdifac_msg);
  fputs("!\n", vrdifac_msg);
  cur_num = -65537;
  vrdierrs_dat = fopen("vrdierrs.dat", "r");
FIND_TOP:
  if (fgets(in_record, 2000, vrdierrs_dat) == NULL)
    goto EARLY_END;
  fgets(in_record, 2000, vrdierrs_dat);
  if (strncmp(in_record, "%%SKIP", 6) == 0) {
    cur_num = cur_num - 1;
  } else if (strncmp(in_record, "%%KEY ", 6) != 0)
    goto FIND_TOP;
TOP:
  strcpy(key, &in_record[6]);
  if ((len = strlen(key)) != 0)
    if (key[len - 1] == '\n')
      key[len - 1] = '\0';
  if (fgets(in_record, 2000, vrdierrs_dat) == NULL)
    goto EARLY_END;
  expected = "%%NUMBER ";
  if (strncmp(in_record, "%%NUMBER ", 9) != 0)
    goto BAD_DIRECTIVE;
  strcpy(number_str, &in_record[9]);
  sscanf(number_str, " %d", &number);
  if (number != cur_num)
    goto BAD_NUMBER;
  cur_num = cur_num - 1;
  if (fgets(in_record, 2000, vrdierrs_dat) == NULL)
    goto EARLY_END;
  expected = "%%NAME ";
  if (strncmp(in_record, "%%NAME ", 7) != 0)
    goto BAD_DIRECTIVE;
  strcpy(name, &in_record[7]);
  if ((len = strlen(name)) != 0)
    if (name[len - 1] == '\n')
      name[len - 1] = '\0';
  if (fgets(in_record, 2000, vrdierrs_dat) == NULL)
    goto EARLY_END;
  expected = "%%MESSAGE ";
  if (strncmp(in_record, "%%MESSAGE ", 10) != 0)
    goto BAD_DIRECTIVE;
  strcpy(message, &in_record[10]);
  if ((len = strlen(message)) != 0)
    if (message[len - 1] == '\n')
      message[len - 1] = '\0';
  fprintf(verrordefs_h, "#define %s %d\n", key, number);
  fprintf(verrdefs_fin, "      INTEGER %s\n", key);
  fprintf(verrdefs_fin, "      PARAMETER (%s = %d)\n", key, number);
  if (fgets(in_record, 2000, vrdierrs_dat) == NULL)
    goto EARLY_END;
  expected = "%%HELP";
  if (strncmp(in_record, "%%HELP", 6) != 0)
    goto BAD_DIRECTIVE;
  fprintf(vrdifac_msg, ".KEY %s\t! %s\n", key, name);
WRT_HLP:
  strcpy(in_record, "  ");
  if (fgets(in_record, 2000, vrdierrs_dat) == NULL)
    goto HLP_DONE;
  if (strncmp(in_record, "%%", 2) == 0)
    goto HLP_DONE;
  fputs(in_record, vrdifac_msg);
  goto WRT_HLP;
HLP_DONE:
  if (strncmp(in_record, "%%", 2) != 0)
    goto DONE;
CHECK_SKIP:
  if (strncmp(in_record, "%%SKIP", 6) != 0)
    goto CHECK_KEY;
  cur_num = cur_num - 1;
  if (fgets(in_record, 2000, vrdierrs_dat) == NULL)
    goto DONE;
  goto CHECK_SKIP;
CHECK_KEY:
  expected = "%%KEY ";
  if (strncmp(in_record, "%%KEY ", 6) != 0)
    goto BAD_DIRECTIVE;
  goto TOP;
DONE:
  fclose(vrdierrs_dat);
  fclose(verrordefs_h);
  fclose(verrdefs_fin);
  puts("****************************************");
  puts("*                                      *");
  puts("* VRDIERRORS.COM:                      *");
  puts("* All files successfully created       *");
  puts("*                                      *");
  puts("****************************************");
  exit(0);
EARLY_END:
  printf("**** Premature end of file encountered processing VRDIERRS.DAT\n");
  printf("**** Check file contents\n");
  goto PLS_FIX;
BAD_DIRECTIVE:
  printf("**** Bad directive in VRDIERRS.DAT\n");
  printf("**** Expected %s\n", expected);
  printf("**** Found %s\n", in_record);
  goto PLS_FIX;
BAD_NUMBER:
  printf("**** Numbering sequence in VRDIERRS.DAT is bad");
  printf("**** Found %d when expecting %ld\n", number, cur_num);
PLS_FIX:
  puts("");
  puts("Please see documentation in ERRORBLD.COM and fix");
  puts("ERROR file build aborted");
}
```