undefined4 AsicCheckCommanOk(int param_1,uint param_2)

{
  char cVar1;
  uint uVar2;
  char *pcVar3;
  uint uVar4;
  uint uVar5;
  uint uVar6;
  uint uVar7;
  
  uVar6 = Status;
  param_2 = param_2 & 0xff;
  uVar7 = 0;
  if (*(char *)(param_1 + 0xad) == '\x01') {
    Status = Status & 0xfffffffe;
    uVar7 = uVar6 & 1;
  }
  uVar6 = 0;
  cVar1 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
  while( true ) {
    uVar5 = 0;
    if (cVar1 == '\0') {
      uVar5 = *(uint *)(*(int *)(param_1 + 0xdc) + 0x7014);
    }
    if ((uVar5 & 0xff) == param_2) {
      uVar2 = 0xff;
      goto LAB_00054324;
    }
    uVar2 = 0xff00;
    if ((((uVar5 << 0x10) >> 0x18 == param_2) || (uVar2 = 0xff0000, (uVar5 << 8) >> 0x18 == param_2)
        ) || (uVar2 = 0xff000000, uVar5 >> 0x18 == param_2)) goto LAB_00054324;
    uVar6 = uVar6 + 1;
    RTMPusecDelay(100);
    if (uVar6 == 200) break;
    cVar1 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
  }
  uVar2 = 0;
LAB_00054324:
  uVar4 = 0;
  if (*(char *)(param_1 + 0xec) == '\0') {
    uVar4 = *(uint *)(*(int *)(param_1 + 0xdc) + 0x701c);
  }
  if (uVar6 < 200) {
    uVar4 = uVar4 & uVar2;
    if (((uVar4 == 1) || (uVar4 == 0x100)) || ((uVar4 == 0x10000 || (uVar4 == 0x1000000)))) {
      if (RTDebugLevel < 3) {
        cVar1 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
      }
      else {
        printk("--> AsicCheckCommanOk CID = 0x%x, CmdStatus= 0x%x \n",uVar5);
        cVar1 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
      }
      if (cVar1 == '\0') {
        *(undefined4 *)(*(int *)(param_1 + 0xdc) + 0x701c) = 0xffffffff;
        cVar1 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
      }
      else {
        cVar1 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
      }
      if (cVar1 == '\0') {
        *(undefined4 *)(*(int *)(param_1 + 0xdc) + 0x7014) = 0xffffffff;
        cVar1 = *(char *)(param_1 + 0xad)   //possible issue identified - semgrep
      }
      else {
        cVar1 = *(char *)(param_1 + 0xad)   //possible issue identified - semgrep
      }
      if (cVar1 == '\x01') {
        Status = Status & 0xfffffffe;
        if (uVar7 != 0) {
          Status = Status | 1;
        }
        return 1;
      }
      return 1;
    }
    if (RTDebugLevel < 3) {
      cVar1 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
      goto LAB_00054450;
    }
    pcVar3 = "--> AsicCheckCommanFail1 CID = 0x%x, CmdStatus= 0x%x \n";
    param_2 = uVar5;
  }
  else {
    if (RTDebugLevel < 3) {
      cVar1 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
      goto LAB_00054450;
    }
    pcVar3 = "--> AsicCheckCommanFail2 Timeout Command = %d, CmdStatus= 0x%x \n";
  }
  printk(pcVar3,param_2);
  cVar1 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
LAB_00054450:
  if (cVar1 == '\0') {
    *(undefined4 *)(*(int *)(param_1 + 0xdc) + 0x701c) = 0xffffffff;
    cVar1 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
  }
  else {
    cVar1 = *(char *)(param_1 + 0xec)   //possible issue identified - semgrep
  }
  if (cVar1 == '\0') {
    *(undefined4 *)(*(int *)(param_1 + 0xdc) + 0x7014) = 0xffffffff;
    cVar1 = *(char *)(param_1 + 0xad)   //possible issue identified - semgrep
  }
  else {
    cVar1 = *(char *)(param_1 + 0xad)   //possible issue identified - semgrep
  }
  if ((cVar1 == '\x01') && (Status = Status & 0xfffffffe, uVar7 != 0)) {
    Status = Status | 1;
  }
  return 0;
}