Code from a 2012 calibration for the exhaust brake switch save
void FUN_0018fdc0(void)
{
undefined uVar1;
undefined1 *puVar2;
puVar2 = &DAT_60010590;
DAT_6000c774 = 0xfffa;
FUN_00063070(&DAT_00011ace,0xfffffffffffffffa);
uVar1 = T_CANC_Exhaust_Brake_Switch_Saved;
CANC_Exhaust_Brake_Switch = uVar1;
*(undefined2 *)(&DAT_ffffc20e + (int)puVar2) = 0;
FUN_00063070(&PTR_00012b6f,0);
return;
}
undefined8 FUN_00198570(int param_1)
{
undefined *puVar1;
short sVar2;
short sVar3;
char cVar4;
byte bVar5;
ushort uVar6;
ulonglong uVar7;
longlong lVar8;
undefined1 *puVar9;
undefined1 *puVar10;
undefined uVar11;
puVar10 = &DAT_60010590;
puVar9 = &DAT_60010590;
sVar2 = DAT_6000c774;
sVar3 = DAT_6000c79e;
if ((param_1 != 0) && (*(ushort *)(param_1 + 4) < 5)) {
param_1 = 0;
uVar6 = CGW3_3FBH_Msg_Status;
CGW3_3FBH_Msg_Status = uVar6 | 2;
CGW3_3FBH_Msg_Timer = 0;
}
if (param_1 == 0) {
if (sVar2 != -7) {
DAT_6000c774 = 0xfff9;
puVar10 = &DAT_60010590;
FUN_00063070(&DAT_00011ace,0xfffffffffffffff9);
CANC_Eb_Sw_Psd = '\0';
}
if (*(short *)(&DAT_ffffc20e + (int)puVar10) != -7) {
*(undefined2 *)(&DAT_ffffc20e + (int)puVar10) = 0xfff9;
FUN_00063070(&PTR_00012b6f,0xfffffffffffffff9);
if ((*(char **)(puVar10 + -0x3e04) != (char *)0x0) && (**(char **)(puVar10 + -0x3e04) != '\0')
) {
cVar4 = C_CANC_EB_Switch_Msg_Lost_Val;
if (cVar4 == '\0') {
uVar11 = 0;
}
else {
if (cVar4 != '\x01') {
return 1;
}
uVar11 = 1;
}
T_CANC_Exhaust_Brake_Switch_Saved = uVar11;
CANC_Exhaust_Brake_Switch = uVar11;
}
}
}
else {
uVar6 = CGW3_3FBH_Msg_Status;
CGW3_3FBH_Msg_Status = uVar6 & 0xffe9;
CGW3_3FBH_Msg_Timer = 0;
puVar1 = *(undefined **)(param_1 + 8);
CGW3_3FBH_Msg_Data_0 = *puVar1;
CGW3_3FBH_Msg_Data_1 = puVar1[1];
CGW3_3FBH_Msg_Data_2 = puVar1[2];
CGW3_3FBH_Msg_Data_3 = puVar1[3];
CGW3_3FBH_Msg_Data_4 = puVar1[4];
uVar7 = ((ulonglong)(byte)puVar1[4] << 0x20) >> 0x22 & 1;
CGW3_3FBH_Msg_Data_5 = puVar1[5];
CGW3_3FBH_Msg_Data_6 = puVar1[6];
CGW3_3FBH_Msg_Data_7 = puVar1[7];
cVar4 = CANC_Eb_Sw_Psd;
CANC_Eb_Sw_Psd = (char)uVar7;
DAT_6000c774 = 0;
DAT_6000c79e = 0;
if (((int)uVar7 == 1) && (cVar4 == '\0')) {
bVar5 = CANC_Exhaust_Brake_Switch;
lVar8 = countLeadingZeros((uint)bVar5);
CANC_Exhaust_Brake_Switch = (char)((ulonglong)(lVar8 << 0x20) >> 0x25);
}
T_CANC_Exhaust_Brake_Switch_Saved = 0;
if (sVar2 != 0) {
puVar9 = puVar10;
FUN_00063070(&DAT_00011ace,0);
}
if (sVar3 != *(short *)(&DAT_ffffc20e + (int)puVar9)) {
FUN_00063070(&PTR_00012b6f);
}
}
return 1;
}