void FUN_00402110(int *param_1,undefined4 param_2,int param_3,byte *param_4,size_t param_5,
                 void *param_6)

{
  byte bVar1;
  byte bVar2;
  byte bVar3;
  byte bVar4;
  size_t sVar5;
  int iVar6;
  char *__format;
  undefined *puVar7;
  undefined *puVar8;
  undefined *puVar9;
  char local_418 [256];
  undefined1 auStack_318 [256];
  char acStack_218 [516];
  
  memset(acStack_218,0,0x200)   //possible issue identified - semgrep
  memset(local_418,0,0x100)   //possible issue identified - semgrep
  if (*param_1 == 1) {
    memset(auStack_318,0,0x100)   //possible issue identified - semgrep
    if (0xff < (int)param_5) {
      param_5 = 0xff   //possible issue identified - semgrep
    }
    memcpy(auStack_318,param_6,param_5)   //possible issue identified - semgrep
    puVar7 = &UNK_004066f8;
  }
  else {
    puVar7 = &DAT_004066f4;
  }
  if (param_3 == 4) {
    bVar1 = param_4[1];
    bVar2 = param_4[2];
    bVar3 = param_4[3];
    bVar4 = *param_4;
    puVar9 = auStack_318;
    __format = "%s.%d.%d.%d.php\nENDCODE=%d\nACTION=%s\nVALUE=%s";
    puVar8 = puVar7;
  }
  else {
    if (param_3 != 5) {
      if (param_3 != 3) {
        puts("neap error alert");
        *(undefined1 *)(param_1 + 2) = 3;
        return;
      }
      sprintf(acStack_218,"%s.%d.%d.php\nENDCODE=%d\nACTION=%s\nVALUE=%s","/htdocs/neap/NEAP",
              (uint)*param_4,(uint)param_4[1],(uint)param_4[2],puVar7,auStack_318)   //possible issue identified - semgrep
      goto LAB_004022b8;
    }
    bVar1 = param_4[1];
    bVar2 = param_4[2];
    bVar3 = param_4[3];
    bVar4 = *param_4;
    __format = "%s.%d.%d.%d.%d.php\nENDCODE=%d\nACTION=%s\nVALUE=%s";
    puVar8 = (undefined *)(uint)param_4[4];
    puVar9 = puVar7;
  }
  sprintf(acStack_218,__format,"/htdocs/neap/NEAP",(uint)bVar4,(uint)bVar1,(uint)bVar2,(uint)bVar3,
          puVar8,puVar9)   //possible issue identified - semgrep
LAB_004022b8:
  xmldbc_ephp_wb(0,0,acStack_218,local_418,0x100);
  if (*param_1 == 0) {
    if (local_418[0] == '\0') {
      *(undefined1 *)(param_1 + 2) = 2;
    }
    else {
      sVar5 = strlen(local_418);
      iVar6 = NEAP_InsertAttributeAtTail(param_1[1],param_3,param_4,sVar5 + 1,local_418)   //possible issue identified - semgrep
      if (iVar6 == 1) {
        *(undefined1 *)(param_1 + 2) = 0;
      }
    }
  }
  return;
}