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

void RT5350_ChipSwitchChannel(int param_1,uint param_2,uint param_3)

{
  byte bVar1;
  uint uVar2;
  int iVar3;
  char cVar4;
  byte *pbVar5;
  int iVar6;
  uint uVar7;
  code cVar8;
  char cVar9;
  undefined1 uVar10;
  byte *pbVar11;
  byte local_48 [8];
  uint local_40;
  int local_3c;
  int local_38;
  uint local_34;
  uint local_30;
  
  local_34 = param_2 & 0xff;
  local_30 = param_3 & 0xff;
  pbVar11 = (byte *)(param_1 + 0x4c22);
  local_48[0] = 0;
  iVar6 = 0;
  pbVar5 = pbVar11;
  cVar4 = '\0';
  do {
    bVar1 = *pbVar5;
    cVar9 = cVar4 + '\x01';
    pbVar5 = pbVar5 + 10;
    if (bVar1 == local_34) {
      iVar6 = iVar6 * 10 + param_1;
      local_3c = (int)*(char *)(iVar6 + 0x4c25);
      local_38 = (int)*(char *)(iVar6 + 0x4c24);
      if (cVar4 == '6') goto LAB_000c52b4;
      goto LAB_000c52dc;
    }
    iVar6 = iVar6 + 1;
    cVar4 = cVar9;
  } while (cVar9 != '6');
  local_38 = 0;
  local_3c = 5;
LAB_000c52b4:
  if (RTDebugLevel != 0) {
    printk("AsicSwitchChannel: Can\'t find the Channel#%d \n",local_34);
  }
LAB_000c52dc:
  if (((*(uint *)(param_1 + 0x4a94) == 0x28720200) ||
      ((*(uint *)(param_1 + 0x4a94) & 0xffff0000) == 0x53500000)) &&
     ((cVar4 = *(char *)(param_1 + 0x4bd4), (byte)(cVar4 - 0xbU) < 2 ||
      (((cVar4 == '\x05' || (cVar4 == '\a')) || (cVar4 == '\b')))))) {   //possible issue identified - semgrep
    local_40 = 0;
    pbVar5 = FreqItems3020;
    iVar6 = 0;
    while( true ) {
      if (NUM_OF_3020_CHNL <= local_40) break;
      if (local_34 == *pbVar5) {
        if (_DAT_b0000010 << 0xb < 0) {
          RT30xxWriteRFRegister(param_1,8,pbVar5[1]);
          RT30xxWriteRFRegister(param_1,9,FreqItems3020[iVar6 + 3]);
          local_48[0] = 0x9f;
        }
        else {
          iVar6 = local_40 * 4;
          RT30xxWriteRFRegister(param_1,8,FreqItems3020_Xtal20M[iVar6 + 1]);
          RT30xxWriteRFRegister(param_1,9,FreqItems3020_Xtal20M[iVar6 + 3]);
          local_48[0] = 0x1f;
        }
        RT30xxWriteRFRegister(param_1,0xd,local_48[0]);
        local_48[0] = 0x4a;
        RT30xxWriteRFRegister(param_1,0xb,0x4a);
        iVar6 = 0;
        bVar1 = *pbVar11;
        goto LAB_000c5428;
      }
      local_40 = local_40 + 1 & 0xff;
      pbVar5 = pbVar5 + 4;
      iVar6 = iVar6 + 4;
    }
    goto LAB_000c6830;
  }
  if (2 < RTDebugLevel) {
    printk("SwitchChannel#%d : unknown RFIC=%d\n",local_34,*(undefined1 *)(param_1 + 0x4bd4));
  }
  goto LAB_000c68dc;
LAB_000c5428:
  pbVar11 = pbVar11 + 10;
  if (bVar1 == local_34) goto code_r0x000c5434;
  iVar6 = iVar6 + 1;
  if (iVar6 == 0x36) goto LAB_000c5480;
  bVar1 = *pbVar11;
  goto LAB_000c5428;
code_r0x000c9a7c:
  cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
  goto LAB_000c9a28;
code_r0x000c7b40:
  cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
  goto LAB_000c7aec;
code_r0x000c5434:
  local_48[0] = *(byte *)(iVar6 * 10 + param_1 + 0x4c24) & 0x3f | 0x80;
  RT30xxWriteRFRegister(param_1,0x31,local_48[0]);
LAB_000c5480:
  local_48[0] = 0x46;
  RT30xxWriteRFRegister(param_1,0xc,0x46);
  RT30xxReadRFRegister(param_1,0x1e,local_48);
  if (AsicRxAntEvalTimeout[param_1 + 5] == (code)0x1) {
    local_48[0] = local_48[0] | 6;
  }
  else {
    local_48[0] = local_48[0] & 0xf9;
  }
  RT30xxWriteRFRegister(param_1,0x1e,local_48[0]);
  if (*(char *)(param_1 + 0x16982) == '\x01') {
    local_48[0] = 0xc0;
  }
  else {
    local_48[0] = 0x80;
  }
  RT30xxWriteRFRegister(param_1,0x20,local_48[0]);
  local_48[0] = 0;
  RT30xxWriteRFRegister(param_1,0x35,0);
  local_48[0] = 0x43;
  RT30xxWriteRFRegister(param_1,0x37,0x43);
  local_48[0] = 0x82;
  RT30xxWriteRFRegister(param_1,0x38,0x82);
  RT30xxReadRFRegister(param_1,3,local_48);
  local_48[0] = local_48[0] & 0x7f | 0x80;
  RT30xxWriteRFRegister(param_1,3,local_48[0]);
  RTMPusecDelay(2000);
  uVar2 = Status;
  cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
  if (cVar4 == '\0') {
    if (*(int *)(param_1 + 0x29f8) == 4) {
      uVar7 = 0;
      if (*(char *)(param_1 + 0xad) == '\x01') {
        Status = Status & 0xfffffffe;
        uVar7 = uVar2 & 1;
      }
      iVar6 = 0;
      cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
LAB_000c560c:
      uVar2 = 0;
      if (cVar4 == '\0') {
        uVar2 = *(uint *)(*(int *)(param_1 + 0xdc) + 0x101c);
      }
      if ((uVar2 & 0x20000) != 0) {
LAB_000c5698:
        iVar6 = iVar6 + 1;
        if (iVar6 == 100) goto LAB_000c56a0;
        cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
        goto LAB_000c560c;
      }
      if (cVar4 == '\0') {
        *(undefined4 *)(*(int *)(param_1 + 0xdc) + 0x101c) = 0xb3100;
      }
      iVar3 = 1;
      while( true ) {
        uVar2 = 0;
        if (*(char *)(param_1 + 0xec) == '\0') {
          uVar2 = *(uint *)(*(int *)(param_1 + 0xdc) + 0x101c);
        }
        if (((uVar2 & 0x20000) == 0) || (iVar3 == 100)) break;
        iVar3 = iVar3 + 1;
      }
      if ((uVar2 & 0x2ff00) != 0x3100) goto LAB_000c5698;
      local_48[0] = (byte)uVar2;
LAB_000c56a0:
      if ((int)(uVar2 << 0xe) < 0) {
        printk("ERROR!!! ");
        printk("BBP(viaMCU=%d) read R%d fail\n",0,0x31);
        local_48[0] = *(byte *)(param_1 + 0x4afa);
LAB_000c583c:
        cVar4 = *(char *)(param_1 + 0xad)   //possible issue identified - semgrep
      }
      else {
        cVar4 = *(char *)(param_1 + 0xad)   //possible issue identified - semgrep
      }
    }
    else {
      uVar7 = 0;
      if (*(char *)(param_1 + 0xad) == '\x01') {
        Status = Status & 0xfffffffe;
        uVar7 = uVar2 & 1;
      }
      iVar6 = 0;
      cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
LAB_000c5718:
      uVar2 = 0;
      if (cVar4 == '\0') {
        uVar2 = *(uint *)(*(int *)(param_1 + 0xdc) + 0x7028);
      }
      if ((uVar2 & 0x20000) != 0) {
LAB_000c57d8:
        iVar6 = iVar6 + 1;
        if (iVar6 == 100) goto LAB_000c57e0;
        cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
        goto LAB_000c5718;
      }
      if (cVar4 == '\0') {
        *(undefined4 *)(*(int *)(param_1 + 0xdc) + 0x7028) = 0xb3100;
      }
      AsicSendCommandToMcuBBP(param_1,0x80,0xff,0,0,0);
      RTMPusecDelay(1000);
      iVar3 = 1;
      while( true ) {
        uVar2 = 0;
        if (*(char *)(param_1 + 0xec) == '\0') {
          uVar2 = *(uint *)(*(int *)(param_1 + 0xdc) + 0x7028);
        }
        if (((uVar2 & 0x20000) == 0) || (iVar3 == 100)) break;
        iVar3 = iVar3 + 1;
      }
      if ((uVar2 & 0x2ff00) != 0x3100) goto LAB_000c57d8;
      local_48[0] = (byte)uVar2;
LAB_000c57e0:
      if ((int)(uVar2 << 0xe) < 0) {
        printk("ERROR!!! ");
        printk("BBP(viaMCU=%d) read R%d fail\n",1,0x31);
        local_48[0] = *(byte *)(param_1 + 0x4afa);
        if (*(char *)(param_1 + 0xec) == '\0') {
          *(uint *)(*(int *)(param_1 + 0xdc) + 0x7028) =
               *(uint *)(*(int *)(param_1 + 0xdc) + 0x7028) & 0xfffdffff;
        }
        goto LAB_000c583c;
      }
      cVar4 = *(char *)(param_1 + 0xad)   //possible issue identified - semgrep
    }
    if (cVar4 == '\x01') {
      Status = Status & 0xfffffffe;
      if (uVar7 != 0) {
        Status = Status | 1;
      }
      cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
    }
    else {
      cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
    }
    uVar2 = Status;
    if (cVar4 == '\0') {
      if (*(int *)(param_1 + 0x29f8) == 4) {
        uVar7 = 0;
        if (*(char *)(param_1 + 0xad) == '\x01') {
          Status = Status & 0xfffffffe;
          uVar7 = uVar2 & 1;
        }
        iVar6 = 1;
        cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
        while( true ) {
          uVar2 = 0;
          if (cVar4 == '\0') {
            uVar2 = *(uint *)(*(int *)(param_1 + 0xdc) + 0x101c);
          }
          if ((uVar2 & 0x20000) == 0) break;
          iVar6 = iVar6 + 1;
          printk(&_LC5)   //possible issue identified - semgrep
          if (iVar6 == 100) goto LAB_000c5944;
          cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
        }
        if (cVar4 == '\0') {
          *(uint *)(*(int *)(param_1 + 0xdc) + 0x101c) = local_48[0] & 0xfe | 0xa3100;
        }
        *(byte *)(param_1 + 0x4afa) = local_48[0] & 0xfe;
        if (iVar6 != 100) {
          cVar4 = *(char *)(param_1 + 0xad)   //possible issue identified - semgrep
          goto LAB_000c5968;
        }
LAB_000c5944:
        printk("ERROR!!! ");
        printk("BBP write R%d fail\n",0x31);
        cVar4 = *(char *)(param_1 + 0xad)   //possible issue identified - semgrep
LAB_000c5968:
        if (cVar4 == '\x01') {
LAB_000c5b34:
          Status = Status & 0xfffffffe;
          if (uVar7 != 0) {
            Status = Status | 1;
          }
          cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
        }
        else {
          cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
        }
      }
      else {
        uVar7 = 0;
        if (*(char *)(param_1 + 0xad) == '\x01') {
          Status = Status & 0xfffffffe;
          uVar7 = uVar2 & 1;
        }
        iVar6 = 1;
        cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
        while( true ) {
          uVar2 = 0;
          if (cVar4 == '\0') {
            uVar2 = *(uint *)(*(int *)(param_1 + 0xdc) + 0x7028);
          }
          if ((uVar2 & 0x20000) == 0) break;
          iVar3 = iVar6 % 0x14;
          iVar6 = iVar6 + 1;
          if ((iVar3 == 0) && (cVar4 == '\0')) {
            *(uint *)(*(int *)(param_1 + 0xdc) + 0x7028) = uVar2 & 0xfffdffff;
          }
          printk(&_LC5)   //possible issue identified - semgrep
          if (iVar6 == 100) goto LAB_000c5ad8;
          cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
        }
        uVar2 = (uint)local_48[0];
        if (cVar4 == '\0') {
          *(uint *)(*(int *)(param_1 + 0xdc) + 0x7028) = uVar2 & 0xfe | 0xa3100;
        }
        iVar3 = AsicSendCommandToMcuBBP(param_1,0x80,0xff,0,0,0);
        if (*(char *)(param_1 + 0x16964) == '\x01') {
          RTMPusecDelay(1000);
        }
        if ((iVar3 == 0) && (*(char *)(param_1 + 0xec) == '\0')) {
          *(uint *)(*(int *)(param_1 + 0xdc) + 0x7028) = uVar2 & 0xfe | 0x83100;
        }
        *(byte *)(param_1 + 0x4afa) = local_48[0] & 0xfe;
        if (iVar6 != 100) {
          cVar4 = *(char *)(param_1 + 0xad)   //possible issue identified - semgrep
          goto LAB_000c5b24;
        }
LAB_000c5ad8:
        printk("ERROR!!! ");
        printk("BBP write R%d fail\n",0x31);
        if (*(char *)(param_1 + 0xec) == '\0') {
          *(uint *)(*(int *)(param_1 + 0xdc) + 0x7028) =
               *(uint *)(*(int *)(param_1 + 0xdc) + 0x7028) & 0xfffdffff;
          cVar4 = *(char *)(param_1 + 0xad)   //possible issue identified - semgrep
        }
        else {
          cVar4 = *(char *)(param_1 + 0xad)   //possible issue identified - semgrep
        }
LAB_000c5b24:
        if (cVar4 == '\x01') goto LAB_000c5b34;
        cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
      }
    }
    else {
      cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
    }
  }
  uVar2 = Status;
  if (cVar4 == '\0') {
    if (*(int *)(param_1 + 0x29f8) == 4) {
      uVar7 = 0;
      if (*(char *)(param_1 + 0xad) == '\x01') {
        Status = Status & 0xfffffffe;
        uVar7 = uVar2 & 1;
      }
      iVar6 = 0;
      cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
LAB_000c5b98:
      uVar2 = 0;
      if (cVar4 == '\0') {
        uVar2 = *(uint *)(*(int *)(param_1 + 0xdc) + 0x101c);
      }
      if ((uVar2 & 0x20000) != 0) {
LAB_000c5c24:
        iVar6 = iVar6 + 1;
        if (iVar6 == 100) goto LAB_000c5c2c;
        cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
        goto LAB_000c5b98;
      }
      if (cVar4 == '\0') {
        *(undefined4 *)(*(int *)(param_1 + 0xdc) + 0x101c) = 0xb3100;
      }
      iVar3 = 1;
      while( true ) {
        uVar2 = 0;
        if (*(char *)(param_1 + 0xec) == '\0') {
          uVar2 = *(uint *)(*(int *)(param_1 + 0xdc) + 0x101c);
        }
        if (((uVar2 & 0x20000) == 0) || (iVar3 == 100)) break;
        iVar3 = iVar3 + 1;
      }
      if ((uVar2 & 0x2ff00) != 0x3100) goto LAB_000c5c24;
      local_48[0] = (byte)uVar2;
LAB_000c5c2c:
      if ((int)(uVar2 << 0xe) < 0) {
        printk("ERROR!!! ");
        printk("BBP(viaMCU=%d) read R%d fail\n",0,0x31);
        local_48[0] = *(byte *)(param_1 + 0x4afa);
LAB_000c5dc8:
        cVar4 = *(char *)(param_1 + 0xad)   //possible issue identified - semgrep
      }
      else {
        cVar4 = *(char *)(param_1 + 0xad)   //possible issue identified - semgrep
      }
    }
    else {
      uVar7 = 0;
      if (*(char *)(param_1 + 0xad) == '\x01') {
        Status = Status & 0xfffffffe;
        uVar7 = uVar2 & 1;
      }
      iVar6 = 0;
      cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
LAB_000c5ca4:
      uVar2 = 0;
      if (cVar4 == '\0') {
        uVar2 = *(uint *)(*(int *)(param_1 + 0xdc) + 0x7028);
      }
      if ((uVar2 & 0x20000) != 0) {
LAB_000c5d64:
        iVar6 = iVar6 + 1;
        if (iVar6 == 100) goto LAB_000c5d6c;
        cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
        goto LAB_000c5ca4;
      }
      if (cVar4 == '\0') {
        *(undefined4 *)(*(int *)(param_1 + 0xdc) + 0x7028) = 0xb3100;
      }
      AsicSendCommandToMcuBBP(param_1,0x80,0xff,0,0,0);
      RTMPusecDelay(1000);
      iVar3 = 1;
      while( true ) {
        uVar2 = 0;
        if (*(char *)(param_1 + 0xec) == '\0') {
          uVar2 = *(uint *)(*(int *)(param_1 + 0xdc) + 0x7028);
        }
        if (((uVar2 & 0x20000) == 0) || (iVar3 == 100)) break;
        iVar3 = iVar3 + 1;
      }
      if ((uVar2 & 0x2ff00) != 0x3100) goto LAB_000c5d64;
      local_48[0] = (byte)uVar2;
LAB_000c5d6c:
      if ((int)(uVar2 << 0xe) < 0) {
        printk("ERROR!!! ");
        printk("BBP(viaMCU=%d) read R%d fail\n",1,0x31);
        local_48[0] = *(byte *)(param_1 + 0x4afa);
        if (*(char *)(param_1 + 0xec) == '\0') {
          *(uint *)(*(int *)(param_1 + 0xdc) + 0x7028) =
               *(uint *)(*(int *)(param_1 + 0xdc) + 0x7028) & 0xfffdffff;
        }
        goto LAB_000c5dc8;
      }
      cVar4 = *(char *)(param_1 + 0xad)   //possible issue identified - semgrep
    }
    if (cVar4 == '\x01') {
      Status = Status & 0xfffffffe;
      if (uVar7 != 0) {
        Status = Status | 1;
      }
      uVar2 = *(uint *)(param_1 + 0x4a94);
    }
    else {
      uVar2 = *(uint *)(param_1 + 0x4a94);
    }
  }
  else {
    uVar2 = *(uint *)(param_1 + 0x4a94);
  }
  *(undefined1 *)(param_1 + 0x50ad) = 1;
  *(char *)(param_1 + 0x4be0) = (char)local_34;
  if ((uVar2 & 0xffff0000) == 0x53500000) {
    local_48[0] = 0;
  }
  if (((local_30 == 0) && (AsicRxAntEvalTimeout[param_1 + 5] == (code)0x1)) &&
     ((*(uint *)(param_1 + 0x4a94) & 0xffff0000) == 0x53500000)) {
    local_48[0] = 0;
  }
  RT30xxWriteRFRegister(param_1,0x18,local_48[0]);
  if (local_30 == 0) {
    uVar2 = *(uint *)(param_1 + 0x4a94);
    if (AsicRxAntEvalTimeout[param_1 + 5] != (code)0x1) goto LAB_000c5eb8;
    if ((uVar2 & 0xffff0000) == 0x53500000) {
      RT30xxWriteRFRegister(param_1,0x1f,0x80);
      uVar2 = *(uint *)(param_1 + 0x4a94);
    }
    else {
      uVar2 = *(uint *)(param_1 + 0x4a94);
    }
  }
  else {
    uVar2 = *(uint *)(param_1 + 0x4a94);
LAB_000c5eb8:
    if ((uVar2 & 0xffff0000) == 0x53500000) {
      RT30xxWriteRFRegister(param_1,0x1f,0x80);
      uVar2 = *(uint *)(param_1 + 0x4a94);
    }
    else {
      uVar2 = *(uint *)(param_1 + 0x4a94);
    }
  }
  uVar10 = (undefined1)local_34;
  if ((uVar2 & 0xffff0000) == 0x53500000) {
    RT30xxReadRFRegister(param_1,3,local_48);
    local_48[0] = local_48[0] & 0x7f | 0x80;
    RT30xxWriteRFRegister(param_1,3,local_48[0]);
    RTMPusecDelay(2000);
    uVar2 = Status;
    cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
    if (cVar4 == '\0') {
      if (*(int *)(param_1 + 0x29f8) == 4) {
        uVar7 = 0;
        if (*(char *)(param_1 + 0xad) == '\x01') {
          Status = Status & 0xfffffffe;
          uVar7 = uVar2 & 1;
        }
        iVar6 = 0;
        cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
LAB_000c5fa0:
        uVar2 = 0;
        if (cVar4 == '\0') {
          uVar2 = *(uint *)(*(int *)(param_1 + 0xdc) + 0x101c);
        }
        if ((uVar2 & 0x20000) != 0) {
LAB_000c602c:
          iVar6 = iVar6 + 1;
          if (iVar6 == 100) goto LAB_000c6034;
          cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
          goto LAB_000c5fa0;
        }
        if (cVar4 == '\0') {
          *(undefined4 *)(*(int *)(param_1 + 0xdc) + 0x101c) = 0xb3100;
        }
        iVar3 = 1;
        while( true ) {
          uVar2 = 0;
          if (*(char *)(param_1 + 0xec) == '\0') {
            uVar2 = *(uint *)(*(int *)(param_1 + 0xdc) + 0x101c);
          }
          if (((uVar2 & 0x20000) == 0) || (iVar3 == 100)) break;
          iVar3 = iVar3 + 1;
        }
        if ((uVar2 & 0x2ff00) != 0x3100) goto LAB_000c602c;
        local_48[0] = (byte)uVar2;
LAB_000c6034:
        if ((int)(uVar2 << 0xe) < 0) {
          printk("ERROR!!! ");
          printk("BBP(viaMCU=%d) read R%d fail\n",0,0x31);
          local_48[0] = *(byte *)(param_1 + 0x4afa);
LAB_000c61d0:
          cVar4 = *(char *)(param_1 + 0xad)   //possible issue identified - semgrep
        }
        else {
          cVar4 = *(char *)(param_1 + 0xad)   //possible issue identified - semgrep
        }
      }
      else {
        uVar7 = 0;
        if (*(char *)(param_1 + 0xad) == '\x01') {
          Status = Status & 0xfffffffe;
          uVar7 = uVar2 & 1;
        }
        iVar6 = 0;
        cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
LAB_000c60ac:
        uVar2 = 0;
        if (cVar4 == '\0') {
          uVar2 = *(uint *)(*(int *)(param_1 + 0xdc) + 0x7028);
        }
        if ((uVar2 & 0x20000) != 0) {
LAB_000c616c:
          iVar6 = iVar6 + 1;
          if (iVar6 == 100) goto LAB_000c6174;
          cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
          goto LAB_000c60ac;
        }
        if (cVar4 == '\0') {
          *(undefined4 *)(*(int *)(param_1 + 0xdc) + 0x7028) = 0xb3100;
        }
        AsicSendCommandToMcuBBP(param_1,0x80,0xff,0,0,0);
        RTMPusecDelay(1000);
        iVar3 = 1;
        while( true ) {
          uVar2 = 0;
          if (*(char *)(param_1 + 0xec) == '\0') {
            uVar2 = *(uint *)(*(int *)(param_1 + 0xdc) + 0x7028);
          }
          if (((uVar2 & 0x20000) == 0) || (iVar3 == 100)) break;
          iVar3 = iVar3 + 1;
        }
        if ((uVar2 & 0x2ff00) != 0x3100) goto LAB_000c616c;
        local_48[0] = (byte)uVar2;
LAB_000c6174:
        if ((int)(uVar2 << 0xe) < 0) {
          printk("ERROR!!! ");
          printk("BBP(viaMCU=%d) read R%d fail\n",1,0x31);
          local_48[0] = *(byte *)(param_1 + 0x4afa);
          if (*(char *)(param_1 + 0xec) == '\0') {
            *(uint *)(*(int *)(param_1 + 0xdc) + 0x7028) =
                 *(uint *)(*(int *)(param_1 + 0xdc) + 0x7028) & 0xfffdffff;
          }
          goto LAB_000c61d0;
        }
        cVar4 = *(char *)(param_1 + 0xad)   //possible issue identified - semgrep
      }
      if (cVar4 == '\x01') {
        Status = Status & 0xfffffffe;
        if (uVar7 != 0) {
          Status = Status | 1;
        }
        cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
      }
      else {
        cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
      }
      uVar2 = Status;
      if (cVar4 == '\0') {
        if (*(int *)(param_1 + 0x29f8) == 4) {
          uVar7 = 0;
          if (*(char *)(param_1 + 0xad) == '\x01') {
            Status = Status & 0xfffffffe;
            uVar7 = uVar2 & 1;
          }
          iVar6 = 1;
          cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
          while( true ) {
            uVar2 = 0;
            if (cVar4 == '\0') {
              uVar2 = *(uint *)(*(int *)(param_1 + 0xdc) + 0x101c);
            }
            if ((uVar2 & 0x20000) == 0) break;
            iVar6 = iVar6 + 1;
            printk(&_LC5)   //possible issue identified - semgrep
            if (iVar6 == 100) goto LAB_000c62d8;
            cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
          }
          if (cVar4 == '\0') {
            *(uint *)(*(int *)(param_1 + 0xdc) + 0x101c) = local_48[0] & 0xfe | 0xa3100;
          }
          *(byte *)(param_1 + 0x4afa) = local_48[0] & 0xfe;
          if (iVar6 != 100) {
            cVar4 = *(char *)(param_1 + 0xad)   //possible issue identified - semgrep
            goto LAB_000c62fc;
          }
LAB_000c62d8:
          printk("ERROR!!! ");
          printk("BBP write R%d fail\n",0x31);
          cVar4 = *(char *)(param_1 + 0xad)   //possible issue identified - semgrep
LAB_000c62fc:
          if (cVar4 == '\x01') {
LAB_000c64c8:
            Status = Status & 0xfffffffe;
            if (uVar7 != 0) {
              Status = Status | 1;
            }
            cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
          }
          else {
            cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
          }
        }
        else {
          uVar7 = 0;
          if (*(char *)(param_1 + 0xad) == '\x01') {
            Status = Status & 0xfffffffe;
            uVar7 = uVar2 & 1;
          }
          iVar6 = 1;
          cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
          while( true ) {
            uVar2 = 0;
            if (cVar4 == '\0') {
              uVar2 = *(uint *)(*(int *)(param_1 + 0xdc) + 0x7028);
            }
            if ((uVar2 & 0x20000) == 0) break;
            iVar3 = iVar6 % 0x14;
            iVar6 = iVar6 + 1;
            if ((iVar3 == 0) && (cVar4 == '\0')) {
              *(uint *)(*(int *)(param_1 + 0xdc) + 0x7028) = uVar2 & 0xfffdffff;
            }
            printk(&_LC5)   //possible issue identified - semgrep
            if (iVar6 == 100) goto LAB_000c646c;
            cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
          }
          uVar2 = (uint)local_48[0];
          if (cVar4 == '\0') {
            *(uint *)(*(int *)(param_1 + 0xdc) + 0x7028) = uVar2 & 0xfe | 0xa3100;
          }
          iVar3 = AsicSendCommandToMcuBBP(param_1,0x80,0xff,0,0,0);
          if (*(char *)(param_1 + 0x16964) == '\x01') {
            RTMPusecDelay(1000);
          }
          if ((iVar3 == 0) && (*(char *)(param_1 + 0xec) == '\0')) {
            *(uint *)(*(int *)(param_1 + 0xdc) + 0x7028) = uVar2 & 0xfe | 0x83100;
          }
          *(byte *)(param_1 + 0x4afa) = local_48[0] & 0xfe;
          if (iVar6 != 100) {
            cVar4 = *(char *)(param_1 + 0xad)   //possible issue identified - semgrep
            goto LAB_000c64b8;
          }
LAB_000c646c:
          printk("ERROR!!! ");
          printk("BBP write R%d fail\n",0x31);
          if (*(char *)(param_1 + 0xec) == '\0') {
            *(uint *)(*(int *)(param_1 + 0xdc) + 0x7028) =
                 *(uint *)(*(int *)(param_1 + 0xdc) + 0x7028) & 0xfffdffff;
            cVar4 = *(char *)(param_1 + 0xad)   //possible issue identified - semgrep
          }
          else {
            cVar4 = *(char *)(param_1 + 0xad)   //possible issue identified - semgrep
          }
LAB_000c64b8:
          if (cVar4 == '\x01') goto LAB_000c64c8;
          cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
        }
      }
      else {
        cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
      }
    }
    uVar2 = Status;
    if (cVar4 == '\0') {
      if (*(int *)(param_1 + 0x29f8) == 4) {
        uVar7 = 0;
        if (*(char *)(param_1 + 0xad) == '\x01') {
          Status = Status & 0xfffffffe;
          uVar7 = uVar2 & 1;
        }
        iVar6 = 0;
        cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
LAB_000c652c:
        uVar2 = 0;
        if (cVar4 == '\0') {
          uVar2 = *(uint *)(*(int *)(param_1 + 0xdc) + 0x101c);
        }
        if ((uVar2 & 0x20000) != 0) {
LAB_000c65b8:
          iVar6 = iVar6 + 1;
          if (iVar6 == 100) goto LAB_000c65c0;
          cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
          goto LAB_000c652c;
        }
        if (cVar4 == '\0') {
          *(undefined4 *)(*(int *)(param_1 + 0xdc) + 0x101c) = 0xb3100;
        }
        iVar3 = 1;
        while( true ) {
          uVar2 = 0;
          if (*(char *)(param_1 + 0xec) == '\0') {
            uVar2 = *(uint *)(*(int *)(param_1 + 0xdc) + 0x101c);
          }
          if (((uVar2 & 0x20000) == 0) || (iVar3 == 100)) break;
          iVar3 = iVar3 + 1;
        }
        if ((uVar2 & 0x2ff00) != 0x3100) goto LAB_000c65b8;
        local_48[0] = (byte)uVar2;
LAB_000c65c0:
        if ((int)(uVar2 << 0xe) < 0) {
          printk("ERROR!!! ");
          printk("BBP(viaMCU=%d) read R%d fail\n",0,0x31);
          local_48[0] = *(byte *)(param_1 + 0x4afa);
LAB_000c675c:
          cVar4 = *(char *)(param_1 + 0xad)   //possible issue identified - semgrep
        }
        else {
          cVar4 = *(char *)(param_1 + 0xad)   //possible issue identified - semgrep
        }
      }
      else {
        uVar7 = 0;
        if (*(char *)(param_1 + 0xad) == '\x01') {
          Status = Status & 0xfffffffe;
          uVar7 = uVar2 & 1;
        }
        iVar6 = 0;
        cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
LAB_000c6638:
        uVar2 = 0;
        if (cVar4 == '\0') {
          uVar2 = *(uint *)(*(int *)(param_1 + 0xdc) + 0x7028);
        }
        if ((uVar2 & 0x20000) != 0) {
LAB_000c66f8:
          iVar6 = iVar6 + 1;
          if (iVar6 == 100) goto LAB_000c6700;
          cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
          goto LAB_000c6638;
        }
        if (cVar4 == '\0') {
          *(undefined4 *)(*(int *)(param_1 + 0xdc) + 0x7028) = 0xb3100;
        }
        AsicSendCommandToMcuBBP(param_1,0x80,0xff,0,0,0);
        RTMPusecDelay(1000);
        iVar3 = 1;
        while( true ) {
          uVar2 = 0;
          if (*(char *)(param_1 + 0xec) == '\0') {
            uVar2 = *(uint *)(*(int *)(param_1 + 0xdc) + 0x7028);
          }
          if (((uVar2 & 0x20000) == 0) || (iVar3 == 100)) break;
          iVar3 = iVar3 + 1;
        }
        if ((uVar2 & 0x2ff00) != 0x3100) goto LAB_000c66f8;
        local_48[0] = (byte)uVar2;
LAB_000c6700:
        if ((int)(uVar2 << 0xe) < 0) {
          printk("ERROR!!! ");
          printk("BBP(viaMCU=%d) read R%d fail\n",1,0x31);
          local_48[0] = *(byte *)(param_1 + 0x4afa);
          if (*(char *)(param_1 + 0xec) == '\0') {
            *(uint *)(*(int *)(param_1 + 0xdc) + 0x7028) =
                 *(uint *)(*(int *)(param_1 + 0xdc) + 0x7028) & 0xfffdffff;
          }
          goto LAB_000c675c;
        }
        cVar4 = *(char *)(param_1 + 0xad)   //possible issue identified - semgrep
      }
      if ((cVar4 == '\x01') && (Status = Status & 0xfffffffe, uVar7 != 0)) {
        Status = Status | 1;
      }
    }
    *(undefined1 *)(param_1 + 0x50ad) = 1;
    RT30xxReadRFRegister(param_1,1,local_48);
    bVar1 = local_48[0] & 3;
    local_48[0] = bVar1 | 0x3c;
    if ((*(uint *)(param_1 + 0x4bf4) & 0xf0) == 0x10) {
      local_48[0] = bVar1 | 0x1c;
    }
    if ((*(uint *)(param_1 + 0x4bf4) & 0xf) == 1) {
      local_48[0] = local_48[0] & 0xef;
    }
    RT30xxWriteRFRegister(param_1,1,local_48[0]);
    uVar10 = (undefined1)local_34;
  }
  *(undefined1 *)(param_1 + 0x4be0) = uVar10;
LAB_000c6830:
  if (2 < RTDebugLevel) {
    printk("SwitchChannel#%d(RF=%d, Pwr0=%d, Pwr1=%d, %dT), N=0x%02X, K=0x%02X, R=0x%02X\n",local_34
           ,*(undefined1 *)(param_1 + 0x4bd4),local_38,local_3c,
           (uint)(*(int *)(param_1 + 0x4bf4) << 0x18) >> 0x1c,FreqItems3020[local_40 * 4 + 1],
           FreqItems3020[local_40 * 4 + 3],FreqItems3020[local_40 * 4 + 2]);
  }
LAB_000c68dc:
  uVar2 = Status;
  if (0xe < local_34) {
    if (*(char *)(param_1 + 0xec) == '\0') {
      if (*(int *)(param_1 + 0x29f8) == 4) {
        uVar7 = 0;
        if (*(char *)(param_1 + 0xad) == '\x01') {
          Status = Status & 0xfffffffe;
          uVar7 = uVar2 & 1;
        }
        iVar6 = 1;
        cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
        while( true ) {
          uVar2 = 0;
          if (cVar4 == '\0') {
            uVar2 = *(uint *)(*(int *)(param_1 + 0xdc) + 0x101c);
          }
          if ((uVar2 & 0x20000) == 0) break;
          iVar6 = iVar6 + 1;
          printk(&_LC5)   //possible issue identified - semgrep
          if (iVar6 == 100) goto LAB_000c8970;
          cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
        }
        bVar1 = *(byte *)(param_1 + 0x4be0);
        if (bVar1 < 0xf) {
          uVar2 = (uint)*(byte *)(param_1 + 0x50e4);
        }
        else if (bVar1 < 0x41) {
          uVar2 = (uint)*(byte *)(param_1 + 0x50e5);
        }
        else if (bVar1 < 0x81) {
          uVar2 = (uint)*(byte *)(param_1 + 0x50e6);
        }
        else {
          uVar2 = (uint)*(byte *)(param_1 + 0x50e7);
        }
        if (cVar4 == '\0') {
          *(uint *)(*(int *)(param_1 + 0xdc) + 0x101c) = 0x37 - uVar2 & 0xff | 0xa3e00;
        }
        bVar1 = *(byte *)(param_1 + 0x4be0);
        if (bVar1 < 0xf) {
          cVar4 = *(char *)(param_1 + 0x50e4)   //possible issue identified - semgrep
        }
        else if (bVar1 < 0x41) {
          cVar4 = *(char *)(param_1 + 0x50e5)   //possible issue identified - semgrep
        }
        else if (bVar1 < 0x81) {
          cVar4 = *(char *)(param_1 + 0x50e6)   //possible issue identified - semgrep
        }
        else {
          cVar4 = *(char *)(param_1 + 0x50e7)   //possible issue identified - semgrep
        }
        *(char *)(param_1 + 0x4b07) = '7' - cVar4;
        if (iVar6 != 100) {
          cVar4 = *(char *)(param_1 + 0xad)   //possible issue identified - semgrep
          goto LAB_000c8994;
        }
LAB_000c8970:
        printk("ERROR!!! ");
        printk("BBP write R%d fail\n",0x3e);
        cVar4 = *(char *)(param_1 + 0xad)   //possible issue identified - semgrep
LAB_000c8994:
        if (cVar4 == '\x01') {
LAB_000c8bd0:
          Status = Status & 0xfffffffe;
          if (uVar7 != 0) {
            Status = Status | 1;
          }
          cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
        }
        else {
          cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
        }
      }
      else {
        uVar7 = 0;
        if (*(char *)(param_1 + 0xad) == '\x01') {
          Status = Status & 0xfffffffe;
          uVar7 = uVar2 & 1;
        }
        iVar6 = 1;
        cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
        while( true ) {
          uVar2 = 0;
          if (cVar4 == '\0') {
            uVar2 = *(uint *)(*(int *)(param_1 + 0xdc) + 0x7028);
          }
          if ((uVar2 & 0x20000) == 0) break;
          iVar3 = iVar6 % 0x14;
          iVar6 = iVar6 + 1;
          if ((iVar3 == 0) && (cVar4 == '\0')) {
            *(uint *)(*(int *)(param_1 + 0xdc) + 0x7028) = uVar2 & 0xfffdffff;
          }
          printk(&_LC5)   //possible issue identified - semgrep
          if (iVar6 == 100) goto LAB_000c8b74;
          cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
        }
        bVar1 = *(byte *)(param_1 + 0x4be0);
        if (bVar1 < 0xf) {
          uVar2 = (uint)*(byte *)(param_1 + 0x50e4);
        }
        else if (bVar1 < 0x41) {
          uVar2 = (uint)*(byte *)(param_1 + 0x50e5);
        }
        else if (bVar1 < 0x81) {
          uVar2 = (uint)*(byte *)(param_1 + 0x50e6);
        }
        else {
          uVar2 = (uint)*(byte *)(param_1 + 0x50e7);
        }
        uVar2 = 0x37 - uVar2 & 0xff;
        if (cVar4 == '\0') {
          *(uint *)(*(int *)(param_1 + 0xdc) + 0x7028) = uVar2 | 0xa3e00;
        }
        iVar3 = AsicSendCommandToMcuBBP(param_1,0x80,0xff,0,0,0);
        if (*(char *)(param_1 + 0x16964) == '\x01') {
          RTMPusecDelay(1000);
        }
        if (iVar3 == 0) {
          if (*(char *)(param_1 + 0xec) == '\0') {
            *(uint *)(*(int *)(param_1 + 0xdc) + 0x7028) = uVar2 | 0x83e00;
          }
          bVar1 = *(byte *)(param_1 + 0x4be0);
        }
        else {
          bVar1 = *(byte *)(param_1 + 0x4be0);
        }
        if (bVar1 < 0xf) {
          cVar4 = *(char *)(param_1 + 0x50e4)   //possible issue identified - semgrep
        }
        else if (bVar1 < 0x41) {
          cVar4 = *(char *)(param_1 + 0x50e5)   //possible issue identified - semgrep
        }
        else if (bVar1 < 0x81) {
          cVar4 = *(char *)(param_1 + 0x50e6)   //possible issue identified - semgrep
        }
        else {
          cVar4 = *(char *)(param_1 + 0x50e7)   //possible issue identified - semgrep
        }
        *(char *)(param_1 + 0x4b07) = '7' - cVar4;
        if (iVar6 != 100) {
          cVar4 = *(char *)(param_1 + 0xad)   //possible issue identified - semgrep
          goto LAB_000c8bc0;
        }
LAB_000c8b74:
        printk("ERROR!!! ");
        printk("BBP write R%d fail\n",0x3e);
        if (*(char *)(param_1 + 0xec) == '\0') {
          *(uint *)(*(int *)(param_1 + 0xdc) + 0x7028) =
               *(uint *)(*(int *)(param_1 + 0xdc) + 0x7028) & 0xfffdffff;
          cVar4 = *(char *)(param_1 + 0xad)   //possible issue identified - semgrep
        }
        else {
          cVar4 = *(char *)(param_1 + 0xad)   //possible issue identified - semgrep
        }
LAB_000c8bc0:
        if (cVar4 == '\x01') goto LAB_000c8bd0;
        cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
      }
    }
    else {
      cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
    }
    uVar2 = Status;
    if (cVar4 == '\0') {
      if (*(int *)(param_1 + 0x29f8) == 4) {
        uVar7 = 0;
        if (*(char *)(param_1 + 0xad) == '\x01') {
          Status = Status & 0xfffffffe;
          uVar7 = uVar2 & 1;
        }
        iVar6 = 1;
        cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
        while( true ) {
          uVar2 = 0;
          if (cVar4 == '\0') {
            uVar2 = *(uint *)(*(int *)(param_1 + 0xdc) + 0x101c);
          }
          if ((uVar2 & 0x20000) == 0) break;
          iVar6 = iVar6 + 1;
          printk(&_LC5)   //possible issue identified - semgrep
          if (iVar6 == 100) goto LAB_000c8d30;
          cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
        }
        bVar1 = *(byte *)(param_1 + 0x4be0);
        if (bVar1 < 0xf) {
          uVar2 = (uint)*(byte *)(param_1 + 0x50e4);
        }
        else if (bVar1 < 0x41) {
          uVar2 = (uint)*(byte *)(param_1 + 0x50e5);
        }
        else if (bVar1 < 0x81) {
          uVar2 = (uint)*(byte *)(param_1 + 0x50e6);
        }
        else {
          uVar2 = (uint)*(byte *)(param_1 + 0x50e7);
        }
        if (cVar4 == '\0') {
          *(uint *)(*(int *)(param_1 + 0xdc) + 0x101c) = 0x37 - uVar2 & 0xff | 0xa3f00;
        }
        bVar1 = *(byte *)(param_1 + 0x4be0);
        if (bVar1 < 0xf) {
          cVar4 = *(char *)(param_1 + 0x50e4)   //possible issue identified - semgrep
        }
        else if (bVar1 < 0x41) {
          cVar4 = *(char *)(param_1 + 0x50e5)   //possible issue identified - semgrep
        }
        else if (bVar1 < 0x81) {
          cVar4 = *(char *)(param_1 + 0x50e6)   //possible issue identified - semgrep
        }
        else {
          cVar4 = *(char *)(param_1 + 0x50e7)   //possible issue identified - semgrep
        }
        *(char *)(param_1 + 0x4b08) = '7' - cVar4;
        if (iVar6 != 100) {
          cVar4 = *(char *)(param_1 + 0xad)   //possible issue identified - semgrep
          goto LAB_000c8d54;
        }
LAB_000c8d30:
        printk("ERROR!!! ");
        printk("BBP write R%d fail\n",0x3f);
        cVar4 = *(char *)(param_1 + 0xad)   //possible issue identified - semgrep
LAB_000c8d54:
        if (cVar4 == '\x01') {
LAB_000c8f90:
          Status = Status & 0xfffffffe;
          if (uVar7 != 0) {
            Status = Status | 1;
          }
          cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
        }
        else {
          cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
        }
      }
      else {
        uVar7 = 0;
        if (*(char *)(param_1 + 0xad) == '\x01') {
          Status = Status & 0xfffffffe;
          uVar7 = uVar2 & 1;
        }
        iVar6 = 1;
        cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
        while( true ) {
          uVar2 = 0;
          if (cVar4 == '\0') {
            uVar2 = *(uint *)(*(int *)(param_1 + 0xdc) + 0x7028);
          }
          if ((uVar2 & 0x20000) == 0) break;
          iVar3 = iVar6 % 0x14;
          iVar6 = iVar6 + 1;
          if ((iVar3 == 0) && (cVar4 == '\0')) {
            *(uint *)(*(int *)(param_1 + 0xdc) + 0x7028) = uVar2 & 0xfffdffff;
          }
          printk(&_LC5)   //possible issue identified - semgrep
          if (iVar6 == 100) goto LAB_000c8f34;
          cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
        }
        bVar1 = *(byte *)(param_1 + 0x4be0);
        if (bVar1 < 0xf) {
          uVar2 = (uint)*(byte *)(param_1 + 0x50e4);
        }
        else if (bVar1 < 0x41) {
          uVar2 = (uint)*(byte *)(param_1 + 0x50e5);
        }
        else if (bVar1 < 0x81) {
          uVar2 = (uint)*(byte *)(param_1 + 0x50e6);
        }
        else {
          uVar2 = (uint)*(byte *)(param_1 + 0x50e7);
        }
        uVar2 = 0x37 - uVar2 & 0xff;
        if (cVar4 == '\0') {
          *(uint *)(*(int *)(param_1 + 0xdc) + 0x7028) = uVar2 | 0xa3f00;
        }
        iVar3 = AsicSendCommandToMcuBBP(param_1,0x80,0xff,0,0,0);
        if (*(char *)(param_1 + 0x16964) == '\x01') {
          RTMPusecDelay(1000);
        }
        if (iVar3 == 0) {
          if (*(char *)(param_1 + 0xec) == '\0') {
            *(uint *)(*(int *)(param_1 + 0xdc) + 0x7028) = uVar2 | 0x83f00;
          }
          bVar1 = *(byte *)(param_1 + 0x4be0);
        }
        else {
          bVar1 = *(byte *)(param_1 + 0x4be0);
        }
        if (bVar1 < 0xf) {
          cVar4 = *(char *)(param_1 + 0x50e4)   //possible issue identified - semgrep
        }
        else if (bVar1 < 0x41) {
          cVar4 = *(char *)(param_1 + 0x50e5)   //possible issue identified - semgrep
        }
        else if (bVar1 < 0x81) {
          cVar4 = *(char *)(param_1 + 0x50e6)   //possible issue identified - semgrep
        }
        else {
          cVar4 = *(char *)(param_1 + 0x50e7)   //possible issue identified - semgrep
        }
        *(char *)(param_1 + 0x4b08) = '7' - cVar4;
        if (iVar6 != 100) {
          cVar4 = *(char *)(param_1 + 0xad)   //possible issue identified - semgrep
          goto LAB_000c8f80;
        }
LAB_000c8f34:
        printk("ERROR!!! ");
        printk("BBP write R%d fail\n",0x3f);
        if (*(char *)(param_1 + 0xec) == '\0') {
          *(uint *)(*(int *)(param_1 + 0xdc) + 0x7028) =
               *(uint *)(*(int *)(param_1 + 0xdc) + 0x7028) & 0xfffdffff;
          cVar4 = *(char *)(param_1 + 0xad)   //possible issue identified - semgrep
        }
        else {
          cVar4 = *(char *)(param_1 + 0xad)   //possible issue identified - semgrep
        }
LAB_000c8f80:
        if (cVar4 == '\x01') goto LAB_000c8f90;
        cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
      }
    }
    else {
      cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
    }
    uVar2 = Status;
    if (cVar4 == '\0') {
      if (*(int *)(param_1 + 0x29f8) == 4) {
        uVar7 = 0;
        if (*(char *)(param_1 + 0xad) == '\x01') {
          Status = Status & 0xfffffffe;
          uVar7 = uVar2 & 1;
        }
        iVar6 = 1;
        cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
        while( true ) {
          uVar2 = 0;
          if (cVar4 == '\0') {
            uVar2 = *(uint *)(*(int *)(param_1 + 0xdc) + 0x101c);
          }
          if ((uVar2 & 0x20000) == 0) break;
          iVar6 = iVar6 + 1;
          printk(&_LC5)   //possible issue identified - semgrep
          if (iVar6 == 100) goto LAB_000c90f0;
          cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
        }
        bVar1 = *(byte *)(param_1 + 0x4be0);
        if (bVar1 < 0xf) {
          uVar2 = (uint)*(byte *)(param_1 + 0x50e4);
        }
        else if (bVar1 < 0x41) {
          uVar2 = (uint)*(byte *)(param_1 + 0x50e5);
        }
        else if (bVar1 < 0x81) {
          uVar2 = (uint)*(byte *)(param_1 + 0x50e6);
        }
        else {
          uVar2 = (uint)*(byte *)(param_1 + 0x50e7);
        }
        if (cVar4 == '\0') {
          *(uint *)(*(int *)(param_1 + 0xdc) + 0x101c) = 0x37 - uVar2 & 0xff | 0xa4000;
        }
        bVar1 = *(byte *)(param_1 + 0x4be0);
        if (bVar1 < 0xf) {
          cVar4 = *(char *)(param_1 + 0x50e4)   //possible issue identified - semgrep
        }
        else if (bVar1 < 0x41) {
          cVar4 = *(char *)(param_1 + 0x50e5)   //possible issue identified - semgrep
        }
        else if (bVar1 < 0x81) {
          cVar4 = *(char *)(param_1 + 0x50e6)   //possible issue identified - semgrep
        }
        else {
          cVar4 = *(char *)(param_1 + 0x50e7)   //possible issue identified - semgrep
        }
        *(char *)(param_1 + 0x4b09) = '7' - cVar4;
        if (iVar6 != 100) {
          cVar4 = *(char *)(param_1 + 0xad)   //possible issue identified - semgrep
          goto LAB_000c9114;
        }
LAB_000c90f0:
        printk("ERROR!!! ");
        printk("BBP write R%d fail\n",0x40);
        cVar4 = *(char *)(param_1 + 0xad)   //possible issue identified - semgrep
LAB_000c9114:
        if (cVar4 == '\x01') {
LAB_000c9350:
          Status = Status & 0xfffffffe;
          if (uVar7 != 0) {
            Status = Status | 1;
          }
          cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
        }
        else {
          cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
        }
      }
      else {
        uVar7 = 0;
        if (*(char *)(param_1 + 0xad) == '\x01') {
          Status = Status & 0xfffffffe;
          uVar7 = uVar2 & 1;
        }
        iVar6 = 1;
        cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
        while( true ) {
          uVar2 = 0;
          if (cVar4 == '\0') {
            uVar2 = *(uint *)(*(int *)(param_1 + 0xdc) + 0x7028);
          }
          if ((uVar2 & 0x20000) == 0) break;
          iVar3 = iVar6 % 0x14;
          iVar6 = iVar6 + 1;
          if ((iVar3 == 0) && (cVar4 == '\0')) {
            *(uint *)(*(int *)(param_1 + 0xdc) + 0x7028) = uVar2 & 0xfffdffff;
          }
          printk(&_LC5)   //possible issue identified - semgrep
          if (iVar6 == 100) goto LAB_000c92f4;
          cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
        }
        bVar1 = *(byte *)(param_1 + 0x4be0);
        if (bVar1 < 0xf) {
          uVar2 = (uint)*(byte *)(param_1 + 0x50e4);
        }
        else if (bVar1 < 0x41) {
          uVar2 = (uint)*(byte *)(param_1 + 0x50e5);
        }
        else if (bVar1 < 0x81) {
          uVar2 = (uint)*(byte *)(param_1 + 0x50e6);
        }
        else {
          uVar2 = (uint)*(byte *)(param_1 + 0x50e7);
        }
        uVar2 = 0x37 - uVar2 & 0xff;
        if (cVar4 == '\0') {
          *(uint *)(*(int *)(param_1 + 0xdc) + 0x7028) = uVar2 | 0xa4000;
        }
        iVar3 = AsicSendCommandToMcuBBP(param_1,0x80,0xff,0,0,0);
        if (*(char *)(param_1 + 0x16964) == '\x01') {
          RTMPusecDelay(1000);
        }
        if (iVar3 == 0) {
          if (*(char *)(param_1 + 0xec) == '\0') {
            *(uint *)(*(int *)(param_1 + 0xdc) + 0x7028) = uVar2 | 0x84000;
          }
          bVar1 = *(byte *)(param_1 + 0x4be0);
        }
        else {
          bVar1 = *(byte *)(param_1 + 0x4be0);
        }
        if (bVar1 < 0xf) {
          cVar4 = *(char *)(param_1 + 0x50e4)   //possible issue identified - semgrep
        }
        else if (bVar1 < 0x41) {
          cVar4 = *(char *)(param_1 + 0x50e5)   //possible issue identified - semgrep
        }
        else if (bVar1 < 0x81) {
          cVar4 = *(char *)(param_1 + 0x50e6)   //possible issue identified - semgrep
        }
        else {
          cVar4 = *(char *)(param_1 + 0x50e7)   //possible issue identified - semgrep
        }
        *(char *)(param_1 + 0x4b09) = '7' - cVar4;
        if (iVar6 != 100) {
          cVar4 = *(char *)(param_1 + 0xad)   //possible issue identified - semgrep
          goto LAB_000c9340;
        }
LAB_000c92f4:
        printk("ERROR!!! ");
        printk("BBP write R%d fail\n",0x40);
        if (*(char *)(param_1 + 0xec) == '\0') {
          *(uint *)(*(int *)(param_1 + 0xdc) + 0x7028) =
               *(uint *)(*(int *)(param_1 + 0xdc) + 0x7028) & 0xfffdffff;
          cVar4 = *(char *)(param_1 + 0xad)   //possible issue identified - semgrep
        }
        else {
          cVar4 = *(char *)(param_1 + 0xad)   //possible issue identified - semgrep
        }
LAB_000c9340:
        if (cVar4 == '\x01') goto LAB_000c9350;
        cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
      }
    }
    else {
      cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
    }
    uVar2 = Status;
    if (cVar4 == '\0') {
      if (*(int *)(param_1 + 0x29f8) == 4) {
        uVar7 = 0;
        if (*(char *)(param_1 + 0xad) == '\x01') {
          Status = Status & 0xfffffffe;
          uVar7 = uVar2 & 1;
        }
        iVar6 = 1;
        cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
        while( true ) {
          uVar2 = 0;
          if (cVar4 == '\0') {
            uVar2 = *(uint *)(*(int *)(param_1 + 0xdc) + 0x101c);
          }
          if ((uVar2 & 0x20000) == 0) break;
          iVar6 = iVar6 + 1;
          printk(&_LC5)   //possible issue identified - semgrep
          if (iVar6 == 100) goto LAB_000c9440;
          cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
        }
        if (cVar4 == '\0') {
          *(undefined4 *)(*(int *)(param_1 + 0xdc) + 0x101c) = 0xa5638;
        }
        *(undefined1 *)(param_1 + 0x4b1f) = 0x38;
        if (iVar6 != 100) {
          cVar4 = *(char *)(param_1 + 0xad)   //possible issue identified - semgrep
          goto LAB_000c9464;
        }
LAB_000c9440:
        printk("ERROR!!! ");
        printk("BBP write R%d fail\n",0x56);
        cVar4 = *(char *)(param_1 + 0xad)   //possible issue identified - semgrep
LAB_000c9464:
        if (cVar4 == '\x01') {
LAB_000c9628:
          Status = Status & 0xfffffffe;
          if (uVar7 != 0) {
            Status = Status | 1;
          }
          cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
        }
        else {
          cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
        }
      }
      else {
        uVar7 = 0;
        if (*(char *)(param_1 + 0xad) == '\x01') {
          Status = Status & 0xfffffffe;
          uVar7 = uVar2 & 1;
        }
        iVar6 = 1;
        cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
        while( true ) {
          uVar2 = 0;
          if (cVar4 == '\0') {
            uVar2 = *(uint *)(*(int *)(param_1 + 0xdc) + 0x7028);
          }
          if ((uVar2 & 0x20000) == 0) break;
          iVar3 = iVar6 % 0x14;
          iVar6 = iVar6 + 1;
          if ((iVar3 == 0) && (cVar4 == '\0')) {
            *(uint *)(*(int *)(param_1 + 0xdc) + 0x7028) = uVar2 & 0xfffdffff;
          }
          printk(&_LC5)   //possible issue identified - semgrep
          if (iVar6 == 100) goto LAB_000c95cc;
          cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
        }
        if (cVar4 == '\0') {
          *(undefined4 *)(*(int *)(param_1 + 0xdc) + 0x7028) = 0xa5638;
        }
        iVar3 = AsicSendCommandToMcuBBP(param_1,0x80,0xff,0,0,0);
        if (*(char *)(param_1 + 0x16964) == '\x01') {
          RTMPusecDelay(1000);
        }
        if ((iVar3 == 0) && (*(char *)(param_1 + 0xec) == '\0')) {
          *(undefined4 *)(*(int *)(param_1 + 0xdc) + 0x7028) = 0x85638;
        }
        *(undefined1 *)(param_1 + 0x4b1f) = 0x38;
        if (iVar6 != 100) {
          cVar4 = *(char *)(param_1 + 0xad)   //possible issue identified - semgrep
          goto LAB_000c9618;
        }
LAB_000c95cc:
        printk("ERROR!!! ");
        printk("BBP write R%d fail\n",0x56);
        if (*(char *)(param_1 + 0xec) == '\0') {
          *(uint *)(*(int *)(param_1 + 0xdc) + 0x7028) =
               *(uint *)(*(int *)(param_1 + 0xdc) + 0x7028) & 0xfffdffff;
          cVar4 = *(char *)(param_1 + 0xad)   //possible issue identified - semgrep
        }
        else {
          cVar4 = *(char *)(param_1 + 0xad)   //possible issue identified - semgrep
        }
LAB_000c9618:
        if (cVar4 == '\x01') goto LAB_000c9628;
        cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
      }
    }
    else {
      cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
    }
    uVar2 = Status;
    if (cVar4 == '\0') {
      if (*(int *)(param_1 + 0x29f8) == 4) {
        uVar7 = 0;
        if (*(char *)(param_1 + 0xad) == '\x01') {
          Status = Status & 0xfffffffe;
          uVar7 = uVar2 & 1;
        }
        iVar6 = 1;
        cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
        while( true ) {
          uVar2 = 0;
          if (cVar4 == '\0') {
            uVar2 = *(uint *)(*(int *)(param_1 + 0xdc) + 0x101c);
          }
          if ((uVar2 & 0x20000) == 0) break;
          iVar6 = iVar6 + 1;
          printk(&_LC5)   //possible issue identified - semgrep
          if (iVar6 == 100) goto LAB_000c9718;
          cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
        }
        if (cVar4 == '\0') {
          *(undefined4 *)(*(int *)(param_1 + 0xdc) + 0x101c) = 0xa52f2;
        }
        *(undefined1 *)(param_1 + 0x4b1b) = 0xf2;
        if (iVar6 != 100) {
          cVar4 = *(char *)(param_1 + 0xad)   //possible issue identified - semgrep
          goto LAB_000c973c;
        }
LAB_000c9718:
        printk("ERROR!!! ");
        printk("BBP write R%d fail\n",0x52);
        cVar4 = *(char *)(param_1 + 0xad)   //possible issue identified - semgrep
LAB_000c973c:
        if (cVar4 == '\x01') {
LAB_000c9900:
          Status = Status & 0xfffffffe;
          if (uVar7 != 0) {
            Status = Status | 1;
          }
          iVar6 = *(int *)(param_1 + 0x4bf4);
        }
        else {
          iVar6 = *(int *)(param_1 + 0x4bf4);
        }
      }
      else {
        uVar7 = 0;
        if (*(char *)(param_1 + 0xad) == '\x01') {
          Status = Status & 0xfffffffe;
          uVar7 = uVar2 & 1;
        }
        iVar6 = 1;
        cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
        while( true ) {
          uVar2 = 0;
          if (cVar4 == '\0') {
            uVar2 = *(uint *)(*(int *)(param_1 + 0xdc) + 0x7028);
          }
          if ((uVar2 & 0x20000) == 0) break;
          iVar3 = iVar6 % 0x14;
          iVar6 = iVar6 + 1;
          if ((iVar3 == 0) && (cVar4 == '\0')) {
            *(uint *)(*(int *)(param_1 + 0xdc) + 0x7028) = uVar2 & 0xfffdffff;
          }
          printk(&_LC5)   //possible issue identified - semgrep
          if (iVar6 == 100) goto LAB_000c98a4;
          cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
        }
        if (cVar4 == '\0') {
          *(undefined4 *)(*(int *)(param_1 + 0xdc) + 0x7028) = 0xa52f2;
        }
        iVar3 = AsicSendCommandToMcuBBP(param_1,0x80,0xff,0,0,0);
        if (*(char *)(param_1 + 0x16964) == '\x01') {
          RTMPusecDelay(1000);
        }
        if ((iVar3 == 0) && (*(char *)(param_1 + 0xec) == '\0')) {
          *(undefined4 *)(*(int *)(param_1 + 0xdc) + 0x7028) = 0x852f2;
        }
        *(undefined1 *)(param_1 + 0x4b1b) = 0xf2;
        if (iVar6 != 100) {
          cVar4 = *(char *)(param_1 + 0xad)   //possible issue identified - semgrep
          goto LAB_000c98f0;
        }
LAB_000c98a4:
        printk("ERROR!!! ");
        printk("BBP write R%d fail\n",0x52);
        if (*(char *)(param_1 + 0xec) == '\0') {
          *(uint *)(*(int *)(param_1 + 0xdc) + 0x7028) =
               *(uint *)(*(int *)(param_1 + 0xdc) + 0x7028) & 0xfffdffff;
          cVar4 = *(char *)(param_1 + 0xad)   //possible issue identified - semgrep
        }
        else {
          cVar4 = *(char *)(param_1 + 0xad)   //possible issue identified - semgrep
        }
LAB_000c98f0:
        if (cVar4 == '\x01') goto LAB_000c9900;
        iVar6 = *(int *)(param_1 + 0x4bf4);
      }
    }
    else {
      iVar6 = *(int *)(param_1 + 0x4bf4);
    }
    uVar2 = Status;
    if (iVar6 << 0xc < 0) {
      if (*(char *)(param_1 + 0xec) == '\0') {
        if (*(int *)(param_1 + 0x29f8) == 4) {
          uVar7 = 0;
          if (*(char *)(param_1 + 0xad) == '\x01') {
            Status = Status & 0xfffffffe;
            uVar7 = uVar2 & 1;
          }
          iVar6 = 1;
          cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
          do {
            uVar2 = 0;
            if (cVar4 == '\0') {
              uVar2 = *(uint *)(*(int *)(param_1 + 0xdc) + 0x101c);
            }
            if ((uVar2 & 0x20000) == 0) {
              if (cVar4 == '\0') {
                *(undefined4 *)(*(int *)(param_1 + 0xdc) + 0x101c) = 0xa4b46;
                uVar10 = 0x46;
              }
              else {
                uVar10 = 0x46;
              }
LAB_000c9bf8:
              *(undefined1 *)(param_1 + 0x4b14) = uVar10;
              if (iVar6 == 100) goto LAB_000c9c0c;
              cVar4 = *(char *)(param_1 + 0xad)   //possible issue identified - semgrep
              goto LAB_000c9c30;
            }
            iVar6 = iVar6 + 1;
            printk(&_LC5)   //possible issue identified - semgrep
            if (iVar6 == 100) goto LAB_000c9c0c;
            cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
          } while( true );
        }
        uVar7 = 0;
        if (*(char *)(param_1 + 0xad) == '\x01') {
          Status = Status & 0xfffffffe;
          uVar7 = uVar2 & 1;
        }
        iVar6 = 1;
        cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
LAB_000c9a28:
        uVar2 = 0;
        if (cVar4 == '\0') {
          uVar2 = *(uint *)(*(int *)(param_1 + 0xdc) + 0x7028);
        }
        if ((uVar2 & 0x20000) == 0) {
          if (cVar4 == '\0') {
            *(undefined4 *)(*(int *)(param_1 + 0xdc) + 0x7028) = 0xa4b46;
          }
          iVar3 = AsicSendCommandToMcuBBP(param_1,0x80,0xff,0,0,0);
          if (*(char *)(param_1 + 0x16964) == '\x01') {
            RTMPusecDelay(1000);
          }
          uVar10 = 0x46;
          if (iVar3 == 0) {
            if (*(char *)(param_1 + 0xec) == '\0') {
              *(undefined4 *)(*(int *)(param_1 + 0xdc) + 0x7028) = 0x84b46;
            }
            uVar10 = 0x46;
          }
LAB_000c9d84:
          *(undefined1 *)(param_1 + 0x4b14) = uVar10;
          if (iVar6 == 100) goto LAB_000c9d98;
          cVar4 = *(char *)(param_1 + 0xad)   //possible issue identified - semgrep
          goto LAB_000c9de4;
        }
        iVar3 = iVar6 % 0x14;
        iVar6 = iVar6 + 1;
        if ((iVar3 == 0) && (cVar4 == '\0')) {
          *(uint *)(*(int *)(param_1 + 0xdc) + 0x7028) = uVar2 & 0xfffdffff;
        }
        printk(&_LC5)   //possible issue identified - semgrep
        if (iVar6 != 100) goto code_r0x000c9a7c;
        goto LAB_000c9d98;
      }
      cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
    }
    else if (*(char *)(param_1 + 0xec) == '\0') {
      if (*(int *)(param_1 + 0x29f8) == 4) {
        uVar7 = 0;
        if (*(char *)(param_1 + 0xad) == '\x01') {
          Status = Status & 0xfffffffe;
          uVar7 = uVar2 & 1;
        }
        iVar6 = 1;
        cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
        while( true ) {
          uVar2 = 0;
          if (cVar4 == '\0') {
            uVar2 = *(uint *)(*(int *)(param_1 + 0xdc) + 0x101c);
          }
          if ((uVar2 & 0x20000) == 0) {
            uVar10 = 0x50;
            if (cVar4 == '\0') {
              *(undefined4 *)(*(int *)(param_1 + 0xdc) + 0x101c) = 0xa4b50;
              uVar10 = 0x50;
            }
            goto LAB_000c9bf8;
          }
          iVar6 = iVar6 + 1;
          printk(&_LC5)   //possible issue identified - semgrep
          if (iVar6 == 100) break;
          cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
        }
LAB_000c9c0c:
        printk("ERROR!!! ");
        printk("BBP write R%d fail\n",0x4b);
        cVar4 = *(char *)(param_1 + 0xad)   //possible issue identified - semgrep
LAB_000c9c30:
        if (cVar4 == '\x01') {
LAB_000c9df4:
          Status = Status & 0xfffffffe;
          if (uVar7 != 0) {
            Status = Status | 1;
          }
          cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
        }
        else {
          cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
        }
      }
      else {
        uVar7 = 0;
        if (*(char *)(param_1 + 0xad) == '\x01') {
          Status = Status & 0xfffffffe;
          uVar7 = uVar2 & 1;
        }
        iVar6 = 1;
        cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
        while( true ) {
          uVar2 = 0;
          if (cVar4 == '\0') {
            uVar2 = *(uint *)(*(int *)(param_1 + 0xdc) + 0x7028);
          }
          if ((uVar2 & 0x20000) == 0) {
            if (cVar4 == '\0') {
              *(undefined4 *)(*(int *)(param_1 + 0xdc) + 0x7028) = 0xa4b50;
            }
            iVar3 = AsicSendCommandToMcuBBP(param_1,0x80,0xff,0,0,0);
            if (*(char *)(param_1 + 0x16964) == '\x01') {
              RTMPusecDelay(1000);
            }
            uVar10 = 0x50;
            if (iVar3 == 0) {
              if (*(char *)(param_1 + 0xec) == '\0') {
                *(undefined4 *)(*(int *)(param_1 + 0xdc) + 0x7028) = 0x84b50;
              }
              uVar10 = 0x50;
            }
            goto LAB_000c9d84;
          }
          iVar3 = iVar6 % 0x14;
          iVar6 = iVar6 + 1;
          if ((iVar3 == 0) && (cVar4 == '\0')) {
            *(uint *)(*(int *)(param_1 + 0xdc) + 0x7028) = uVar2 & 0xfffdffff;
          }
          printk(&_LC5)   //possible issue identified - semgrep
          if (iVar6 == 100) break;
          cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
        }
LAB_000c9d98:
        printk("ERROR!!! ");
        printk("BBP write R%d fail\n",0x4b);
        if (*(char *)(param_1 + 0xec) == '\0') {
          *(uint *)(*(int *)(param_1 + 0xdc) + 0x7028) =
               *(uint *)(*(int *)(param_1 + 0xdc) + 0x7028) & 0xfffdffff;
          cVar4 = *(char *)(param_1 + 0xad)   //possible issue identified - semgrep
        }
        else {
          cVar4 = *(char *)(param_1 + 0xad)   //possible issue identified - semgrep
        }
LAB_000c9de4:
        if (cVar4 == '\x01') goto LAB_000c9df4;
        cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
      }
    }
    else {
      cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
    }
    if (cVar4 == '\0') {
      *(uint *)(*(int *)(param_1 + 0xdc) + 0x132c) =
           *(uint *)(*(int *)(param_1 + 0xdc) + 0x132c) & 0xfffffff9 | 2;
      uVar2 = *(uint *)(param_1 + 0x4bf4);
    }
    else {
      uVar2 = *(uint *)(param_1 + 0x4bf4);
    }
    if ((uVar2 & 0xf0) == 0x10) {
      uVar7 = 0x50f01;
    }
    else {
      uVar7 = 0x50f05;
    }
    if ((uVar2 & 0xf) == 1) {
      uVar7 = uVar7 & 0xfffff3ff;
      cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
    }
    else {
      cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
    }
    if (cVar4 == '\0') {
      *(uint *)(*(int *)(param_1 + 0xdc) + 0x1328) = uVar7;
    }
    goto LAB_000c9e84;
  }
  if (*(char *)(param_1 + 0xec) == '\0') {
    if (*(int *)(param_1 + 0x29f8) == 4) {
      uVar7 = 0;
      if (*(char *)(param_1 + 0xad) == '\x01') {
        Status = Status & 0xfffffffe;
        uVar7 = uVar2 & 1;
      }
      iVar6 = 1;
      cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
      while( true ) {
        uVar2 = 0;
        if (cVar4 == '\0') {
          uVar2 = *(uint *)(*(int *)(param_1 + 0xdc) + 0x101c);
        }
        if ((uVar2 & 0x20000) == 0) break;
        iVar6 = iVar6 + 1;
        printk(&_LC5)   //possible issue identified - semgrep
        if (iVar6 == 100) goto LAB_000c6a34;
        cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
      }
      bVar1 = *(byte *)(param_1 + 0x4be0);
      if (bVar1 < 0xf) {
        uVar2 = (uint)*(byte *)(param_1 + 0x50e4);
      }
      else if (bVar1 < 0x41) {
        uVar2 = (uint)*(byte *)(param_1 + 0x50e5);
      }
      else if (bVar1 < 0x81) {
        uVar2 = (uint)*(byte *)(param_1 + 0x50e6);
      }
      else {
        uVar2 = (uint)*(byte *)(param_1 + 0x50e7);
      }
      if (cVar4 == '\0') {
        *(uint *)(*(int *)(param_1 + 0xdc) + 0x101c) = 0x37 - uVar2 & 0xff | 0xa3e00;
      }
      bVar1 = *(byte *)(param_1 + 0x4be0);
      if (bVar1 < 0xf) {
        cVar4 = *(char *)(param_1 + 0x50e4)   //possible issue identified - semgrep
      }
      else if (bVar1 < 0x41) {
        cVar4 = *(char *)(param_1 + 0x50e5)   //possible issue identified - semgrep
      }
      else if (bVar1 < 0x81) {
        cVar4 = *(char *)(param_1 + 0x50e6)   //possible issue identified - semgrep
      }
      else {
        cVar4 = *(char *)(param_1 + 0x50e7)   //possible issue identified - semgrep
      }
      *(char *)(param_1 + 0x4b07) = '7' - cVar4;
      if (iVar6 != 100) {
        cVar4 = *(char *)(param_1 + 0xad)   //possible issue identified - semgrep
        goto LAB_000c6a58;
      }
LAB_000c6a34:
      printk("ERROR!!! ");
      printk("BBP write R%d fail\n",0x3e);
      cVar4 = *(char *)(param_1 + 0xad)   //possible issue identified - semgrep
LAB_000c6a58:
      if (cVar4 == '\x01') {
LAB_000c6c94:
        Status = Status & 0xfffffffe;
        if (uVar7 != 0) {
          Status = Status | 1;
        }
        cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
      }
      else {
        cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
      }
    }
    else {
      uVar7 = 0;
      if (*(char *)(param_1 + 0xad) == '\x01') {
        Status = Status & 0xfffffffe;
        uVar7 = uVar2 & 1;
      }
      iVar6 = 1;
      cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
      while( true ) {
        uVar2 = 0;
        if (cVar4 == '\0') {
          uVar2 = *(uint *)(*(int *)(param_1 + 0xdc) + 0x7028);
        }
        if ((uVar2 & 0x20000) == 0) break;
        iVar3 = iVar6 % 0x14;
        iVar6 = iVar6 + 1;
        if ((iVar3 == 0) && (cVar4 == '\0')) {
          *(uint *)(*(int *)(param_1 + 0xdc) + 0x7028) = uVar2 & 0xfffdffff;
        }
        printk(&_LC5)   //possible issue identified - semgrep
        if (iVar6 == 100) goto LAB_000c6c38;
        cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
      }
      bVar1 = *(byte *)(param_1 + 0x4be0);
      if (bVar1 < 0xf) {
        uVar2 = (uint)*(byte *)(param_1 + 0x50e4);
      }
      else if (bVar1 < 0x41) {
        uVar2 = (uint)*(byte *)(param_1 + 0x50e5);
      }
      else if (bVar1 < 0x81) {
        uVar2 = (uint)*(byte *)(param_1 + 0x50e6);
      }
      else {
        uVar2 = (uint)*(byte *)(param_1 + 0x50e7);
      }
      uVar2 = 0x37 - uVar2 & 0xff;
      if (cVar4 == '\0') {
        *(uint *)(*(int *)(param_1 + 0xdc) + 0x7028) = uVar2 | 0xa3e00;
      }
      iVar3 = AsicSendCommandToMcuBBP(param_1,0x80,0xff,0,0,0);
      if (*(char *)(param_1 + 0x16964) == '\x01') {
        RTMPusecDelay(1000);
      }
      if (iVar3 == 0) {
        if (*(char *)(param_1 + 0xec) == '\0') {
          *(uint *)(*(int *)(param_1 + 0xdc) + 0x7028) = uVar2 | 0x83e00;
        }
        bVar1 = *(byte *)(param_1 + 0x4be0);
      }
      else {
        bVar1 = *(byte *)(param_1 + 0x4be0);
      }
      if (bVar1 < 0xf) {
        cVar4 = *(char *)(param_1 + 0x50e4)   //possible issue identified - semgrep
      }
      else if (bVar1 < 0x41) {
        cVar4 = *(char *)(param_1 + 0x50e5)   //possible issue identified - semgrep
      }
      else if (bVar1 < 0x81) {
        cVar4 = *(char *)(param_1 + 0x50e6)   //possible issue identified - semgrep
      }
      else {
        cVar4 = *(char *)(param_1 + 0x50e7)   //possible issue identified - semgrep
      }
      *(char *)(param_1 + 0x4b07) = '7' - cVar4;
      if (iVar6 != 100) {
        cVar4 = *(char *)(param_1 + 0xad)   //possible issue identified - semgrep
        goto LAB_000c6c84;
      }
LAB_000c6c38:
      printk("ERROR!!! ");
      printk("BBP write R%d fail\n",0x3e);
      if (*(char *)(param_1 + 0xec) == '\0') {
        *(uint *)(*(int *)(param_1 + 0xdc) + 0x7028) =
             *(uint *)(*(int *)(param_1 + 0xdc) + 0x7028) & 0xfffdffff;
        cVar4 = *(char *)(param_1 + 0xad)   //possible issue identified - semgrep
      }
      else {
        cVar4 = *(char *)(param_1 + 0xad)   //possible issue identified - semgrep
      }
LAB_000c6c84:
      if (cVar4 == '\x01') goto LAB_000c6c94;
      cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
    }
  }
  else {
    cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
  }
  uVar2 = Status;
  if (cVar4 == '\0') {
    if (*(int *)(param_1 + 0x29f8) == 4) {
      uVar7 = 0;
      if (*(char *)(param_1 + 0xad) == '\x01') {
        Status = Status & 0xfffffffe;
        uVar7 = uVar2 & 1;
      }
      iVar6 = 1;
      cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
      while( true ) {
        uVar2 = 0;
        if (cVar4 == '\0') {
          uVar2 = *(uint *)(*(int *)(param_1 + 0xdc) + 0x101c);
        }
        if ((uVar2 & 0x20000) == 0) break;
        iVar6 = iVar6 + 1;
        printk(&_LC5)   //possible issue identified - semgrep
        if (iVar6 == 100) goto LAB_000c6df4;
        cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
      }
      bVar1 = *(byte *)(param_1 + 0x4be0);
      if (bVar1 < 0xf) {
        uVar2 = (uint)*(byte *)(param_1 + 0x50e4);
      }
      else if (bVar1 < 0x41) {
        uVar2 = (uint)*(byte *)(param_1 + 0x50e5);
      }
      else if (bVar1 < 0x81) {
        uVar2 = (uint)*(byte *)(param_1 + 0x50e6);
      }
      else {
        uVar2 = (uint)*(byte *)(param_1 + 0x50e7);
      }
      if (cVar4 == '\0') {
        *(uint *)(*(int *)(param_1 + 0xdc) + 0x101c) = 0x37 - uVar2 & 0xff | 0xa3f00;
      }
      bVar1 = *(byte *)(param_1 + 0x4be0);
      if (bVar1 < 0xf) {
        cVar4 = *(char *)(param_1 + 0x50e4)   //possible issue identified - semgrep
      }
      else if (bVar1 < 0x41) {
        cVar4 = *(char *)(param_1 + 0x50e5)   //possible issue identified - semgrep
      }
      else if (bVar1 < 0x81) {
        cVar4 = *(char *)(param_1 + 0x50e6)   //possible issue identified - semgrep
      }
      else {
        cVar4 = *(char *)(param_1 + 0x50e7)   //possible issue identified - semgrep
      }
      *(char *)(param_1 + 0x4b08) = '7' - cVar4;
      if (iVar6 != 100) {
        cVar4 = *(char *)(param_1 + 0xad)   //possible issue identified - semgrep
        goto LAB_000c6e18;
      }
LAB_000c6df4:
      printk("ERROR!!! ");
      printk("BBP write R%d fail\n",0x3f);
      cVar4 = *(char *)(param_1 + 0xad)   //possible issue identified - semgrep
LAB_000c6e18:
      if (cVar4 == '\x01') {
LAB_000c7054:
        Status = Status & 0xfffffffe;
        if (uVar7 != 0) {
          Status = Status | 1;
        }
        cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
      }
      else {
        cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
      }
    }
    else {
      uVar7 = 0;
      if (*(char *)(param_1 + 0xad) == '\x01') {
        Status = Status & 0xfffffffe;
        uVar7 = uVar2 & 1;
      }
      iVar6 = 1;
      cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
      while( true ) {
        uVar2 = 0;
        if (cVar4 == '\0') {
          uVar2 = *(uint *)(*(int *)(param_1 + 0xdc) + 0x7028);
        }
        if ((uVar2 & 0x20000) == 0) break;
        iVar3 = iVar6 % 0x14;
        iVar6 = iVar6 + 1;
        if ((iVar3 == 0) && (cVar4 == '\0')) {
          *(uint *)(*(int *)(param_1 + 0xdc) + 0x7028) = uVar2 & 0xfffdffff;
        }
        printk(&_LC5)   //possible issue identified - semgrep
        if (iVar6 == 100) goto LAB_000c6ff8;
        cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
      }
      bVar1 = *(byte *)(param_1 + 0x4be0);
      if (bVar1 < 0xf) {
        uVar2 = (uint)*(byte *)(param_1 + 0x50e4);
      }
      else if (bVar1 < 0x41) {
        uVar2 = (uint)*(byte *)(param_1 + 0x50e5);
      }
      else if (bVar1 < 0x81) {
        uVar2 = (uint)*(byte *)(param_1 + 0x50e6);
      }
      else {
        uVar2 = (uint)*(byte *)(param_1 + 0x50e7);
      }
      uVar2 = 0x37 - uVar2 & 0xff;
      if (cVar4 == '\0') {
        *(uint *)(*(int *)(param_1 + 0xdc) + 0x7028) = uVar2 | 0xa3f00;
      }
      iVar3 = AsicSendCommandToMcuBBP(param_1,0x80,0xff,0,0,0);
      if (*(char *)(param_1 + 0x16964) == '\x01') {
        RTMPusecDelay(1000);
      }
      if (iVar3 == 0) {
        if (*(char *)(param_1 + 0xec) == '\0') {
          *(uint *)(*(int *)(param_1 + 0xdc) + 0x7028) = uVar2 | 0x83f00;
        }
        bVar1 = *(byte *)(param_1 + 0x4be0);
      }
      else {
        bVar1 = *(byte *)(param_1 + 0x4be0);
      }
      if (bVar1 < 0xf) {
        cVar4 = *(char *)(param_1 + 0x50e4)   //possible issue identified - semgrep
      }
      else if (bVar1 < 0x41) {
        cVar4 = *(char *)(param_1 + 0x50e5)   //possible issue identified - semgrep
      }
      else if (bVar1 < 0x81) {
        cVar4 = *(char *)(param_1 + 0x50e6)   //possible issue identified - semgrep
      }
      else {
        cVar4 = *(char *)(param_1 + 0x50e7)   //possible issue identified - semgrep
      }
      *(char *)(param_1 + 0x4b08) = '7' - cVar4;
      if (iVar6 != 100) {
        cVar4 = *(char *)(param_1 + 0xad)   //possible issue identified - semgrep
        goto LAB_000c7044;
      }
LAB_000c6ff8:
      printk("ERROR!!! ");
      printk("BBP write R%d fail\n",0x3f);
      if (*(char *)(param_1 + 0xec) == '\0') {
        *(uint *)(*(int *)(param_1 + 0xdc) + 0x7028) =
             *(uint *)(*(int *)(param_1 + 0xdc) + 0x7028) & 0xfffdffff;
        cVar4 = *(char *)(param_1 + 0xad)   //possible issue identified - semgrep
      }
      else {
        cVar4 = *(char *)(param_1 + 0xad)   //possible issue identified - semgrep
      }
LAB_000c7044:
      if (cVar4 == '\x01') goto LAB_000c7054;
      cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
    }
  }
  else {
    cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
  }
  uVar2 = Status;
  if (cVar4 == '\0') {
    if (*(int *)(param_1 + 0x29f8) == 4) {
      uVar7 = 0;
      if (*(char *)(param_1 + 0xad) == '\x01') {
        Status = Status & 0xfffffffe;
        uVar7 = uVar2 & 1;
      }
      iVar6 = 1;
      cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
      while( true ) {
        uVar2 = 0;
        if (cVar4 == '\0') {
          uVar2 = *(uint *)(*(int *)(param_1 + 0xdc) + 0x101c);
        }
        if ((uVar2 & 0x20000) == 0) break;
        iVar6 = iVar6 + 1;
        printk(&_LC5)   //possible issue identified - semgrep
        if (iVar6 == 100) goto LAB_000c71b4;
        cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
      }
      bVar1 = *(byte *)(param_1 + 0x4be0);
      if (bVar1 < 0xf) {
        uVar2 = (uint)*(byte *)(param_1 + 0x50e4);
      }
      else if (bVar1 < 0x41) {
        uVar2 = (uint)*(byte *)(param_1 + 0x50e5);
      }
      else if (bVar1 < 0x81) {
        uVar2 = (uint)*(byte *)(param_1 + 0x50e6);
      }
      else {
        uVar2 = (uint)*(byte *)(param_1 + 0x50e7);
      }
      if (cVar4 == '\0') {
        *(uint *)(*(int *)(param_1 + 0xdc) + 0x101c) = 0x37 - uVar2 & 0xff | 0xa4000;
      }
      bVar1 = *(byte *)(param_1 + 0x4be0);
      if (bVar1 < 0xf) {
        cVar4 = *(char *)(param_1 + 0x50e4)   //possible issue identified - semgrep
      }
      else if (bVar1 < 0x41) {
        cVar4 = *(char *)(param_1 + 0x50e5)   //possible issue identified - semgrep
      }
      else if (bVar1 < 0x81) {
        cVar4 = *(char *)(param_1 + 0x50e6)   //possible issue identified - semgrep
      }
      else {
        cVar4 = *(char *)(param_1 + 0x50e7)   //possible issue identified - semgrep
      }
      *(char *)(param_1 + 0x4b09) = '7' - cVar4;
      if (iVar6 != 100) {
        cVar4 = *(char *)(param_1 + 0xad)   //possible issue identified - semgrep
        goto LAB_000c71d8;
      }
LAB_000c71b4:
      printk("ERROR!!! ");
      printk("BBP write R%d fail\n",0x40);
      cVar4 = *(char *)(param_1 + 0xad)   //possible issue identified - semgrep
LAB_000c71d8:
      if (cVar4 == '\x01') {
LAB_000c7414:
        Status = Status & 0xfffffffe;
        if (uVar7 != 0) {
          Status = Status | 1;
        }
        cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
      }
      else {
        cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
      }
    }
    else {
      uVar7 = 0;
      if (*(char *)(param_1 + 0xad) == '\x01') {
        Status = Status & 0xfffffffe;
        uVar7 = uVar2 & 1;
      }
      iVar6 = 1;
      cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
      while( true ) {
        uVar2 = 0;
        if (cVar4 == '\0') {
          uVar2 = *(uint *)(*(int *)(param_1 + 0xdc) + 0x7028);
        }
        if ((uVar2 & 0x20000) == 0) break;
        iVar3 = iVar6 % 0x14;
        iVar6 = iVar6 + 1;
        if ((iVar3 == 0) && (cVar4 == '\0')) {
          *(uint *)(*(int *)(param_1 + 0xdc) + 0x7028) = uVar2 & 0xfffdffff;
        }
        printk(&_LC5)   //possible issue identified - semgrep
        if (iVar6 == 100) goto LAB_000c73b8;
        cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
      }
      bVar1 = *(byte *)(param_1 + 0x4be0);
      if (bVar1 < 0xf) {
        uVar2 = (uint)*(byte *)(param_1 + 0x50e4);
      }
      else if (bVar1 < 0x41) {
        uVar2 = (uint)*(byte *)(param_1 + 0x50e5);
      }
      else if (bVar1 < 0x81) {
        uVar2 = (uint)*(byte *)(param_1 + 0x50e6);
      }
      else {
        uVar2 = (uint)*(byte *)(param_1 + 0x50e7);
      }
      uVar2 = 0x37 - uVar2 & 0xff;
      if (cVar4 == '\0') {
        *(uint *)(*(int *)(param_1 + 0xdc) + 0x7028) = uVar2 | 0xa4000;
      }
      iVar3 = AsicSendCommandToMcuBBP(param_1,0x80,0xff,0,0,0);
      if (*(char *)(param_1 + 0x16964) == '\x01') {
        RTMPusecDelay(1000);
      }
      if (iVar3 == 0) {
        if (*(char *)(param_1 + 0xec) == '\0') {
          *(uint *)(*(int *)(param_1 + 0xdc) + 0x7028) = uVar2 | 0x84000;
        }
        bVar1 = *(byte *)(param_1 + 0x4be0);
      }
      else {
        bVar1 = *(byte *)(param_1 + 0x4be0);
      }
      if (bVar1 < 0xf) {
        cVar4 = *(char *)(param_1 + 0x50e4)   //possible issue identified - semgrep
      }
      else if (bVar1 < 0x41) {
        cVar4 = *(char *)(param_1 + 0x50e5)   //possible issue identified - semgrep
      }
      else if (bVar1 < 0x81) {
        cVar4 = *(char *)(param_1 + 0x50e6)   //possible issue identified - semgrep
      }
      else {
        cVar4 = *(char *)(param_1 + 0x50e7)   //possible issue identified - semgrep
      }
      *(char *)(param_1 + 0x4b09) = '7' - cVar4;
      if (iVar6 != 100) {
        cVar4 = *(char *)(param_1 + 0xad)   //possible issue identified - semgrep
        goto LAB_000c7404;
      }
LAB_000c73b8:
      printk("ERROR!!! ");
      printk("BBP write R%d fail\n",0x40);
      if (*(char *)(param_1 + 0xec) == '\0') {
        *(uint *)(*(int *)(param_1 + 0xdc) + 0x7028) =
             *(uint *)(*(int *)(param_1 + 0xdc) + 0x7028) & 0xfffdffff;
        cVar4 = *(char *)(param_1 + 0xad)   //possible issue identified - semgrep
      }
      else {
        cVar4 = *(char *)(param_1 + 0xad)   //possible issue identified - semgrep
      }
LAB_000c7404:
      if (cVar4 == '\x01') goto LAB_000c7414;
      cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
    }
  }
  else {
    cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
  }
  uVar2 = Status;
  if (cVar4 == '\0') {
    if (*(int *)(param_1 + 0x29f8) == 4) {
      uVar7 = 0;
      if (*(char *)(param_1 + 0xad) == '\x01') {
        Status = Status & 0xfffffffe;
        uVar7 = uVar2 & 1;
      }
      iVar6 = 1;
      cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
      while( true ) {
        uVar2 = 0;
        if (cVar4 == '\0') {
          uVar2 = *(uint *)(*(int *)(param_1 + 0xdc) + 0x101c);
        }
        if ((uVar2 & 0x20000) == 0) break;
        iVar6 = iVar6 + 1;
        printk(&_LC5)   //possible issue identified - semgrep
        if (iVar6 == 100) goto LAB_000c7504;
        cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
      }
      if (cVar4 == '\0') {
        *(undefined4 *)(*(int *)(param_1 + 0xdc) + 0x101c) = 0xa5638;
      }
      *(undefined1 *)(param_1 + 0x4b1f) = 0x38;
      if (iVar6 != 100) {
        cVar4 = *(char *)(param_1 + 0xad)   //possible issue identified - semgrep
        goto LAB_000c7528;
      }
LAB_000c7504:
      printk("ERROR!!! ");
      printk("BBP write R%d fail\n",0x56);
      cVar4 = *(char *)(param_1 + 0xad)   //possible issue identified - semgrep
LAB_000c7528:
      if (cVar4 == '\x01') {
LAB_000c76ec:
        Status = Status & 0xfffffffe;
        if (uVar7 != 0) {
          Status = Status | 1;
        }
        iVar6 = *(int *)(param_1 + 0x4bf4);
      }
      else {
        iVar6 = *(int *)(param_1 + 0x4bf4);
      }
    }
    else {
      uVar7 = 0;
      if (*(char *)(param_1 + 0xad) == '\x01') {
        Status = Status & 0xfffffffe;
        uVar7 = uVar2 & 1;
      }
      iVar6 = 1;
      cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
      while( true ) {
        uVar2 = 0;
        if (cVar4 == '\0') {
          uVar2 = *(uint *)(*(int *)(param_1 + 0xdc) + 0x7028);
        }
        if ((uVar2 & 0x20000) == 0) break;
        iVar3 = iVar6 % 0x14;
        iVar6 = iVar6 + 1;
        if ((iVar3 == 0) && (cVar4 == '\0')) {
          *(uint *)(*(int *)(param_1 + 0xdc) + 0x7028) = uVar2 & 0xfffdffff;
        }
        printk(&_LC5)   //possible issue identified - semgrep
        if (iVar6 == 100) goto LAB_000c7690;
        cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
      }
      if (cVar4 == '\0') {
        *(undefined4 *)(*(int *)(param_1 + 0xdc) + 0x7028) = 0xa5638;
      }
      iVar3 = AsicSendCommandToMcuBBP(param_1,0x80,0xff,0,0,0);
      if (*(char *)(param_1 + 0x16964) == '\x01') {
        RTMPusecDelay(1000);
      }
      if ((iVar3 == 0) && (*(char *)(param_1 + 0xec) == '\0')) {
        *(undefined4 *)(*(int *)(param_1 + 0xdc) + 0x7028) = 0x85638;
      }
      *(undefined1 *)(param_1 + 0x4b1f) = 0x38;
      if (iVar6 != 100) {
        cVar4 = *(char *)(param_1 + 0xad)   //possible issue identified - semgrep
        goto LAB_000c76dc;
      }
LAB_000c7690:
      printk("ERROR!!! ");
      printk("BBP write R%d fail\n",0x56);
      if (*(char *)(param_1 + 0xec) == '\0') {
        *(uint *)(*(int *)(param_1 + 0xdc) + 0x7028) =
             *(uint *)(*(int *)(param_1 + 0xdc) + 0x7028) & 0xfffdffff;
        cVar4 = *(char *)(param_1 + 0xad)   //possible issue identified - semgrep
      }
      else {
        cVar4 = *(char *)(param_1 + 0xad)   //possible issue identified - semgrep
      }
LAB_000c76dc:
      if (cVar4 == '\x01') goto LAB_000c76ec;
      iVar6 = *(int *)(param_1 + 0x4bf4);
    }
  }
  else {
    iVar6 = *(int *)(param_1 + 0x4bf4);
  }
  uVar2 = Status;
  if (iVar6 << 0xd < 0) {
    if (*(char *)(param_1 + 0xec) == '\0') {
      if (*(int *)(param_1 + 0x29f8) == 4) {
        uVar7 = 0;
        if (*(char *)(param_1 + 0xad) == '\x01') {
          Status = Status & 0xfffffffe;
          uVar7 = uVar2 & 1;
        }
        iVar6 = 1;
        cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
        while( true ) {
          uVar2 = 0;
          if (cVar4 == '\0') {
            uVar2 = *(uint *)(*(int *)(param_1 + 0xdc) + 0x101c);
          }
          if ((uVar2 & 0x20000) == 0) break;
          iVar6 = iVar6 + 1;
          printk(&_LC5)   //possible issue identified - semgrep
          if (iVar6 == 100) goto LAB_000c77e8;
          cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
        }
        if (cVar4 == '\0') {
          *(undefined4 *)(*(int *)(param_1 + 0xdc) + 0x101c) = 0xa5262;
        }
        *(undefined1 *)(param_1 + 0x4b1b) = 0x62;
        if (iVar6 != 100) {
          cVar4 = *(char *)(param_1 + 0xad)   //possible issue identified - semgrep
          goto LAB_000c780c;
        }
LAB_000c77e8:
        printk("ERROR!!! ");
        printk("BBP write R%d fail\n",0x52);
        cVar4 = *(char *)(param_1 + 0xad)   //possible issue identified - semgrep
LAB_000c780c:
        if (cVar4 == '\x01') {
LAB_000c79d0:
          Status = Status & 0xfffffffe;
          if (uVar7 != 0) {
            Status = Status | 1;
          }
          cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
        }
        else {
          cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
        }
      }
      else {
        uVar7 = 0;
        if (*(char *)(param_1 + 0xad) == '\x01') {
          Status = Status & 0xfffffffe;
          uVar7 = uVar2 & 1;
        }
        iVar6 = 1;
        cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
        while( true ) {
          uVar2 = 0;
          if (cVar4 == '\0') {
            uVar2 = *(uint *)(*(int *)(param_1 + 0xdc) + 0x7028);
          }
          if ((uVar2 & 0x20000) == 0) break;
          iVar3 = iVar6 % 0x14;
          iVar6 = iVar6 + 1;
          if ((iVar3 == 0) && (cVar4 == '\0')) {
            *(uint *)(*(int *)(param_1 + 0xdc) + 0x7028) = uVar2 & 0xfffdffff;
          }
          printk(&_LC5)   //possible issue identified - semgrep
          if (iVar6 == 100) goto LAB_000c7974;
          cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
        }
        if (cVar4 == '\0') {
          *(undefined4 *)(*(int *)(param_1 + 0xdc) + 0x7028) = 0xa5262;
        }
        iVar3 = AsicSendCommandToMcuBBP(param_1,0x80,0xff,0,0,0);
        if (*(char *)(param_1 + 0x16964) == '\x01') {
          RTMPusecDelay(1000);
        }
        if ((iVar3 == 0) && (*(char *)(param_1 + 0xec) == '\0')) {
          *(undefined4 *)(*(int *)(param_1 + 0xdc) + 0x7028) = 0x85262;
        }
        *(undefined1 *)(param_1 + 0x4b1b) = 0x62;
        if (iVar6 != 100) {
          cVar4 = *(char *)(param_1 + 0xad)   //possible issue identified - semgrep
          goto LAB_000c79c0;
        }
LAB_000c7974:
        printk("ERROR!!! ");
        printk("BBP write R%d fail\n",0x52);
        if (*(char *)(param_1 + 0xec) == '\0') {
          *(uint *)(*(int *)(param_1 + 0xdc) + 0x7028) =
               *(uint *)(*(int *)(param_1 + 0xdc) + 0x7028) & 0xfffdffff;
          cVar4 = *(char *)(param_1 + 0xad)   //possible issue identified - semgrep
        }
        else {
          cVar4 = *(char *)(param_1 + 0xad)   //possible issue identified - semgrep
        }
LAB_000c79c0:
        if (cVar4 == '\x01') goto LAB_000c79d0;
        cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
      }
    }
    else {
      cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
    }
    uVar2 = Status;
    if (cVar4 == '\0') {
      if (*(int *)(param_1 + 0x29f8) == 4) {
        uVar7 = 0;
        if (*(char *)(param_1 + 0xad) == '\x01') {
          Status = Status & 0xfffffffe;
          uVar7 = uVar2 & 1;
        }
        iVar6 = 1;
        cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
        do {
          uVar2 = 0;
          if (cVar4 == '\0') {
            uVar2 = *(uint *)(*(int *)(param_1 + 0xdc) + 0x101c);
          }
          if ((uVar2 & 0x20000) == 0) {
            if (cVar4 == '\0') {
              *(undefined4 *)(*(int *)(param_1 + 0xdc) + 0x101c) = 0xa4b46;
              uVar10 = 0x46;
            }
            else {
              uVar10 = 0x46;
            }
LAB_000c7f94:
            *(undefined1 *)(param_1 + 0x4b14) = uVar10;
            if (iVar6 == 100) goto LAB_000c7fa8;
            cVar4 = *(char *)(param_1 + 0xad)   //possible issue identified - semgrep
            goto LAB_000c7fcc;
          }
          iVar6 = iVar6 + 1;
          printk(&_LC5)   //possible issue identified - semgrep
          if (iVar6 == 100) goto LAB_000c7fa8;
          cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
        } while( true );
      }
      uVar7 = 0;
      if (*(char *)(param_1 + 0xad) == '\x01') {
        Status = Status & 0xfffffffe;
        uVar7 = uVar2 & 1;
      }
      iVar6 = 1;
      cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
LAB_000c7aec:
      uVar2 = 0;
      if (cVar4 == '\0') {
        uVar2 = *(uint *)(*(int *)(param_1 + 0xdc) + 0x7028);
      }
      if ((uVar2 & 0x20000) == 0) {
        if (cVar4 == '\0') {
          *(undefined4 *)(*(int *)(param_1 + 0xdc) + 0x7028) = 0xa4b46;
        }
        iVar3 = AsicSendCommandToMcuBBP(param_1,0x80,0xff,0,0,0);
        if (*(char *)(param_1 + 0x16964) == '\x01') {
          RTMPusecDelay(1000);
        }
        uVar10 = 0x46;
        if (iVar3 == 0) {
          if (*(char *)(param_1 + 0xec) == '\0') {
            *(undefined4 *)(*(int *)(param_1 + 0xdc) + 0x7028) = 0x84b46;
          }
          uVar10 = 0x46;
        }
LAB_000c8120:
        *(undefined1 *)(param_1 + 0x4b14) = uVar10;
        if (iVar6 == 100) goto LAB_000c8134;
        cVar4 = *(char *)(param_1 + 0xad)   //possible issue identified - semgrep
        goto LAB_000c8180;
      }
      iVar3 = iVar6 % 0x14;
      iVar6 = iVar6 + 1;
      if ((iVar3 == 0) && (cVar4 == '\0')) {
        *(uint *)(*(int *)(param_1 + 0xdc) + 0x7028) = uVar2 & 0xfffdffff;
      }
      printk(&_LC5)   //possible issue identified - semgrep
      if (iVar6 != 100) goto code_r0x000c7b40;
      goto LAB_000c8134;
    }
    uVar2 = *(uint *)(param_1 + 0x4a94);
  }
  else {
    if (*(char *)(param_1 + 0xec) == '\0') {
      if (*(int *)(param_1 + 0x29f8) == 4) {
        uVar7 = 0;
        if (*(char *)(param_1 + 0xad) == '\x01') {
          Status = Status & 0xfffffffe;
          uVar7 = uVar2 & 1;
        }
        iVar6 = 1;
        cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
        while( true ) {
          uVar2 = 0;
          if (cVar4 == '\0') {
            uVar2 = *(uint *)(*(int *)(param_1 + 0xdc) + 0x101c);
          }
          if ((uVar2 & 0x20000) == 0) break;
          iVar6 = iVar6 + 1;
          printk(&_LC5)   //possible issue identified - semgrep
          if (iVar6 == 100) goto LAB_000c7cd0;
          cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
        }
        if (cVar4 == '\0') {
          *(undefined4 *)(*(int *)(param_1 + 0xdc) + 0x101c) = 0xa5284;
        }
        *(undefined1 *)(param_1 + 0x4b1b) = 0x84;
        if (iVar6 != 100) {
          cVar4 = *(char *)(param_1 + 0xad)   //possible issue identified - semgrep
          goto LAB_000c7cf4;
        }
LAB_000c7cd0:
        printk("ERROR!!! ");
        printk("BBP write R%d fail\n",0x52);
        cVar4 = *(char *)(param_1 + 0xad)   //possible issue identified - semgrep
LAB_000c7cf4:
        if (cVar4 == '\x01') {
LAB_000c7eb8:
          Status = Status & 0xfffffffe;
          if (uVar7 != 0) {
            Status = Status | 1;
          }
          cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
        }
        else {
          cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
        }
      }
      else {
        uVar7 = 0;
        if (*(char *)(param_1 + 0xad) == '\x01') {
          Status = Status & 0xfffffffe;
          uVar7 = uVar2 & 1;
        }
        iVar6 = 1;
        cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
        while( true ) {
          uVar2 = 0;
          if (cVar4 == '\0') {
            uVar2 = *(uint *)(*(int *)(param_1 + 0xdc) + 0x7028);
          }
          if ((uVar2 & 0x20000) == 0) break;
          iVar3 = iVar6 % 0x14;
          iVar6 = iVar6 + 1;
          if ((iVar3 == 0) && (cVar4 == '\0')) {
            *(uint *)(*(int *)(param_1 + 0xdc) + 0x7028) = uVar2 & 0xfffdffff;
          }
          printk(&_LC5)   //possible issue identified - semgrep
          if (iVar6 == 100) goto LAB_000c7e5c;
          cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
        }
        if (cVar4 == '\0') {
          *(undefined4 *)(*(int *)(param_1 + 0xdc) + 0x7028) = 0xa5284;
        }
        iVar3 = AsicSendCommandToMcuBBP(param_1,0x80,0xff,0,0,0);
        if (*(char *)(param_1 + 0x16964) == '\x01') {
          RTMPusecDelay(1000);
        }
        if ((iVar3 == 0) && (*(char *)(param_1 + 0xec) == '\0')) {
          *(undefined4 *)(*(int *)(param_1 + 0xdc) + 0x7028) = 0x85284;
        }
        *(undefined1 *)(param_1 + 0x4b1b) = 0x84;
        if (iVar6 != 100) {
          cVar4 = *(char *)(param_1 + 0xad)   //possible issue identified - semgrep
          goto LAB_000c7ea8;
        }
LAB_000c7e5c:
        printk("ERROR!!! ");
        printk("BBP write R%d fail\n",0x52);
        if (*(char *)(param_1 + 0xec) == '\0') {
          *(uint *)(*(int *)(param_1 + 0xdc) + 0x7028) =
               *(uint *)(*(int *)(param_1 + 0xdc) + 0x7028) & 0xfffdffff;
          cVar4 = *(char *)(param_1 + 0xad)   //possible issue identified - semgrep
        }
        else {
          cVar4 = *(char *)(param_1 + 0xad)   //possible issue identified - semgrep
        }
LAB_000c7ea8:
        if (cVar4 == '\x01') goto LAB_000c7eb8;
        cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
      }
    }
    else {
      cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
    }
    uVar2 = Status;
    if (cVar4 == '\0') {
      if (*(int *)(param_1 + 0x29f8) == 4) {
        uVar7 = 0;
        if (*(char *)(param_1 + 0xad) == '\x01') {
          Status = Status & 0xfffffffe;
          uVar7 = uVar2 & 1;
        }
        iVar6 = 1;
        cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
        while( true ) {
          uVar2 = 0;
          if (cVar4 == '\0') {
            uVar2 = *(uint *)(*(int *)(param_1 + 0xdc) + 0x101c);
          }
          if ((uVar2 & 0x20000) == 0) {
            uVar10 = 0x50;
            if (cVar4 == '\0') {
              *(undefined4 *)(*(int *)(param_1 + 0xdc) + 0x101c) = 0xa4b50;
              uVar10 = 0x50;
            }
            goto LAB_000c7f94;
          }
          iVar6 = iVar6 + 1;
          printk(&_LC5)   //possible issue identified - semgrep
          if (iVar6 == 100) break;
          cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
        }
LAB_000c7fa8:
        printk("ERROR!!! ");
        printk("BBP write R%d fail\n",0x4b);
        cVar4 = *(char *)(param_1 + 0xad)   //possible issue identified - semgrep
LAB_000c7fcc:
        if (cVar4 == '\x01') {
LAB_000c8190:
          Status = Status & 0xfffffffe;
          if (uVar7 != 0) {
            Status = Status | 1;
          }
          uVar2 = *(uint *)(param_1 + 0x4a94);
        }
        else {
          uVar2 = *(uint *)(param_1 + 0x4a94);
        }
      }
      else {
        uVar7 = 0;
        if (*(char *)(param_1 + 0xad) == '\x01') {
          Status = Status & 0xfffffffe;
          uVar7 = uVar2 & 1;
        }
        iVar6 = 1;
        cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
        while( true ) {
          uVar2 = 0;
          if (cVar4 == '\0') {
            uVar2 = *(uint *)(*(int *)(param_1 + 0xdc) + 0x7028);
          }
          if ((uVar2 & 0x20000) == 0) {
            if (cVar4 == '\0') {
              *(undefined4 *)(*(int *)(param_1 + 0xdc) + 0x7028) = 0xa4b50;
            }
            iVar3 = AsicSendCommandToMcuBBP(param_1,0x80,0xff,0,0,0);
            if (*(char *)(param_1 + 0x16964) == '\x01') {
              RTMPusecDelay(1000);
            }
            uVar10 = 0x50;
            if (iVar3 == 0) {
              if (*(char *)(param_1 + 0xec) == '\0') {
                *(undefined4 *)(*(int *)(param_1 + 0xdc) + 0x7028) = 0x84b50;
              }
              uVar10 = 0x50;
            }
            goto LAB_000c8120;
          }
          iVar3 = iVar6 % 0x14;
          iVar6 = iVar6 + 1;
          if ((iVar3 == 0) && (cVar4 == '\0')) {
            *(uint *)(*(int *)(param_1 + 0xdc) + 0x7028) = uVar2 & 0xfffdffff;
          }
          printk(&_LC5)   //possible issue identified - semgrep
          if (iVar6 == 100) break;
          cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
        }
LAB_000c8134:
        printk("ERROR!!! ");
        printk("BBP write R%d fail\n",0x4b);
        if (*(char *)(param_1 + 0xec) == '\0') {
          *(uint *)(*(int *)(param_1 + 0xdc) + 0x7028) =
               *(uint *)(*(int *)(param_1 + 0xdc) + 0x7028) & 0xfffdffff;
          cVar4 = *(char *)(param_1 + 0xad)   //possible issue identified - semgrep
        }
        else {
          cVar4 = *(char *)(param_1 + 0xad)   //possible issue identified - semgrep
        }
LAB_000c8180:
        if (cVar4 == '\x01') goto LAB_000c8190;
        uVar2 = *(uint *)(param_1 + 0x4a94);
      }
    }
    else {
      uVar2 = *(uint *)(param_1 + 0x4a94);
    }
  }
  uVar7 = Status;
  cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
  if (((uVar2 & 0xffff0000) == 0x53500000) && (cVar4 == '\0')) {
    if (*(int *)(param_1 + 0x29f8) == 4) {
      uVar2 = 0;
      if (*(char *)(param_1 + 0xad) == '\x01') {
        Status = Status & 0xfffffffe;
        uVar2 = uVar7 & 1;
      }
      iVar6 = 1;
      cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
      while( true ) {
        uVar7 = 0;
        if (cVar4 == '\0') {
          uVar7 = *(uint *)(*(int *)(param_1 + 0xdc) + 0x101c);
        }
        if ((uVar7 & 0x20000) == 0) break;
        iVar6 = iVar6 + 1;
        printk(&_LC5)   //possible issue identified - semgrep
        if (iVar6 == 100) goto LAB_000c8294;
        cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
      }
      if (cVar4 == '\0') {
        *(undefined4 *)(*(int *)(param_1 + 0xdc) + 0x101c) = 0xa5262;
      }
      *(undefined1 *)(param_1 + 0x4b1b) = 0x62;
      if (iVar6 != 100) {
        cVar4 = *(char *)(param_1 + 0xad)   //possible issue identified - semgrep
        goto LAB_000c82b8;
      }
LAB_000c8294:
      printk("ERROR!!! ");
      printk("BBP write R%d fail\n",0x52);
      cVar4 = *(char *)(param_1 + 0xad)   //possible issue identified - semgrep
LAB_000c82b8:
      if (cVar4 == '\x01') {
LAB_000c847c:
        Status = Status & 0xfffffffe;
        if (uVar2 != 0) {
          Status = Status | 1;
        }
        cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
      }
      else {
        cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
      }
    }
    else {
      uVar2 = 0;
      if (*(char *)(param_1 + 0xad) == '\x01') {
        Status = Status & 0xfffffffe;
        uVar2 = uVar7 & 1;
      }
      iVar6 = 1;
      cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
      while( true ) {
        uVar7 = 0;
        if (cVar4 == '\0') {
          uVar7 = *(uint *)(*(int *)(param_1 + 0xdc) + 0x7028);
        }
        if ((uVar7 & 0x20000) == 0) break;
        iVar3 = iVar6 % 0x14;
        iVar6 = iVar6 + 1;
        if ((iVar3 == 0) && (cVar4 == '\0')) {
          *(uint *)(*(int *)(param_1 + 0xdc) + 0x7028) = uVar7 & 0xfffdffff;
        }
        printk(&_LC5)   //possible issue identified - semgrep
        if (iVar6 == 100) goto LAB_000c8420;
        cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
      }
      if (cVar4 == '\0') {
        *(undefined4 *)(*(int *)(param_1 + 0xdc) + 0x7028) = 0xa5262;
      }
      iVar3 = AsicSendCommandToMcuBBP(param_1,0x80,0xff,0,0,0);
      if (*(char *)(param_1 + 0x16964) == '\x01') {
        RTMPusecDelay(1000);
      }
      if ((iVar3 == 0) && (*(char *)(param_1 + 0xec) == '\0')) {
        *(undefined4 *)(*(int *)(param_1 + 0xdc) + 0x7028) = 0x85262;
      }
      *(undefined1 *)(param_1 + 0x4b1b) = 0x62;
      if (iVar6 != 100) {
        cVar4 = *(char *)(param_1 + 0xad)   //possible issue identified - semgrep
        goto LAB_000c846c;
      }
LAB_000c8420:
      printk("ERROR!!! ");
      printk("BBP write R%d fail\n",0x52);
      if (*(char *)(param_1 + 0xec) == '\0') {
        *(uint *)(*(int *)(param_1 + 0xdc) + 0x7028) =
             *(uint *)(*(int *)(param_1 + 0xdc) + 0x7028) & 0xfffdffff;
        cVar4 = *(char *)(param_1 + 0xad)   //possible issue identified - semgrep
      }
      else {
        cVar4 = *(char *)(param_1 + 0xad)   //possible issue identified - semgrep
      }
LAB_000c846c:
      if (cVar4 == '\x01') goto LAB_000c847c;
      cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
    }
    uVar2 = Status;
    if (cVar4 == '\0') {
      if (*(int *)(param_1 + 0x29f8) == 4) {
        uVar7 = 0;
        if (*(char *)(param_1 + 0xad) == '\x01') {
          Status = Status & 0xfffffffe;
          uVar7 = uVar2 & 1;
        }
        iVar6 = 1;
        cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
        while( true ) {
          uVar2 = 0;
          if (cVar4 == '\0') {
            uVar2 = *(uint *)(*(int *)(param_1 + 0xdc) + 0x101c);
          }
          if ((uVar2 & 0x20000) == 0) break;
          iVar6 = iVar6 + 1;
          printk(&_LC5)   //possible issue identified - semgrep
          if (iVar6 == 100) goto LAB_000c856c;
          cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
        }
        if (cVar4 == '\0') {
          *(undefined4 *)(*(int *)(param_1 + 0xdc) + 0x101c) = 0xa537a;
        }
        *(undefined1 *)(param_1 + 0x4b1c) = 0x7a;
        if (iVar6 != 100) {
          cVar4 = *(char *)(param_1 + 0xad)   //possible issue identified - semgrep
          goto LAB_000c8590;
        }
LAB_000c856c:
        printk("ERROR!!! ");
        printk("BBP write R%d fail\n",0x53);
        cVar4 = *(char *)(param_1 + 0xad)   //possible issue identified - semgrep
LAB_000c8590:
        if (cVar4 == '\x01') {
LAB_000c8754:
          Status = Status & 0xfffffffe;
          if (uVar7 != 0) {
            Status = Status | 1;
          }
          cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
        }
        else {
          cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
        }
      }
      else {
        uVar7 = 0;
        if (*(char *)(param_1 + 0xad) == '\x01') {
          Status = Status & 0xfffffffe;
          uVar7 = uVar2 & 1;
        }
        iVar6 = 1;
        cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
        while( true ) {
          uVar2 = 0;
          if (cVar4 == '\0') {
            uVar2 = *(uint *)(*(int *)(param_1 + 0xdc) + 0x7028);
          }
          if ((uVar2 & 0x20000) == 0) break;
          iVar3 = iVar6 % 0x14;
          iVar6 = iVar6 + 1;
          if ((iVar3 == 0) && (cVar4 == '\0')) {
            *(uint *)(*(int *)(param_1 + 0xdc) + 0x7028) = uVar2 & 0xfffdffff;
          }
          printk(&_LC5)   //possible issue identified - semgrep
          if (iVar6 == 100) goto LAB_000c86f8;
          cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
        }
        if (cVar4 == '\0') {
          *(undefined4 *)(*(int *)(param_1 + 0xdc) + 0x7028) = 0xa537a;
        }
        iVar3 = AsicSendCommandToMcuBBP(param_1,0x80,0xff,0,0,0);
        if (*(char *)(param_1 + 0x16964) == '\x01') {
          RTMPusecDelay(1000);
        }
        if ((iVar3 == 0) && (*(char *)(param_1 + 0xec) == '\0')) {
          *(undefined4 *)(*(int *)(param_1 + 0xdc) + 0x7028) = 0x8537a;
        }
        *(undefined1 *)(param_1 + 0x4b1c) = 0x7a;
        if (iVar6 != 100) {
          cVar4 = *(char *)(param_1 + 0xad)   //possible issue identified - semgrep
          goto LAB_000c8744;
        }
LAB_000c86f8:
        printk("ERROR!!! ");
        printk("BBP write R%d fail\n",0x53);
        if (*(char *)(param_1 + 0xec) == '\0') {
          *(uint *)(*(int *)(param_1 + 0xdc) + 0x7028) =
               *(uint *)(*(int *)(param_1 + 0xdc) + 0x7028) & 0xfffdffff;
          cVar4 = *(char *)(param_1 + 0xad)   //possible issue identified - semgrep
        }
        else {
          cVar4 = *(char *)(param_1 + 0xad)   //possible issue identified - semgrep
        }
LAB_000c8744:
        if (cVar4 == '\x01') goto LAB_000c8754;
        cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
      }
    }
    else {
      cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
    }
  }
  if (cVar4 == '\0') {
    *(uint *)(*(int *)(param_1 + 0xdc) + 0x132c) =
         *(uint *)(*(int *)(param_1 + 0xdc) + 0x132c) & 0xfffffff9 | 4;
    uVar2 = *(uint *)(param_1 + 0x4bf4);
  }
  else {
    uVar2 = *(uint *)(param_1 + 0x4bf4);
  }
  if ((uVar2 & 0xf0) == 0x10) {
    uVar7 = 0x50f02;
  }
  else {
    uVar7 = 0x50f0a;
  }
  if ((uVar2 & 0xf) == 1) {
    uVar7 = uVar7 & 0xfffff3ff;
    cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
  }
  else {
    cVar4 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
  }
  if (cVar4 == '\0') {
    *(uint *)(*(int *)(param_1 + 0xdc) + 0x1328) = uVar7;
  }
  RT30xxWriteRFRegister(param_1,0x3b,(&DAT_000e49ef)[local_34]);
  RtmpUpdateFilterCoefficientControl(param_1,local_34);
LAB_000c9e84:
  if (local_30 == 0) {
    cVar8 = AsicRxAntEvalTimeout[param_1 + 5];
  }
  else {
    cVar8 = (code)0x0;
  }
  RTMPSetAGCInitValue(param_1,cVar8);
  RTMPusecDelay(1000);
  return;
}