undefined4 Set_ATE_DIV_ANTENNA_Proc(int param_1,undefined4 param_2)
{
byte bVar1;
int iVar2;
char cVar3;
uint uVar4;
int iVar5;
uint uVar6;
undefined4 uVar7;
byte local_18 [8];
iVar2 = simple_strtol(param_2,0,10);
if (iVar2 == 0) {
local_18[0] = 0;
if (2 < RTDebugLevel) {
printk("Set_ATE_DIV_ANTENNA_Proc: enable hardware antenna diversity\n");
}
RT30xxReadRFRegister(param_1,0x1d,local_18);
local_18[0] = local_18[0] & 0x3f | 0xc0;
RT30xxWriteRFRegister(param_1,0x1d,local_18[0]);
RT30xxReadRFRegister(param_1,0x1d,local_18);
iVar2 = 0;
cVar3 = *(char *)(param_1 + 0xec) //possible issue identified - semgrep
while( true ) {
uVar4 = 0;
if (cVar3 == '\0') {
uVar4 = *(uint *)(*(int *)(param_1 + 0xdc) + 0x101c);
}
if ((uVar4 & 0x20000) == 0) {
if (cVar3 == '\0') {
*(undefined4 *)(*(int *)(param_1 + 0xdc) + 0x101c) = 0xb2f00;
}
iVar5 = 1;
while( true ) {
uVar4 = 0;
if (*(char *)(param_1 + 0xec) == '\0') {
uVar4 = *(uint *)(*(int *)(param_1 + 0xdc) + 0x101c);
}
if (((uVar4 & 0x20000) == 0) || (iVar5 == 100)) break;
iVar5 = iVar5 + 1;
}
if ((uVar4 & 0x2ff00) == 0x2f00) {
uVar6 = uVar4 & 0xff;
goto LAB_0009ef14;
}
}
iVar2 = iVar2 + 1;
if (iVar2 == 100) break;
cVar3 = *(char *)(param_1 + 0xec) //possible issue identified - semgrep
}
uVar6 = 0;
LAB_0009ef14:
if ((int)(uVar4 << 0xe) < 0) {
if (RTDebugLevel == 0) {
bVar1 = *(byte *)(param_1 + 0x4af8);
}
else {
printk("BBP read R%d fail\n",0x2f);
bVar1 = *(byte *)(param_1 + 0x4af8);
}
uVar6 = (uint)bVar1;
cVar3 = *(char *)(param_1 + 0xec) //possible issue identified - semgrep
}
else {
cVar3 = *(char *)(param_1 + 0xec) //possible issue identified - semgrep
}
iVar2 = 0;
do {
uVar4 = 0;
if (cVar3 == '\0') {
uVar4 = *(uint *)(*(int *)(param_1 + 0xdc) + 0x101c);
}
if ((uVar4 & 0x20000) == 0) {
if (cVar3 == '\0') {
*(uint *)(*(int *)(param_1 + 0xdc) + 0x101c) = uVar6 | 0xa2f80;
}
*(byte *)(param_1 + 0x4af8) = (byte)uVar6 | 0x80;
if (iVar2 != 100) goto LAB_0009eff0;
break;
}
iVar2 = iVar2 + 1;
} while (iVar2 != 100);
if (RTDebugLevel == 0) {
cVar3 = *(char *)(param_1 + 0xec) //possible issue identified - semgrep
}
else {
printk("BBP write R%d fail\n",0x2f);
LAB_0009eff0:
cVar3 = *(char *)(param_1 + 0xec) //possible issue identified - semgrep
}
iVar2 = 0;
do {
uVar4 = 0;
if (cVar3 == '\0') {
uVar4 = *(uint *)(*(int *)(param_1 + 0xdc) + 0x101c);
}
if ((uVar4 & 0x20000) == 0) {
if (cVar3 == '\0') {
*(undefined4 *)(*(int *)(param_1 + 0xdc) + 0x101c) = 0xa96be;
}
*(undefined1 *)(param_1 + 0x4b5f) = 0xbe;
if (iVar2 != 100) {
cVar3 = *(char *)(param_1 + 0xec) //possible issue identified - semgrep
goto LAB_0009f0a4;
}
break;
}
iVar2 = iVar2 + 1;
} while (iVar2 != 100);
if (RTDebugLevel == 0) {
cVar3 = *(char *)(param_1 + 0xec) //possible issue identified - semgrep
}
else {
printk("BBP write R%d fail\n",0x96);
cVar3 = *(char *)(param_1 + 0xec) //possible issue identified - semgrep
}
LAB_0009f0a4:
iVar2 = 0;
do {
uVar4 = 0;
if (cVar3 == '\0') {
uVar4 = *(uint *)(*(int *)(param_1 + 0xdc) + 0x101c);
}
if ((uVar4 & 0x20000) == 0) {
if (cVar3 == '\0') {
*(undefined4 *)(*(int *)(param_1 + 0xdc) + 0x101c) = 0xa97b0;
}
*(undefined1 *)(param_1 + 0x4b60) = 0xb0;
if (iVar2 != 100) {
cVar3 = *(char *)(param_1 + 0xec) //possible issue identified - semgrep
goto LAB_0009f154;
}
break;
}
iVar2 = iVar2 + 1;
} while (iVar2 != 100);
if (RTDebugLevel == 0) {
cVar3 = *(char *)(param_1 + 0xec) //possible issue identified - semgrep
}
else {
printk("BBP write R%d fail\n",0x97);
cVar3 = *(char *)(param_1 + 0xec) //possible issue identified - semgrep
}
LAB_0009f154:
iVar2 = 0;
do {
uVar4 = 0;
if (cVar3 == '\0') {
uVar4 = *(uint *)(*(int *)(param_1 + 0xdc) + 0x101c);
}
if ((uVar4 & 0x20000) == 0) {
if (cVar3 == '\0') {
*(undefined4 *)(*(int *)(param_1 + 0xdc) + 0x101c) = 0xa9823;
}
*(undefined1 *)(param_1 + 0x4b61) = 0x23;
if (iVar2 != 100) {
cVar3 = *(char *)(param_1 + 0xec) //possible issue identified - semgrep
goto LAB_0009f204;
}
break;
}
iVar2 = iVar2 + 1;
} while (iVar2 != 100);
if (RTDebugLevel == 0) {
cVar3 = *(char *)(param_1 + 0xec) //possible issue identified - semgrep
}
else {
printk("BBP write R%d fail\n",0x98);
cVar3 = *(char *)(param_1 + 0xec) //possible issue identified - semgrep
}
LAB_0009f204:
iVar2 = 0;
do {
uVar4 = 0;
if (cVar3 == '\0') {
uVar4 = *(uint *)(*(int *)(param_1 + 0xdc) + 0x101c);
}
if ((uVar4 & 0x20000) == 0) {
if (cVar3 == '\0') {
*(undefined4 *)(*(int *)(param_1 + 0xdc) + 0x101c) = 0xa993a;
}
*(undefined1 *)(param_1 + 0x4b62) = 0x3a;
if (iVar2 != 100) {
cVar3 = *(char *)(param_1 + 0xec) //possible issue identified - semgrep
goto LAB_0009f2b4;
}
break;
}
iVar2 = iVar2 + 1;
} while (iVar2 != 100);
if (RTDebugLevel == 0) {
cVar3 = *(char *)(param_1 + 0xec) //possible issue identified - semgrep
}
else {
printk("BBP write R%d fail\n",0x99);
cVar3 = *(char *)(param_1 + 0xec) //possible issue identified - semgrep
}
LAB_0009f2b4:
iVar2 = 0;
do {
uVar4 = 0;
if (cVar3 == '\0') {
uVar4 = *(uint *)(*(int *)(param_1 + 0xdc) + 0x101c);
}
if ((uVar4 & 0x20000) == 0) {
if (cVar3 == '\0') {
*(undefined4 *)(*(int *)(param_1 + 0xdc) + 0x101c) = 0xa9a10;
}
*(undefined1 *)(param_1 + 0x4b63) = 0x10;
if (iVar2 != 100) {
cVar3 = *(char *)(param_1 + 0xec) //possible issue identified - semgrep
goto LAB_0009f364;
}
break;
}
iVar2 = iVar2 + 1;
} while (iVar2 != 100);
if (RTDebugLevel == 0) {
cVar3 = *(char *)(param_1 + 0xec) //possible issue identified - semgrep
}
else {
printk("BBP write R%d fail\n",0x9a);
cVar3 = *(char *)(param_1 + 0xec) //possible issue identified - semgrep
}
LAB_0009f364:
iVar2 = 0;
do {
uVar4 = 0;
if (cVar3 == '\0') {
uVar4 = *(uint *)(*(int *)(param_1 + 0xdc) + 0x101c);
}
if ((uVar4 & 0x20000) == 0) {
if (cVar3 == '\0') {
*(undefined4 *)(*(int *)(param_1 + 0xdc) + 0x101c) = 0xa9b3b;
}
*(undefined1 *)(param_1 + 0x4b64) = 0x3b;
if (iVar2 != 100) {
cVar3 = *(char *)(param_1 + 0xec) //possible issue identified - semgrep
goto LAB_0009f414;
}
break;
}
iVar2 = iVar2 + 1;
} while (iVar2 != 100);
if (RTDebugLevel == 0) {
cVar3 = *(char *)(param_1 + 0xec) //possible issue identified - semgrep
}
else {
printk("BBP write R%d fail\n",0x9b);
cVar3 = *(char *)(param_1 + 0xec) //possible issue identified - semgrep
}
LAB_0009f414:
iVar2 = 0;
do {
uVar4 = 0;
if (cVar3 == '\0') {
uVar4 = *(uint *)(*(int *)(param_1 + 0xdc) + 0x101c);
}
if ((uVar4 & 0x20000) == 0) {
if (cVar3 == '\0') {
*(undefined4 *)(*(int *)(param_1 + 0xdc) + 0x101c) = 0xafd04;
}
*(undefined1 *)(param_1 + 0x4bc6) = 4;
if (iVar2 != 100) {
return 1;
}
break;
}
iVar2 = iVar2 + 1;
} while (iVar2 != 100);
if (RTDebugLevel == 0) {
return 1;
}
uVar7 = 0xfd;
LAB_000a0148:
printk("BBP write R%d fail\n",uVar7);
return 1;
}
if (iVar2 != 1) {
if (2 < RTDebugLevel) {
printk("Set_ATE_DIV_ANTENNA_Proc: fix to aux antenna\n");
}
iVar2 = 0;
cVar3 = *(char *)(param_1 + 0xec) //possible issue identified - semgrep
while( true ) {
uVar4 = 0;
if (cVar3 == '\0') {
uVar4 = *(uint *)(*(int *)(param_1 + 0xdc) + 0x101c);
}
if ((uVar4 & 0x20000) == 0) {
if (cVar3 == '\0') {
*(undefined4 *)(*(int *)(param_1 + 0xdc) + 0x101c) = 0xb9600;
}
iVar5 = 1;
while( true ) {
uVar4 = 0;
if (*(char *)(param_1 + 0xec) == '\0') {
uVar4 = *(uint *)(*(int *)(param_1 + 0xdc) + 0x101c);
}
if (((uVar4 & 0x20000) == 0) || (iVar5 == 100)) break;
iVar5 = iVar5 + 1;
}
if ((uVar4 & 0x2ff00) == 0x9600) {
uVar6 = uVar4 & 0xff;
goto LAB_0009fbb8;
}
}
iVar2 = iVar2 + 1;
if (iVar2 == 100) break;
cVar3 = *(char *)(param_1 + 0xec) //possible issue identified - semgrep
}
uVar6 = 0;
LAB_0009fbb8:
if ((int)(uVar4 << 0xe) < 0) {
if (RTDebugLevel == 0) {
bVar1 = *(byte *)(param_1 + 0x4b5f);
}
else {
printk("BBP read R%d fail\n",0x96);
bVar1 = *(byte *)(param_1 + 0x4b5f);
}
uVar6 = (uint)bVar1;
cVar3 = *(char *)(param_1 + 0xec) //possible issue identified - semgrep
}
else {
cVar3 = *(char *)(param_1 + 0xec) //possible issue identified - semgrep
}
uVar6 = uVar6 & 0x7f;
iVar2 = 0;
do {
uVar4 = 0;
if (cVar3 == '\0') {
uVar4 = *(uint *)(*(int *)(param_1 + 0xdc) + 0x101c);
}
if ((uVar4 & 0x20000) == 0) {
if (cVar3 == '\0') {
*(uint *)(*(int *)(param_1 + 0xdc) + 0x101c) = uVar6 | 0xa9600;
}
*(char *)(param_1 + 0x4b5f) = (char)uVar6;
if (iVar2 != 100) goto LAB_0009fc9c;
break;
}
iVar2 = iVar2 + 1;
} while (iVar2 != 100);
if (RTDebugLevel != 0) {
printk("BBP write R%d fail\n",0x96);
}
LAB_0009fc9c:
iVar2 = 0;
cVar3 = *(char *)(param_1 + 0xec) //possible issue identified - semgrep
LAB_0009fcb8:
uVar4 = 0;
if (cVar3 == '\0') {
uVar4 = *(uint *)(*(int *)(param_1 + 0xdc) + 0x101c);
}
if ((uVar4 & 0x20000) == 0) {
if (cVar3 == '\0') {
*(undefined4 *)(*(int *)(param_1 + 0xdc) + 0x101c) = 0xb9700;
}
iVar5 = 1;
while( true ) {
uVar4 = 0;
if (*(char *)(param_1 + 0xec) == '\0') {
uVar4 = *(uint *)(*(int *)(param_1 + 0xdc) + 0x101c);
}
if (((uVar4 & 0x20000) == 0) || (iVar5 == 100)) break;
iVar5 = iVar5 + 1;
}
if ((uVar4 & 0x2ff00) == 0x9700) {
uVar6 = uVar4 & 0xff;
LAB_0009fd4c:
if ((int)(uVar4 << 0xe) < 0) {
if (RTDebugLevel == 0) {
bVar1 = *(byte *)(param_1 + 0x4b60);
}
else {
printk("BBP read R%d fail\n",0x97);
bVar1 = *(byte *)(param_1 + 0x4b60);
}
uVar6 = (uint)bVar1;
cVar3 = *(char *)(param_1 + 0xec) //possible issue identified - semgrep
}
else {
cVar3 = *(char *)(param_1 + 0xec) //possible issue identified - semgrep
}
uVar6 = uVar6 & 0x7f;
iVar2 = 0;
do {
uVar4 = 0;
if (cVar3 == '\0') {
uVar4 = *(uint *)(*(int *)(param_1 + 0xdc) + 0x101c);
}
if ((uVar4 & 0x20000) == 0) {
if (cVar3 == '\0') {
*(uint *)(*(int *)(param_1 + 0xdc) + 0x101c) = uVar6 | 0xa9700;
}
*(char *)(param_1 + 0x4b60) = (char)uVar6;
if (iVar2 != 100) goto LAB_0009fe30;
break;
}
iVar2 = iVar2 + 1;
} while (iVar2 != 100);
if (RTDebugLevel != 0) {
printk("BBP write R%d fail\n",0x97);
}
LAB_0009fe30:
iVar2 = 0;
cVar3 = *(char *)(param_1 + 0xec) //possible issue identified - semgrep
LAB_0009fe4c:
uVar4 = 0;
if (cVar3 == '\0') {
uVar4 = *(uint *)(*(int *)(param_1 + 0xdc) + 0x101c);
}
if ((uVar4 & 0x20000) == 0) {
if (cVar3 == '\0') {
*(undefined4 *)(*(int *)(param_1 + 0xdc) + 0x101c) = 0xb9a00;
}
iVar5 = 1;
while( true ) {
uVar4 = 0;
if (*(char *)(param_1 + 0xec) == '\0') {
uVar4 = *(uint *)(*(int *)(param_1 + 0xdc) + 0x101c);
}
if (((uVar4 & 0x20000) == 0) || (iVar5 == 100)) break;
iVar5 = iVar5 + 1;
}
if ((uVar4 & 0x2ff00) == 0x9a00) {
uVar6 = uVar4 & 0xff;
LAB_0009fee0:
if ((int)(uVar4 << 0xe) < 0) {
if (RTDebugLevel == 0) {
bVar1 = *(byte *)(param_1 + 0x4b63);
}
else {
printk("BBP read R%d fail\n",0x9a);
bVar1 = *(byte *)(param_1 + 0x4b63);
}
uVar6 = (uint)bVar1;
cVar3 = *(char *)(param_1 + 0xec) //possible issue identified - semgrep
}
else {
cVar3 = *(char *)(param_1 + 0xec) //possible issue identified - semgrep
}
uVar6 = uVar6 & 0xef;
iVar2 = 0;
do {
uVar4 = 0;
if (cVar3 == '\0') {
uVar4 = *(uint *)(*(int *)(param_1 + 0xdc) + 0x101c);
}
if ((uVar4 & 0x20000) == 0) {
if (cVar3 == '\0') {
*(uint *)(*(int *)(param_1 + 0xdc) + 0x101c) = uVar6 | 0xa9a00;
}
*(char *)(param_1 + 0x4b63) = (char)uVar6;
if (iVar2 != 100) goto LAB_0009ffc4;
break;
}
iVar2 = iVar2 + 1;
} while (iVar2 != 100);
if (RTDebugLevel != 0) {
printk("BBP write R%d fail\n",0x9a);
}
LAB_0009ffc4:
iVar2 = 0;
cVar3 = *(char *)(param_1 + 0xec) //possible issue identified - semgrep
LAB_0009ffe0:
uVar4 = 0;
if (cVar3 == '\0') {
uVar4 = *(uint *)(*(int *)(param_1 + 0xdc) + 0x101c);
}
if ((uVar4 & 0x20000) == 0) {
if (cVar3 == '\0') {
*(undefined4 *)(*(int *)(param_1 + 0xdc) + 0x101c) = 0xb9800;
}
iVar5 = 1;
while( true ) {
uVar4 = 0;
if (*(char *)(param_1 + 0xec) == '\0') {
uVar4 = *(uint *)(*(int *)(param_1 + 0xdc) + 0x101c);
}
if (((uVar4 & 0x20000) == 0) || (iVar5 == 100)) break;
iVar5 = iVar5 + 1;
}
if ((uVar4 & 0x2ff00) == 0x9800) {
uVar6 = uVar4 & 0xff;
LAB_000a0074:
if ((int)(uVar4 << 0xe) < 0) {
if (RTDebugLevel == 0) {
bVar1 = *(byte *)(param_1 + 0x4b61);
}
else {
printk("BBP read R%d fail\n",0x98);
bVar1 = *(byte *)(param_1 + 0x4b61);
}
uVar6 = (uint)bVar1;
cVar3 = *(char *)(param_1 + 0xec) //possible issue identified - semgrep
}
else {
cVar3 = *(char *)(param_1 + 0xec) //possible issue identified - semgrep
}
iVar2 = 0;
LAB_000a00bc:
uVar4 = 0;
if (cVar3 == '\0') {
uVar4 = *(uint *)(*(int *)(param_1 + 0xdc) + 0x101c);
}
if ((uVar4 & 0x20000) != 0) goto code_r0x000a00d4;
uVar6 = uVar6 & 0x7f;
LAB_000a00e0:
if (cVar3 == '\0') {
*(uint *)(*(int *)(param_1 + 0xdc) + 0x101c) = uVar6 | 0xa9800;
}
*(char *)(param_1 + 0x4b61) = (char)uVar6;
if (iVar2 != 100) {
return 1;
}
goto LAB_000a0134;
}
}
iVar2 = iVar2 + 1;
if (iVar2 == 100) goto LAB_000a0074;
cVar3 = *(char *)(param_1 + 0xec) //possible issue identified - semgrep
goto LAB_0009ffe0;
}
}
iVar2 = iVar2 + 1;
if (iVar2 == 100) goto LAB_0009fee0;
cVar3 = *(char *)(param_1 + 0xec) //possible issue identified - semgrep
goto LAB_0009fe4c;
}
}
iVar2 = iVar2 + 1;
if (iVar2 == 100) goto LAB_0009fd4c;
cVar3 = *(char *)(param_1 + 0xec) //possible issue identified - semgrep
goto LAB_0009fcb8;
}
if (2 < RTDebugLevel) {
printk("Set_ATE_DIV_ANTENNA_Proc: fix to main antenna\n");
}
iVar2 = 0;
cVar3 = *(char *)(param_1 + 0xec) //possible issue identified - semgrep
while( true ) {
uVar4 = 0;
if (cVar3 == '\0') {
uVar4 = *(uint *)(*(int *)(param_1 + 0xdc) + 0x101c);
}
if ((uVar4 & 0x20000) == 0) {
if (cVar3 == '\0') {
*(undefined4 *)(*(int *)(param_1 + 0xdc) + 0x101c) = 0xb9600;
}
iVar5 = 1;
while( true ) {
uVar4 = 0;
if (*(char *)(param_1 + 0xec) == '\0') {
uVar4 = *(uint *)(*(int *)(param_1 + 0xdc) + 0x101c);
}
if (((uVar4 & 0x20000) == 0) || (iVar5 == 100)) break;
iVar5 = iVar5 + 1;
}
if ((uVar4 & 0x2ff00) == 0x9600) {
uVar6 = uVar4 & 0xff;
goto LAB_0009f5a0;
}
}
iVar2 = iVar2 + 1;
if (iVar2 == 100) break;
cVar3 = *(char *)(param_1 + 0xec) //possible issue identified - semgrep
}
uVar6 = 0;
LAB_0009f5a0:
if ((int)(uVar4 << 0xe) < 0) {
if (RTDebugLevel == 0) {
bVar1 = *(byte *)(param_1 + 0x4b5f);
}
else {
printk("BBP read R%d fail\n",0x96);
bVar1 = *(byte *)(param_1 + 0x4b5f);
}
uVar6 = (uint)bVar1;
cVar3 = *(char *)(param_1 + 0xec) //possible issue identified - semgrep
}
else {
cVar3 = *(char *)(param_1 + 0xec) //possible issue identified - semgrep
}
uVar6 = uVar6 & 0x7f;
iVar2 = 0;
do {
uVar4 = 0;
if (cVar3 == '\0') {
uVar4 = *(uint *)(*(int *)(param_1 + 0xdc) + 0x101c);
}
if ((uVar4 & 0x20000) == 0) {
if (cVar3 == '\0') {
*(uint *)(*(int *)(param_1 + 0xdc) + 0x101c) = uVar6 | 0xa9600;
}
*(char *)(param_1 + 0x4b5f) = (char)uVar6;
if (iVar2 != 100) goto LAB_0009f684;
break;
}
iVar2 = iVar2 + 1;
} while (iVar2 != 100);
if (RTDebugLevel != 0) {
printk("BBP write R%d fail\n",0x96);
}
LAB_0009f684:
iVar2 = 0;
cVar3 = *(char *)(param_1 + 0xec) //possible issue identified - semgrep
LAB_0009f6a0:
uVar4 = 0;
if (cVar3 == '\0') {
uVar4 = *(uint *)(*(int *)(param_1 + 0xdc) + 0x101c);
}
if ((uVar4 & 0x20000) == 0) {
if (cVar3 == '\0') {
*(undefined4 *)(*(int *)(param_1 + 0xdc) + 0x101c) = 0xb9700;
}
iVar5 = 1;
while( true ) {
uVar4 = 0;
if (*(char *)(param_1 + 0xec) == '\0') {
uVar4 = *(uint *)(*(int *)(param_1 + 0xdc) + 0x101c);
}
if (((uVar4 & 0x20000) == 0) || (iVar5 == 100)) break;
iVar5 = iVar5 + 1;
}
if ((uVar4 & 0x2ff00) == 0x9700) {
uVar6 = uVar4 & 0xff;
LAB_0009f734:
if ((int)(uVar4 << 0xe) < 0) {
if (RTDebugLevel == 0) {
bVar1 = *(byte *)(param_1 + 0x4b60);
}
else {
printk("BBP read R%d fail\n",0x97);
bVar1 = *(byte *)(param_1 + 0x4b60);
}
uVar6 = (uint)bVar1;
cVar3 = *(char *)(param_1 + 0xec) //possible issue identified - semgrep
}
else {
cVar3 = *(char *)(param_1 + 0xec) //possible issue identified - semgrep
}
uVar6 = uVar6 & 0x7f;
iVar2 = 0;
do {
uVar4 = 0;
if (cVar3 == '\0') {
uVar4 = *(uint *)(*(int *)(param_1 + 0xdc) + 0x101c);
}
if ((uVar4 & 0x20000) == 0) {
if (cVar3 == '\0') {
*(uint *)(*(int *)(param_1 + 0xdc) + 0x101c) = uVar6 | 0xa9700;
}
*(char *)(param_1 + 0x4b60) = (char)uVar6;
if (iVar2 != 100) goto LAB_0009f818;
break;
}
iVar2 = iVar2 + 1;
} while (iVar2 != 100);
if (RTDebugLevel != 0) {
printk("BBP write R%d fail\n",0x97);
}
LAB_0009f818:
iVar2 = 0;
cVar3 = *(char *)(param_1 + 0xec) //possible issue identified - semgrep
LAB_0009f834:
uVar4 = 0;
if (cVar3 == '\0') {
uVar4 = *(uint *)(*(int *)(param_1 + 0xdc) + 0x101c);
}
if ((uVar4 & 0x20000) == 0) {
if (cVar3 == '\0') {
*(undefined4 *)(*(int *)(param_1 + 0xdc) + 0x101c) = 0xb9a00;
}
iVar5 = 1;
while( true ) {
uVar4 = 0;
if (*(char *)(param_1 + 0xec) == '\0') {
uVar4 = *(uint *)(*(int *)(param_1 + 0xdc) + 0x101c);
}
if (((uVar4 & 0x20000) == 0) || (iVar5 == 100)) break;
iVar5 = iVar5 + 1;
}
if ((uVar4 & 0x2ff00) == 0x9a00) {
uVar6 = uVar4 & 0xff;
LAB_0009f8c8:
if ((int)(uVar4 << 0xe) < 0) {
if (RTDebugLevel == 0) {
bVar1 = *(byte *)(param_1 + 0x4b63);
}
else {
printk("BBP read R%d fail\n",0x9a);
bVar1 = *(byte *)(param_1 + 0x4b63);
}
uVar6 = (uint)bVar1;
cVar3 = *(char *)(param_1 + 0xec) //possible issue identified - semgrep
}
else {
cVar3 = *(char *)(param_1 + 0xec) //possible issue identified - semgrep
}
uVar6 = uVar6 & 0xef;
iVar2 = 0;
do {
uVar4 = 0;
if (cVar3 == '\0') {
uVar4 = *(uint *)(*(int *)(param_1 + 0xdc) + 0x101c);
}
if ((uVar4 & 0x20000) == 0) {
if (cVar3 == '\0') {
*(uint *)(*(int *)(param_1 + 0xdc) + 0x101c) = uVar6 | 0xa9a00;
}
*(char *)(param_1 + 0x4b63) = (char)uVar6;
if (iVar2 != 100) goto LAB_0009f9ac;
break;
}
iVar2 = iVar2 + 1;
} while (iVar2 != 100);
if (RTDebugLevel != 0) {
printk("BBP write R%d fail\n",0x9a);
}
LAB_0009f9ac:
iVar2 = 0;
cVar3 = *(char *)(param_1 + 0xec) //possible issue identified - semgrep
LAB_0009f9c8:
uVar4 = 0;
if (cVar3 == '\0') {
uVar4 = *(uint *)(*(int *)(param_1 + 0xdc) + 0x101c);
}
if ((uVar4 & 0x20000) == 0) {
if (cVar3 == '\0') {
*(undefined4 *)(*(int *)(param_1 + 0xdc) + 0x101c) = 0xb9800;
}
iVar5 = 1;
while( true ) {
uVar4 = 0;
if (*(char *)(param_1 + 0xec) == '\0') {
uVar4 = *(uint *)(*(int *)(param_1 + 0xdc) + 0x101c);
}
if (((uVar4 & 0x20000) == 0) || (iVar5 == 100)) break;
iVar5 = iVar5 + 1;
}
if ((uVar4 & 0x2ff00) == 0x9800) {
uVar6 = uVar4 & 0xff;
LAB_0009fa5c:
if ((int)(uVar4 << 0xe) < 0) {
if (RTDebugLevel == 0) {
bVar1 = *(byte *)(param_1 + 0x4b61);
}
else {
printk("BBP read R%d fail\n",0x98);
bVar1 = *(byte *)(param_1 + 0x4b61);
}
uVar6 = (uint)bVar1;
cVar3 = *(char *)(param_1 + 0xec) //possible issue identified - semgrep
}
else {
cVar3 = *(char *)(param_1 + 0xec) //possible issue identified - semgrep
}
iVar2 = 0;
do {
uVar4 = 0;
if (cVar3 == '\0') {
uVar4 = *(uint *)(*(int *)(param_1 + 0xdc) + 0x101c);
}
if ((uVar4 & 0x20000) == 0) {
uVar6 = uVar6 | 0x80;
goto LAB_000a00e0;
}
iVar2 = iVar2 + 1;
} while (iVar2 != 100);
LAB_000a0134:
if (RTDebugLevel == 0) {
return 1;
}
uVar7 = 0x98;
goto LAB_000a0148;
}
}
iVar2 = iVar2 + 1;
if (iVar2 == 100) goto LAB_0009fa5c;
cVar3 = *(char *)(param_1 + 0xec) //possible issue identified - semgrep
goto LAB_0009f9c8;
}
}
iVar2 = iVar2 + 1;
if (iVar2 == 100) goto LAB_0009f8c8;
cVar3 = *(char *)(param_1 + 0xec) //possible issue identified - semgrep
goto LAB_0009f834;
}
}
iVar2 = iVar2 + 1;
if (iVar2 == 100) goto LAB_0009f734;
cVar3 = *(char *)(param_1 + 0xec) //possible issue identified - semgrep
goto LAB_0009f6a0;
code_r0x000a00d4:
iVar2 = iVar2 + 1;
if (iVar2 == 100) goto LAB_000a0134;
goto LAB_000a00bc;
}