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

; 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.MTRand = type { i8 }
%class.TSPMutation = type { %class.Mutation, i32, ptr, i32, i32 }
%class.Mutation = type { ptr }

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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) #1

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN11TSPMutation10regionSizeEP13TSPIndividual(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef %1) #2 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca double, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca %class.MTRand, align 1
  %11 = alloca double, align 8
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  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 4, ptr %5) #7
  %16 = getelementptr inbounds %class.TSPMutation, ptr %15, i32 0, i32 1
  %17 = load i32, ptr %16, align 8, !tbaa !9
  %18 = mul nsw i32 %17, 5
  %19 = sdiv i32 %18, 12
  store i32 %19, ptr %5, align 4, !tbaa !13
  %20 = getelementptr inbounds %class.TSPMutation, ptr %15, i32 0, i32 1
  %21 = load i32, ptr %20, align 8, !tbaa !9
  %22 = load ptr, ptr %4, align 8, !tbaa !5
  %23 = call noundef i32 @_ZN13TSPIndividual15getNumberCitiesEv(ptr noundef nonnull align 8 dereferenceable(64) %22)
  %24 = icmp ne i32 %21, %23
  br i1 %24, label %25, label %125

25:                                               ; preds = %2
  %26 = getelementptr inbounds %class.TSPMutation, ptr %15, i32 0, i32 1
  %27 = load i32, ptr %26, align 8, !tbaa !9
  %28 = icmp sgt i32 %27, 0
  br i1 %28, label %29, label %35

29:                                               ; preds = %25
  %30 = getelementptr inbounds %class.TSPMutation, ptr %15, i32 0, i32 2
  %31 = load ptr, ptr %30, align 8, !tbaa !14
  %32 = icmp eq ptr %31, null
  br i1 %32, label %34, label %33

33:                                               ; preds = %29
  call void @_ZdlPvm(ptr noundef %31, i64 noundef 8) #8
  br label %34

34:                                               ; preds = %33, %29
  br label %35

35:                                               ; preds = %34, %25
  %36 = load ptr, ptr %4, align 8, !tbaa !5
  %37 = call noundef i32 @_ZN13TSPIndividual15getNumberCitiesEv(ptr noundef nonnull align 8 dereferenceable(64) %36)
  %38 = getelementptr inbounds %class.TSPMutation, ptr %15, i32 0, i32 1
  store i32 %37, ptr %38, align 8, !tbaa !9
  %39 = getelementptr inbounds %class.TSPMutation, ptr %15, i32 0, i32 1
  %40 = load i32, ptr %39, align 8, !tbaa !9
  %41 = mul nsw i32 %40, 5
  %42 = sdiv i32 %41, 12
  store i32 %42, ptr %5, align 4, !tbaa !13
  %43 = load i32, ptr %5, align 4, !tbaa !13
  %44 = sext i32 %43 to i64
  %45 = call { i64, i1 } @llvm.umul.with.overflow.i64(i64 %44, i64 8)
  %46 = extractvalue { i64, i1 } %45, 1
  %47 = extractvalue { i64, i1 } %45, 0
  %48 = select i1 %46, i64 -1, i64 %47
  %49 = call noalias noundef nonnull ptr @_Znam(i64 noundef %48) #9
  %50 = getelementptr inbounds %class.TSPMutation, ptr %15, i32 0, i32 2
  store ptr %49, ptr %50, align 8, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #7
  store double 0.000000e+00, ptr %6, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #7
  store i32 0, ptr %7, align 4, !tbaa !13
  br label %51

51:                                               ; preds = %74, %35
  %52 = load i32, ptr %7, align 4, !tbaa !13
  %53 = load i32, ptr %5, align 4, !tbaa !13
  %54 = icmp slt i32 %52, %53
  br i1 %54, label %56, label %55

55:                                               ; preds = %51
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  br label %77

