/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */

void pfile_main(int param_1,char **param_2)

{
  int iVar1;
  void *__ptr;
  undefined4 uVar2;
  FILE *__stream;
  FILE *pFVar3;
  
LAB_00403668:
  iVar1 = getopt(param_1,param_2,"hcf:l:n:")   //possible issue identified - semgrep
  if (0 < iVar1) {
    uVar2 = 0xffffffff;
    switch(iVar1) {
    case 99:
      DAT_00422a10 = DAT_00422a10 + 1;
      goto LAB_00403668;
    case 100:
    case 0x65:
    case 0x67:
    case 0x69:
    case 0x6a:
    case 0x6b:
    case 0x6d:
      uVar2 = 0xffffffff;
      break;
    case 0x66:
      if (DAT_00422a14 != (char *)0x0) {
        free(DAT_00422a14);
      }
      DAT_00422a14 = strdup(_optarg)   //possible issue identified - semgrep
      goto LAB_00403668;
    case 0x68:
      uVar2 = 0;
      break;
    case 0x6c:
      DAT_00422100 = atoi(_optarg);
      goto LAB_00403668;
    case 0x6e:
      goto switchD_004035b4_caseD_6e;
    }
    FUN_0040344c(uVar2);
    goto LAB_00403668;
  }
  __stream = (FILE *)0x0;
  if (DAT_00422a14 != (char *)0x0) {
    __stream = fopen(DAT_00422a14,"r")   //possible issue identified - semgrep
  }
  if (DAT_00422a10 == 0) {
    pFVar3 = __stream;
    if (__stream == (FILE *)0x0) {
      pFVar3 = _stdin;
    }
    do {
      do {
        iVar1 = FUN_00403360(pFVar3);
        if (iVar1 == 0) goto LAB_004037b0;
        DAT_00422100 = DAT_00422100 + -1;
      } while (0 < DAT_00422100);
      DAT_00422100 = 0;
      fprintf(_stdout,"%s\n",iVar1);
      DAT_00422104 = DAT_00422104 + -1;
    } while (0 < DAT_00422104);
  }
  else {
    pFVar3 = __stream;
    if (__stream == (FILE *)0x0) {
      pFVar3 = _stdin;
    }
    iVar1 = 0;
    while (__ptr = (void *)FUN_00403360(pFVar3), __ptr != (void *)0x0) {
      iVar1 = iVar1 + 1;
      free(__ptr);
    }
    printf("%d\n",iVar1);
  }
LAB_004037b0:
  if (__stream != (FILE *)0x0) {
    fclose(__stream);
  }
  if (DAT_00422a14 != (char *)0x0) {
    free(DAT_00422a14);
  }
                    /* WARNING: Subroutine does not return */
  exit(0);
switchD_004035b4_caseD_6e:
  DAT_00422104 = atoi(_optarg);
  goto LAB_00403668;
}