undefined4 dhcp6_ctl_readcommand(int param_1)
{
ssize_t sVar1;
int *piVar2;
char *pcVar3;
int iVar4;
uint uVar5;
uint uVar6;
int *piVar7;
int *piVar8;
piVar7 = DAT_0043cdd4;
if (DAT_0043cdd4 != (int *)0x0) {
do {
uVar5 = piVar7[2];
piVar8 = (int *)*piVar7;
if ((*(int *)(param_1 + (uVar5 >> 5) * 4) >> (uVar5 & 0x1f) & 1U) != 0) {
sVar1 = read(uVar5,(void *)((int)piVar7 + piVar7[0x104] + 0xc),piVar7[0x103] - piVar7[0x104]
) //possible issue identified - semgrep
if (sVar1 < 0) {
piVar2 = __errno_location();
pcVar3 = strerror(*piVar2);
dprintf(4,"dhcp6_ctl_readcommand","read failed: %s",pcVar3);
LAB_00419998:
iVar4 = *piVar7;
if (iVar4 == 0) goto LAB_00419948;
LAB_004199a8:
*(int *)(iVar4 + 4) = piVar7[1];
}
else {
if (sVar1 == 0) {
dprintf(6,"dhcp6_ctl_readcommand","control channel was reset by peer");
goto LAB_00419998;
}
uVar6 = piVar7[0x103];
uVar5 = sVar1 + piVar7[0x104];
piVar7[0x104] = uVar5;
if ((int)uVar5 < (int)uVar6) goto LAB_00419890;
if (uVar5 == 0xc) {
uVar6 = CONCAT11(*(undefined1 *)((int)piVar7 + 0xe),*(undefined1 *)((int)piVar7 + 0xf))
+ uVar6;
piVar7[0x103] = uVar6;
if (uVar6 == 0xc) goto LAB_00419a38;
}
else if (uVar5 == uVar6) {
LAB_00419a38:
iVar4 = (*(code *)piVar7[0x105])(piVar7 + 3);
if (1 < iVar4 + 1U) goto LAB_00419890;
goto LAB_00419998;
}
if (uVar6 < 0x401) goto LAB_00419890;
dprintf(6,"dhcp6_ctl_readcommand","too large command (%d bytes)");
iVar4 = *piVar7;
if (iVar4 != 0) goto LAB_004199a8;
LAB_00419948:
DAT_0043cdd8 = piVar7[1];
}
*(int *)piVar7[1] = iVar4;
FUN_00419778(piVar7);
}
LAB_00419890:
piVar7 = piVar8;
} while (piVar8 != (int *)0x0);
}
return 0;
}