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

undefined4 FUN_00405844(undefined4 param_1,char *param_2,int param_3)

{
  FILE *pFVar1;
  int iVar2;
  int *piVar3;
  char *pcVar4;
  uint uVar5;
  size_t sVar6;
  undefined4 uVar7;
  uint uVar8;
  char acStack_40 [16];
  char *local_30;
  undefined4 local_2c;
  
  iVar2 = FUN_00403d38(param_1,param_2,0x8b01,acStack_40);
  uVar7 = 0xfffffffe;
  if (-1 < iVar2) {
    uVar7 = 0;
    if (*(int *)(param_3 + 0x14) != 0) {
      local_30 = *(char **)(param_3 + 0x18);
      local_2c = CONCAT31((int3)((uint)*(undefined4 *)(param_3 + 0x1c) >> 8),1);
      iVar2 = FUN_00404058(param_1,param_2,0x8b02,acStack_40);
      pFVar1 = _stderr;
      if (iVar2 < 0) {
        uVar7 = 0xffffffff;
        piVar3 = __errno_location();
        pcVar4 = strerror(*piVar3);
        fprintf(pFVar1,"SIOCSIWNWID: %s\n",pcVar4);
      }
      else {
        uVar7 = 0;
      }
    }
    if (*(int *)(param_3 + 0x20) != 0) {
      FUN_00403710(*(undefined4 *)(param_3 + 0x28));
      iVar2 = FUN_00404058(param_1,param_2,0x8b04,acStack_40);
      pFVar1 = _stderr;
      if (iVar2 < 0) {
        uVar7 = 0xffffffff;
        piVar3 = __errno_location();
        pcVar4 = strerror(*piVar3);
        fprintf(pFVar1,"SIOCSIWFREQ: %s\n",pcVar4);
      }
    }
    if (*(int *)(param_3 + 0x30) != 0) {
      uVar8 = *(uint *)(param_3 + 0x58);
      uVar5 = uVar8 & 0xff;
      if (uVar5 != 0) {
        local_30 = (char *)0x0;
        local_2c = (uint)(ushort)((ushort)uVar5 | 0x800) << 0x10;
        iVar2 = FUN_00404058(param_1,param_2,0x8b2a,acStack_40);
        pFVar1 = _stderr;
        if (iVar2 < 0) {
          uVar7 = 0xffffffff;
          piVar3 = __errno_location();
          iVar2 = *piVar3;
          pcVar4 = strerror(iVar2);
          fprintf(pFVar1,"SIOCSIWENCODE(%d): %s\n",iVar2,pcVar4);
        }
      }
      local_30 = (char *)(param_3 + 0x34);
      local_2c = CONCAT22((short)uVar8,(short)*(undefined4 *)(param_3 + 0x54)) & 0xff00ffff;
      iVar2 = FUN_00404058(param_1,param_2,0x8b2a,acStack_40);
      pFVar1 = _stderr;
      if (iVar2 < 0) {
        uVar7 = 0xffffffff;
        piVar3 = __errno_location();
        iVar2 = *piVar3;
        pcVar4 = strerror(iVar2);
        fprintf(pFVar1,"SIOCSIWENCODE(%d): %s\n",iVar2,pcVar4);
      }
    }
    if (*(int *)(param_3 + 0x5c) != 0) {
      local_30 = (char *)(param_3 + 100);
      sVar6 = strlen((char *)(param_3 + 100))   //possible issue identified - semgrep
      local_2c = CONCAT22((short)*(undefined4 *)(param_3 + 0x60),(short)sVar6 + 1);
      iVar2 = FUN_00404058(param_1,param_2,0x8b1a,acStack_40);
      pFVar1 = _stderr;
      if (iVar2 < 0) {
        uVar7 = 0xffffffff;
        piVar3 = __errno_location();
        pcVar4 = strerror(*piVar3);
        fprintf(pFVar1,"SIOCSIWESSID: %s\n",pcVar4);
      }
    }
    if (*(int *)(param_3 + 0x88) != 0) {
      strncpy(acStack_40,param_2,0x10)   //possible issue identified - semgrep
      local_30 = *(char **)(param_3 + 0x8c);
      iVar2 = FUN_00403d38(param_1,param_2,0x8b06,acStack_40);
      pFVar1 = _stderr;
      if (iVar2 < 0) {
        uVar7 = 0xffffffff;
        piVar3 = __errno_location();
        pcVar4 = strerror(*piVar3);
        fprintf(pFVar1,"SIOCSIWMODE: %s\n",pcVar4);
      }
    }
  }
  return uVar7;
}