void read_leases(char *param_1)
{
FILE *__stream;
size_t sVar1;
int iVar2;
uint uVar3;
uint uVar4;
void *__s2;
int iVar5;
uint uVar6;
undefined1 auStack_90 [16];
uint local_80;
uint local_7c;
int local_78;
undefined1 auStack_74 [68];
undefined1 *local_30;
__stream = fopen(param_1,"r") //possible issue identified - semgrep
if (__stream == (FILE *)0x0) {
return;
}
local_30 = auStack_74;
uVar6 = 0;
LAB_0040296c:
do {
do {
if ((DAT_0041bc64 <= uVar6) ||
(sVar1 = fread(auStack_90,0x5c,1,__stream), uVar4 = local_80, sVar1 != 1)) //possible issue identified - semgrep
goto LAB_00402a2c;
} while ((local_80 < DAT_0041bc44) ||
((DAT_0041bc48 < local_80 || (iVar5 = 0, __s2 = static_leases, local_78 == 0))));
do {
uVar3 = *(uint *)((int)__s2 + 0x10);
if (uVar3 == 0) break;
iVar2 = memcmp(auStack_90,__s2,0x10);
if (iVar2 == 0) {
if (uVar4 == uVar3) {
*(undefined4 *)((int)__s2 + 0x18) = 1;
}
goto LAB_0040296c;
}
iVar5 = iVar5 + 1;
if (uVar4 == uVar3) goto LAB_0040296c;
__s2 = (void *)((int)__s2 + 0x5c);
} while (iVar5 != 0x20);
uVar3 = local_7c << 0x18 | local_7c >> 0x18 | (local_7c & 0xff0000) >> 8 |
(local_7c & 0xff00) << 8;
if (DAT_0041bc68 == '\0') {
local_7c = uVar3;
iVar5 = get_uptime();
uVar3 = uVar3 - iVar5;
uVar4 = local_80;
}
local_7c = uVar3;
if (uVar3 == 0xffffffff) {
local_7c = DAT_0041bc60;
}
iVar5 = add_lease(auStack_90,uVar4,local_7c,local_30);
if (iVar5 == 0) {
LAB_00402a2c:
fclose(__stream);
return;
}
*(undefined4 *)(iVar5 + 0x18) = 1;
uVar6 = uVar6 + 1;
} while( true );
}