void RTMPIoctlQueryBaTable(int param_1,uint *param_2)
{
char cVar1;
int iVar2;
undefined1 *puVar3;
ushort *puVar4;
int *piVar5;
int iVar6;
uint uVar7;
short *psVar8;
int iVar9;
char cVar10;
int unaff_gp;
iVar2 = vmalloc(0xc02) //possible issue identified - semgrep
RTMPZeroMemory(iVar2,0xc02);
cVar10 = *(char *)(param_1 + 0x71338) //possible issue identified - semgrep
piVar5 = (int *)(param_1 + 0x5cf38);
uVar7 = 0;
iVar9 = 0;
do {
if (cVar10 == '\0') break;
if (((*piVar5 == 1) && (piVar5[0x9d] == 2)) && ((short)piVar5[0x108] != 0)) {
memmove((void *)(uVar7 * 0x30 + iVar2),(void *)(param_1 + iVar9 * 0xa20 + 0x5d190),6) //possible issue identified - semgrep
puVar4 = (ushort *)(param_1 + iVar9 * 0xa20 + 0x5d36e);
puVar3 = (undefined1 *)(iVar2 + (uVar7 * 6 + 1) * 8);
cVar1 = '\0';
do {
if (*puVar4 == 0) {
*puVar3 = 0;
}
else {
*puVar3 = *(undefined1 *)((uint)*puVar4 * 0x38 + param_1 + 0x7136e);
}
cVar1 = cVar1 + '\x01';
puVar4 = puVar4 + 1;
puVar3 = puVar3 + 1;
} while (cVar1 != '\b');
cVar10 = cVar10 + -1 //possible issue identified - semgrep
*(char *)(iVar2 + 0xc00) = *(char *)(iVar2 + 0xc00) + '\x01';
uVar7 = uVar7 + 1 & 0xff;
}
iVar9 = iVar9 + 1;
piVar5 = piVar5 + 0x288;
} while (iVar9 != 0x20);
cVar10 = *(char *)(param_1 + 0x71338) //possible issue identified - semgrep
psVar8 = (short *)(param_1 + 0x5d356);
uVar7 = 0;
iVar9 = 0;
do {
if (cVar10 == '\0') break;
if (((*(int *)(psVar8 + -0x20f) == 1) && (*(int *)(psVar8 + -0xd5) == 2)) && (*psVar8 != 0)) {
iVar6 = uVar7 * 0x30;
memmove((void *)(iVar2 + iVar6 + 0x600),(void *)(param_1 + iVar9 * 0xa20 + 0x5d190),6) //possible issue identified - semgrep
*(char *)(iVar2 + iVar6 + 0x606) = (char)*psVar8;
puVar4 = (ushort *)(param_1 + iVar9 * 0xa20 + 0x5d35e);
puVar3 = (undefined1 *)(iVar2 + iVar6 + 0x608);
cVar1 = '\0';
do {
if (*puVar4 == 0) {
*puVar3 = 0;
}
else {
*puVar3 = *(undefined1 *)((uint)*puVar4 * 0x4c + param_1 + 0x72f6e);
}
cVar1 = cVar1 + '\x01';
puVar4 = puVar4 + 1;
puVar3 = puVar3 + 1;
} while (cVar1 != '\b');
cVar10 = cVar10 + -1 //possible issue identified - semgrep
*(char *)(iVar2 + 0xc01) = *(char *)(iVar2 + 0xc01) + '\x01';
uVar7 = uVar7 + 1 & 0xff;
}
iVar9 = iVar9 + 1;
psVar8 = psVar8 + 0x510;
} while (iVar9 != 0x20);
uVar7 = *param_2;
*(undefined2 *)(param_2 + 1) = 0xc02;
if (((uVar7 + 0xc02 | uVar7) & *(uint *)(unaff_gp + 0x18)) == 0) {
iVar9 = 0xc02;
__copy_user(uVar7,iVar2);
if (iVar9 == 0) goto LAB_000866f8;
}
if (2 < RTDebugLevel) {
printk("%s: copy_to_user() fail\n","RTMPIoctlQueryBaTable");
}
LAB_000866f8:
vfree(iVar2);
return;
}