; LLVM IR from jorgemf/c-evolutionary-library :: examples/tsp/TSPFitness.ll (ZN10TSPFitness28evaluateGeographicalDistanceEPii)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%class.TSPFitness = type <{ %class.FitnessFunction, ptr, ptr, i32, [4 x i8] }>
%class.FitnessFunction = type { ptr }

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: mustprogress nounwind uwtable
define dso_local noundef double @_ZN10TSPFitness28evaluateGeographicalDistanceEPii(ptr noundef nonnull align 8 dereferenceable(28) %0, ptr noundef %1, i32 noundef %2) #1 align 2 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca double, align 8
  %8 = alloca double, align 8
  %9 = alloca double, align 8
  %10 = alloca double, align 8
  %11 = alloca double, align 8
  %12 = alloca double, align 8
  %13 = alloca double, align 8
  %14 = alloca double, align 8
  %15 = alloca double, align 8
  %16 = alloca double, align 8
  %17 = alloca i32, align 4
  %18 = alloca double, align 8
  %19 = alloca i32, align 4
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  store i32 %2, ptr %6, align 4, !tbaa !9
  %20 = load ptr, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #4
  store double 0x400921FAFC8B007A, ptr %7, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  store double 0x40B8EA6353F7CED9, ptr %8, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  store double 0.000000e+00, ptr %9, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #4
  store i32 0, ptr %19, align 4, !tbaa !9
  br label %21

21:                                               ; preds = %217, %3
  %22 = load i32, ptr %19, align 4, !tbaa !9
  %23 = load i32, ptr %6, align 4, !tbaa !9
  %24 = sub nsw i32 %23, 1
  %25 = icmp slt i32 %22, %24
  br i1 %25, label %27, label %26

26:                                               ; preds = %21
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #4
  br label %220

27:                                               ; preds = %21
  %28 = getelementptr inbounds %class.TSPFitness, ptr %20, i32 0, i32 2
  %29 = load ptr, ptr %28, align 8, !tbaa !13
  %30 = load ptr, ptr %5, align 8, !tbaa !5
  %31 = load i32, ptr %19, align 4, !tbaa !9
  %32 = sext i32 %31 to i64
  %33 = getelementptr inbounds i32, ptr %30, i64 %32
  %34 = load i32, ptr %33, align 4, !tbaa !9
  %35 = sub nsw i32 %34, 1
  %36 = sext i32 %35 to i64
  %37 = getelementptr inbounds ptr, ptr %29, i64 %36
  %38 = load ptr, ptr %37, align 8, !tbaa !5
  %39 = getelementptr inbounds double, ptr %38, i64 0
  %40 = load double, ptr %39, align 8, !tbaa !11
  %41 = fptosi double %40 to i32
  store i32 %41, ptr %17, align 4, !tbaa !9
  %42 = getelementptr inbounds %class.TSPFitness, ptr %20, i32 0, i32 2
  %43 = load ptr, ptr %42, align 8, !tbaa !13
  %44 = load ptr, ptr %5, align 8, !tbaa !5
  %45 = load i32, ptr %19, align 4, !tbaa !9
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds i32, ptr %44, i64 %46
  %48 = load i32, ptr %47, align 4, !tbaa !9
  %49 = sub nsw i32 %48, 1
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds ptr, ptr %43, i64 %50
  %52 = load ptr, ptr %51, align 8, !tbaa !5
  %53 = getelementptr inbounds double, ptr %52, i64 0
  %54 = load double, ptr %53, align 8, !tbaa !11
  %55 = load i32, ptr %17, align 4, !tbaa !9
  %56 = sitofp i32 %55 to double
  %57 = fsub double %54, %56
  store double %57, ptr %18, align 8, !tbaa !11
  %58 = load double, ptr %7, align 8, !tbaa !11
  %59 = load i32, ptr %17, align 4, !tbaa !9
  %60 = sitofp i32 %59 to double
  %61 = load double, ptr %18, align 8, !tbaa !11
  %62 = fmul double 5.000000e+00, %61
  %63 = fdiv double %62, 3.000000e+00
  %64 = fadd double %60, %63
  %65 = fmul double %58, %64
  %66 = fdiv double %65, 1.800000e+02
  store double %66, ptr %10, align 8, !tbaa !11
  %67 = getelementptr inbounds %class.TSPFitness, ptr %20, i32 0, i32 2
  %68 = load ptr, ptr %67, align 8, !tbaa !13
  %69 = load ptr, ptr %5, align 8, !tbaa !5
  %70 = load i32, ptr %19, align 4, !tbaa !9
  %71 = sext i32 %70 to i64
  %72 = getelementptr inbounds i32, ptr %69, i64 %71
  %73 = load i32, ptr %72, align 4, !tbaa !9
  %74 = sub nsw i32 %73, 1
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds ptr, ptr %68, i64 %75
  %77 = load ptr, ptr %76, align 8, !tbaa !5
  %78 = getelementptr inbounds double, ptr %77, i64 1
  %79 = load double, ptr %78, align 8, !tbaa !11
  %80 = fptosi double %79 to i32
  store i32 %80, ptr %17, align 4, !tbaa !9
  %81 = getelementptr inbounds %class.TSPFitness, ptr %20, i32 0, i32 2
  %82 = load ptr, ptr %81, align 8, !tbaa !13
  %83 = load ptr, ptr %5, align 8, !tbaa !5
  %84 = load i32, ptr %19, align 4, !tbaa !9
  %85 = sext i32 %84 to i64
  %86 = getelementptr inbounds i32, ptr %83, i64 %85
  %87 = load i32, ptr %86, align 4, !tbaa !9
  %88 = sub nsw i32 %87, 1
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds ptr, ptr %82, i64 %89
  %91 = load ptr, ptr %90, align 8, !tbaa !5
  %92 = getelementptr inbounds double, ptr %91, i64 1
  %93 = load double, ptr %92, align 8, !tbaa !11
  %94 = load i32, ptr %17, align 4, !tbaa !9
  %95 = sitofp i32 %94 to double
  %96 = fsub double %93, %95
  store double %96, ptr %18, align 8, !tbaa !11
  %97 = load double, ptr %7, align 8, !tbaa !11
  %98 = load i32, ptr %17, align 4, !tbaa !9
  %99 = sitofp i32 %98 to double
  %100 = load double, ptr %18, align 8, !tbaa !11
  %101 = fmul double 5.000000e+00, %100
  %102 = fdiv double %101, 3.000000e+00
  %103 = fadd double %99, %102
  %104 = fmul double %97, %103
  %105 = fdiv double %104, 1.800000e+02
  store double %105, ptr %11, align 8, !tbaa !11
  %106 = getelementptr inbounds %class.TSPFitness, ptr %20, i32 0, i32 2
  %107 = load ptr, ptr %106, align 8, !tbaa !13
  %108 = load ptr, ptr %5, align 8, !tbaa !5
  %109 = load i32, ptr %19, align 4, !tbaa !9
  %110 = add nsw i32 %109, 1
  %111 = sext i32 %110 to i64
  %112 = getelementptr inbounds i32, ptr %108, i64 %111
  %113 = load i32, ptr %112, align 4, !tbaa !9
  %114 = sub nsw i32 %113, 1
  %115 = sext i32 %114 to i64
  %116 = getelementptr inbounds ptr, ptr %107, i64 %115
  %117 = load ptr, ptr %116, align 8, !tbaa !5
  %118 = getelementptr inbounds double, ptr %117, i64 0
  %119 = load double, ptr %118, align 8, !tbaa !11
  %120 = fptosi double %119 to i32
  store i32 %120, ptr %17, align 4, !tbaa !9
  %121 = getelementptr inbounds %class.TSPFitness, ptr %20, i32 0, i32 2
  %122 = load ptr, ptr %121, align 8, !tbaa !13
  %123 = load ptr, ptr %5, align 8, !tbaa !5
  %124 = load i32, ptr %19, align 4, !tbaa !9
  %125 = add nsw i32 %124, 1
  %126 = sext i32 %125 to i64
  %127 = getelementptr inbounds i32, ptr %123, i64 %126
  %128 = load i32, ptr %127, align 4, !tbaa !9
  %129 = sub nsw i32 %128, 1
  %130 = sext i32 %129 to i64
  %131 = getelementptr inbounds ptr, ptr %122, i64 %130
  %132 = load ptr, ptr %131, align 8, !tbaa !5
  %133 = getelementptr inbounds double, ptr %132, i64 0
  %134 = load double, ptr %133, align 8, !tbaa !11
  %135 = load i32, ptr %17, align 4, !tbaa !9
  %136 = sitofp i32 %135 to double
  %137 = fsub double %134, %136
  store double %137, ptr %18, align 8, !tbaa !11
  %138 = load double, ptr %7, align 8, !tbaa !11
  %139 = load i32, ptr %17, align 4, !tbaa !9
  %140 = sitofp i32 %139 to double
  %141 = load double, ptr %18, align 8, !tbaa !11
  %142 = fmul double 5.000000e+00, %141
  %143 = fdiv double %142, 3.000000e+00
  %144 = fadd double %140, %143
  %145 = fmul double %138, %144
  %146 = fdiv double %145, 1.800000e+02
  store double %146, ptr %12, align 8, !tbaa !11
  %147 = getelementptr inbounds %class.TSPFitness, ptr %20, i32 0, i32 2
  %148 = load ptr, ptr %147, align 8, !tbaa !13
  %149 = load ptr, ptr %5, align 8, !tbaa !5
  %150 = load i32, ptr %19, align 4, !tbaa !9
  %151 = add nsw i32 %150, 1
  %152 = sext i32 %151 to i64
  %153 = getelementptr inbounds i32, ptr %149, i64 %152
  %154 = load i32, ptr %153, align 4, !tbaa !9
  %155 = sub nsw i32 %154, 1
  %156 = sext i32 %155 to i64
  %157 = getelementptr inbounds ptr, ptr %148, i64 %156
  %158 = load ptr, ptr %157, align 8, !tbaa !5
  %159 = getelementptr inbounds double, ptr %158, i64 1
  %160 = load double, ptr %159, align 8, !tbaa !11
  %161 = fptosi double %160 to i32
  store i32 %161, ptr %17, align 4, !tbaa !9
  %162 = getelementptr inbounds %class.TSPFitness, ptr %20, i32 0, i32 2
  %163 = load ptr, ptr %162, align 8, !tbaa !13
  %164 = load ptr, ptr %5, align 8, !tbaa !5
  %165 = load i32, ptr %19, align 4, !tbaa !9
  %166 = add nsw i32 %165, 1
  %167 = sext i32 %166 to i64
  %168 = getelementptr inbounds i32, ptr %164, i64 %167
  %169 = load i32, ptr %168, align 4, !tbaa !9
  %170 = sub nsw i32 %169, 1
  %171 = sext i32 %170 to i64
  %172 = getelementptr inbounds ptr, ptr %163, i64 %171
  %173 = load ptr, ptr %172, align 8, !tbaa !5
  %174 = getelementptr inbounds double, ptr %173, i64 1
  %175 = load double, ptr %174, align 8, !tbaa !11
  %176 = load i32, ptr %17, align 4, !tbaa !9
  %177 = sitofp i32 %176 to double
  %178 = fsub double %175, %177
  store double %178, ptr %18, align 8, !tbaa !11
  %179 = load double, ptr %7, align 8, !tbaa !11
  %180 = load i32, ptr %17, align 4, !tbaa !9
  %181 = sitofp i32 %180 to double
  %182 = load double, ptr %18, align 8, !tbaa !11
  %183 = fmul double 5.000000e+00, %182
  %184 = fdiv double %183, 3.000000e+00
  %185 = fadd double %181, %184
  %186 = fmul double %179, %185
  %187 = fdiv double %186, 1.800000e+02
  store double %187, ptr %13, align 8, !tbaa !11
  %188 = load double, ptr %11, align 8, !tbaa !11
  %189 = load double, ptr %13, align 8, !tbaa !11
  %190 = fsub double %188, %189
  %191 = call double @cos(double noundef %190) #4
  store double %191, ptr %14, align 8, !tbaa !11
  %192 = load double, ptr %10, align 8, !tbaa !11
  %193 = load double, ptr %12, align 8, !tbaa !11
  %194 = fsub double %192, %193
  %195 = call double @cos(double noundef %194) #4
  store double %195, ptr %15, align 8, !tbaa !11
  %196 = load double, ptr %10, align 8, !tbaa !11
  %197 = load double, ptr %12, align 8, !tbaa !11
  %198 = fadd double %196, %197
  %199 = call double @cos(double noundef %198) #4
  store double %199, ptr %16, align 8, !tbaa !11
  %200 = load double, ptr %8, align 8, !tbaa !11
  %201 = load double, ptr %14, align 8, !tbaa !11
  %202 = fadd double 1.000000e+00, %201
  %203 = load double, ptr %15, align 8, !tbaa !11
  %204 = load double, ptr %14, align 8, !tbaa !11
  %205 = fsub double 1.000000e+00, %204
  %206 = load double, ptr %16, align 8, !tbaa !11
  %207 = fmul double %205, %206
  %208 = fneg double %207
  %209 = call double @llvm.fmuladd.f64(double %202, double %203, double %208)
  %210 = fmul double 5.000000e-01, %209
  %211 = call double @acos(double noundef %210) #4
  %212 = call double @llvm.fmuladd.f64(double %200, double %211, double 1.000000e+00)
  %213 = fptosi double %212 to i32
  %214 = sitofp i32 %213 to double
  %215 = load double, ptr %9, align 8, !tbaa !11
  %216 = fadd double %215, %214
  store double %216, ptr %9, align 8, !tbaa !11
  br label %217

217:                                              ; preds = %27
  %218 = load i32, ptr %19, align 4, !tbaa !9
  %219 = add nsw i32 %218, 1
  store i32 %219, ptr %19, align 4, !tbaa !9
  br label %21, !llvm.loop !17

220:                                              ; preds = %26
  %221 = getelementptr inbounds %class.TSPFitness, ptr %20, i32 0, i32 2
  %222 = load ptr, ptr %221, align 8, !tbaa !13
  %223 = load ptr, ptr %5, align 8, !tbaa !5
  %224 = load i32, ptr %6, align 4, !tbaa !9
  %225 = sub nsw i32 %224, 1
  %226 = sext i32 %225 to i64
  %227 = getelementptr inbounds i32, ptr %223, i64 %226
  %228 = load i32, ptr %227, align 4, !tbaa !9
  %229 = sub nsw i32 %228, 1
  %230 = sext i32 %229 to i64
  %231 = getelementptr inbounds ptr, ptr %222, i64 %230
  %232 = load ptr, ptr %231, align 8, !tbaa !5
  %233 = getelementptr inbounds double, ptr %232, i64 0
  %234 = load double, ptr %233, align 8, !tbaa !11
  %235 = fptosi double %234 to i32
  store i32 %235, ptr %17, align 4, !tbaa !9
  %236 = getelementptr inbounds %class.TSPFitness, ptr %20, i32 0, i32 2
  %237 = load ptr, ptr %236, align 8, !tbaa !13
  %238 = load ptr, ptr %5, align 8, !tbaa !5
  %239 = load i32, ptr %6, align 4, !tbaa !9
  %240 = sub nsw i32 %239, 1
  %241 = sext i32 %240 to i64
  %242 = getelementptr inbounds i32, ptr %238, i64 %241
  %243 = load i32, ptr %242, align 4, !tbaa !9
  %244 = sub nsw i32 %243, 1
  %245 = sext i32 %244 to i64
  %246 = getelementptr inbounds ptr, ptr %237, i64 %245
  %247 = load ptr, ptr %246, align 8, !tbaa !5
  %248 = getelementptr inbounds double, ptr %247, i64 0
  %249 = load double, ptr %248, align 8, !tbaa !11
  %250 = load i32, ptr %17, align 4, !tbaa !9
  %251 = sitofp i32 %250 to double
  %252 = fsub double %249, %251
  store double %252, ptr %18, align 8, !tbaa !11
  %253 = load double, ptr %7, align 8, !tbaa !11
  %254 = load i32, ptr %17, align 4, !tbaa !9
  %255 = sitofp i32 %254 to double
  %256 = load double, ptr %18, align 8, !tbaa !11
  %257 = fmul double 5.000000e+00, %256
  %258 = fdiv double %257, 3.000000e+00
  %259 = fadd double %255, %258
  %260 = fmul double %253, %259
  %261 = fdiv double %260, 1.800000e+02
  store double %261, ptr %10, align 8, !tbaa !11
  %262 = getelementptr inbounds %class.TSPFitness, ptr %20, i32 0, i32 2
  %263 = load ptr, ptr %262, align 8, !tbaa !13
  %264 = load ptr, ptr %5, align 8, !tbaa !5
  %265 = load i32, ptr %6, align 4, !tbaa !9
  %266 = sub nsw i32 %265, 1
  %267 = sext i32 %266 to i64
  %268 = getelementptr inbounds i32, ptr %264, i64 %267
  %269 = load i32, ptr %268, align 4, !tbaa !9
  %270 = sub nsw i32 %269, 1
  %271 = sext i32 %270 to i64
  %272 = getelementptr inbounds ptr, ptr %263, i64 %271
  %273 = load ptr, ptr %272, align 8, !tbaa !5
  %274 = getelementptr inbounds double, ptr %273, i64 1
  %275 = load double, ptr %274, align 8, !tbaa !11
  %276 = fptosi double %275 to i32
  store i32 %276, ptr %17, align 4, !tbaa !9
  %277 = getelementptr inbounds %class.TSPFitness, ptr %20, i32 0, i32 2
  %278 = load ptr, ptr %277, align 8, !tbaa !13
  %279 = load ptr, ptr %5, align 8, !tbaa !5
  %280 = load i32, ptr %6, align 4, !tbaa !9
  %281 = sub nsw i32 %280, 1
  %282 = sext i32 %281 to i64
  %283 = getelementptr inbounds i32, ptr %279, i64 %282
  %284 = load i32, ptr %283, align 4, !tbaa !9
  %285 = sub nsw i32 %284, 1
  %286 = sext i32 %285 to i64
  %287 = getelementptr inbounds ptr, ptr %278, i64 %286
  %288 = load ptr, ptr %287, align 8, !tbaa !5
  %289 = getelementptr inbounds double, ptr %288, i64 1
  %290 = load double, ptr %289, align 8, !tbaa !11
  %291 = load i32, ptr %17, align 4, !tbaa !9
  %292 = sitofp i32 %291 to double
  %293 = fsub double %290, %292
  store double %293, ptr %18, align 8, !tbaa !11
  %294 = load double, ptr %7, align 8, !tbaa !11
  %295 = load i32, ptr %17, align 4, !tbaa !9
  %296 = sitofp i32 %295 to double
  %297 = load double, ptr %18, align 8, !tbaa !11
  %298 = fmul double 5.000000e+00, %297
  %299 = fdiv double %298, 3.000000e+00
  %300 = fadd double %296, %299
  %301 = fmul double %294, %300
  %302 = fdiv double %301, 1.800000e+02
  store double %302, ptr %11, align 8, !tbaa !11
  %303 = getelementptr inbounds %class.TSPFitness, ptr %20, i32 0, i32 2
  %304 = load ptr, ptr %303, align 8, !tbaa !13
  %305 = load ptr, ptr %5, align 8, !tbaa !5
  %306 = getelementptr inbounds i32, ptr %305, i64 0
  %307 = load i32, ptr %306, align 4, !tbaa !9
  %308 = sub nsw i32 %307, 1
  %309 = sext i32 %308 to i64
  %310 = getelementptr inbounds ptr, ptr %304, i64 %309
  %311 = load ptr, ptr %310, align 8, !tbaa !5
  %312 = getelementptr inbounds double, ptr %311, i64 0
  %313 = load double, ptr %312, align 8, !tbaa !11
  %314 = fptosi double %313 to i32
  store i32 %314, ptr %17, align 4, !tbaa !9
  %315 = getelementptr inbounds %class.TSPFitness, ptr %20, i32 0, i32 2
  %316 = load ptr, ptr %315, align 8, !tbaa !13
  %317 = load ptr, ptr %5, align 8, !tbaa !5
  %318 = getelementptr inbounds i32, ptr %317, i64 0
  %319 = load i32, ptr %318, align 4, !tbaa !9
  %320 = sub nsw i32 %319, 1
  %321 = sext i32 %320 to i64
  %322 = getelementptr inbounds ptr, ptr %316, i64 %321
  %323 = load ptr, ptr %322, align 8, !tbaa !5
  %324 = getelementptr inbounds double, ptr %323, i64 0
  %325 = load double, ptr %324, align 8, !tbaa !11
  %326 = load i32, ptr %17, align 4, !tbaa !9
  %327 = sitofp i32 %326 to double
  %328 = fsub double %325, %327
  store double %328, ptr %18, align 8, !tbaa !11
  %329 = load double, ptr %7, align 8, !tbaa !11
  %330 = load i32, ptr %17, align 4, !tbaa !9
  %331 = sitofp i32 %330 to double
  %332 = load double, ptr %18, align 8, !tbaa !11
  %333 = fmul double 5.000000e+00, %332
  %334 = fdiv double %333, 3.000000e+00
  %335 = fadd double %331, %334
  %336 = fmul double %329, %335
  %337 = fdiv double %336, 1.800000e+02
  store double %337, ptr %12, align 8, !tbaa !11
  %338 = getelementptr inbounds %class.TSPFitness, ptr %20, i32 0, i32 2
  %339 = load ptr, ptr %338, align 8, !tbaa !13
  %340 = load ptr, ptr %5, align 8, !tbaa !5
  %341 = getelementptr inbounds i32, ptr %340, i64 0
  %342 = load i32, ptr %341, align 4, !tbaa !9
  %343 = sub nsw i32 %342, 1
  %344 = sext i32 %343 to i64
  %345 = getelementptr inbounds ptr, ptr %339, i64 %344
  %346 = load ptr, ptr %345, align 8, !tbaa !5
  %347 = getelementptr inbounds double, ptr %346, i64 1
  %348 = load double, ptr %347, align 8, !tbaa !11
  %349 = fptosi double %348 to i32
  store i32 %349, ptr %17, align 4, !tbaa !9
  %350 = getelementptr inbounds %class.TSPFitness, ptr %20, i32 0, i32 2
  %351 = load ptr, ptr %350, align 8, !tbaa !13
  %352 = load ptr, ptr %5, align 8, !tbaa !5
  %353 = getelementptr inbounds i32, ptr %352, i64 0
  %354 = load i32, ptr %353, align 4, !tbaa !9
  %355 = sub nsw i32 %354, 1
  %356 = sext i32 %355 to i64
  %357 = getelementptr inbounds ptr, ptr %351, i64 %356
  %358 = load ptr, ptr %357, align 8, !tbaa !5
  %359 = getelementptr inbounds double, ptr %358, i64 1
  %360 = load double, ptr %359, align 8, !tbaa !11
  %361 = load i32, ptr %17, align 4, !tbaa !9
  %362 = sitofp i32 %361 to double
  %363 = fsub double %360, %362
  store double %363, ptr %18, align 8, !tbaa !11
  %364 = load double, ptr %7, align 8, !tbaa !11
  %365 = load i32, ptr %17, align 4, !tbaa !9
  %366 = sitofp i32 %365 to double
  %367 = load double, ptr %18, align 8, !tbaa !11
  %368 = fmul double 5.000000e+00, %367
  %369 = fdiv double %368, 3.000000e+00
  %370 = fadd double %366, %369
  %371 = fmul double %364, %370
  %372 = fdiv double %371, 1.800000e+02
  store double %372, ptr %13, align 8, !tbaa !11
  %373 = load double, ptr %11, align 8, !tbaa !11
  %374 = load double, ptr %13, align 8, !tbaa !11
  %375 = fsub double %373, %374
  %376 = call double @cos(double noundef %375) #4
  store double %376, ptr %14, align 8, !tbaa !11
  %377 = load double, ptr %10, align 8, !tbaa !11
  %378 = load double, ptr %12, align 8, !tbaa !11
  %379 = fsub double %377, %378
  %380 = call double @cos(double noundef %379) #4
  store double %380, ptr %15, align 8, !tbaa !11
  %381 = load double, ptr %10, align 8, !tbaa !11
  %382 = load double, ptr %12, align 8, !tbaa !11
  %383 = fadd double %381, %382
  %384 = call double @cos(double noundef %383) #4
  store double %384, ptr %16, align 8, !tbaa !11
  %385 = load double, ptr %8, align 8, !tbaa !11
  %386 = load double, ptr %14, align 8, !tbaa !11
  %387 = fadd double 1.000000e+00, %386
  %388 = load double, ptr %15, align 8, !tbaa !11
  %389 = load double, ptr %14, align 8, !tbaa !11
  %390 = fsub double 1.000000e+00, %389
  %391 = load double, ptr %16, align 8, !tbaa !11
  %392 = fmul double %390, %391
  %393 = fneg double %392
  %394 = call double @llvm.fmuladd.f64(double %387, double %388, double %393)
  %395 = fmul double 5.000000e-01, %394
  %396 = call double @acos(double noundef %395) #4
  %397 = call double @llvm.fmuladd.f64(double %385, double %396, double 1.000000e+00)
  %398 = fptosi double %397 to i32
  %399 = sitofp i32 %398 to double
  %400 = load double, ptr %9, align 8, !tbaa !11
  %401 = fadd double %400, %399
  store double %401, ptr %9, align 8, !tbaa !11
  %402 = load double, ptr %9, align 8, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #4
  ret double %402
}

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #2

; Function Attrs: nounwind
declare double @cos(double noundef) #3

; Function Attrs: nounwind
declare double @acos(double noundef) #3

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #3 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"double", !7, i64 0}
!13 = !{!14, !6, i64 16}
!14 = !{!"_ZTS10TSPFitness", !15, i64 0, !6, i64 8, !6, i64 16, !16, i64 24}
!15 = !{!"_ZTS15FitnessFunction"}
!16 = !{!"_ZTSN12AlgorithmTSP9DATA_TYPEE", !7, i64 0}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

; Function Attrs: mustprogress nofree nounwind memory(readwrite, inaccessiblemem: write) uwtable
define dso_local noundef double @_ZN10TSPFitness28evaluateGeographicalDistanceEPii(ptr nocapture noundef nonnull readonly align 8 dereferenceable(28) %0, ptr nocapture noundef readonly %1, i32 noundef %2) local_unnamed_addr #0 align 2 {
  %4 = add i32 %2, -1
  %5 = icmp sgt i32 %2, 1
  br i1 %5, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %3
  %6 = getelementptr inbounds i8, ptr %0, i64 16
  %wide.trip.count = zext nneg i32 %4 to i64
  br label %67

._crit_edge:                                      ; preds = %67, %3
  %.088.lcssa = phi double [ 0.000000e+00, %3 ], [ %126, %67 ]
  %7 = getelementptr inbounds i8, ptr %0, i64 16
  %8 = load ptr, ptr %7, align 8, !tbaa !5
  %9 = sext i32 %4 to i64
  %10 = getelementptr inbounds i32, ptr %1, i64 %9
  %11 = load i32, ptr %10, align 4, !tbaa !12
  %12 = sext i32 %11 to i64
  %13 = getelementptr ptr, ptr %8, i64 %12
  %14 = getelementptr i8, ptr %13, i64 -8
  %15 = load ptr, ptr %14, align 8, !tbaa !14
  %16 = load double, ptr %15, align 8, !tbaa !15
  %17 = getelementptr inbounds i8, ptr %15, i64 8
  %18 = load double, ptr %17, align 8, !tbaa !15
  %19 = load i32, ptr %1, align 4, !tbaa !12
  %20 = sext i32 %19 to i64
  %21 = getelementptr ptr, ptr %8, i64 %20
  %22 = getelementptr i8, ptr %21, i64 -8
  %23 = load ptr, ptr %22, align 8, !tbaa !14
  %24 = load double, ptr %23, align 8, !tbaa !15
  %25 = insertelement <2 x double> poison, double %16, i64 0
  %26 = insertelement <2 x double> %25, double %24, i64 1
  %27 = fptosi <2 x double> %26 to <2 x i32>
  %28 = sitofp <2 x i32> %27 to <2 x double>
  %29 = fsub <2 x double> %26, %28
  %30 = fmul <2 x double> %29, <double 5.000000e+00, double 5.000000e+00>
  %31 = fdiv <2 x double> %30, <double 3.000000e+00, double 3.000000e+00>
  %32 = fadd <2 x double> %31, %28
  %33 = fmul <2 x double> %32, <double 0x400921FAFC8B007A, double 0x400921FAFC8B007A>
  %34 = fdiv <2 x double> %33, <double 1.800000e+02, double 1.800000e+02>
  %35 = getelementptr inbounds i8, ptr %23, i64 8
  %36 = load double, ptr %35, align 8, !tbaa !15
  %37 = insertelement <2 x double> poison, double %18, i64 0
  %38 = insertelement <2 x double> %37, double %36, i64 1
  %39 = fptosi <2 x double> %38 to <2 x i32>
  %40 = sitofp <2 x i32> %39 to <2 x double>
  %41 = fsub <2 x double> %38, %40
  %42 = fmul <2 x double> %41, <double 5.000000e+00, double 5.000000e+00>
  %43 = fdiv <2 x double> %42, <double 3.000000e+00, double 3.000000e+00>
  %44 = fadd <2 x double> %43, %40
  %45 = fmul <2 x double> %44, <double 0x400921FAFC8B007A, double 0x400921FAFC8B007A>
  %46 = fdiv <2 x double> %45, <double 1.800000e+02, double 1.800000e+02>
  %shift = shufflevector <2 x double> %46, <2 x double> poison, <2 x i32> <i32 1, i32 poison>
  %47 = fsub <2 x double> %46, %shift
  %48 = extractelement <2 x double> %47, i64 0
  %49 = tail call double @cos(double noundef %48) #3
  %50 = extractelement <2 x double> %34, i64 0
  %51 = extractelement <2 x double> %34, i64 1
  %52 = fsub double %50, %51
  %53 = tail call double @cos(double noundef %52) #3
  %54 = fadd double %50, %51
  %55 = tail call double @cos(double noundef %54) #3
  %56 = fadd double %49, 1.000000e+00
  %57 = fsub double 1.000000e+00, %49
  %58 = fneg double %57
  %59 = fmul double %55, %58
  %60 = tail call double @llvm.fmuladd.f64(double %56, double %53, double %59)
  %61 = fmul double %60, 5.000000e-01
  %62 = tail call double @acos(double noundef %61) #3
  %63 = tail call double @llvm.fmuladd.f64(double %62, double 0x40B8EA6353F7CED9, double 1.000000e+00)
  %64 = fptosi double %63 to i32
  %65 = sitofp i32 %64 to double
  %66 = fadd double %.088.lcssa, %65
  ret double %66

67:                                               ; preds = %.lr.ph, %67
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %67 ]
  %.08890 = phi double [ 0.000000e+00, %.lr.ph ], [ %126, %67 ]
  %68 = load ptr, ptr %6, align 8, !tbaa !5
  %69 = getelementptr inbounds i32, ptr %1, i64 %indvars.iv
  %70 = load i32, ptr %69, align 4, !tbaa !12
  %71 = sext i32 %70 to i64
  %72 = getelementptr ptr, ptr %68, i64 %71
  %73 = getelementptr i8, ptr %72, i64 -8
  %74 = load ptr, ptr %73, align 8, !tbaa !14
  %75 = load double, ptr %74, align 8, !tbaa !15
  %76 = getelementptr inbounds i8, ptr %74, i64 8
  %77 = load double, ptr %76, align 8, !tbaa !15
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %78 = getelementptr inbounds i32, ptr %1, i64 %indvars.iv.next
  %79 = load i32, ptr %78, align 4, !tbaa !12
  %80 = sext i32 %79 to i64
  %81 = getelementptr ptr, ptr %68, i64 %80
  %82 = getelementptr i8, ptr %81, i64 -8
  %83 = load ptr, ptr %82, align 8, !tbaa !14
  %84 = load double, ptr %83, align 8, !tbaa !15
  %85 = insertelement <2 x double> poison, double %75, i64 0
  %86 = insertelement <2 x double> %85, double %84, i64 1
  %87 = fptosi <2 x double> %86 to <2 x i32>
  %88 = sitofp <2 x i32> %87 to <2 x double>
  %89 = fsub <2 x double> %86, %88
  %90 = fmul <2 x double> %89, <double 5.000000e+00, double 5.000000e+00>
  %91 = fdiv <2 x double> %90, <double 3.000000e+00, double 3.000000e+00>
  %92 = fadd <2 x double> %91, %88
  %93 = fmul <2 x double> %92, <double 0x400921FAFC8B007A, double 0x400921FAFC8B007A>
  %94 = fdiv <2 x double> %93, <double 1.800000e+02, double 1.800000e+02>
  %95 = getelementptr inbounds i8, ptr %83, i64 8
  %96 = load double, ptr %95, align 8, !tbaa !15
  %97 = insertelement <2 x double> poison, double %77, i64 0
  %98 = insertelement <2 x double> %97, double %96, i64 1
  %99 = fptosi <2 x double> %98 to <2 x i32>
  %100 = sitofp <2 x i32> %99 to <2 x double>
  %101 = fsub <2 x double> %98, %100
  %102 = fmul <2 x double> %101, <double 5.000000e+00, double 5.000000e+00>
  %103 = fdiv <2 x double> %102, <double 3.000000e+00, double 3.000000e+00>
  %104 = fadd <2 x double> %103, %100
  %105 = fmul <2 x double> %104, <double 0x400921FAFC8B007A, double 0x400921FAFC8B007A>
  %106 = fdiv <2 x double> %105, <double 1.800000e+02, double 1.800000e+02>
  %shift94 = shufflevector <2 x double> %106, <2 x double> poison, <2 x i32> <i32 1, i32 poison>
  %107 = fsub <2 x double> %106, %shift94
  %108 = extractelement <2 x double> %107, i64 0
  %109 = tail call double @cos(double noundef %108) #3
  %110 = extractelement <2 x double> %94, i64 0
  %111 = extractelement <2 x double> %94, i64 1
  %112 = fsub double %110, %111
  %113 = tail call double @cos(double noundef %112) #3
  %114 = fadd double %110, %111
  %115 = tail call double @cos(double noundef %114) #3
  %116 = fadd double %109, 1.000000e+00
  %117 = fsub double 1.000000e+00, %109
  %118 = fneg double %117
  %119 = fmul double %115, %118
  %120 = tail call double @llvm.fmuladd.f64(double %116, double %113, double %119)
  %121 = fmul double %120, 5.000000e-01
  %122 = tail call double @acos(double noundef %121) #3
  %123 = tail call double @llvm.fmuladd.f64(double %122, double 0x40B8EA6353F7CED9, double 1.000000e+00)
  %124 = fptosi double %123 to i32
  %125 = sitofp i32 %124 to double
  %126 = fadd double %.08890, %125
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge, label %67, !llvm.loop !17
}

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #1

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @cos(double noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @acos(double noundef) local_unnamed_addr #2

attributes #0 = { mustprogress nofree nounwind memory(readwrite, inaccessiblemem: write) uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #2 = { mustprogress nofree nounwind willreturn memory(write) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !8, i64 16}
!6 = !{!"_ZTS10TSPFitness", !7, i64 0, !8, i64 8, !8, i64 16, !11, i64 24}
!7 = !{!"_ZTS15FitnessFunction"}
!8 = !{!"any pointer", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = !{!"_ZTSN12AlgorithmTSP9DATA_TYPEE", !9, i64 0}
!12 = !{!13, !13, i64 0}
!13 = !{!"int", !9, i64 0}
!14 = !{!8, !8, i64 0}
!15 = !{!16, !16, i64 0}
!16 = !{!"double", !9, i64 0}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass,VectorCombinePass