56:                                               ; preds = %51
  %57 = load i32, ptr %7, align 4, !tbaa !13
  %58 = add nsw i32 %57, 1
  %59 = sitofp i32 %58 to double
  %60 = fdiv double 1.000000e+00, %59
  %61 = getelementptr inbounds %class.TSPMutation, ptr %15, i32 0, i32 2
  %62 = load ptr, ptr %61, align 8, !tbaa !14
  %63 = load i32, ptr %7, align 4, !tbaa !13
  %64 = sext i32 %63 to i64
  %65 = getelementptr inbounds double, ptr %62, i64 %64
  store double %60, ptr %65, align 8, !tbaa !15
  %66 = getelementptr inbounds %class.TSPMutation, ptr %15, i32 0, i32 2
  %67 = load ptr, ptr %66, align 8, !tbaa !14
  %68 = load i32, ptr %7, align 4, !tbaa !13
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds double, ptr %67, i64 %69
  %71 = load double, ptr %70, align 8, !tbaa !15
  %72 = load double, ptr %6, align 8, !tbaa !15
  %73 = fadd double %72, %71
  store double %73, ptr %6, align 8, !tbaa !15
  br label %74

74:                                               ; preds = %56
  %75 = load i32, ptr %7, align 4, !tbaa !13
  %76 = add nsw i32 %75, 1
  store i32 %76, ptr %7, align 4, !tbaa !13
  br label %51, !llvm.loop !17

77:                                               ; preds = %55
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #7
  store i32 0, ptr %8, align 4, !tbaa !13
  br label %78

78:                                               ; preds = %92, %77
  %79 = load i32, ptr %8, align 4, !tbaa !13
  %80 = load i32, ptr %5, align 4, !tbaa !13
  %81 = icmp slt i32 %79, %80
  br i1 %81, label %83, label %82

82:                                               ; preds = %78
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  br label %95

83:                                               ; preds = %78
  %84 = load double, ptr %6, align 8, !tbaa !15
  %85 = getelementptr inbounds %class.TSPMutation, ptr %15, i32 0, i32 2
  %86 = load ptr, ptr %85, align 8, !tbaa !14
  %87 = load i32, ptr %8, align 4, !tbaa !13
  %88 = sext i32 %87 to i64
  %89 = getelementptr inbounds double, ptr %86, i64 %88
  %90 = load double, ptr %89, align 8, !tbaa !15
  %91 = fdiv double %90, %84
  store double %91, ptr %89, align 8, !tbaa !15
  br label %92

92:                                               ; preds = %83
  %93 = load i32, ptr %8, align 4, !tbaa !13
  %94 = add nsw i32 %93, 1
  store i32 %94, ptr %8, align 4, !tbaa !13
  br label %78, !llvm.loop !19

95:                                               ; preds = %82
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #7
  store i32 1, ptr %9, align 4, !tbaa !13
  br label %96

96:                                               ; preds = %121, %95
  %97 = load i32, ptr %9, align 4, !tbaa !13
  %98 = load i32, ptr %5, align 4, !tbaa !13
  %99 = icmp slt i32 %97, %98
  br i1 %99, label %101, label %100

100:                                              ; preds = %96
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  br label %124

101:                                              ; preds = %96
  %102 = getelementptr inbounds %class.TSPMutation, ptr %15, i32 0, i32 2
  %103 = load ptr, ptr %102, align 8, !tbaa !14
  %104 = load i32, ptr %9, align 4, !tbaa !13
  %105 = sext i32 %104 to i64
  %106 = getelementptr inbounds double, ptr %103, i64 %105
  %107 = load double, ptr %106, align 8, !tbaa !15
  %108 = getelementptr inbounds %class.TSPMutation, ptr %15, i32 0, i32 2
  %109 = load ptr, ptr %108, align 8, !tbaa !14
  %110 = load i32, ptr %9, align 4, !tbaa !13
  %111 = sub nsw i32 %110, 1
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds double, ptr %109, i64 %112
  %114 = load double, ptr %113, align 8, !tbaa !15
  %115 = fadd double %107, %114
  %116 = getelementptr inbounds %class.TSPMutation, ptr %15, i32 0, i32 2
  %117 = load ptr, ptr %116, align 8, !tbaa !14
  %118 = load i32, ptr %9, align 4, !tbaa !13
  %119 = sext i32 %118 to i64
  %120 = getelementptr inbounds double, ptr %117, i64 %119
  store double %115, ptr %120, align 8, !tbaa !15
  br label %121

