/* WARNING: Removing unreachable block (ram,0x0007e6e4) */
/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */

void UAPSD_SP_AUE_Handle(int *param_1,int param_2)

{
  short sVar1;
  uint uVar2;
  undefined4 *puVar3;
  int iVar4;
  uint uVar5;
  
  if (param_2 == 0) {
    return;
  }
  if (*(char *)(param_2 + 0x270) == '\0') {
    *(undefined1 *)(param_2 + 0x2ea) = 0;
    *(undefined1 *)(param_2 + 0x2eb) = 0;
    return;
  }
  if (*(char *)(param_2 + 0x270) != '\x01') {
    return;
  }
  local_bh_disable();
  if (*(char *)(param_2 + 0x2f0) != '\0') {
LAB_0007e6b4:
    local_bh_enable();
    return;
  }
  if (*(char *)(param_2 + 0x2eb) == '\0') {
    *(undefined1 *)(param_2 + 0x2f1) = 0;
  }
  *(undefined4 *)(param_2 + 0x2ec) = _jiffies;
  if (*(short *)(param_2 + 0x2e8) == 0) {
    if ((char)param_1[0x5a56] == '\x01') {
      *(undefined1 *)(param_2 + 0x2ea) = 1;
    }
    if ((*(char *)(param_2 + 0x2eb) != '\0') && ((char)param_1[0x5a56] == '\0')) {
      *(undefined1 *)(param_2 + 0x2ea) = 0;
      *(undefined1 *)(param_2 + 0x2eb) = 0;
    }
    goto LAB_0007e6b4;
  }
  uVar5 = 0;
  if (*(short *)(param_2 + 0x2e8) == 1) {
    puVar3 = *(undefined4 **)(param_2 + 0x2e4);
    if (puVar3 == (undefined4 *)0x0) {
      sVar1 = *(short *)(param_2 + 0x2e8)   //possible issue identified - semgrep
      goto LAB_0007e5bc;
    }
    *puVar3 = 0;
    uVar5 = *(byte *)((int)puVar3 + 0x2b) & 0x7f;
    if (3 < uVar5) {
      uVar5 = 0;
    }
    if ((int *)param_1[uVar5 * 3 + 0xa8d] == (int *)0x0) {
      param_1[uVar5 * 3 + 0xa8c] = *(int *)(param_2 + 0x2e4);
    }
    else {
      *(int *)param_1[uVar5 * 3 + 0xa8d] = *(int *)(param_2 + 0x2e4);
    }
    param_1[uVar5 * 3 + 0xa8d] = *(int *)(param_2 + 0x2e4);
    param_1[uVar5 * 3 + 0xa8e] = param_1[uVar5 * 3 + 0xa8e] + 1;
    uVar5 = 1;
    *(undefined4 *)(param_2 + 0x2e4) = 0;
  }
  sVar1 = *(short *)(param_2 + 0x2e8)   //possible issue identified - semgrep
LAB_0007e5bc:
  *(short *)(param_2 + 0x2e8) = sVar1 + -1;
  local_bh_enable();
  if (uVar5 != 0) {
    iVar4 = *param_1;
    if (_kill_pid << 0xf < 0) {
      uVar2 = *(uint *)(iVar4 + 0xd8);
      *(uint *)(iVar4 + 0xd8) = uVar2 | uVar5;
      uVar2 = uVar2 & uVar5;
    }
    else {
      uVar5 = Status & 1;
      uVar2 = *(uint *)(iVar4 + 0xd8) & 1;
      *(uint *)(iVar4 + 0xd8) = *(uint *)(iVar4 + 0xd8) | 1;
      Status = Status & 0xfffffffe;
      if (uVar5 != 0) {
        Status = Status | 1;
      }
    }
    if (uVar2 == 0) {
      __tasklet_hi_schedule(iVar4 + 0xd4);
      return;
    }
  }
  return;
}