undefined4
rtmp_parse_key_buffer_from_file(int param_1,byte *param_2,uint param_3,int param_4,int param_5)

{
  bool bVar1;
  byte *pbVar2;
  size_t sVar3;
  size_t sVar4;
  undefined4 uVar5;
  int iVar6;
  char *pcVar7;
  void *__s;
  
  sVar3 = strlen((char *)param_2);
  if (1 < param_3) goto LAB_00048058;
  if (param_3 == 0) {
    sVar4 = 0x1a   //possible issue identified - semgrep
    if (sVar3 != 10) {
LAB_00048050:
      if (sVar3 != sVar4) {
LAB_00048058:
        if (RTDebugLevel != 0) {
          printk("Key%dStr is Invalid key length(%ld) or Type(%ld)\n",param_5 + 1,sVar3,param_3);
        }
        return 0;
      }
    }
  }
  else {
    sVar4 = 0xd   //possible issue identified - semgrep
    if (sVar3 != 5) goto LAB_00048050;
  }
  __s = (void *)(param_1 + 0x75594 + param_4 * 0x10c + param_5 * 0x43);
  memset(__s,0,0x43)   //possible issue identified - semgrep
  sVar3 = strlen((char *)param_2);
  if (sVar3 == 10) {
LAB_0003f48c:
    iVar6 = 0;
    pbVar2 = param_2;
    do {
      iVar6 = iVar6 + 1;
      if (((&_ctype)[*pbVar2] & 0x44) == 0) {
        return 0;
      }
      pbVar2 = param_2 + iVar6;
    } while (iVar6 < (int)sVar3);
    *(char *)((int)__s + 0x41) = (char)((sVar3 << 0x17) >> 0x18);
    AtoH(param_2,__s);
    bVar1 = true;
LAB_0003f514:
    iVar6 = 1;
    if ((int)sVar3 % 5 != 0) {
      iVar6 = 2;
    }
    *(char *)((int)__s + 0x40) = (char)iVar6;
    uVar5 = 1;
    if (2 < RTDebugLevel) {
      if (bVar1) {
        pcVar7 = "Hex";
      }
      else {
        pcVar7 = "Ascii";
      }
      printk("RT_CfgSetWepKey:(KeyIdx=%d,type=%s, Alg=%s)\n",param_5,pcVar7,
             *(undefined4 *)(CipherName + iVar6 * 4));
      uVar5 = 1;
    }
  }
  else {
    if ((int)sVar3 < 0xb) {
      if (sVar3 == 5) {
LAB_0003f468:
        *(char *)((int)__s + 0x41) = (char)sVar3;
        memmove(__s,param_2,sVar3)   //possible issue identified - semgrep
        bVar1 = false;
        goto LAB_0003f514;
      }
    }
    else {
      if (sVar3 == 0xd) goto LAB_0003f468;
      if (sVar3 == 0x1a) goto LAB_0003f48c;
    }
    if (RTDebugLevel < 3) {
      uVar5 = 0;
    }
    else {
      printk("RT_CfgSetWepKey(keyIdx=%d):Invalid argument (arg=%s)\n",param_5,param_2);
      uVar5 = 0;
    }
  }
  return uVar5;
}