undefined4 FUN_0040cba0(undefined4 param_1,undefined4 param_2,undefined4 param_3)
{
char *__s;
size_t sVar1;
int iVar2;
int iVar3;
undefined4 uVar4;
void *local_828;
undefined1 local_824;
undefined1 auStack_823 [2055];
local_828 = (void *)0x0;
__s = (char *)FUN_0040c5d0(param_3,"NewInMessage");
if (__s == (char *)0x0) {
LAB_0040cd24:
iVar2 = 0;
}
else {
sVar1 = strlen(__s);
sVar1 = base64decode(__s,sVar1,&local_828);
if (sVar1 == 0) goto LAB_0040cd24;
iVar2 = FUN_0040c654(5,0);
if (iVar2 != 0) {
local_824 = 0xc;
memcpy(auStack_823,local_828,sVar1) //possible issue identified - semgrep
free(local_828);
local_828 = (void *)0x0;
iVar3 = usock_send(iVar2,&local_824,sVar1 + 1,0x4000) //possible issue identified - semgrep
if (((0 < iVar3) && (iVar3 = usock_recv_timed(iVar2,&local_824,0x800,0,5), 0 < iVar3)) &&
(iVar3 = base64encode(&local_824,iVar3,&local_828), iVar3 != 0)) {
FUN_0040c1f0(200,param_1,param_2,"NewOutMessage",local_828);
uVar4 = 0;
free(local_828);
local_828 = (void *)0x0;
goto LAB_0040cd48;
}
}
}
FUN_0040c1f0(0x192,0,0,0,0);
uVar4 = 0xffffffff;
LAB_0040cd48:
if (local_828 != (void *)0x0) {
free(local_828);
}
if (iVar2 != 0) {
usock_close(iVar2);
}
return uVar4;
}