121:                                              ; preds = %101
  %122 = load i32, ptr %9, align 4, !tbaa !13
  %123 = add nsw i32 %122, 1
  store i32 %123, ptr %9, align 4, !tbaa !13
  br label %96, !llvm.loop !20

124:                                              ; preds = %100
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #7
  br label %125

125:                                              ; preds = %124, %2
  call void @llvm.lifetime.start.p0(i64 1, ptr %10) #7
  call void @_ZN6MTRandC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %10)
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #7
  %126 = invoke noundef double @_ZN6MTRandclEv(ptr noundef nonnull align 1 dereferenceable(1) %10)
          to label %127 unwind label %147

127:                                              ; preds = %125
  store double %126, ptr %11, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #7
  store i32 1, ptr %14, align 4, !tbaa !13
  br label %128

128:                                              ; preds = %144, %127
  %129 = load i32, ptr %14, align 4, !tbaa !13
  %130 = load i32, ptr %5, align 4, !tbaa !13
  %131 = icmp slt i32 %129, %130
  br i1 %131, label %132, label %142

132:                                              ; preds = %128
  %133 = getelementptr inbounds %class.TSPMutation, ptr %15, i32 0, i32 2
  %134 = load ptr, ptr %133, align 8, !tbaa !14
  %135 = load i32, ptr %14, align 4, !tbaa !13
  %136 = sub nsw i32 %135, 1
  %137 = sext i32 %136 to i64
  %138 = getelementptr inbounds double, ptr %134, i64 %137
  %139 = load double, ptr %138, align 8, !tbaa !15
  %140 = load double, ptr %11, align 8, !tbaa !15
  %141 = fcmp olt double %139, %140
  br label %142

142:                                              ; preds = %132, %128
  %143 = phi i1 [ false, %128 ], [ %141, %132 ]
  br i1 %143, label %144, label %151

144:                                              ; preds = %142
  %145 = load i32, ptr %14, align 4, !tbaa !13
  %146 = add nsw i32 %145, 1
  store i32 %146, ptr %14, align 4, !tbaa !13
  br label %128, !llvm.loop !21

147:                                              ; preds = %125
  %148 = landingpad { ptr, i32 }
          cleanup
  %149 = extractvalue { ptr, i32 } %148, 0
  store ptr %149, ptr %12, align 8
  %150 = extractvalue { ptr, i32 } %148, 1
  store i32 %150, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  call void @_ZN12MTRand_int32D2Ev(ptr noundef nonnull align 1 dereferenceable(1) %10) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #7
  br label %153

151:                                              ; preds = %142
  %152 = load i32, ptr %14, align 4, !tbaa !13
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  call void @_ZN12MTRand_int32D2Ev(ptr noundef nonnull align 1 dereferenceable(1) %10) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #7
  ret i32 %152

153:                                              ; preds = %147
  %154 = load ptr, ptr %12, align 8
  %155 = load i32, ptr %13, align 4
  %156 = insertvalue { ptr, i32 } poison, ptr %154, 0
  %157 = insertvalue { ptr, i32 } %156, i32 %155, 1
  resume { ptr, i32 } %157
}

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare { i64, i1 } @llvm.umul.with.overflow.i64(i64, i64) #4

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znam(i64 noundef) #5

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

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nobuiltin 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 #2 = { 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 #3 = { 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 #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nobuiltin allocsize(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 = { 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 #7 = { nounwind }
attributes #8 = { builtin nounwind }
attributes #9 = { builtin allocsize(0) }

!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, !12, i64 8}
!10 = !{!"_ZTS11TSPMutation", !11, i64 0, !12, i64 8, !6, i64 16, !12, i64 24, !12, i64 28}
!11 = !{!"_ZTS8Mutation"}
!12 = !{!"int", !7, i64 0}
!13 = !{!12, !12, i64 0}
!14 = !{!10, !6, i64 16}
!15 = !{!16, !16, i64 0}
!16 = !{!"double", !7, i64 0}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}
!19 = distinct !{!19, !18}
!20 = distinct !{!20, !18}
!21 = distinct !{!21, !18}


; 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.MTRand = type { i8 }

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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN11TSPMutation10regionSizeEP13TSPIndividual(ptr nocapture noundef nonnull align 8 dereferenceable(32) %0, ptr noundef nonnull %1) local_unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca %class.MTRand, align 1
  %4 = getelementptr inbounds i8, ptr %0, i64 8
  %5 = load i32, ptr %4, align 8, !tbaa !5
  %6 = mul nsw i32 %5, 5
  %7 = sdiv i32 %6, 12
  %8 = tail call noundef i32 @_ZN13TSPIndividual15getNumberCitiesEv(ptr noundef nonnull align 8 dereferenceable(64) %1)
  %.not = icmp eq i32 %5, %8
  br i1 %.not, label %.loopexit, label %9

9:                                                ; preds = %2
  %10 = load i32, ptr %4, align 8, !tbaa !5
  %11 = icmp sgt i32 %10, 0
  br i1 %11, label %12, label %17

12:                                               ; preds = %9
  %13 = getelementptr inbounds i8, ptr %0, i64 16
  %14 = load ptr, ptr %13, align 8, !tbaa !12
  %15 = icmp eq ptr %14, null
  br i1 %15, label %17, label %16

16:                                               ; preds = %12
  tail call void @_ZdlPvm(ptr noundef nonnull %14, i64 noundef 8) #7
  br label %17

17:                                               ; preds = %12, %16, %9
  %18 = tail call noundef i32 @_ZN13TSPIndividual15getNumberCitiesEv(ptr noundef nonnull align 8 dereferenceable(64) %1)
  store i32 %18, ptr %4, align 8, !tbaa !5
  %19 = mul nsw i32 %18, 5
  %20 = sdiv i32 %19, 12
  %21 = sext i32 %20 to i64
  %22 = icmp slt i32 %18, -2
  %23 = shl nsw i64 %21, 3
  %24 = select i1 %22, i64 -1, i64 %23
  %25 = tail call noalias noundef nonnull ptr @_Znam(i64 noundef %24) #8
  %26 = getelementptr inbounds i8, ptr %0, i64 16
  store ptr %25, ptr %26, align 8, !tbaa !12
  %27 = icmp sgt i32 %18, 2
  br i1 %27, label %.lr.ph.preheader, label %.loopexit

.lr.ph.preheader:                                 ; preds = %17
  %smax = tail call i32 @llvm.smax.i32(i32 %20, i32 1)
  %wide.trip.count = zext nneg i32 %smax to i64
  %xtraiter = and i64 %wide.trip.count, 3
  %28 = icmp slt i32 %18, 10
  br i1 %28, label %.preheader37.unr-lcssa, label %.lr.ph.preheader.new

.lr.ph.preheader.new:                             ; preds = %.lr.ph.preheader
  %unroll_iter = and i64 %wide.trip.count, 268435452
  br label %.lr.ph

.preheader37.unr-lcssa:                           ; preds = %.lr.ph, %.lr.ph.preheader
  %.lcssa.ph = phi double [ poison, %.lr.ph.preheader ], [ %56, %.lr.ph ]
  %indvars.iv.unr = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next.3, %.lr.ph ]
  %.03039.unr = phi double [ 0.000000e+00, %.lr.ph.preheader ], [ %56, %.lr.ph ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.preheader37, label %.lr.ph.epil

.lr.ph.epil:                                      ; preds = %.preheader37.unr-lcssa, %.lr.ph.epil
  %indvars.iv.epil = phi i64 [ %indvars.iv.next.epil, %.lr.ph.epil ], [ %indvars.iv.unr, %.preheader37.unr-lcssa ]
  %.03039.epil = phi double [ %33, %.lr.ph.epil ], [ %.03039.unr, %.preheader37.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.lr.ph.epil ], [ 0, %.preheader37.unr-lcssa ]
  %indvars.iv.next.epil = add nuw nsw i64 %indvars.iv.epil, 1
  %29 = trunc nuw nsw i64 %indvars.iv.next.epil to i32
  %30 = uitofp nneg i32 %29 to double
  %31 = fdiv double 1.000000e+00, %30
  %32 = getelementptr inbounds double, ptr %25, i64 %indvars.iv.epil
  store double %31, ptr %32, align 8, !tbaa !13
  %33 = fadd double %.03039.epil, %31
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
  br i1 %epil.iter.cmp.not, label %.preheader37, label %.lr.ph.epil, !llvm.loop !15

.preheader37:                                     ; preds = %.lr.ph.epil, %.preheader37.unr-lcssa
  %.lcssa = phi double [ %.lcssa.ph, %.preheader37.unr-lcssa ], [ %33, %.lr.ph.epil ]
  br i1 %27, label %.lr.ph41.preheader, label %.loopexit

.lr.ph41.preheader:                               ; preds = %.preheader37
  %smax53 = tail call i32 @llvm.smax.i32(i32 %20, i32 1)
  %wide.trip.count54 = zext nneg i32 %smax53 to i64
  %min.iters.check = icmp slt i32 %18, 5
  br i1 %min.iters.check, label %.lr.ph41.preheader72, label %vector.ph

.lr.ph41.preheader72:                             ; preds = %middle.block, %.lr.ph41.preheader
  %indvars.iv50.ph = phi i64 [ 0, %.lr.ph41.preheader ], [ %n.vec, %middle.block ]
  br label %.lr.ph41

vector.ph:                                        ; preds = %.lr.ph41.preheader
  %n.vec = and i64 %wide.trip.count, 268435454
  %broadcast.splatinsert = insertelement <2 x double> poison, double %.lcssa, i64 0
  %broadcast.splat = shufflevector <2 x double> %broadcast.splatinsert, <2 x double> poison, <2 x i32> zeroinitializer
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %34 = getelementptr inbounds double, ptr %25, i64 %index
  %wide.load = load <2 x double>, ptr %34, align 8, !tbaa !13
  %35 = fdiv <2 x double> %wide.load, %broadcast.splat
  store <2 x double> %35, ptr %34, align 8, !tbaa !13
  %index.next = add nuw i64 %index, 2
  %36 = icmp eq i64 %index.next, %n.vec
  br i1 %36, label %middle.block, label %vector.body, !llvm.loop !17

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

.lr.ph:                                           ; preds = %.lr.ph, %.lr.ph.preheader.new
  %indvars.iv = phi i64 [ 0, %.lr.ph.preheader.new ], [ %indvars.iv.next.3, %.lr.ph ]
  %.03039 = phi double [ 0.000000e+00, %.lr.ph.preheader.new ], [ %56, %.lr.ph ]
  %niter = phi i64 [ 0, %.lr.ph.preheader.new ], [ %niter.next.3, %.lr.ph ]
  %indvars.iv.next = or disjoint i64 %indvars.iv, 1
  %37 = trunc nuw nsw i64 %indvars.iv.next to i32
  %38 = uitofp nneg i32 %37 to double
  %39 = fdiv double 1.000000e+00, %38
  %40 = getelementptr inbounds double, ptr %25, i64 %indvars.iv
  store double %39, ptr %40, align 8, !tbaa !13
  %41 = fadd double %.03039, %39
  %indvars.iv.next.1 = or disjoint i64 %indvars.iv, 2
  %42 = trunc nuw nsw i64 %indvars.iv.next.1 to i32
  %43 = uitofp nneg i32 %42 to double
  %44 = fdiv double 1.000000e+00, %43
  %45 = getelementptr inbounds double, ptr %25, i64 %indvars.iv.next
  store double %44, ptr %45, align 8, !tbaa !13
  %46 = fadd double %41, %44
  %indvars.iv.next.2 = or disjoint i64 %indvars.iv, 3
  %47 = trunc nuw nsw i64 %indvars.iv.next.2 to i32
  %48 = uitofp nneg i32 %47 to double
  %49 = fdiv double 1.000000e+00, %48
  %50 = getelementptr inbounds double, ptr %25, i64 %indvars.iv.next.1
  store double %49, ptr %50, align 8, !tbaa !13
  %51 = fadd double %46, %49
  %indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4
  %52 = trunc nuw nsw i64 %indvars.iv.next.3 to i32
  %53 = uitofp nneg i32 %52 to double
  %54 = fdiv double 1.000000e+00, %53
  %55 = getelementptr inbounds double, ptr %25, i64 %indvars.iv.next.2
  store double %54, ptr %55, align 8, !tbaa !13
  %56 = fadd double %51, %54
  %niter.next.3 = add i64 %niter, 4
  %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3, label %.preheader37.unr-lcssa, label %.lr.ph, !llvm.loop !21

.preheader36:                                     ; preds = %.lr.ph41, %middle.block
  %57 = icmp sgt i32 %18, 4
  br i1 %57, label %.lr.ph43.preheader, label %.loopexit

.lr.ph43.preheader:                               ; preds = %.preheader36
  %smax59 = tail call i32 @llvm.smax.i32(i32 %20, i32 2)
  %wide.trip.count60 = zext nneg i32 %smax59 to i64
  %load_initial = load double, ptr %25, align 8
  %58 = add nsw i64 %wide.trip.count60, -1
  %59 = add nsw i64 %wide.trip.count60, -2
  %xtraiter74 = and i64 %58, 3
  %60 = icmp ult i64 %59, 3
  br i1 %60, label %.loopexit.loopexit.unr-lcssa, label %.lr.ph43.preheader.new

.lr.ph43.preheader.new:                           ; preds = %.lr.ph43.preheader
  %unroll_iter77 = and i64 %58, -4
  %invariant.gep83 = getelementptr inbounds i8, ptr %25, i64 8
  %invariant.gep85 = getelementptr inbounds i8, ptr %25, i64 16
  %invariant.gep87 = getelementptr inbounds i8, ptr %25, i64 24
  br label %.lr.ph43

.lr.ph41:                                         ; preds = %.lr.ph41.preheader72, %.lr.ph41
  %indvars.iv50 = phi i64 [ %indvars.iv.next51, %.lr.ph41 ], [ %indvars.iv50.ph, %.lr.ph41.preheader72 ]
  %61 = getelementptr inbounds double, ptr %25, i64 %indvars.iv50
  %62 = load double, ptr %61, align 8, !tbaa !13
  %63 = fdiv double %62, %.lcssa
  store double %63, ptr %61, align 8, !tbaa !13
  %indvars.iv.next51 = add nuw nsw i64 %indvars.iv50, 1
  %exitcond55.not = icmp eq i64 %indvars.iv.next51, %wide.trip.count54
  br i1 %exitcond55.not, label %.preheader36, label %.lr.ph41, !llvm.loop !22

.lr.ph43:                                         ; preds = %.lr.ph43, %.lr.ph43.preheader.new
  %store_forwarded = phi double [ %load_initial, %.lr.ph43.preheader.new ], [ %72, %.lr.ph43 ]
  %indvars.iv56 = phi i64 [ 1, %.lr.ph43.preheader.new ], [ %indvars.iv.next57.3, %.lr.ph43 ]
  %niter78 = phi i64 [ 0, %.lr.ph43.preheader.new ], [ %niter78.next.3, %.lr.ph43 ]
  %64 = getelementptr inbounds double, ptr %25, i64 %indvars.iv56
  %65 = load double, ptr %64, align 8, !tbaa !13
  %66 = fadd double %65, %store_forwarded
  store double %66, ptr %64, align 8, !tbaa !13
  %gep84 = getelementptr inbounds double, ptr %invariant.gep83, i64 %indvars.iv56
  %67 = load double, ptr %gep84, align 8, !tbaa !13
  %68 = fadd double %67, %66
  store double %68, ptr %gep84, align 8, !tbaa !13
  %gep86 = getelementptr inbounds double, ptr %invariant.gep85, i64 %indvars.iv56
  %69 = load double, ptr %gep86, align 8, !tbaa !13
  %70 = fadd double %69, %68
  store double %70, ptr %gep86, align 8, !tbaa !13
  %gep88 = getelementptr inbounds double, ptr %invariant.gep87, i64 %indvars.iv56
  %71 = load double, ptr %gep88, align 8, !tbaa !13
  %72 = fadd double %71, %70
  store double %72, ptr %gep88, align 8, !tbaa !13
  %indvars.iv.next57.3 = add nuw nsw i64 %indvars.iv56, 4
  %niter78.next.3 = add i64 %niter78, 4
  %niter78.ncmp.3 = icmp eq i64 %niter78.next.3, %unroll_iter77
  br i1 %niter78.ncmp.3, label %.loopexit.loopexit.unr-lcssa, label %.lr.ph43, !llvm.loop !23

.loopexit.loopexit.unr-lcssa:                     ; preds = %.lr.ph43, %.lr.ph43.preheader
  %store_forwarded.unr = phi double [ %load_initial, %.lr.ph43.preheader ], [ %72, %.lr.ph43 ]
  %indvars.iv56.unr = phi i64 [ 1, %.lr.ph43.preheader ], [ %indvars.iv.next57.3, %.lr.ph43 ]
  %lcmp.mod76.not = icmp eq i64 %xtraiter74, 0
  br i1 %lcmp.mod76.not, label %.loopexit, label %.lr.ph43.epil

.lr.ph43.epil:                                    ; preds = %.loopexit.loopexit.unr-lcssa, %.lr.ph43.epil
  %store_forwarded.epil = phi double [ %75, %.lr.ph43.epil ], [ %store_forwarded.unr, %.loopexit.loopexit.unr-lcssa ]
  %indvars.iv56.epil = phi i64 [ %indvars.iv.next57.epil, %.lr.ph43.epil ], [ %indvars.iv56.unr, %.loopexit.loopexit.unr-lcssa ]
  %epil.iter75 = phi i64 [ %epil.iter75.next, %.lr.ph43.epil ], [ 0, %.loopexit.loopexit.unr-lcssa ]
  %73 = getelementptr inbounds double, ptr %25, i64 %indvars.iv56.epil
  %74 = load double, ptr %73, align 8, !tbaa !13
  %75 = fadd double %74, %store_forwarded.epil
  store double %75, ptr %73, align 8, !tbaa !13
  %indvars.iv.next57.epil = add nuw nsw i64 %indvars.iv56.epil, 1
  %epil.iter75.next = add i64 %epil.iter75, 1
  %epil.iter75.cmp.not = icmp eq i64 %epil.iter75.next, %xtraiter74
  br i1 %epil.iter75.cmp.not, label %.loopexit, label %.lr.ph43.epil, !llvm.loop !24

.loopexit:                                        ; preds = %.loopexit.loopexit.unr-lcssa, %.lr.ph43.epil, %17, %.preheader37, %.preheader36, %2
  %.029 = phi i32 [ %7, %2 ], [ %20, %.preheader36 ], [ %20, %.preheader37 ], [ %20, %17 ], [ %20, %.lr.ph43.epil ], [ %20, %.loopexit.loopexit.unr-lcssa ]
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %3) #9
  call void @_ZN6MTRandC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %3)
  %76 = invoke noundef double @_ZN6MTRandclEv(ptr noundef nonnull align 1 dereferenceable(1) %3)
          to label %.preheader unwind label %84

