metadata:
{
  "callingConvention": "unknown",
  "isExternal": "false",
  "signature": "undefined OnTechResearched(void)",
  "parameterCount": "0",
  "isThunk": "false",
  "returnType": "undefined"
}
address:
0x00891790
sizeInBytes:
3357
calleeCount:
36
offset:
1
functionName:
OnTechResearched
startAddress:
0x00891790
callees:
[
  {
    "address": "0x00429990",
    "signature": "undefined FUN_00429990(void)",
    "name": "FUN_00429990",
    "callCount": 1
  },
  {
    "address": "0x0059f1a0",
    "signature": "undefined FUN_0059f1a0(void)",
    "name": "FUN_0059f1a0",
    "callCount": 1
  },
  {
    "address": "0x00924d82",
    "signature": "undefined __security_check_cookie(void)",
    "name": "__security_check_cookie",
    "callCount": 1
  },
  {
    "address": "0x0088df20",
    "signature": "undefined FUN_0088df20(void)",
    "name": "FUN_0088df20",
    "callCount": 1
  },
  {
    "address": "0x0057d610",
    "signature": "undefined GetTechDef(void)",
    "name": "GetTechDef",
    "callCount": 1
  },
  {
    "address": "0x00691020",
    "signature": "undefined FUN_00691020(void)",
    "name": "FUN_00691020",
    "callCount": 1
  },
  {
    "address": "0x0057e950",
    "signature": "undefined FUN_0057e950(void)",
    "name": "FUN_0057e950",
    "callCount": 1
  },
  {
    "address": "0x0074a870",
    "signature": "undefined FUN_0074a870(void)",
    "name": "FUN_0074a870",
    "callCount": 2
  },
  {
    "address": "0x00743800",
    "signature": "undefined FUN_00743800(void)",
    "name": "FUN_00743800",
    "callCount": 1
  },
  {
    "address": "0x00745e40",
    "signature": "undefined FUN_00745e40(void)",
    "name": "FUN_00745e40",
    "callCount": 1
  },
  {
    "address": "0x008186b0",
    "signature": "undefined SetAIBenefit(void)",
    "name": "SetAIBenefit",
    "callCount": 1
  },
  {
    "address": "0x00425550",
    "signature": "undefined FUN_00425550(void)",
    "name": "FUN_00425550",
    "callCount": 3
  },
  {
    "address": "0x00537240",
    "signature": "undefined GetPlagueCureMask(void)",
    "name": "GetPlagueCureMask",
    "callCount": 1
  },
  {
    "address": "0x00425430",
    "signature": "undefined FUN_00425430(void)",
    "name": "FUN_00425430",
    "callCount": 5
  },
  {
    "address": "0x004d7960",
    "signature": "undefined ComputeTechBitmasks(void)",
    "name": "ComputeTechBitmasks",
    "callCount": 1
  },
  {
    "address": "0x0082bf10",
    "signature": "undefined RebuildSpeciesTechFlags(void)",
    "name": "RebuildSpeciesTechFlags",
    "callCount": 1
  },
  {
    "address": "0x007ba1a0",
    "signature": "undefined FUN_007ba1a0(void)",
    "name": "FUN_007ba1a0",
    "callCount": 1
  },
  {
    "address": "0x008c8eb0",
    "signature": "undefined FUN_008c8eb0(void)",
    "name": "FUN_008c8eb0",
    "callCount": 2
  },
  {
    "address": "0x00691030",
    "signature": "undefined FUN_00691030(void)",
    "name": "FUN_00691030",
    "callCount": 1
  },
  {
    "address": "0x00751b60",
    "signature": "undefined FUN_00751b60(void)",
    "name": "FUN_00751b60",
    "callCount": 1
  },
  {
    "address": "0x005388a0",
    "signature": "undefined FUN_005388a0(void)",
    "name": "FUN_005388a0",
    "callCount": 1
  },
  {
    "address": "0x0078c7e0",
    "signature": "undefined FUN_0078c7e0(void)",
    "name": "FUN_0078c7e0",
    "callCount": 1
  },
  {
    "address": "0x004231c0",
    "signature": "undefined FUN_004231c0(void)",
    "name": "FUN_004231c0",
    "callCount": 1
  },
  {
    "address": "0x0080e320",
    "signature": "undefined FUN_0080e320(void)",
    "name": "FUN_0080e320",
    "callCount": 1
  },
  {
    "address": "0x00924faa",
    "signature": "void operator_delete(void * param_1)",
    "name": "operator_delete",
    "callCount": 5
  },
  {
    "address": "0x008862b0",
    "signature": "undefined FUN_008862b0(void)",
    "name": "FUN_008862b0",
    "callCount": 2
  },
  {
    "address": "0x0074d070",
    "signature": "undefined FUN_0074d070(void)",
    "name": "FUN_0074d070",
    "callCount": 1
  },
  {
    "address": "0x008182c0",
    "signature": "undefined FUN_008182c0(void)",
    "name": "FUN_008182c0",
    "callCount": 1
  },
  {
    "address": "0x00756040",
    "signature": "undefined FUN_00756040(void)",
    "name": "FUN_00756040",
    "callCount": 1
  },
  {
    "address": "0x0080e410",
    "signature": "undefined SpeciesOfTranslationTech(void)",
    "name": "SpeciesOfTranslationTech",
    "callCount": 2
  },
  {
    "address": "0x0080e330",
    "signature": "undefined ApplyAITechBonus(void)",
    "name": "ApplyAITechBonus",
    "callCount": 1
  },
  {
    "address": "0x0057d5d0",
    "signature": "undefined IsTech(void)",
    "name": "IsTech",
    "callCount": 33
  },
  {
    "address": "0x005862d0",
    "signature": "undefined FUN_005862d0(void)",
    "name": "FUN_005862d0",
    "callCount": 1
  },
  {
    "address": "0x0057d810",
    "signature": "undefined HasResearched(void)",
    "name": "HasResearched",
    "callCount": 2
  },
  {
    "address": "0x008c97f0",
    "signature": "undefined FUN_008c97f0(void)",
    "name": "FUN_008c97f0",
    "callCount": 2
  },
  {
    "address": "0x00753510",
    "signature": "undefined FUN_00753510(void)",
    "name": "FUN_00753510",
    "callCount": 1
  }
]
inputAddress:
0x00891790
decompSignature:
void __thiscall Game::ServerPlayer::OnTechResearched(int param_1,char *param_2,char param_3);
programName:
Sword of the Stars.exe
isUndefinedFunction:
false
resolvedFrom:
address/symbol
totalLines:
691
limit:
1000
decompilation:
   1	
   2	/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
   3	/* ServerPlayer::OnTechResearched(TechDef* def, bool silent) - vft slot 4, called from
   4	   TechTree::SetResearched. Hard-coded strategic tech effects: chain of MasterTechTree::IsTech(def,
   5	   10000+i) tests writing ServerPlayer fields
   6	   (ConMod/SavMod/OutMod/PopMod/TerraMod/SuitTol/MaxOH/MinRate/pddm/CstR-E-T/PrGtTrf/flags). See
   7	   /srv/re-lab/handoff/tech-effects.md for the id->effect table. Tail: plague-cure mask
   8	   (HasImm/HasVac), tech bitmasks (+0x190/+0x194), RebuildSpeciesTechFlags, Zuul CruisCon->free
   9	   BrdPod, cdp=SpyBm&&SlvgTech, EVENT_TEMPERANCE cure. */
  10	
  11	void __thiscall Game::ServerPlayer::OnTechResearched(int param_1,char *param_2,char param_3)
  12	
  13	{
  14	  undefined4 uVar1;
  15	  float fVar2;
  16	  float fVar3;
  17	  char cVar4;
  18	  byte bVar5;
  19	  char *pcVar6;
  20	  undefined4 *puVar7;
  21	  undefined1 *puVar8;
  22	  int iVar9;
  23	  int *piVar10;
  24	  char *pcVar11;
  25	  uint uVar12;
  26	  float10 fVar13;
  27	  longlong lVar14;
  28	  char local_204 [12];
  29	  undefined4 uStack_1f8;
  30	  void **local_1f4;
  31	  undefined4 local_1f0;
  32	  undefined4 uStack_1ec;
  33	  char local_1e8 [8];
  34	  undefined4 uStack_1e0;
  35	  char *pcStack_1dc;
  36	  void **local_1d8;
  37	  undefined4 local_1d4;
  38	  int iStack_1d0;
  39	  undefined4 uStack_1cc;
  40	  undefined1 *puStack_1c8;
  41	  int iStack_1c4;
  42	  char *pcStack_1c0;
  43	  undefined1 local_1a8 [4];
  44	  char *local_1a4;
  45	  uint local_1a0;
  46	  undefined8 local_19c;
  47	  char *local_194;
  48	  char local_18d;
  49	  int local_18c;
  50	  void *local_188 [4];
  51	  undefined4 local_178;
  52	  uint local_174;
  53	  void *local_16c [4];
  54	  undefined4 local_15c;
  55	  uint local_158;
  56	  void *local_150;
  57	  undefined1 local_14c [12];
  58	  undefined4 local_140;
  59	  uint local_13c;
  60	  void *local_134 [3];
  61	  int local_128;
  62	  int local_124;
  63	  uint local_120;
  64	  char local_118 [256];
  65	  undefined1 local_18;
  66	  uint local_14;
  67	  void *local_10;
  68	  undefined1 *puStack_c;
  69	  int local_8;
  70	  
  71	  local_8 = 0xffffffff;
  72	  puStack_c = &LAB_0099c1a3;
  73	  local_10 = ExceptionList;
  74	  local_14 = DAT_00af8b78 ^ (uint)&stack0xfffffffc;
  75	  ExceptionList = &local_10;
  76	  local_1a4 = param_2;
  77	  puStack_1c8 = (undefined1 *)0x8917e1;
  78	  iStack_1c4 = param_1;
  79	  pcStack_1c0 = (char *)param_1;
  80	  FUN_007ba1a0();
  81	  if (*(char **)(param_1 + 0x294) == param_2) {
  82	    if (*(char *)(param_1 + 0x3b4) != '\0') {
  83	      FUN_0088df20();
  84	    }
  85	    *(undefined1 *)(param_1 + 0x3b4) = 0;
  86	    *(undefined4 *)(param_1 + 0x294) = 0;
  87	  }
  88	  if (param_3 == '\0') {
  89	    local_194 = *(char **)(*(int *)(param_1 + 8) + 8);
  90	    local_18c = (int)(param_2 + 0x40);
  91	    if (0xf < *(uint *)(param_2 + 0x54)) {
  92	      local_18c = *(int *)local_18c;
  93	    }
  94	    pcStack_1c0 = "";
  95	    local_18 = 0;
  96	    local_120 = 0xf;
  97	    local_124 = 0;
  98	    local_134[0] = (void *)((uint)local_134[0] & 0xffffff00);
  99	    iStack_1c4 = 0x89185c;
 100	    FUN_00425550();
 101	    local_8 = 0;
 102	    pcStack_1c0 = (char *)0x89186b;
 103	    fVar13 = (float10)FUN_0057e950();
 104	    pcStack_1c0 = (char *)0x0;
 105	    iStack_1c4 = 0;
 106	    puStack_1c8 = (undefined1 *)0x0;
 107	    uStack_1cc = 0;
 108	    iStack_1d0 = local_18c;
 109	    pcStack_1dc = local_118;
 110	    if ((float)_DAT_009e20c8 <= (float)fVar13) {
 111	      pcVar11 = *(char **)PTR_PTR_00af09ec;
 112	      local_1d4 = *(undefined4 *)PTR_PTR_00af09f4;
 113	      local_1d8 = (void **)0x100;
 114	      local_19c._4_4_ = "EVENT_RESEARCH_COMPLETE";
 115	      uStack_1e0 = 0x8918fe;
 116	      FUN_008c8eb0();
 117	      pcVar6 = local_118;
 118	      do {
 119	        cVar4 = *pcVar6;
 120	        pcVar6 = pcVar6 + 1;
 121	      } while (cVar4 != '\0');
 122	    }
 123	    else {
 124	      pcVar11 = *(char **)PTR_PTR_00af09fc;
 125	      local_1d4 = *(undefined4 *)PTR_PTR_00af0a04;
 126	      local_1d8 = (void **)0x100;
 127	      local_19c._4_4_ = "EVENT_RESEARCH_UNDERBUDGET";
 128	      uStack_1e0 = 0x8918c0;
 129	      FUN_008c8eb0();
 130	      pcVar6 = local_118;
 131	      do {
 132	        cVar4 = *pcVar6;
 133	        pcVar6 = pcVar6 + 1;
 134	      } while (cVar4 != '\0');
 135	    }
 136	    pcStack_1c0 = local_118;
 137	    iStack_1c4 = 0x89192c;
 138	    FUN_00425550();
 139	    pcStack_1c0 = local_19c._4_4_;
 140	    iStack_1c4 = (int)local_194;
 141	    puStack_1c8 = (undefined1 *)0x0;
 142	    uStack_1cc = 0;
 143	    local_19c._4_4_ = local_1e8;
 144	    uStack_1ec = 0xffffffff;
 145	    local_1f0 = 0;
 146	    local_1f4 = local_134;
 147	    local_1d4 = 0xf;
 148	    local_1d8 = (void **)0x0;
 149	    local_1e8[0] = '\0';
 150	    uStack_1f8 = 0x89196c;
 151	    FUN_00425430();
 152	    local_194 = pcVar11 + 1;
 153	    local_1f0 = 0xf;
 154	    local_1f4 = (void **)0x0;
 155	    local_8._0_1_ = 1;
 156	    local_204[0] = '\0';
 157	    pcVar6 = pcVar11;
 158	    do {
 159	      cVar4 = *pcVar6;
 160	      pcVar6 = pcVar6 + 1;
 161	    } while (cVar4 != '\0');
 162	    FUN_00425550(pcVar11,(int)pcVar6 - (int)local_194);
 163	    local_8 = (uint)local_8._1_3_ << 8;
 164	    FUN_008862b0();
 165	    local_8 = 0xffffffff;
 166	    if (0xf < local_120) {
 167	                    /* WARNING: Subroutine does not return */
 168	      pcStack_1c0 = &UNK_008919d6;
 169	      operator_delete(local_134[0]);
 170	    }
 171	  }
 172	  local_18c = *(undefined4 *)(*(int *)(param_1 + 0xf4) + 4);
 173	  pcStack_1c0 = param_2;
 174	  iStack_1c4 = 0x8919f5;
 175	  cVar4 = MasterTechTree::IsTech();
 176	  if (cVar4 != '\0') {
 177	    *(undefined1 *)(param_1 + 0x103) = 1;
 178	    local_19c = CONCAT44(local_19c._4_4_,(undefined4)local_19c);
 179	    goto LAB_00892156;
 180	  }
 181	  pcStack_1c0 = param_2;
 182	  iStack_1c4 = 0x891a12;
 183	  cVar4 = MasterTechTree::IsTech();
 184	  if (cVar4 == '\0') {
 185	    pcStack_1c0 = param_2;
 186	    iStack_1c4 = 0x891a23;
 187	    cVar4 = MasterTechTree::IsTech();
 188	    if (cVar4 != '\0') {
 189	      fVar2 = (float)_DAT_009e5060;
 190	      *(float *)(param_1 + 0x10c) = *(float *)(param_1 + 0x10c) - fVar2;
 191	      *(float *)(param_1 + 0x110) = *(float *)(param_1 + 0x110) - fVar2;
 192	      *(float *)(param_1 + 0x114) = *(float *)(param_1 + 0x114) - fVar2;
 193	      *(float *)(param_1 + 0x124) = *(float *)(param_1 + 0x124) + (float)_DAT_009e20d8;
 194	      local_19c = CONCAT44(local_19c._4_4_,(undefined4)local_19c);
 195	      goto LAB_00892156;
 196	    }
 197	    pcStack_1c0 = param_2;
 198	    iStack_1c4 = 0x891a7b;
 199	    cVar4 = MasterTechTree::IsTech();
 200	    if (cVar4 == '\0') {
 201	      pcStack_1c0 = param_2;
 202	      iStack_1c4 = 0x891ad3;
 203	      cVar4 = MasterTechTree::IsTech();
 204	      if (cVar4 != '\0') {
 205	        fVar2 = (float)_DAT_009e5060;
 206	        *(float *)(param_1 + 0x118) = *(float *)(param_1 + 0x118) - fVar2;
 207	        *(float *)(param_1 + 0x11c) = *(float *)(param_1 + 0x11c) - fVar2;
 208	        *(float *)(param_1 + 0x120) = *(float *)(param_1 + 0x120) - fVar2;
 209	        local_19c = CONCAT44(local_19c._4_4_,(undefined4)local_19c);
 210	        goto LAB_00892156;
 211	      }
 212	      pcStack_1c0 = param_2;
 213	      iStack_1c4 = 0x891b19;
 214	      cVar4 = MasterTechTree::IsTech();
 215	      if (cVar4 == '\0') {
 216	        pcStack_1c0 = param_2;
 217	        iStack_1c4 = 0x891b3f;
 218	        cVar4 = MasterTechTree::IsTech();
 219	        if (cVar4 != '\0') {
 220	          *(float *)(param_1 + 0x124) = *(float *)(param_1 + 0x124) + (float)_DAT_009e5df0;
 221	          local_19c = CONCAT44(local_19c._4_4_,(undefined4)local_19c);
 222	          goto LAB_00892156;
 223	        }
 224	        pcStack_1c0 = param_2;
 225	        iStack_1c4 = 0x891b67;
 226	        cVar4 = MasterTechTree::IsTech();
 227	        if (cVar4 != '\0') {
 228	          *(float *)(param_1 + 0x124) = *(float *)(param_1 + 0x124) + (float)_DAT_009e2318;
 229	          local_19c = CONCAT44(local_19c._4_4_,(undefined4)local_19c);
 230	          goto LAB_00892156;
 231	        }
 232	        pcStack_1c0 = param_2;
 233	        iStack_1c4 = 0x891b8f;
 234	        cVar4 = MasterTechTree::IsTech();
 235	        if (cVar4 != '\0') {
 236	          *(undefined1 *)(param_1 + 0x138) = 1;
 237	          local_19c = CONCAT44(local_19c._4_4_,(undefined4)local_19c);
 238	          goto LAB_00892156;
 239	        }
 240	        pcStack_1c0 = param_2;
 241	        iStack_1c4 = 0x891bac;
 242	        cVar4 = MasterTechTree::IsTech();
 243	        if (cVar4 != '\0') {
 244	          pcStack_1c0 = (char *)(param_1 + 0xb8);
 245	          local_194 = _DAT_009e22f0;
 246	          iStack_1c4 = 0x891bcf;
 247	          puVar7 = (undefined4 *)FUN_004231c0();
 248	          *(undefined4 *)(param_1 + 0xb8) = *puVar7;
 249	          *(float *)(param_1 + 0x140) = *(float *)(param_1 + 0x140) + (float)_DAT_009e1ef0;
 250	          local_19c = CONCAT44(local_19c._4_4_,(undefined4)local_19c);
 251	          goto LAB_00892156;
 252	        }
 253	        pcStack_1c0 = param_2;
 254	        iStack_1c4 = 0x891bfe;
 255	        cVar4 = MasterTechTree::IsTech();
 256	        if (cVar4 != '\0') {
 257	          *(float *)(param_1 + 0x130) = *(float *)(param_1 + 0x130) + (float)_DAT_009e2318;
 258	          local_19c = CONCAT44(local_19c._4_4_,(undefined4)local_19c);
 259	          goto LAB_00892156;
 260	        }
 261	        pcStack_1c0 = param_2;
 262	        iStack_1c4 = 0x891c26;
 263	        cVar4 = MasterTechTree::IsTech();
 264	        if (cVar4 != '\0') {
 265	          *(float *)(param_1 + 0xb4) = *(float *)(param_1 + 0xb4) + (float)_DAT_009e8d28;
 266	          *(float *)(param_1 + 0x130) = *(float *)(param_1 + 0x130) + (float)_DAT_00a33360;
 267	          *(float *)(param_1 + 0x134) = *(float *)(param_1 + 0x134) + (float)_DAT_009f15b0;
 268	          local_19c = CONCAT44(local_19c._4_4_,(undefined4)local_19c);
 269	          goto LAB_00892156;
 270	        }
 271	        pcStack_1c0 = param_2;
 272	        iStack_1c4 = 0x891c72;
 273	        cVar4 = MasterTechTree::IsTech();
 274	        if (cVar4 == '\0') {
 275	          pcStack_1c0 = param_2;
 276	          iStack_1c4 = 0x891c9a;
 277	          cVar4 = MasterTechTree::IsTech();
 278	          if (cVar4 != '\0') {
 279	            *(float *)(param_1 + 0xb4) = *(float *)(param_1 + 0xb4) + (float)_DAT_009e90b8;
 280	            *(float *)(param_1 + 0x130) = *(float *)(param_1 + 0x130) + (float)_DAT_009e2318;
 281	            *(float *)(param_1 + 0x134) = *(float *)(param_1 + 0x134) + (float)_DAT_009f15b0;
 282	            local_19c = CONCAT44(local_19c._4_4_,(undefined4)local_19c);
 283	            goto LAB_00892156;
 284	          }
 285	          pcStack_1c0 = param_2;
 286	          iStack_1c4 = 0x891ce6;
 287	          cVar4 = MasterTechTree::IsTech();
 288	          if (cVar4 != '\0') {
 289	            uVar12 = 0;
 290	            local_128 = 0;
 291	            local_124 = 0;
 292	            local_120 = 0;
 293	            local_8 = 2;
 294	            if (*(int *)(param_1 + 0x34) - *(int *)(param_1 + 0x30) >> 2 != 0) {
 295	              do {
 296	                local_194 = *(char **)(*(int *)(param_1 + 0x30) + uVar12 * 4);
 297	                lVar14 = FUN_0074d070();
 298	                local_19c = lVar14;
 299	                lVar14 = FUN_0074a870();
 300	                if (lVar14 == local_19c) {
 301	                  pcStack_1c0 = (char *)0x891d68;
 302	                  FUN_0059f1a0();
 303	                }
 304	                uVar12 = uVar12 + 1;
 305	              } while (uVar12 < (uint)(*(int *)(param_1 + 0x34) - *(int *)(param_1 + 0x30) >> 2));
 306	            }
 307	            fVar2 = (float)_DAT_009ed188;
 308	            uVar12 = 0;
 309	            *(undefined1 *)(param_1 + 0x104) = 1;
 310	            *(float *)(param_1 + 0x130) = *(float *)(param_1 + 0x130) + fVar2;
 311	            if (local_124 - local_128 >> 2 != 0) {
 312	              do {
 313	                uVar1 = *(undefined4 *)(local_128 + uVar12 * 4);
 314	                FUN_005388a0();
 315	                local_8._0_1_ = 3;
 316	                pcStack_1c0 = (char *)FUN_0074a870();
 317	                puStack_1c8 = local_14c;
 318	                uStack_1cc = 0x891dd8;
 319	                iStack_1c4 = uVar1;
 320	                FUN_00756040();
 321	                pcStack_1c0 = (char *)0x891de9;
 322	                FUN_00753510();
 323	                local_8 = CONCAT31(local_8._1_3_,2);
 324	                FUN_00751b60();
 325	                uVar12 = uVar12 + 1;
 326	              } while (uVar12 < (uint)(local_124 - local_128 >> 2));
 327	            }
 328	            local_8 = 0xffffffff;
 329	            FUN_00429990();
 330	            param_2 = local_1a4;
 331	            goto LAB_00892156;
 332	          }
 333	          pcStack_1c0 = param_2;
 334	          iStack_1c4 = 0x891e3e;
 335	          cVar4 = MasterTechTree::IsTech();
 336	          if (cVar4 != '\0') {
 337	            *(float *)(param_1 + 0x134) = *(float *)(param_1 + 0x134) + (float)_DAT_009e5068;
 338	            local_19c = CONCAT44(local_19c._4_4_,(undefined4)local_19c);
 339	            goto LAB_00892156;
 340	          }
 341	          pcStack_1c0 = param_2;
 342	          iStack_1c4 = 0x891e66;
 343	          cVar4 = MasterTechTree::IsTech();
 344	          if (cVar4 == '\0') {
 345	            pcStack_1c0 = param_2;
 346	            iStack_1c4 = 0x891e8e;
 347	            cVar4 = MasterTechTree::IsTech();
 348	            if (cVar4 != '\0') {
 349	              *(float *)(param_1 + 0x134) = *(float *)(param_1 + 0x134) + (float)_DAT_009e20a0;
 350	              local_19c = CONCAT44(local_19c._4_4_,(undefined4)local_19c);
 351	              goto LAB_00892156;
 352	            }
 353	            pcStack_1c0 = param_2;
 354	            iStack_1c4 = 0x891eb6;
 355	            cVar4 = MasterTechTree::IsTech();
 356	            piVar10 = (int *)PTR_DAT_00aedfe0;
 357	            if (cVar4 == '\0') {
 358	              pcStack_1c0 = param_2;
 359	              iStack_1c4 = 0x891ecf;
 360	              cVar4 = MasterTechTree::IsTech();
 361	              piVar10 = (int *)PTR_DAT_00aedfe4;
 362	              if (cVar4 == '\0') {
 363	                pcStack_1c0 = param_2;
 364	                iStack_1c4 = 0x891f03;
 365	                cVar4 = MasterTechTree::IsTech();
 366	                if (cVar4 != '\0') {
 367	                  *(undefined4 *)(param_1 + 0x150) = _DAT_00a2bed0;
 368	                  *(undefined4 *)(param_1 + 0x154) = _DAT_009e5840;
 369	                  *(undefined4 *)(param_1 + 0x158) = 0x3f800000;
 370	                  local_19c = CONCAT44(local_19c._4_4_,(undefined4)local_19c);
 371	                  goto LAB_00892156;
 372	                }
 373	                pcStack_1c0 = param_2;
 374	                iStack_1c4 = 0x891f39;
 375	                cVar4 = MasterTechTree::IsTech();
 376	                if (cVar4 == '\0') {
 377	                  pcStack_1c0 = param_2;
 378	                  iStack_1c4 = 0x891f4a;
 379	                  cVar4 = MasterTechTree::IsTech();
 380	                  if (cVar4 == '\0') {
 381	                    pcStack_1c0 = param_2;
 382	                    iStack_1c4 = 0x891f5b;
 383	                    cVar4 = MasterTechTree::IsTech();
 384	                    if (cVar4 == '\0') {
 385	                      pcStack_1c0 = param_2;
 386	                      iStack_1c4 = 0x891f86;
 387	                      cVar4 = MasterTechTree::IsTech();
 388	                      if (cVar4 != '\0') {
 389	                        uVar12 = 0;
 390	                        if (*(int *)(param_1 + 0x34) - *(int *)(param_1 + 0x30) >> 2 != 0) {
 391	                          do {
 392	                            *(undefined1 *)(*(int *)(*(int *)(param_1 + 0x30) + uVar12 * 4) + 0x188)
 393	                                 = 1;
 394	                            uVar12 = uVar12 + 1;
 395	                          } while (uVar12 < (uint)(*(int *)(param_1 + 0x34) -
 396	                                                   *(int *)(param_1 + 0x30) >> 2));
 397	                        }
 398	                        local_19c = CONCAT44(local_19c._4_4_,(undefined4)local_19c);
 399	                        if (*(int *)(param_1 + 0x3b8) != 0) {
 400	                          FUN_00691030();
 401	                          local_19c = CONCAT44(local_19c._4_4_,(undefined4)local_19c);
 402	                        }
 403	                        goto LAB_00892156;
 404	                      }
 405	                      pcStack_1c0 = param_2;
 406	                      iStack_1c4 = 0x891fe0;
 407	                      cVar4 = MasterTechTree::IsTech();
 408	                      if (cVar4 != '\0') {
 409	                        uVar12 = 0;
 410	                        if (*(int *)(param_1 + 0x34) - *(int *)(param_1 + 0x30) >> 2 != 0) {
 411	                          do {
 412	                            *(undefined1 *)(*(int *)(*(int *)(param_1 + 0x30) + uVar12 * 4) + 0x188)
 413	                                 = 1;
 414	                            uVar12 = uVar12 + 1;
 415	                          } while (uVar12 < (uint)(*(int *)(param_1 + 0x34) -
 416	                                                   *(int *)(param_1 + 0x30) >> 2));
 417	                        }
 418	                        pcStack_1c0 = (char *)0x892017;
 419	                        SetAIBenefit();
 420	                        local_19c = CONCAT44(local_19c._4_4_,(undefined4)local_19c);
 421	                        if (*(int *)(param_1 + 0x3b8) != 0) {
 422	                          FUN_00691020();
 423	                          local_19c = CONCAT44(local_19c._4_4_,(undefined4)local_19c);
 424	                        }
 425	                        goto LAB_00892156;
 426	                      }
 427	                      iVar9 = SpeciesOfTranslationTech();
 428	                      if (iVar9 != -1) {
 429	                        bVar5 = SpeciesOfTranslationTech();
 430	                        *(uint *)(param_1 + 0x290) =
 431	                             *(uint *)(param_1 + 0x290) | 1 << (bVar5 & 0x1f);
 432	                        local_19c = CONCAT44(local_19c._4_4_,(undefined4)local_19c);
 433	                        goto LAB_00892156;
 434	                      }
 435	                      pcStack_1c0 = param_2;
 436	                      iStack_1c4 = 0x89206d;
 437	                      cVar4 = MasterTechTree::IsTech();
 438	                      if (cVar4 != '\0') {
 439	                        local_19c = CONCAT44(local_19c._4_4_,(undefined4)local_19c);
 440	                        if (*(char *)(param_1 + 0xfc) == '\0') {
 441	                          *(undefined1 *)(param_1 + 0xff) = 1;
 442	                          local_19c = CONCAT44(local_19c._4_4_,(undefined4)local_19c);
 443	                        }
 444	                        goto LAB_00892156;
 445	                      }
 446	                      pcStack_1c0 = param_2;
 447	                      iStack_1c4 = 0x892097;
 448	                      cVar4 = MasterTechTree::IsTech();
 449	                      if (cVar4 != '\0') {
 450	                        *(undefined1 *)(param_1 + 0x100) = 1;
 451	                        goto LAB_00892156;
 452	                      }
 453	                      pcStack_1c0 = param_2;
 454	                      iStack_1c4 = 0x8920b4;
 455	                      cVar4 = MasterTechTree::IsTech();
 456	                      if (cVar4 != '\0') {
 457	                        *(undefined1 *)(param_1 + 0x102) = 1;
 458	                        goto LAB_00892156;
 459	                      }
 460	                      pcStack_1c0 = param_2;
 461	                      iStack_1c4 = 0x8920d1;
 462	                      cVar4 = MasterTechTree::IsTech();
 463	                      if (cVar4 != '\0') {
 464	                        *(undefined1 *)(param_1 + 0x101) = 1;
 465	                        goto LAB_00892156;
 466	                      }
 467	                      pcStack_1c0 = param_2;
 468	                      iStack_1c4 = 0x8920eb;
 469	                      cVar4 = MasterTechTree::IsTech();
 470	                      if (cVar4 != '\0') {
 471	                        *(float *)(param_1 + 0x108) =
 472	                             *(float *)(param_1 + 0x108) * (float)_PTR_009e5d70;
 473	                        *(float *)(param_1 + 0x124) =
 474	                             *(float *)(param_1 + 0x124) * (float)_DAT_009e23a0;
 475	                        goto LAB_00892156;
 476	                      }
 477	                      pcStack_1c0 = param_2;
 478	                      iStack_1c4 = 0x892122;
 479	                      cVar4 = MasterTechTree::IsTech();
 480	                      if (cVar4 == '\0') goto LAB_00892156;
 481	                      fVar3 = (float)_DAT_009e5060;
 482	                      *(float *)(param_1 + 0x10c) = *(float *)(param_1 + 0x10c) - fVar3;
 483	                      fVar2 = *(float *)(param_1 + 0x110) - fVar3;
 484	                      goto LAB_00892144;
 485	                    }
 486	                  }
 487	                }
 488	                local_19c = CONCAT44(local_19c._4_4_,(undefined4)local_19c);
 489	                if (*(char *)(param_1 + 0xfe) != '\0') {
 490	                  pcStack_1c0 = (char *)0x891f74;
 491	                  ApplyAITechBonus();
 492	                  local_19c = CONCAT44(local_19c._4_4_,(undefined4)local_19c);
 493	                }
 494	                goto LAB_00892156;
 495	              }
 496	            }
 497	            if (*piVar10 <= *(int *)(param_1 + 0x148)) {
 498	              piVar10 = (int *)(param_1 + 0x148);
 499	            }
 500	            *(int *)(param_1 + 0x148) = *piVar10;
 501	            local_19c = CONCAT44(local_19c._4_4_,(undefined4)local_19c);
 502	            goto LAB_00892156;
 503	          }
 504	        }
 505	        else {
 506	          *(float *)(param_1 + 0x130) = *(float *)(param_1 + 0x130) + (float)_DAT_009e20d8;
 507	        }
 508	        *(float *)(param_1 + 0x134) = *(float *)(param_1 + 0x134) + (float)_DAT_00a33358;
 509	        local_19c = CONCAT44(local_19c._4_4_,(undefined4)local_19c);
 510	      }
 511	      else {
 512	        fVar3 = (float)_DAT_009e5060;
 513	        fVar2 = *(float *)(param_1 + 0x110) - fVar3;
 514	LAB_00892144:
 515	        *(float *)(param_1 + 0x110) = fVar2;
 516	        *(float *)(param_1 + 0x114) = *(float *)(param_1 + 0x114) - fVar3;
 517	        local_19c = CONCAT44(local_19c._4_4_,(undefined4)local_19c);
 518	      }
 519	      goto LAB_00892156;
 520	    }
 521	  }
 522	  fVar2 = (float)_DAT_009e2318;
 523	  *(float *)(param_1 + 0x10c) = *(float *)(param_1 + 0x10c) - fVar2;
 524	  *(float *)(param_1 + 0x110) = *(float *)(param_1 + 0x110) - fVar2;
 525	  *(float *)(param_1 + 0x114) = *(float *)(param_1 + 0x114) - fVar2;
 526	  *(float *)(param_1 + 0x124) = *(float *)(param_1 + 0x124) + (float)_DAT_009ed188;
 527	  local_19c = CONCAT44(local_19c._4_4_,(undefined4)local_19c);
 528	LAB_00892156:
 529	  local_1a0 = 0;
 530	  iStack_1c4 = 0x89216d;
 531	  pcStack_1c0 = param_2;
 532	  cVar4 = TechDef::GetPlagueCureMask();
 533	  if (cVar4 != '\0') {
 534	    *(uint *)(param_1 + 0x28c) = *(uint *)(param_1 + 0x28c) | local_1a0;
 535	    *(uint *)(param_1 + 0x288) = *(uint *)(param_1 + 0x288) | local_1a0;
 536	    iStack_1c4 = 0x89219b;
 537	    pcStack_1c0 = (char *)param_1;
 538	    FUN_0078c7e0();
 539	  }
 540	  pcStack_1c0 = local_1a8;
 541	  iStack_1c4 = 0x8921ae;
 542	  puVar7 = (undefined4 *)ComputeTechBitmasks();
 543	  *(undefined4 *)(param_1 + 400) = *puVar7;
 544	  *(undefined4 *)(param_1 + 0x194) = puVar7[1];
 545	  FUN_008182c0();
 546	  RebuildSpeciesTechFlags();
 547	  iStack_1c4 = 0x8921dd;
 548	  pcStack_1c0 = param_2;
 549	  cVar4 = MasterTechTree::IsTech();
 550	  if ((cVar4 != '\0') && (*(int *)(param_1 + 0x5c) == 5)) {
 551	    pcStack_1c0 = (char *)0x8921f3;
 552	    puVar8 = (undefined1 *)MasterTechTree::GetTechDef();
 553	    if (puVar8 != (undefined1 *)0x0) {
 554	      pcStack_1c0 = (char *)0x1;
 555	      iStack_1c4 = 1;
 556	      uStack_1cc = 0x892209;
 557	      puStack_1c8 = puVar8;
 558	      FUN_005862d0();
 559	    }
 560	  }
 561	  if (*(char *)(param_1 + 0x330) == '\0') {
 562	    pcStack_1c0 = (char *)0x892222;
 563	    cVar4 = TechTree::HasResearched();
 564	    if (cVar4 != '\0') {
 565	      pcStack_1c0 = (char *)0x892236;
 566	      cVar4 = TechTree::HasResearched();
 567	      if (cVar4 != '\0') {
 568	        *(undefined1 *)(param_1 + 0x330) = 1;
 569	      }
 570	    }
 571	  }
 572	  local_19c._4_4_ = (char *)(param_1 + 0x348);
 573	  local_18c = 0;
 574	  do {
 575	    if ((*(uint *)local_19c._4_4_ >> 5 & 1) != 0) {
 576	      uVar12 = 0;
 577	      local_18d = '\0';
 578	      if (*(int *)(param_1 + 0x34) - *(int *)(param_1 + 0x30) >> 2 != 0) {
 579	        do {
 580	          pcStack_1c0 = (char *)0x892294;
 581	          cVar4 = FUN_00745e40();
 582	          if (cVar4 != '\0') {
 583	            pcStack_1c0 = (char *)0x8922a6;
 584	            FUN_00743800();
 585	            local_18d = '\x01';
 586	          }
 587	          uVar12 = uVar12 + 1;
 588	        } while (uVar12 < (uint)(*(int *)(param_1 + 0x34) - *(int *)(param_1 + 0x30) >> 2));
 589	      }
 590	      if ((param_3 == '\0') && (local_18d != '\0')) {
 591	        local_1d4 = *(undefined4 *)PTR_PTR_00af0a8c;
 592	        pcStack_1c0 = (char *)0x0;
 593	        iStack_1c4 = 0;
 594	        puStack_1c8 = (undefined1 *)0x0;
 595	        uStack_1cc = 0;
 596	        iStack_1d0 = 0;
 597	        local_1d8 = local_134;
 598	        pcStack_1dc = (char *)0x8922ee;
 599	        iStack_1c4 = FUN_008c97f0();
 600	        pcStack_1c0 = (char *)0x0;
 601	        local_8 = 4;
 602	        local_158 = 0xf;
 603	        local_15c = 0;
 604	        local_16c[0] = (void *)((uint)local_16c[0] & 0xffffff00);
 605	        puStack_1c8 = (undefined1 *)0x89231e;
 606	        FUN_00425430();
 607	        local_8._0_1_ = 6;
 608	        if (0xf < local_120) {
 609	                    /* WARNING: Subroutine does not return */
 610	          pcStack_1c0 = &UNK_00892337;
 611	          operator_delete(local_134[0]);
 612	        }
 613	        local_1d4 = *(undefined4 *)PTR_PTR_00af0a94;
 614	        pcStack_1c0 = (char *)0x0;
 615	        iStack_1c4 = 0;
 616	        puStack_1c8 = (undefined1 *)0x0;
 617	        uStack_1cc = 0;
 618	        iStack_1d0 = 0;
 619	        local_1d8 = local_188;
 620	        local_120 = 0xf;
 621	        local_124 = 0;
 622	        local_134[0] = (void *)((uint)local_134[0] & 0xffffff00);
 623	        pcStack_1dc = (char *)0x892368;
 624	        iStack_1c4 = FUN_008c97f0();
 625	        pcStack_1c0 = (char *)0x0;
 626	        local_8._0_1_ = 7;
 627	        local_13c = 0xf;
 628	        local_140 = 0;
 629	        local_150 = (void *)((uint)local_150 & 0xffffff00);
 630	        puStack_1c8 = (undefined1 *)0x892391;
 631	        FUN_00425430();
 632	        local_8._0_1_ = 9;
 633	        if (0xf < local_174) {
 634	                    /* WARNING: Subroutine does not return */
 635	          pcStack_1c0 = &UNK_008923aa;
 636	          operator_delete(local_188[0]);
 637	        }
 638	        pcStack_1c0 = "EVENT_TEMPERANCE";
 639	        local_174 = 0xf;
 640	        local_178 = 0;
 641	        local_188[0] = (void *)((uint)local_188[0] & 0xffffff00);
 642	        iStack_1c4 = 0x8923cd;
 643	        iVar9 = FUN_0080e320();
 644	        iStack_1c4 = *(undefined4 *)(iVar9 + 0xc);
 645	        puStack_1c8 = (undefined1 *)0x0;
 646	        uStack_1cc = 0;
 647	        local_1a4 = local_1e8;
 648	        uStack_1ec = 0xffffffff;
 649	        local_1f0 = 0;
 650	        local_1f4 = &local_150;
 651	        local_1d4 = 0xf;
 652	        local_1d8 = (void **)0x0;
 653	        local_1e8[0] = '\0';
 654	        uStack_1f8 = 0x8923f6;
 655	        FUN_00425430();
 656	        local_194 = local_204;
 657	        local_1f0 = 0xf;
 658	        local_1f4 = (void **)0x0;
 659	        local_8._0_1_ = 10;
 660	        local_204[0] = '\0';
 661	        FUN_00425430(local_16c,0,0xffffffff);
 662	        local_8 = CONCAT31(local_8._1_3_,9);
 663	        FUN_008862b0();
 664	        if (0xf < local_13c) {
 665	                    /* WARNING: Subroutine does not return */
 666	          pcStack_1c0 = &UNK_00892441;
 667	          operator_delete(local_150);
 668	        }
 669	        local_13c = 0xf;
 670	        local_140 = 0;
 671	        local_150 = (void *)((uint)local_150 & 0xffffff00);
 672	        local_8 = 0xffffffff;
 673	        if (0xf < local_158) {
 674	                    /* WARNING: Subroutine does not return */
 675	          pcStack_1c0 = &UNK_00892473;
 676	          operator_delete(local_16c[0]);
 677	        }
 678	        local_158 = 0xf;
 679	        local_15c = 0;
 680	        local_16c[0] = (void *)((uint)local_16c[0] & 0xffffff00);
 681	      }
 682	    }
 683	    local_19c._4_4_ = (char *)((int)local_19c._4_4_ + 4);
 684	    local_18c = local_18c + 1;
 685	    if (6 < local_18c) {
 686	      ExceptionList = local_10;
 687	      __security_check_cookie(local_14 ^ (uint)&stack0xfffffffc);
 688	      return;
 689	    }
 690	  } while( true );
 691	}

totalCalleeCount:
36
parameters:
[]
endAddress:
0x008924c3
