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

; 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.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%class.MTRand_int32 = type { i8 }

@_ZSt4cerr = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [26 x i8], align 1

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN12MTRand_int32C2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZN12MTRand_int32clEv(ptr noundef nonnull align 1 dereferenceable(1)) #1 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN12TSPMutation215exchangeRegionsEP14TSPIndividual2(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef %1) #1 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca %class.MTRand_int32, align 1
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca double, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %15 = load ptr, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 1, ptr %5) #6
  call void @_ZN12MTRand_int32C2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5)
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  %16 = load ptr, ptr %4, align 8, !tbaa !5
  %17 = invoke noundef i32 @_ZN11TSPMutation10regionSizeEP13TSPIndividual(ptr noundef nonnull align 8 dereferenceable(32) %15, ptr noundef %16)
          to label %18 unwind label %74

18:                                               ; preds = %2
  store i32 %17, ptr %6, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  %19 = load ptr, ptr %4, align 8, !tbaa !5
  %20 = invoke noundef i32 @_ZN13TSPIndividual15getNumberCitiesEv(ptr noundef nonnull align 8 dereferenceable(64) %19)
          to label %21 unwind label %78

21:                                               ; preds = %18
  store i32 %20, ptr %9, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  %22 = load ptr, ptr %4, align 8, !tbaa !5
  %23 = invoke noundef ptr @_ZN14TSPIndividual214getDoubleRouteEv(ptr noundef nonnull align 8 dereferenceable(80) %22)
          to label %24 unwind label %82

24:                                               ; preds = %21
  store ptr %23, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  %25 = invoke noundef i64 @_ZN12MTRand_int32clEv(ptr noundef nonnull align 1 dereferenceable(1) %5)
          to label %26 unwind label %86

26:                                               ; preds = %24
  %27 = load i32, ptr %9, align 4, !tbaa !9
  %28 = load i32, ptr %6, align 4, !tbaa !9
  %29 = mul nsw i32 2, %28
  %30 = sub nsw i32 %27, %29
  %31 = sext i32 %30 to i64
  %32 = urem i64 %25, %31
  %33 = trunc i64 %32 to i32
  store i32 %33, ptr %11, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  %34 = load i32, ptr %11, align 4, !tbaa !9
  %35 = load i32, ptr %6, align 4, !tbaa !9
  %36 = add nsw i32 %34, %35
  %37 = sext i32 %36 to i64
  %38 = invoke noundef i64 @_ZN12MTRand_int32clEv(ptr noundef nonnull align 1 dereferenceable(1) %5)
          to label %39 unwind label %90

39:                                               ; preds = %26
  %40 = load i32, ptr %9, align 4, !tbaa !9
  %41 = load i32, ptr %6, align 4, !tbaa !9
  %42 = mul nsw i32 2, %41
  %43 = sub nsw i32 %40, %42
  %44 = load i32, ptr %11, align 4, !tbaa !9
  %45 = sub nsw i32 %43, %44
  %46 = sext i32 %45 to i64
  %47 = urem i64 %38, %46
  %48 = add i64 %37, %47
  %49 = trunc i64 %48 to i32
  store i32 %49, ptr %12, align 4, !tbaa !9
  %50 = load i32, ptr %11, align 4, !tbaa !9
  %51 = load i32, ptr %6, align 4, !tbaa !9
  %52 = mul nsw i32 %51, 2
  %53 = add nsw i32 %50, %52
  %54 = load i32, ptr %9, align 4, !tbaa !9
  %55 = icmp sle i32 %53, %54
  br i1 %55, label %56, label %126

56:                                               ; preds = %39
  %57 = load i32, ptr %12, align 4, !tbaa !9
  %58 = load i32, ptr %6, align 4, !tbaa !9
  %59 = add nsw i32 %57, %58
  %60 = load i32, ptr %9, align 4, !tbaa !9
  %61 = icmp sle i32 %59, %60
  br i1 %61, label %62, label %126

62:                                               ; preds = %56
  %63 = load i32, ptr %11, align 4, !tbaa !9
  %64 = load i32, ptr %6, align 4, !tbaa !9
  %65 = add nsw i32 %63, %64
  %66 = load i32, ptr %12, align 4, !tbaa !9
  %67 = icmp sle i32 %65, %66
  br i1 %67, label %68, label %126

