// File: /workspace/github_c_makefile_star2_O3/mmayer[P]pcal/src/pcal.c
// Function: display_usage
void display_usage (FILE *fp,       /* destination of usage message */
                    int fullmsg)    /* print complete message? */
{
   FLAG_MSG *pflag;
   PARAM_MSG *ppar;
   char buf[30], *p, flag, *meta;
   int nchars, first, i, indent, n;
   
   sprintf(buf, "%s: %s", W_USAGE, progname);
   nchars = indent = strlen(buf);
   first = TRUE;
   meta = p = NULL;
   fprintf(fp, "\n%s", buf);
   
   /* convert various values to strings for printing (cf. pcallang.h) */
   sprintf(Xtval, "%d", 0);
   sprintf(Ytval, "%d", 0);
   sprintf(Xsval, "%.3f", 1.0);
   sprintf(Ysval, "%.3f", 1.0);
   sprintf(gen_diags_val, "%d", 0);
   
   sprintf(Ncopy, "%d", NCOPY);
   
   /* Display the basic command-line syntax message (by group of flags)... */
   
   for (pflag = flag_msg; (flag = pflag->flag) != '\0'; pflag++) {
      if (flag == '\n') {   /* end of group? */
         if (p) *p = '\0';
         if (meta) {   /* append metavariable name */
            strcat(buf, " ");
            strcat(buf, meta);
         }
         strcat(buf, "]");
         n = strlen(buf);
         if (nchars + n > SCREENWIDTH) {   /* does it fit on line? */
            fprintf(fp, "\n");   /* no - start new one */
            for (nchars = 0; nchars < indent; nchars++) fprintf(fp, " ");
         }
         fprintf(fp, "%s", buf);
         nchars += n;
         first = TRUE;
      }
      else if (flag != ' ') {   /* accumulate flags for group */
         if (first) {
            sprintf(buf, " [");
            p = buf + strlen(buf);
         }
         else *p++ = '|';

         *p++ = '-';
         *p++ = flag;
         meta = pflag->meta;   /* save metavariable name */
         first = FALSE;
      }
   }

   /* After displaying all the possible flag options, we now loop to append a
      display of the various possible formats of the numeric parameter
      descriptions (starting year, starting month, and number of months, in
      various permutations)... */

   for (i = 0; i < PARAM_MSGS; i++) {
      sprintf(buf, " [%s]%s", param_msg[i].desc, i < PARAM_MSGS - 1 ? " |" : "");
      n = strlen(buf);
      if (nchars + n > SCREENWIDTH) {   /* does it fit on line? */
         fprintf(fp, "\n");   /* no - start new one */
         for (nchars = 0; nchars < indent; nchars++) fprintf(fp, " ");
      }
      fprintf(fp, "%s", buf);
      nchars += n;
   }
   
   fprintf(fp, "\n\n");
   if (! fullmsg) {
      fprintf(fp, USAGE_MSG, progname, F_HELP);
      return;
   }
   
   /* Display detailed descriptions of each of the possible command-line
      flags... */

   for (pflag = flag_msg; (flag = pflag->flag) != '\0'; pflag++) {
      if (flag == '\n') {   /* newline?  print and quit */
         fprintf(fp, "\n");
         continue;
      }
      p = buf;   /* copy flag and metavariable to buffer */
      if (flag != ' ') *p++ = '-';
      
      *p++ = flag;
      
      *p = '\0';
      if (pflag->meta) sprintf(p, " %s", pflag->meta);

      fprintf(fp, "\t%-20.20s", buf);
      if (pflag->text) fprintf(fp, "%s", pflag->text);

      /* print default value if specified */
      if (pflag->def) {
         fprintf(fp, " (%s: %s)", W_DEFAULT, pflag->def[0] ? pflag->def : "\"\"" );
      }
      fprintf(fp, "\n");

      /* special case - print color messages after F_OUTLINE_GRAY */
      if (flag == F_OUTLINE_GRAY) {
         fprintf(fp, "\t%20s  (%s: %s)\n", "", W_DEFAULT, color_msg());
      }

   }
   
   /* now print the information about the numeric parameters */
   
   for (ppar = param_msg; ppar->desc; ppar++) {
      fprintf(fp, "\t%-16.16s%s\n", ppar->desc, ppar->text);
   }

   fprintf(fp, "\n");

   return;
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
subq $0x48, %rsp
movl %esi, 0x14(%rsp)
movq %rdi, %rbx
leaq 0x10cd0(%rip), %rsi     # 0x16e42
leaq 0x10cd0(%rip), %rdx     # 0x16e49
leaq 0x276b0(%rip), %rcx     # 0x2d830
xorl %ebp, %ebp
leaq 0x20(%rsp), %r15
movq %r15, %rdi
xorl %eax, %eax
callq 0x52f0
movq %r15, %rdi
callq 0x5100
movq %rax, %r14
leaq 0x10cac(%rip), %rsi     # 0x16e4f
movq %rbx, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0x5210
leaq 0x27535(%rip), %rdi     # 0x2d6ec
leaq 0x1a12c(%rip), %r12     # 0x202ea
movq %r12, %rsi
xorl %edx, %edx
xorl %eax, %eax
callq 0x52f0
leaq 0x27527(%rip), %rdi     # 0x2d6f8
movq %r12, %rsi
xorl %edx, %edx
xorl %eax, %eax
callq 0x52f0
leaq 0x27520(%rip), %rdi     # 0x2d704
leaq 0x10c68(%rip), %r13     # 0x16e53
movsd 0xfe6d(%rip), %xmm0     # 0x16060
movq %r13, %rsi
movb $0x1, %al
callq 0x52f0
leaq 0x2750c(%rip), %rdi     # 0x2d710
movq %r13, %rsi
movsd 0xfe51(%rip), %xmm0     # 0x16060
movb $0x1, %al
callq 0x52f0
leaq 0x274c3(%rip), %rdi     # 0x2d6e0
movq %r12, %rsi
xorl %edx, %edx
xorl %eax, %eax
callq 0x52f0
leaq 0x274ec(%rip), %rdi     # 0x2d71c
movl $0x1, %r13d
movq %r12, %rsi
movl $0x1, %edx
xorl %eax, %eax
callq 0x52f0
leaq 0x23b34(%rip), %r15     # 0x29d80
movq $0x0, 0x18(%rsp)
movq %r14, 0x8(%rsp)
movzbl (%r15), %r12d
cmpl $0xa, %r12d
je 0x62a3
cmpl $0x20, %r12d
je 0x6361
testl %r12d, %r12d
je 0x636a
testl %r13d, %r13d
je 0x6329
movb $0x0, 0x22(%rsp)
movw $0x5b20, 0x20(%rsp)     # imm = 0x5B20
leaq 0x20(%rsp), %rdi
callq 0x5100
leaq (%rsp,%rax), %rbp
addq $0x20, %rbp
jmp 0x6330
testq %rbp, %rbp
leaq 0x20(%rsp), %r12
je 0x62b1
movb $0x0, (%rbp)
movq 0x18(%rsp), %r13
testq %r13, %r13
je 0x62d5
movq %r12, %rdi
callq 0x5100
movw $0x20, 0x20(%rsp,%rax)
movq %r12, %rdi
movq %r13, %rsi
callq 0x52e0
movq %r12, %rdi
callq 0x5100
movw $0x5d, 0x20(%rsp,%rax)
movq %r12, %rdi
callq 0x5100
movq %rax, %r13
addl %r14d, %eax
cmpl $0x4f, %eax
jl 0x634d
movl $0xa, %edi
movq %rbx, %rsi
callq 0x51c0
movq 0x8(%rsp), %rax
testl %eax, %eax
jle 0x634a
movl %eax, %r14d
movl $0x20, %edi
movq %rbx, %rsi
callq 0x51c0
decl %r14d
jne 0x6310
movq 0x8(%rsp), %r14
jmp 0x634d
movb $0x7c, (%rbp)
incq %rbp
movb $0x2d, (%rbp)
movb %r12b, 0x1(%rbp)
addq $0x2, %rbp
movq 0x8(%r15), %rax
movq %rax, 0x18(%rsp)
xorl %r13d, %r13d
jmp 0x6361
xorl %r14d, %r14d
movq %r12, %rdi
movq %rbx, %rsi
callq 0x5160
addl %r13d, %r14d
movl $0x1, %r13d
addq $0x20, %r15
jmp 0x625a
leaq 0x10ae7(%rip), %r12     # 0x16e58
leaq 0x20(%rsp), %r15
xorl %ebp, %ebp
movq %rbp, %rax
shlq $0x4, %rax
leaq 0x245da(%rip), %rcx     # 0x2a960
movq (%rax,%rcx), %rdx
cmpq $0x2, %rbp
leaq 0x10acb(%rip), %rcx     # 0x16e60
leaq 0x1a411(%rip), %rax     # 0x207ad
cmoveq %rax, %rcx
movq %r15, %rdi
movq %r12, %rsi
xorl %eax, %eax
callq 0x52f0
movq %r15, %rdi
callq 0x5100
movq %rax, %r13
addl %r14d, %eax
cmpl $0x4f, %eax
jl 0x63f5
movl $0xa, %edi
movq %rbx, %rsi
callq 0x51c0
movq 0x8(%rsp), %rax
testl %eax, %eax
jle 0x63f2
movl %eax, %r14d
movl $0x20, %edi
movq %rbx, %rsi
callq 0x51c0
decl %r14d
jne 0x63d9
movq 0x8(%rsp), %r14
jmp 0x63f5
xorl %r14d, %r14d
movq %r15, %rdi
movq %rbx, %rsi
callq 0x5160
addl %r13d, %r14d
incq %rbp
cmpq $0x3, %rbp
jne 0x6378
leaq 0x1c848(%rip), %rdi     # 0x22c5f
movl $0x2, %esi
movl $0x1, %edx
movq %rbx, %rcx
callq 0x5310
cmpl $0x0, 0x14(%rsp)
je 0x657a
leaq 0x2395d(%rip), %r13     # 0x29d98
leaq 0x10a6a(%rip), %r14     # 0x16eac
leaq 0x10a77(%rip), %rbp     # 0x16ec0
movzbl -0x18(%r13), %r12d
cmpl $0xa, %r12d
je 0x651e
movq %r15, %rdi
cmpl $0x20, %r12d
je 0x6474
testl %r12d, %r12d
je 0x6534
movb $0x2d, 0x20(%rsp)
leaq 0x21(%rsp), %rdi
movb %r12b, (%rdi)
movb $0x0, 0x1(%rdi)
movq -0x10(%r13), %rdx
testq %rdx, %rdx
je 0x6495
incq %rdi
leaq 0x109b7(%rip), %rsi     # 0x16e45
xorl %eax, %eax
callq 0x52f0
movq %rbx, %rdi
movq %r14, %rsi
movq %r15, %rdx
xorl %eax, %eax
callq 0x5210
movq -0x8(%r13), %rdi
testq %rdi, %rdi
je 0x64b6
movq %rbx, %rsi
callq 0x5160
movq (%r13), %rax
testq %rax, %rax
je 0x64e2
cmpb $0x0, (%rax)
leaq 0x109ff(%rip), %rcx     # 0x16ec8
je 0x64ce
movq %rax, %rcx
movq %rbx, %rdi
leaq 0x109de(%rip), %rsi     # 0x16eb6
movq %rbp, %rdx
xorl %eax, %eax
callq 0x5210
movl $0xa, %edi
movq %rbx, %rsi
callq 0x51c0
cmpb $0x47, %r12b
jne 0x652b
callq 0x65a6
movq %rbx, %rdi
leaq 0x109c7(%rip), %rsi     # 0x16ecb
leaq 0x1a2a2(%rip), %rdx     # 0x207ad
movq %rbp, %rcx
leaq 0x27f8b(%rip), %r8      # 0x2e4a0
xorl %eax, %eax
callq 0x5210
jmp 0x652b
movl $0xa, %edi
movq %rbx, %rsi
callq 0x51c0
addq $0x20, %r13
jmp 0x6449
movq 0x24425(%rip), %rdx     # 0x2a960
testq %rdx, %rdx
je 0x656b
leaq 0x24429(%rip), %r15     # 0x2a970
leaq 0x1098e(%rip), %r14     # 0x16edc
movq -0x8(%r15), %rcx
movq %rbx, %rdi
movq %r14, %rsi
xorl %eax, %eax
callq 0x5210
movq (%r15), %rdx
addq $0x10, %r15
testq %rdx, %rdx
jne 0x654e
movl $0xa, %edi
movq %rbx, %rsi
callq 0x51c0
jmp 0x6597
leaq 0x108e2(%rip), %rsi     # 0x16e63
leaq 0x272a8(%rip), %rdx     # 0x2d830
movq %rbx, %rdi
movl $0x68, %ecx
xorl %eax, %eax
callq 0x5210
addq $0x48, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq