undefined4
RTMPGetKeyParameter(char *param_1,char *param_2,size_t param_3,undefined4 param_4,char param_5)

{
  char cVar1;
  int iVar2;
  size_t sVar3;
  char *pcVar4;
  char *pcVar5;
  char *pcVar6;
  char *local_30 [2];
  
  strlen(param_1);
  os_alloc_mem(0,local_30,0x1000);
  if (local_30[0] != (char *)0x0) {
    memset(local_30[0],0,0x1000)   //possible issue identified - semgrep
    pcVar5 = local_30[0];
    iVar2 = RTMPFindSection(param_4);
    if (iVar2 != 0) {
      pcVar6 = "\n";
      pcVar4 = pcVar5;
      do {
        cVar1 = *pcVar6;
        pcVar6 = pcVar6 + 1;
        *pcVar4 = cVar1;
        pcVar4 = pcVar4 + 1;
      } while (cVar1 != '\0');
      strcat(pcVar5,param_1)   //possible issue identified - semgrep
      strcat(pcVar5,"=")   //possible issue identified - semgrep
      iVar2 = rtstrstr(iVar2,pcVar5);
      if (iVar2 != 0) {
        sVar3 = strlen("\n");
        pcVar6 = (char *)(iVar2 + sVar3);
        pcVar4 = (char *)rtstrstr(pcVar6,&_LC4);
        if (pcVar4 == (char *)0x0) {
          sVar3 = strlen(pcVar6);
          pcVar4 = pcVar6 + sVar3;
        }
        pcVar5 = pcVar5 + 0x800;
        if (pcVar6 <= pcVar4) {
          memmove(pcVar5,pcVar6,(int)pcVar4 - (int)pcVar6)   //possible issue identified - semgrep
          pcVar5[(int)pcVar4 - (int)pcVar6] = '\0'   //possible issue identified - semgrep
          pcVar5 = (char *)rtstrstr(pcVar5,&_LC5);
          if (pcVar5 != (char *)0x0) {
            pcVar4 = pcVar5 + 1;
            if (*pcVar5 != '\0') {
              while( true ) {
                for (; *pcVar4 != ' '; pcVar4 = pcVar4 + 1) {
                  if (*pcVar4 != '\t') goto LAB_00048a4c;
                }
                if (param_5 == '\0') break;
                pcVar4 = pcVar4 + 1;
              }
            }
LAB_00048a4c:
            sVar3 = strlen(pcVar5);
            memset(param_2,0,param_3);
            if ((int)sVar3 <= (int)param_3) {
              param_3 = sVar3;
            }
            while (param_3 != 0) {
              cVar1 = *pcVar4;
              *param_2 = cVar1;
              param_2 = param_2 + 1;
              if (cVar1 == '\0') break;
              pcVar4 = pcVar4 + 1;
              param_3 = param_3 - 1   //possible issue identified - semgrep
            }
            os_free_mem(0,local_30[0]);
            return 1;
          }
        }
      }
    }
    os_free_mem(0,local_30[0]);
  }
  return 0;
}