68:                                               ; preds = %62
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  store i32 0, ptr %13, align 4, !tbaa !9
  br label %69

69:                                               ; preds = %122, %68
  %70 = load i32, ptr %13, align 4, !tbaa !9
  %71 = load i32, ptr %6, align 4, !tbaa !9
  %72 = icmp slt i32 %70, %71
  br i1 %72, label %94, label %73

73:                                               ; preds = %69
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  br label %125

74:                                               ; preds = %2
  %75 = landingpad { ptr, i32 }
          cleanup
  %76 = extractvalue { ptr, i32 } %75, 0
  store ptr %76, ptr %7, align 8
  %77 = extractvalue { ptr, i32 } %75, 1
  store i32 %77, ptr %8, align 4
  br label %135

78:                                               ; preds = %18
  %79 = landingpad { ptr, i32 }
          cleanup
  %80 = extractvalue { ptr, i32 } %79, 0
  store ptr %80, ptr %7, align 8
  %81 = extractvalue { ptr, i32 } %79, 1
  store i32 %81, ptr %8, align 4
  br label %134

82:                                               ; preds = %21
  %83 = landingpad { ptr, i32 }
          cleanup
  %84 = extractvalue { ptr, i32 } %83, 0
  store ptr %84, ptr %7, align 8
  %85 = extractvalue { ptr, i32 } %83, 1
  store i32 %85, ptr %8, align 4
  br label %133

86:                                               ; preds = %24
  %87 = landingpad { ptr, i32 }
          cleanup
  %88 = extractvalue { ptr, i32 } %87, 0
  store ptr %88, ptr %7, align 8
  %89 = extractvalue { ptr, i32 } %87, 1
  store i32 %89, ptr %8, align 4
  br label %132

90:                                               ; preds = %128, %126, %26
  %91 = landingpad { ptr, i32 }
          cleanup
  %92 = extractvalue { ptr, i32 } %91, 0
  store ptr %92, ptr %7, align 8
  %93 = extractvalue { ptr, i32 } %91, 1
  store i32 %93, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  br label %132

94:                                               ; preds = %69
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  %95 = load ptr, ptr %10, align 8, !tbaa !5
  %96 = load i32, ptr %13, align 4, !tbaa !9
  %97 = load i32, ptr %11, align 4, !tbaa !9
  %98 = add nsw i32 %96, %97
  %99 = sext i32 %98 to i64
  %100 = getelementptr inbounds double, ptr %95, i64 %99
  %101 = load double, ptr %100, align 8, !tbaa !11
  store double %101, ptr %14, align 8, !tbaa !11
  %102 = load ptr, ptr %10, align 8, !tbaa !5
  %103 = load i32, ptr %13, align 4, !tbaa !9
  %104 = load i32, ptr %12, align 4, !tbaa !9
  %105 = add nsw i32 %103, %104
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds double, ptr %102, i64 %106
  %108 = load double, ptr %107, align 8, !tbaa !11
  %109 = load ptr, ptr %10, align 8, !tbaa !5
  %110 = load i32, ptr %13, align 4, !tbaa !9
  %111 = load i32, ptr %11, align 4, !tbaa !9
  %112 = add nsw i32 %110, %111
  %113 = sext i32 %112 to i64
  %114 = getelementptr inbounds double, ptr %109, i64 %113
  store double %108, ptr %114, align 8, !tbaa !11
  %115 = load double, ptr %14, align 8, !tbaa !11
  %116 = load ptr, ptr %10, align 8, !tbaa !5
  %117 = load i32, ptr %13, align 4, !tbaa !9
  %118 = load i32, ptr %12, align 4, !tbaa !9
  %119 = add nsw i32 %117, %118
  %120 = sext i32 %119 to i64
  %121 = getelementptr inbounds double, ptr %116, i64 %120
  store double %115, ptr %121, align 8, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  br label %122

122:                                              ; preds = %94
  %123 = load i32, ptr %13, align 4, !tbaa !9
  %124 = add nsw i32 %123, 1
  store i32 %124, ptr %13, align 4, !tbaa !9
  br label %69, !llvm.loop !13

125:                                              ; preds = %73
  br label %131

126:                                              ; preds = %62, %56, %39
  %127 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cerr, ptr noundef @.str)
          to label %128 unwind label %90

128:                                              ; preds = %126
  %129 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %127, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %130 unwind label %90

130:                                              ; preds = %128
  br label %131

131:                                              ; preds = %130, %125
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  call void @_ZN12MTRand_int32D2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %5) #6
  ret void

132:                                              ; preds = %90, %86
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  br label %133

133:                                              ; preds = %132, %82
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  br label %134

134:                                              ; preds = %133, %78
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  br label %135

135:                                              ; preds = %134, %74
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  call void @_ZN12MTRand_int32D2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %5) #6
  br label %136

136:                                              ; preds = %135
  %137 = load ptr, ptr %7, align 8
  %138 = load i32, ptr %8, align 4
  %139 = insertvalue { ptr, i32 } poison, ptr %137, 0
  %140 = insertvalue { ptr, i32 } %139, i32 %138, 1
  resume { ptr, i32 } %140
}

; 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
declare dso_local void @_ZN12MTRand_int32D2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #2 align 2

declare noundef i32 @_ZN11TSPMutation10regionSizeEP13TSPIndividual(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef) #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN13TSPIndividual15getNumberCitiesEv(ptr noundef nonnull align 8 dereferenceable(64)) #4 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN14TSPIndividual214getDoubleRouteEv(ptr noundef nonnull align 8 dereferenceable(80)) #4 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #5

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #5

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress 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 = { 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 #3 = { "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 = { inlinehint 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 #5 = { inlinehint mustprogress 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 #6 = { 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 = distinct !{!13, !14}
!14 = !{!"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"

%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%class.MTRand_int32 = type { i8 }

@_ZSt4cerr = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [26 x i8], align 1

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN12MTRand_int32C2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZN12MTRand_int32clEv(ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #1 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN12TSPMutation215exchangeRegionsEP14TSPIndividual2(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef %1) local_unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca %class.MTRand_int32, align 1
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %3) #6
  call void @_ZN12MTRand_int32C2Ev(ptr noundef nonnull align 1 dereferenceable(1) %3)
  %4 = invoke noundef i32 @_ZN11TSPMutation10regionSizeEP13TSPIndividual(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef %1)
          to label %5 unwind label %41

5:                                                ; preds = %2
  %6 = call noundef i32 @_ZN13TSPIndividual15getNumberCitiesEv(ptr noundef nonnull align 8 dereferenceable(64) %1)
  %7 = call noundef ptr @_ZN14TSPIndividual214getDoubleRouteEv(ptr noundef nonnull align 8 dereferenceable(80) %1)
  %8 = invoke noundef i64 @_ZN12MTRand_int32clEv(ptr noundef nonnull align 1 dereferenceable(1) %3)
          to label %9 unwind label %43

9:                                                ; preds = %5
  %10 = shl nsw i32 %4, 1
  %11 = sub nsw i32 %6, %10
  %12 = sext i32 %11 to i64
  %13 = urem i64 %8, %12
  %14 = invoke noundef i64 @_ZN12MTRand_int32clEv(ptr noundef nonnull align 1 dereferenceable(1) %3)
          to label %15 unwind label %45

15:                                               ; preds = %9
  %16 = trunc i64 %13 to i32
  %17 = add nsw i32 %4, %16
  %18 = sub nsw i32 %11, %16
  %19 = sext i32 %18 to i64
  %20 = urem i64 %14, %19
  %21 = trunc i64 %20 to i32
  %22 = add i32 %17, %21
  %23 = add nsw i32 %10, %16
  %.not = icmp sgt i32 %23, %6
  %24 = add nsw i32 %22, %4
  %.not42 = icmp sgt i32 %24, %6
  %or.cond = select i1 %.not, i1 true, i1 %.not42
  %.not43 = icmp sgt i32 %17, %22
  %or.cond46 = select i1 %or.cond, i1 true, i1 %.not43
  br i1 %or.cond46, label %51, label %.preheader

.preheader:                                       ; preds = %15
  %25 = icmp sgt i32 %4, 0
  br i1 %25, label %.lr.ph.preheader, label %.loopexit

.lr.ph.preheader:                                 ; preds = %.preheader
  %sext = shl i64 %13, 32
  %26 = sext i32 %22 to i64
  %wide.trip.count = zext nneg i32 %4 to i64
  %27 = ashr exact i64 %sext, 29
  %invariant.gep = getelementptr i8, ptr %7, i64 %27
  %invariant.gep49 = getelementptr double, ptr %7, i64 %26
  %min.iters.check = icmp ult i32 %4, 12
  br i1 %min.iters.check, label %.lr.ph.preheader55, label %vector.memcheck

.lr.ph.preheader55:                               ; preds = %middle.block, %vector.memcheck, %.lr.ph.preheader
  %indvars.iv.ph = phi i64 [ 0, %vector.memcheck ], [ 0, %.lr.ph.preheader ], [ %n.vec, %middle.block ]
  %xtraiter = and i64 %wide.trip.count, 1
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.lr.ph.prol.loopexit, label %.lr.ph.prol

.lr.ph.prol:                                      ; preds = %.lr.ph.preheader55
  %gep.prol = getelementptr double, ptr %invariant.gep, i64 %indvars.iv.ph
  %28 = load double, ptr %gep.prol, align 8, !tbaa !5
  %gep50.prol = getelementptr double, ptr %invariant.gep49, i64 %indvars.iv.ph
  %29 = load double, ptr %gep50.prol, align 8, !tbaa !5
  store double %29, ptr %gep.prol, align 8, !tbaa !5
  store double %28, ptr %gep50.prol, align 8, !tbaa !5
  %indvars.iv.next.prol = or disjoint i64 %indvars.iv.ph, 1
  br label %.lr.ph.prol.loopexit

.lr.ph.prol.loopexit:                             ; preds = %.lr.ph.prol, %.lr.ph.preheader55
  %indvars.iv.unr = phi i64 [ %indvars.iv.ph, %.lr.ph.preheader55 ], [ %indvars.iv.next.prol, %.lr.ph.prol ]
  %30 = add nsw i64 %wide.trip.count, -1
  %31 = icmp eq i64 %indvars.iv.ph, %30
  br i1 %31, label %.loopexit, label %.lr.ph

vector.memcheck:                                  ; preds = %.lr.ph.preheader
  %32 = shl nuw nsw i64 %wide.trip.count, 3
  %33 = getelementptr i8, ptr %7, i64 %32
  %scevgep = getelementptr i8, ptr %33, i64 %27
  %34 = add nsw i64 %26, %wide.trip.count
  %35 = shl nsw i64 %34, 3
  %scevgep51 = getelementptr i8, ptr %7, i64 %35
  %bound0 = icmp ult ptr %invariant.gep, %scevgep51
  %bound1 = icmp ult ptr %invariant.gep49, %scevgep
  %found.conflict = and i1 %bound0, %bound1
  br i1 %found.conflict, label %.lr.ph.preheader55, label %vector.ph

vector.ph:                                        ; preds = %vector.memcheck
  %n.vec = and i64 %wide.trip.count, 2147483644
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %36 = getelementptr double, ptr %invariant.gep, i64 %index
  %37 = getelementptr i8, ptr %36, i64 16
  %wide.load = load <2 x double>, ptr %36, align 8, !tbaa !5, !alias.scope !9, !noalias !12
  %wide.load52 = load <2 x double>, ptr %37, align 8, !tbaa !5, !alias.scope !9, !noalias !12
  %38 = getelementptr double, ptr %invariant.gep49, i64 %index
  %39 = getelementptr i8, ptr %38, i64 16
  %wide.load53 = load <2 x double>, ptr %38, align 8, !tbaa !5, !alias.scope !12
  %wide.load54 = load <2 x double>, ptr %39, align 8, !tbaa !5, !alias.scope !12
  store <2 x double> %wide.load53, ptr %36, align 8, !tbaa !5, !alias.scope !9, !noalias !12
  store <2 x double> %wide.load54, ptr %37, align 8, !tbaa !5, !alias.scope !9, !noalias !12
  store <2 x double> %wide.load, ptr %38, align 8, !tbaa !5, !alias.scope !12
  store <2 x double> %wide.load52, ptr %39, align 8, !tbaa !5, !alias.scope !12
  %index.next = add nuw i64 %index, 4
  %40 = icmp eq i64 %index.next, %n.vec
  br i1 %40, label %middle.block, label %vector.body, !llvm.loop !14

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %n.vec, %wide.trip.count
  br i1 %cmp.n, label %.loopexit, label %.lr.ph.preheader55

41:                                               ; preds = %2
  %42 = landingpad { ptr, i32 }
          cleanup
  br label %55

43:                                               ; preds = %5
  %44 = landingpad { ptr, i32 }
          cleanup
  br label %55

45:                                               ; preds = %53, %51, %9
  %46 = landingpad { ptr, i32 }
          cleanup
  br label %55

.lr.ph:                                           ; preds = %.lr.ph.prol.loopexit, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next.1, %.lr.ph ], [ %indvars.iv.unr, %.lr.ph.prol.loopexit ]
  %gep = getelementptr double, ptr %invariant.gep, i64 %indvars.iv
  %47 = load double, ptr %gep, align 8, !tbaa !5
  %gep50 = getelementptr double, ptr %invariant.gep49, i64 %indvars.iv
  %48 = load double, ptr %gep50, align 8, !tbaa !5
  store double %48, ptr %gep, align 8, !tbaa !5
  store double %47, ptr %gep50, align 8, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %gep.1 = getelementptr double, ptr %invariant.gep, i64 %indvars.iv.next
  %49 = load double, ptr %gep.1, align 8, !tbaa !5
  %gep50.1 = getelementptr double, ptr %invariant.gep49, i64 %indvars.iv.next
  %50 = load double, ptr %gep50.1, align 8, !tbaa !5
  store double %50, ptr %gep.1, align 8, !tbaa !5
  store double %49, ptr %gep50.1, align 8, !tbaa !5
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
  %exitcond.not.1 = icmp eq i64 %indvars.iv.next.1, %wide.trip.count
  br i1 %exitcond.not.1, label %.loopexit, label %.lr.ph, !llvm.loop !18

51:                                               ; preds = %15
  %52 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cerr, ptr noundef nonnull @.str)
          to label %53 unwind label %45

53:                                               ; preds = %51
  %54 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %52, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %.loopexit unwind label %45

.loopexit:                                        ; preds = %.lr.ph.prol.loopexit, %.lr.ph, %middle.block, %.preheader, %53
  call void @_ZN12MTRand_int32D2Ev(ptr noundef nonnull align 1 dereferenceable(1) %3) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %3) #6
  ret void

55:                                               ; preds = %43, %45, %41
  %.pn.pn = phi { ptr, i32 } [ %42, %41 ], [ %46, %45 ], [ %44, %43 ]
  call void @_ZN12MTRand_int32D2Ev(ptr noundef nonnull align 1 dereferenceable(1) %3) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %3) #6
  resume { ptr, i32 } %.pn.pn
}

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN12MTRand_int32D2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #2 align 2

declare noundef i32 @_ZN11TSPMutation10regionSizeEP13TSPIndividual(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef) local_unnamed_addr #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN13TSPIndividual15getNumberCitiesEv(ptr noundef nonnull align 8 dereferenceable(64)) local_unnamed_addr #4 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN14TSPIndividual214getDoubleRouteEv(ptr noundef nonnull align 8 dereferenceable(80)) local_unnamed_addr #4 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #5

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #5

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress 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 = { 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 #3 = { "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 = { inlinehint 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 #5 = { inlinehint mustprogress 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 #6 = { 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 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10}
!10 = distinct !{!10, !11}
!11 = distinct !{!11, !"LVerDomain"}
!12 = !{!13}
!13 = distinct !{!13, !11}
!14 = distinct !{!14, !15, !16, !17}
!15 = !{!"llvm.loop.mustprogress"}
!16 = !{!"llvm.loop.isvectorized", i32 1}
!17 = !{!"llvm.loop.unroll.runtime.disable"}
!18 = distinct !{!18, !15, !16}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,ReassociatePass,SROAPass,SimplifyCFGPass