.preheader:                                       ; preds = %.loopexit
  %77 = icmp sgt i32 %.029, 1
  br i1 %77, label %.lr.ph45, label %.critedge

.lr.ph45:                                         ; preds = %.preheader
  %78 = getelementptr inbounds i8, ptr %0, i64 16
  %79 = load ptr, ptr %78, align 8, !tbaa !12
  %invariant.gep = getelementptr i8, ptr %79, i64 -8
  %wide.trip.count65 = zext nneg i32 %.029 to i64
  br label %80

80:                                               ; preds = %.lr.ph45, %83
  %indvars.iv62 = phi i64 [ 1, %.lr.ph45 ], [ %indvars.iv.next63, %83 ]
  %gep = getelementptr double, ptr %invariant.gep, i64 %indvars.iv62
  %81 = load double, ptr %gep, align 8, !tbaa !13
  %82 = fcmp olt double %81, %76
  br i1 %82, label %83, label %.critedge.loopexit.split.loop.exit68

83:                                               ; preds = %80
  %indvars.iv.next63 = add nuw nsw i64 %indvars.iv62, 1
  %exitcond66.not = icmp eq i64 %indvars.iv.next63, %wide.trip.count65
  br i1 %exitcond66.not, label %.critedge, label %80, !llvm.loop !25

