// File: /workspace/github_c_makefile_star2_O2/usgs[P]nshmp-haz-catalogs/src/agrid/adaptive/ck_args_wt_results.c
// Function: check_args
int check_args(int argc, char **argv, char *paramf, char *summf, char *paramf_format, int *stop_run, int *newp)
/*--------------------------------------------------------------------------*/
{
/* CHECK INPUT ARGUMENTS */
  if (  (argc != 2) && (argc != 4) && (argc !=5)  ) {
    fprintf(stderr,"USAGE: %s [parameter file] [parameter file formatting (new/old)] [summary file name] [[ optional quit before run (1) ]]\n", argv[0]);
    fprintf(stderr,"For parameter file formatting, enter -h, as single command line argument.\n");
    fprintf(stderr,"Enter (new/old) to specify the formatting style for the parameter file.\n");
    fprintf(stderr,"Optional quit argument will stop run before seismicity rate calculations to permit check of parameters.\n"); exit(1);
  }
  sscanf(argv[1],"%s",paramf);
  if ( argc > 2) {
    sscanf(argv[2],"%s",paramf_format);
    sscanf(argv[3],"%s",summf);
    if (argc > 4) sscanf(argv[4],"%d", stop_run);
  }

// check for help option
  if ( STREQ(paramf,"-h") ) {
    print_param_format();
    return 1;
  }
// check pareter file formatting
  if ( STREQ(paramf_format,"new") ) {
    fprintf(stderr,"Using new parameter file formatting...\n");
    *newp=1;
    return 0;
  }
  else if ( STREQ(paramf_format,"old") ) {
    fprintf(stderr,"Using old parameter file formatting...\n");
    *newp=0;
    return 0;
  }
  else {
    fprintf(stderr,"User must enter 'new' or 'old' to specify the style of formatting for the parameter file - %s.\n", paramf_format);
    return 1;
  }
}

// Assembly:
pushq %rbp
pushq %r15
pushq %r14
pushq %r13
pushq %r12
pushq %rbx
pushq %rax
movq %r8, (%rsp)
movq %rsi, %r12
cmpl $0x5, %edi
ja 0x4f9e
movl %edi, %ebp
pushq $0x34
popq %rax
btl %edi, %eax
jae 0x4f9e
movq %r9, %rbx
movq %rcx, %r13
movq %rdx, %r14
movq 0x8(%r12), %rdi
leaq 0x1501(%rip), %rsi      # 0x638f
xorl %eax, %eax
callq 0x1110
cmpl $0x3, %ebp
jb 0x4ee1
movq 0x10(%r12), %rdi
leaq 0x14e9(%rip), %r15      # 0x638f
movq %r15, %rsi
movq (%rsp), %rdx
xorl %eax, %eax
callq 0x1110
movq 0x18(%r12), %rdi
movq %r15, %rsi
movq %r13, %rdx
xorl %eax, %eax
callq 0x1110
cmpl $0x5, %ebp
jb 0x4ee1
movq 0x20(%r12), %rdi
leaq 0x14b2(%rip), %rsi      # 0x6389
movq %rbx, %rdx
xorl %eax, %eax
callq 0x1110
cmpb $0x2d, (%r14)
jne 0x4f0c
cmpb $0x68, 0x1(%r14)
jne 0x4f0c
cmpb $0x0, 0x2(%r14)
jne 0x4f0c
callq 0x12ac
pushq $0x1
popq %rax
addq $0x8, %rsp
popq %rbx
popq %r12
popq %r13
popq %r14
popq %r15
popq %rbp
retq
movq 0x40(%rsp), %rbx
leaq 0x289e(%rip), %rsi      # 0x77b6
movq (%rsp), %r15
movq %r15, %rdi
callq 0x10e0
testl %eax, %eax
jne 0x4f4c
movq 0x50c9(%rip), %rax      # 0x9ff8
movq (%rax), %rcx
leaq 0x2881(%rip), %rdi      # 0x77ba
pushq $0x27
popq %rsi
pushq $0x1
popq %rdx
callq 0x1190
movl $0x1, (%rbx)
jmp 0x4f7e
leaq 0x288f(%rip), %rsi      # 0x77e2
movq %r15, %rdi
callq 0x10e0
movq 0x5096(%rip), %rcx      # 0x9ff8
movq (%rcx), %rcx
testl %eax, %eax
jne 0x4f85
leaq 0x2876(%rip), %rdi      # 0x77e6
pushq $0x27
popq %rsi
pushq $0x1
popq %rdx
callq 0x1190
andl $0x0, (%rbx)
xorl %eax, %eax
jmp 0x4efd
leaq 0x2882(%rip), %rsi      # 0x780e
movq %rcx, %rdi
movq %r15, %rdx
xorl %eax, %eax
callq 0x10f0
jmp 0x4efa
movq 0x5053(%rip), %r14      # 0x9ff8
movq (%r14), %rdi
movq (%r12), %rdx
leaq 0x268d(%rip), %rsi      # 0x7640
xorl %eax, %eax
callq 0x10f0
movq (%r14), %rcx
leaq 0x26f5(%rip), %rdi      # 0x76b9
pushq $0x4a
popq %rsi
pushq $0x1
popq %rbx
movq %rbx, %rdx
callq 0x1190
movq (%r14), %rcx
leaq 0x2728(%rip), %rdi      # 0x7704
pushq $0x48
popq %rsi
movq %rbx, %rdx
callq 0x1190
movq (%r14), %rcx
leaq 0x275c(%rip), %rdi      # 0x774d
pushq $0x68
popq %rsi
movq %rbx, %rdx
callq 0x1190
pushq $0x1
popq %rdi
callq 0x1180