what does this code do undefined8 main(void)
{
bool bVar1;
int iVar2;
FILE *__stream;
FILE *__stream_00;
time_t tVar3;
long lVar4;
long lVar5;
long lVar6;
long in_FS_OFFSET;
uint local_1070;
uint local_106c;
uint local_1068;
int local_1064;
int local_1060;
int local_105c;
undefined local_1048 [96];
undefined local_fe8 [96];
long local_f88;
long local_f80;
long local_f78;
long local_f70;
long local_f68;
long local_f60;
long local_f58;
long local_f50;
long local_f48;
long local_f40;
long local_f38;
long local_f30;
long local_f28 [483];
local_f28[481] = *(long *)(in_FS_OFFSET + 0x28);
__stream = fopen("/home/jw12/Documents/Innovation-Task/GA-NPV-Output.log","w");
__stream_00 = fopen("/home/jw12/Documents/Innovation-Task/GA-NPV-Only-Output.log","w");
bVar1 = true;
local_1070 = 0;
tVar3 = time((time_t *)0x0);
iVar2 = rand();
srand(iVar2 + (int)tVar3);
while (bVar1) {
printf("Generation No. %d\n",(ulong)local_1070);
fprintf(__stream,"Generation No. %d\n",(ulong)local_1070);
for (local_106c = 0; (int)local_106c < 0x14; local_106c = local_106c + 1) {
for (local_1068 = 0; (int)local_1068 < 10; local_1068 = local_1068 + 1) {
lVar5 = generateNetCashFlow();
local_f28[(long)(int)local_106c * 0xc + (long)(int)local_1068] = lVar5;
printf("\x1b[32;1mNet Flow Year %d - %.2f\x1b[0m\n",
local_f28[(long)(int)local_106c * 0xc + (long)(int)local_1068],(ulong)local_1068);
fprintf(__stream,"Net Flow Year %d - %.2f\n",
local_f28[(long)(int)local_106c * 0xc + (long)(int)local_1068],(ulong)local_1068);
}
lVar5 = calculateNPVFitness(local_f28 + (long)(int)local_106c * 0xc);
local_f28[(long)(int)local_106c * 0xc + 10] = lVar5;
lVar5 = calculateNPV(local_f28 + (long)(int)local_106c * 0xc);
local_f28[(long)(int)local_106c * 0xc + 0xb] = lVar5;
printf("Individual %d - Fitness: %.2f - NPV: %.2f\n",
local_f28[(long)(int)local_106c * 0xc + 10],
local_f28[(long)(int)local_106c * 0xc + 0xb],(ulong)local_106c);
fprintf(__stream,"NPV: %.2f\n",local_f28[(long)(int)local_106c * 0xc + 0xb]);
fprintf(__stream_00,"%.2f\n",local_f28[(long)(int)local_106c * 0xc + 0xb]);
}
for (local_1064 = 0; local_1064 < 10; local_1064 = local_1064 + 1) {
for (local_1060 = 0; local_1060 < 0x14; local_1060 = local_1060 + 1) {
selection(local_f28,local_1048,local_fe8);
crossover(local_1048,local_fe8,&local_f88);
mutate(&local_f88);
local_f38 = calculateNPVFitness(&local_f88);
local_f30 = calculateNPV(&local_f88);
lVar5 = (long)local_1060;
local_f28[lVar5 * 0xc + 0xf0] = local_f88;
local_f28[lVar5 * 0xc + 0xf1] = local_f80;
local_f28[lVar5 * 0xc + 0xf2] = local_f78;
local_f28[lVar5 * 0xc + 0xf3] = local_f70;
local_f28[lVar5 * 0xc + 0xf4] = local_f68;
local_f28[lVar5 * 0xc + 0xf5] = local_f60;
local_f28[lVar5 * 0xc + 0xf6] = local_f58;
local_f28[lVar5 * 0xc + 0xf7] = local_f50;
local_f28[lVar5 * 0xc + 0xf8] = local_f48;
local_f28[lVar5 * 0xc + 0xf9] = local_f40;
local_f28[lVar5 * 0xc + 0xfa] = local_f38;
local_f28[lVar5 * 0xc + 0xfb] = local_f30;
}
for (local_105c = 0; local_105c < 0x14; local_105c = local_105c + 1) {
lVar6 = (long)local_105c;
lVar4 = (long)local_105c;
lVar5 = local_f28[lVar4 * 0xc + 0xf1];
local_f28[lVar6 * 0xc] = local_f28[lVar4 * 0xc + 0xf0];
local_f28[lVar6 * 0xc + 1] = lVar5;
lVar5 = local_f28[lVar4 * 0xc + 0xf3];
local_f28[lVar6 * 0xc + 2] = local_f28[lVar4 * 0xc + 0xf2];
local_f28[lVar6 * 0xc + 3] = lVar5;
lVar5 = local_f28[lVar4 * 0xc + 0xf5];
local_f28[lVar6 * 0xc + 4] = local_f28[lVar4 * 0xc + 0xf4];
local_f28[lVar6 * 0xc + 5] = lVar5;
lVar5 = local_f28[lVar4 * 0xc + 0xf7];
local_f28[lVar6 * 0xc + 6] = local_f28[lVar4 * 0xc + 0xf6];
local_f28[lVar6 * 0xc + 7] = lVar5;
lVar5 = local_f28[lVar4 * 0xc + 0xf9];
local_f28[lVar6 * 0xc + 8] = local_f28[lVar4 * 0xc + 0xf8];
local_f28[lVar6 * 0xc + 9] = lVar5;
lVar5 = local_f28[lVar4 * 0xc + 0xfb];
local_f28[lVar6 * 0xc + 10] = local_f28[lVar4 * 0xc + 0xfa];
local_f28[lVar6 * 0xc + 0xb] = lVar5;
}
}
local_1070 = local_1070 + 1;
if (local_1070 == 10) {
bVar1 = false;
}
}
fclose(__stream);
fclose(__stream_00);
findHighestNPV();
if (local_f28[481] != *(long )(in_FS_OFFSET + 0x28)) {
/ WARNING: Subroutine does not return */
__stack_chk_fail();
}
return 0;
}