84:                                               ; preds = %.loopexit
  %85 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN12MTRand_int32D2Ev(ptr noundef nonnull align 1 dereferenceable(1) %3) #9
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %3) #9
  resume { ptr, i32 } %85

.critedge.loopexit.split.loop.exit68:             ; preds = %80
  %86 = trunc nuw nsw i64 %indvars.iv62 to i32
  br label %.critedge

.critedge:                                        ; preds = %83, %.critedge.loopexit.split.loop.exit68, %.preheader
  %.0.lcssa = phi i32 [ 1, %.preheader ], [ %86, %.critedge.loopexit.split.loop.exit68 ], [ %.029, %83 ]
  call void @_ZN12MTRand_int32D2Ev(ptr noundef nonnull align 1 dereferenceable(1) %3) #9
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %3) #9
  ret i32 %.0.lcssa
}

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

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znam(i64 noundef) local_unnamed_addr #4

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

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

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #6

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nobuiltin 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 #2 = { 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 #3 = { 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 #4 = { nobuiltin allocsize(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 = { 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 #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #7 = { builtin nounwind }
attributes #8 = { builtin allocsize(0) }
attributes #9 = { 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 8}
!6 = !{!"_ZTS11TSPMutation", !7, i64 0, !8, i64 8, !11, i64 16, !8, i64 24, !8, i64 28}
!7 = !{!"_ZTS8Mutation"}
!8 = !{!"int", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = !{!"any pointer", !9, i64 0}
!12 = !{!6, !11, i64 16}
!13 = !{!14, !14, i64 0}
!14 = !{!"double", !9, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.unroll.disable"}
!17 = distinct !{!17, !18, !19, !20}
!18 = !{!"llvm.loop.mustprogress"}
!19 = !{!"llvm.loop.isvectorized", i32 1}
!20 = !{!"llvm.loop.unroll.runtime.disable"}
!21 = distinct !{!21, !18}
!22 = distinct !{!22, !18, !20, !19}
!23 = distinct !{!23, !18}
!24 = distinct !{!24, !16}
!25 = distinct !{!25, !18}


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