server-re/decomp/DBCServer_Release_x64/full/functions/0x14014a110.c

146 lines
4.1 KiB
C

/* DBCServer_Release_x64.exe sha256 d9e4fccdf3482e50247686d4452c0b13c75a53efc4bd7320668eece8d1ce828c
* Ghidra 12.1.2 decompiler output for 0x14014a110 FUN_14014a110
* Pseudocode, not original source. */
undefined8
FUN_14014a110(undefined8 param_1,undefined4 *param_2,undefined8 param_3,undefined8 param_4)
{
int *piVar1;
short sVar2;
char cVar3;
ulonglong uVar4;
short *psVar5;
short *psVar6;
undefined4 local_res8 [2];
short *local_res10;
short *local_res18;
short *local_res20;
undefined8 uVar7;
uVar7 = 0xfffffffffffffffe;
cVar3 = FUN_14016b370(param_1,local_res8,4,param_4,0xfffffffffffffffe);
if (cVar3 != '\0') {
*param_2 = local_res8[0];
}
cVar3 = FUN_14016b370(param_1,local_res8,4,param_4,uVar7);
if (cVar3 != '\0') {
param_2[1] = local_res8[0];
}
cVar3 = FUN_14016b370(param_1,local_res8,4,param_4,uVar7);
if (cVar3 != '\0') {
param_2[2] = local_res8[0];
}
cVar3 = FUN_14016b370(param_1,local_res8,1,param_4,uVar7);
if (cVar3 != '\0') {
*(undefined1 *)(param_2 + 3) = (undefined1)local_res8[0];
}
cVar3 = FUN_14016b370(param_1,local_res8,4,param_4,uVar7);
if (cVar3 != '\0') {
param_2[4] = local_res8[0];
}
cVar3 = FUN_14016b370(param_1,local_res8,4);
if (cVar3 != '\0') {
param_2[5] = local_res8[0];
}
cVar3 = FUN_14016b370(param_1,local_res8,4);
if (cVar3 != '\0') {
param_2[6] = local_res8[0];
}
cVar3 = FUN_14016b370(param_1,local_res8,4);
if (cVar3 != '\0') {
param_2[7] = local_res8[0];
}
cVar3 = FUN_14016b370(param_1,local_res8,1);
if (cVar3 != '\0') {
*(undefined1 *)(param_2 + 8) = (undefined1)local_res8[0];
}
FUN_14016d8c0();
local_res20 = (short *)PTR_DAT_1403440a0;
FUN_14016d8c0();
local_res18 = (short *)PTR_DAT_1403440a0;
FUN_14016d8c0();
local_res10 = (short *)PTR_DAT_1403440a0;
thunk_FUN_14016c760(param_1,&local_res20);
thunk_FUN_14016c760(param_1,&local_res18);
thunk_FUN_14016c760(param_1,&local_res10);
psVar5 = local_res20;
if (local_res20 == (short *)0x0) {
psVar5 = (short *)PTR_DAT_1403440a0;
}
uVar4 = 0xffffffffffffffff;
psVar6 = psVar5;
do {
if (uVar4 == 0) break;
uVar4 = uVar4 - 1;
sVar2 = *psVar6;
psVar6 = psVar6 + 1;
} while (sVar2 != 0);
FUN_140056040(param_2 + 10,psVar5,~uVar4 - 1);
psVar5 = local_res18;
if (local_res18 == (short *)0x0) {
psVar5 = (short *)PTR_DAT_1403440a0;
}
uVar4 = 0xffffffffffffffff;
psVar6 = psVar5;
do {
if (uVar4 == 0) break;
uVar4 = uVar4 - 1;
sVar2 = *psVar6;
psVar6 = psVar6 + 1;
} while (sVar2 != 0);
FUN_140056040(param_2 + 0x14,psVar5,~uVar4 - 1);
psVar5 = local_res10;
if (local_res10 == (short *)0x0) {
psVar5 = (short *)PTR_DAT_1403440a0;
}
uVar4 = 0xffffffffffffffff;
psVar6 = psVar5;
do {
if (uVar4 == 0) break;
uVar4 = uVar4 - 1;
sVar2 = *psVar6;
psVar6 = psVar6 + 1;
} while (sVar2 != 0);
FUN_140056040(param_2 + 0x1e,psVar5,~uVar4 - 1);
psVar5 = local_res10;
if (((local_res10 != (short *)0x0) && (local_res10 != (short *)PTR_DAT_1403440a0)) &&
(psVar6 = local_res10 + -4, psVar6 != (short *)0x0)) {
uVar7 = FUN_14016d8c0();
FUN_14016db50(uVar7);
piVar1 = (int *)(psVar5 + -2);
*piVar1 = *piVar1 + -1;
if (*piVar1 == 0) {
FUN_14016d970(psVar6);
}
FUN_14016dbe0(uVar7);
}
psVar5 = local_res18;
local_res10 = (short *)PTR_DAT_1403440a0;
if (((local_res18 != (short *)0x0) && (local_res18 != (short *)PTR_DAT_1403440a0)) &&
(psVar6 = local_res18 + -4, psVar6 != (short *)0x0)) {
uVar7 = FUN_14016d8c0();
FUN_14016db50(uVar7);
piVar1 = (int *)(psVar5 + -2);
*piVar1 = *piVar1 + -1;
if (*piVar1 == 0) {
FUN_14016d970(psVar6);
}
FUN_14016dbe0(uVar7);
}
psVar5 = local_res20;
if (((local_res20 != (short *)0x0) && (local_res20 != (short *)PTR_DAT_1403440a0)) &&
(psVar6 = local_res20 + -4, psVar6 != (short *)0x0)) {
local_res18 = (short *)PTR_DAT_1403440a0;
uVar7 = FUN_14016d8c0();
FUN_14016db50(uVar7);
piVar1 = (int *)(psVar5 + -2);
*piVar1 = *piVar1 + -1;
if (*piVar1 == 0) {
FUN_14016d970(psVar6);
}
FUN_14016dbe0(uVar7);
}
return param_1;
}