; LLVM IR from yourtion/LearningMasteringAlgorithms-C :: source (shortest)

; 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"

%struct.Graph_ = type { i32, i32, ptr, ptr, %struct.List_ }
%struct.List_ = type { i32, ptr, ptr, ptr, ptr }
%struct.ListElmt_ = type { ptr, ptr }
%struct.AdjList_ = type { ptr, %struct.List_ }
%struct.PathVertex_ = type { ptr, double, i32, double, ptr }

; Function Attrs: nounwind uwtable
define dso_local i32 @shortest(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3) #0 {
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca double, align 8
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  store ptr %0, ptr %6, align 8, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !5
  store ptr %2, ptr %8, align 8, !tbaa !5
  store ptr %3, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #3
  store ptr null, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #3
  store i32 0, ptr %16, align 4, !tbaa !9
  %19 = load ptr, ptr %6, align 8, !tbaa !5
  %20 = getelementptr inbounds %struct.Graph_, ptr %19, i32 0, i32 4
  %21 = getelementptr inbounds %struct.List_, ptr %20, i32 0, i32 3
  %22 = load ptr, ptr %21, align 8, !tbaa !11
  store ptr %22, ptr %13, align 8, !tbaa !5
  br label %23

23:                                               ; preds = %52, %4
  %24 = load ptr, ptr %13, align 8, !tbaa !5
  %25 = icmp ne ptr %24, null
  br i1 %25, label %26, label %56

26:                                               ; preds = %23
  %27 = load ptr, ptr %13, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct.ListElmt_, ptr %27, i32 0, i32 0
  %29 = load ptr, ptr %28, align 8, !tbaa !14
  %30 = getelementptr inbounds %struct.AdjList_, ptr %29, i32 0, i32 0
  %31 = load ptr, ptr %30, align 8, !tbaa !16
  store ptr %31, ptr %11, align 8, !tbaa !5
  %32 = load ptr, ptr %9, align 8, !tbaa !5
  %33 = load ptr, ptr %11, align 8, !tbaa !5
  %34 = load ptr, ptr %7, align 8, !tbaa !5
  %35 = call i32 %32(ptr noundef %33, ptr noundef %34)
  %36 = icmp ne i32 %35, 0
  br i1 %36, label %37, label %44

37:                                               ; preds = %26
  %38 = load ptr, ptr %11, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct.PathVertex_, ptr %38, i32 0, i32 2
  store i32 0, ptr %39, align 8, !tbaa !18
  %40 = load ptr, ptr %11, align 8, !tbaa !5
  %41 = getelementptr inbounds %struct.PathVertex_, ptr %40, i32 0, i32 3
  store double 0.000000e+00, ptr %41, align 8, !tbaa !21
  %42 = load ptr, ptr %11, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct.PathVertex_, ptr %42, i32 0, i32 4
  store ptr null, ptr %43, align 8, !tbaa !22
  store i32 1, ptr %16, align 4, !tbaa !9
  br label %51

44:                                               ; preds = %26
  %45 = load ptr, ptr %11, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct.PathVertex_, ptr %45, i32 0, i32 2
  store i32 0, ptr %46, align 8, !tbaa !18
  %47 = load ptr, ptr %11, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct.PathVertex_, ptr %47, i32 0, i32 3
  store double 0x7FEFFFFFFFFFFFFF, ptr %48, align 8, !tbaa !21
  %49 = load ptr, ptr %11, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct.PathVertex_, ptr %49, i32 0, i32 4
  store ptr null, ptr %50, align 8, !tbaa !22
  br label %51

51:                                               ; preds = %44, %37
  br label %52

52:                                               ; preds = %51
  %53 = load ptr, ptr %13, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct.ListElmt_, ptr %53, i32 0, i32 1
  %55 = load ptr, ptr %54, align 8, !tbaa !23
  store ptr %55, ptr %13, align 8, !tbaa !5
  br label %23, !llvm.loop !24

56:                                               ; preds = %23
  %57 = load i32, ptr %16, align 4, !tbaa !9
  %58 = icmp ne i32 %57, 0
  br i1 %58, label %60, label %59

59:                                               ; preds = %56
  store i32 -1, ptr %5, align 4
  store i32 1, ptr %18, align 4
  br label %194

60:                                               ; preds = %56
  store i32 0, ptr %17, align 4, !tbaa !9
  br label %61

61:                                               ; preds = %155, %60
  %62 = load i32, ptr %17, align 4, !tbaa !9
  %63 = load ptr, ptr %6, align 8, !tbaa !5
  %64 = getelementptr inbounds %struct.Graph_, ptr %63, i32 0, i32 0
  %65 = load i32, ptr %64, align 8, !tbaa !26
  %66 = icmp slt i32 %62, %65
  br i1 %66, label %67, label %158

67:                                               ; preds = %61
  store double 0x7FEFFFFFFFFFFFFF, ptr %15, align 8, !tbaa !27
  %68 = load ptr, ptr %6, align 8, !tbaa !5
  %69 = getelementptr inbounds %struct.Graph_, ptr %68, i32 0, i32 4
  %70 = getelementptr inbounds %struct.List_, ptr %69, i32 0, i32 3
  %71 = load ptr, ptr %70, align 8, !tbaa !11
  store ptr %71, ptr %13, align 8, !tbaa !5
  br label %72

72:                                               ; preds = %99, %67
  %73 = load ptr, ptr %13, align 8, !tbaa !5
  %74 = icmp ne ptr %73, null
  br i1 %74, label %75, label %103

75:                                               ; preds = %72
  %76 = load ptr, ptr %13, align 8, !tbaa !5
  %77 = getelementptr inbounds %struct.ListElmt_, ptr %76, i32 0, i32 0
  %78 = load ptr, ptr %77, align 8, !tbaa !14
  %79 = getelementptr inbounds %struct.AdjList_, ptr %78, i32 0, i32 0
  %80 = load ptr, ptr %79, align 8, !tbaa !16
  store ptr %80, ptr %11, align 8, !tbaa !5
  %81 = load ptr, ptr %11, align 8, !tbaa !5
  %82 = getelementptr inbounds %struct.PathVertex_, ptr %81, i32 0, i32 2
  %83 = load i32, ptr %82, align 8, !tbaa !18
  %84 = icmp eq i32 %83, 0
  br i1 %84, label %85, label %98

85:                                               ; preds = %75
  %86 = load ptr, ptr %11, align 8, !tbaa !5
  %87 = getelementptr inbounds %struct.PathVertex_, ptr %86, i32 0, i32 3
  %88 = load double, ptr %87, align 8, !tbaa !21
  %89 = load double, ptr %15, align 8, !tbaa !27
  %90 = fcmp olt double %88, %89
  br i1 %90, label %91, label %98

91:                                               ; preds = %85
  %92 = load ptr, ptr %11, align 8, !tbaa !5
  %93 = getelementptr inbounds %struct.PathVertex_, ptr %92, i32 0, i32 3
  %94 = load double, ptr %93, align 8, !tbaa !21
  store double %94, ptr %15, align 8, !tbaa !27
  %95 = load ptr, ptr %13, align 8, !tbaa !5
  %96 = getelementptr inbounds %struct.ListElmt_, ptr %95, i32 0, i32 0
  %97 = load ptr, ptr %96, align 8, !tbaa !14
  store ptr %97, ptr %10, align 8, !tbaa !5
  br label %98

98:                                               ; preds = %91, %85, %75
  br label %99

99:                                               ; preds = %98
  %100 = load ptr, ptr %13, align 8, !tbaa !5
  %101 = getelementptr inbounds %struct.ListElmt_, ptr %100, i32 0, i32 1
  %102 = load ptr, ptr %101, align 8, !tbaa !23
  store ptr %102, ptr %13, align 8, !tbaa !5
  br label %72, !llvm.loop !28

103:                                              ; preds = %72
  %104 = load ptr, ptr %10, align 8, !tbaa !5
  %105 = getelementptr inbounds %struct.AdjList_, ptr %104, i32 0, i32 0
  %106 = load ptr, ptr %105, align 8, !tbaa !16
  %107 = getelementptr inbounds %struct.PathVertex_, ptr %106, i32 0, i32 2
  store i32 2, ptr %107, align 8, !tbaa !18
  %108 = load ptr, ptr %10, align 8, !tbaa !5
  %109 = getelementptr inbounds %struct.AdjList_, ptr %108, i32 0, i32 1
  %110 = getelementptr inbounds %struct.List_, ptr %109, i32 0, i32 3
  %111 = load ptr, ptr %110, align 8, !tbaa !29
  store ptr %111, ptr %14, align 8, !tbaa !5
  br label %112

112:                                              ; preds = %151, %103
  %113 = load ptr, ptr %14, align 8, !tbaa !5
  %114 = icmp ne ptr %113, null
  br i1 %114, label %115, label %155

115:                                              ; preds = %112
  %116 = load ptr, ptr %14, align 8, !tbaa !5
  %117 = getelementptr inbounds %struct.ListElmt_, ptr %116, i32 0, i32 0
  %118 = load ptr, ptr %117, align 8, !tbaa !14
  store ptr %118, ptr %12, align 8, !tbaa !5
  %119 = load ptr, ptr %6, align 8, !tbaa !5
  %120 = getelementptr inbounds %struct.Graph_, ptr %119, i32 0, i32 4
  %121 = getelementptr inbounds %struct.List_, ptr %120, i32 0, i32 3
  %122 = load ptr, ptr %121, align 8, !tbaa !11
  store ptr %122, ptr %13, align 8, !tbaa !5
  br label %123

123:                                              ; preds = %146, %115
  %124 = load ptr, ptr %13, align 8, !tbaa !5
  %125 = icmp ne ptr %124, null
  br i1 %125, label %126, label %150

126:                                              ; preds = %123
  %127 = load ptr, ptr %13, align 8, !tbaa !5
  %128 = getelementptr inbounds %struct.ListElmt_, ptr %127, i32 0, i32 0
  %129 = load ptr, ptr %128, align 8, !tbaa !14
  %130 = getelementptr inbounds %struct.AdjList_, ptr %129, i32 0, i32 0
  %131 = load ptr, ptr %130, align 8, !tbaa !16
  store ptr %131, ptr %11, align 8, !tbaa !5
  %132 = load ptr, ptr %9, align 8, !tbaa !5
  %133 = load ptr, ptr %11, align 8, !tbaa !5
  %134 = load ptr, ptr %12, align 8, !tbaa !5
  %135 = call i32 %132(ptr noundef %133, ptr noundef %134)
  %136 = icmp ne i32 %135, 0
  br i1 %136, label %137, label %145

137:                                              ; preds = %126
  %138 = load ptr, ptr %10, align 8, !tbaa !5
  %139 = getelementptr inbounds %struct.AdjList_, ptr %138, i32 0, i32 0
  %140 = load ptr, ptr %139, align 8, !tbaa !16
  %141 = load ptr, ptr %11, align 8, !tbaa !5
  %142 = load ptr, ptr %12, align 8, !tbaa !5
  %143 = getelementptr inbounds %struct.PathVertex_, ptr %142, i32 0, i32 1
  %144 = load double, ptr %143, align 8, !tbaa !30
  call void @relax(ptr noundef %140, ptr noundef %141, double noundef %144)
  br label %145

145:                                              ; preds = %137, %126
  br label %146

146:                                              ; preds = %145
  %147 = load ptr, ptr %13, align 8, !tbaa !5
  %148 = getelementptr inbounds %struct.ListElmt_, ptr %147, i32 0, i32 1
  %149 = load ptr, ptr %148, align 8, !tbaa !23
  store ptr %149, ptr %13, align 8, !tbaa !5
  br label %123, !llvm.loop !31

150:                                              ; preds = %123
  br label %151

151:                                              ; preds = %150
  %152 = load ptr, ptr %14, align 8, !tbaa !5
  %153 = getelementptr inbounds %struct.ListElmt_, ptr %152, i32 0, i32 1
  %154 = load ptr, ptr %153, align 8, !tbaa !23
  store ptr %154, ptr %14, align 8, !tbaa !5
  br label %112, !llvm.loop !32

155:                                              ; preds = %112
  %156 = load i32, ptr %17, align 4, !tbaa !9
  %157 = add nsw i32 %156, 1
  store i32 %157, ptr %17, align 4, !tbaa !9
  br label %61, !llvm.loop !33

158:                                              ; preds = %61
  %159 = load ptr, ptr %8, align 8, !tbaa !5
  call void @list_init(ptr noundef %159, ptr noundef null)
  %160 = load ptr, ptr %6, align 8, !tbaa !5
  %161 = getelementptr inbounds %struct.Graph_, ptr %160, i32 0, i32 4
  %162 = getelementptr inbounds %struct.List_, ptr %161, i32 0, i32 3
  %163 = load ptr, ptr %162, align 8, !tbaa !11
  store ptr %163, ptr %13, align 8, !tbaa !5
  br label %164

164:                                              ; preds = %189, %158
  %165 = load ptr, ptr %13, align 8, !tbaa !5
  %166 = icmp ne ptr %165, null
  br i1 %166, label %167, label %193

167:                                              ; preds = %164
  %168 = load ptr, ptr %13, align 8, !tbaa !5
  %169 = getelementptr inbounds %struct.ListElmt_, ptr %168, i32 0, i32 0
  %170 = load ptr, ptr %169, align 8, !tbaa !14
  %171 = getelementptr inbounds %struct.AdjList_, ptr %170, i32 0, i32 0
  %172 = load ptr, ptr %171, align 8, !tbaa !16
  store ptr %172, ptr %11, align 8, !tbaa !5
  %173 = load ptr, ptr %11, align 8, !tbaa !5
  %174 = getelementptr inbounds %struct.PathVertex_, ptr %173, i32 0, i32 2
  %175 = load i32, ptr %174, align 8, !tbaa !18
  %176 = icmp eq i32 %175, 2
  br i1 %176, label %177, label %188

177:                                              ; preds = %167
  %178 = load ptr, ptr %8, align 8, !tbaa !5
  %179 = load ptr, ptr %8, align 8, !tbaa !5
  %180 = getelementptr inbounds %struct.List_, ptr %179, i32 0, i32 4
  %181 = load ptr, ptr %180, align 8, !tbaa !34
  %182 = load ptr, ptr %11, align 8, !tbaa !5
  %183 = call i32 @list_ins_next(ptr noundef %178, ptr noundef %181, ptr noundef %182)
  %184 = icmp ne i32 %183, 0
  br i1 %184, label %185, label %187

185:                                              ; preds = %177
  %186 = load ptr, ptr %8, align 8, !tbaa !5
  call void @list_destroy(ptr noundef %186)
  store i32 -1, ptr %5, align 4
  store i32 1, ptr %18, align 4
  br label %194

187:                                              ; preds = %177
  br label %188

188:                                              ; preds = %187, %167
  br label %189

189:                                              ; preds = %188
  %190 = load ptr, ptr %13, align 8, !tbaa !5
  %191 = getelementptr inbounds %struct.ListElmt_, ptr %190, i32 0, i32 1
  %192 = load ptr, ptr %191, align 8, !tbaa !23
  store ptr %192, ptr %13, align 8, !tbaa !5
  br label %164, !llvm.loop !35

193:                                              ; preds = %164
  store i32 0, ptr %5, align 4
  store i32 1, ptr %18, align 4
  br label %194

194:                                              ; preds = %193, %185, %59
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #3
  %195 = load i32, ptr %5, align 4
  ret i32 %195
}

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

; Function Attrs: nounwind uwtable
declare hidden void @relax(ptr noundef, ptr noundef, double noundef) #0

declare void @list_init(ptr noundef, ptr noundef) #2

declare i32 @list_ins_next(ptr noundef, ptr noundef, ptr noundef) #2

declare void @list_destroy(ptr noundef) #2

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

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "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, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !6, i64 48}
!12 = !{!"Graph_", !10, i64 0, !10, i64 4, !6, i64 8, !6, i64 16, !13, i64 24}
!13 = !{!"List_", !10, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32}
!14 = !{!15, !6, i64 0}
!15 = !{!"ListElmt_", !6, i64 0, !6, i64 8}
!16 = !{!17, !6, i64 0}
!17 = !{!"AdjList_", !6, i64 0, !13, i64 8}
!18 = !{!19, !10, i64 16}
!19 = !{!"PathVertex_", !6, i64 0, !20, i64 8, !10, i64 16, !20, i64 24, !6, i64 32}
!20 = !{!"double", !7, i64 0}
!21 = !{!19, !20, i64 24}
!22 = !{!19, !6, i64 32}
!23 = !{!15, !6, i64 8}
!24 = distinct !{!24, !25}
!25 = !{!"llvm.loop.mustprogress"}
!26 = !{!12, !10, i64 0}
!27 = !{!20, !20, i64 0}
!28 = distinct !{!28, !25}
!29 = !{!17, !6, i64 32}
!30 = !{!19, !20, i64 8}
!31 = distinct !{!31, !25}
!32 = distinct !{!32, !25}
!33 = distinct !{!33, !25}
!34 = !{!13, !6, i64 32}
!35 = distinct !{!35, !25}


; 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: nounwind uwtable
define dso_local range(i32 -1, 1) i32 @shortest(ptr nocapture noundef readonly %0, ptr noundef %1, ptr noundef %2, ptr nocapture noundef readonly %3) local_unnamed_addr #0 {
  %5 = getelementptr inbounds i8, ptr %0, i64 48
  %.05571 = load ptr, ptr %5, align 8, !tbaa !5
  %.not72 = icmp eq ptr %.05571, null
  br i1 %.not72, label %.loopexit, label %.lr.ph.outer

.lr.ph.outer:                                     ; preds = %4, %.thread
  %.05574.ph = phi ptr [ %.055107, %.thread ], [ %.05571, %4 ]
  %6 = phi i1 [ false, %.thread ], [ true, %4 ]
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.outer, %12
  %.05574 = phi ptr [ %.055, %12 ], [ %.05574.ph, %.lr.ph.outer ]
  %7 = load ptr, ptr %.05574, align 8, !tbaa !9
  %8 = load ptr, ptr %7, align 8, !tbaa !11
  %9 = tail call i32 %3(ptr noundef %8, ptr noundef %1) #3
  %.not69 = icmp eq i32 %9, 0
  %10 = getelementptr inbounds i8, ptr %8, i64 16
  store i32 0, ptr %10, align 8
  %11 = getelementptr inbounds i8, ptr %8, i64 24
  br i1 %.not69, label %12, label %.thread

12:                                               ; preds = %.lr.ph
  store double 0x7FEFFFFFFFFFFFFF, ptr %11, align 8
  %13 = getelementptr inbounds i8, ptr %8, i64 32
  store ptr null, ptr %13, align 8
  %14 = getelementptr inbounds i8, ptr %.05574, i64 8
  %.055 = load ptr, ptr %14, align 8, !tbaa !5
  %.not = icmp eq ptr %.055, null
  br i1 %.not, label %._crit_edge, label %.lr.ph, !llvm.loop !15

.thread:                                          ; preds = %.lr.ph
  %15 = getelementptr inbounds i8, ptr %.05574, i64 8
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %11, i8 0, i64 16, i1 false)
  %.055107 = load ptr, ptr %15, align 8, !tbaa !5
  %.not108 = icmp eq ptr %.055107, null
  br i1 %.not108, label %.preheader70, label %.lr.ph.outer, !llvm.loop !15

._crit_edge:                                      ; preds = %12
  br i1 %6, label %.loopexit, label %.preheader70

.preheader70:                                     ; preds = %.thread, %._crit_edge
  %16 = load i32, ptr %0, align 8, !tbaa !17
  %17 = icmp sgt i32 %16, 0
  br i1 %17, label %.preheader, label %._crit_edge97

.preheader:                                       ; preds = %.preheader70, %._crit_edge94
  %18 = phi i32 [ %48, %._crit_edge94 ], [ %16, %.preheader70 ]
  %.096 = phi i32 [ %49, %._crit_edge94 ], [ 0, %.preheader70 ]
  %.05895 = phi ptr [ %.159.lcssa116, %._crit_edge94 ], [ null, %.preheader70 ]
  %.15675 = load ptr, ptr %5, align 8, !tbaa !5
  %.not6576 = icmp eq ptr %.15675, null
  br i1 %.not6576, label %._crit_edge81.thread, label %.lr.ph80

.lr.ph80:                                         ; preds = %.preheader, %29
  %.15679 = phi ptr [ %.156, %29 ], [ %.15675, %.preheader ]
  %.05278 = phi double [ %.153, %29 ], [ 0x7FEFFFFFFFFFFFFF, %.preheader ]
  %.15977 = phi ptr [ %.260, %29 ], [ %.05895, %.preheader ]
  %19 = load ptr, ptr %.15679, align 8, !tbaa !9
  %20 = load ptr, ptr %19, align 8, !tbaa !11
  %21 = getelementptr inbounds i8, ptr %20, i64 16
  %22 = load i32, ptr %21, align 8, !tbaa !19
  %23 = icmp eq i32 %22, 0
  br i1 %23, label %24, label %29

24:                                               ; preds = %.lr.ph80
  %25 = getelementptr inbounds i8, ptr %20, i64 24
  %26 = load double, ptr %25, align 8, !tbaa !22
  %27 = fcmp olt double %26, %.05278
  br i1 %27, label %28, label %29

28:                                               ; preds = %24
  br label %29

29:                                               ; preds = %.lr.ph80, %24, %28
  %.260 = phi ptr [ %19, %28 ], [ %.15977, %24 ], [ %.15977, %.lr.ph80 ]
  %.153 = phi double [ %26, %28 ], [ %.05278, %24 ], [ %.05278, %.lr.ph80 ]
  %30 = getelementptr inbounds i8, ptr %.15679, i64 8
  %.156 = load ptr, ptr %30, align 8, !tbaa !5
  %.not65 = icmp eq ptr %.156, null
  br i1 %.not65, label %._crit_edge81, label %.lr.ph80, !llvm.loop !23

._crit_edge81:                                    ; preds = %29
  %31 = load ptr, ptr %.260, align 8, !tbaa !11
  %32 = getelementptr inbounds i8, ptr %31, i64 16
  store i32 2, ptr %32, align 8, !tbaa !19
  %33 = getelementptr inbounds i8, ptr %.260, i64 32
  %.05489 = load ptr, ptr %33, align 8, !tbaa !5
  %.not6690 = icmp eq ptr %.05489, null
  %brmerge = or i1 %.not6690, %.not6576
  br i1 %brmerge, label %._crit_edge94, label %.lr.ph93.split

._crit_edge81.thread:                             ; preds = %.preheader
  %34 = load ptr, ptr %.05895, align 8, !tbaa !11
  %35 = getelementptr inbounds i8, ptr %34, i64 16
  store i32 2, ptr %35, align 8, !tbaa !19
  br label %._crit_edge94

.lr.ph93.split:                                   ; preds = %._crit_edge81, %._crit_edge88
  %.05491 = phi ptr [ %.054, %._crit_edge88 ], [ %.05489, %._crit_edge81 ]
  %36 = load ptr, ptr %.05491, align 8, !tbaa !9
  %.283 = load ptr, ptr %5, align 8, !tbaa !5
  %.not6784 = icmp eq ptr %.283, null
  br i1 %.not6784, label %._crit_edge88, label %.lr.ph87

.lr.ph87:                                         ; preds = %.lr.ph93.split
  %37 = getelementptr inbounds i8, ptr %36, i64 8
  br label %38

38:                                               ; preds = %.lr.ph87, %45
  %.285 = phi ptr [ %.283, %.lr.ph87 ], [ %.2, %45 ]
  %39 = load ptr, ptr %.285, align 8, !tbaa !9
  %40 = load ptr, ptr %39, align 8, !tbaa !11
  %41 = tail call i32 %3(ptr noundef %40, ptr noundef %36) #3
  %.not68 = icmp eq i32 %41, 0
  br i1 %.not68, label %45, label %42

42:                                               ; preds = %38
  %43 = load ptr, ptr %.260, align 8, !tbaa !11
  %44 = load double, ptr %37, align 8, !tbaa !24
  tail call void @relax(ptr noundef %43, ptr noundef %40, double noundef %44)
  br label %45

45:                                               ; preds = %38, %42
  %46 = getelementptr inbounds i8, ptr %.285, i64 8
  %.2 = load ptr, ptr %46, align 8, !tbaa !5
  %.not67 = icmp eq ptr %.2, null
  br i1 %.not67, label %._crit_edge88, label %38, !llvm.loop !25

._crit_edge88:                                    ; preds = %45, %.lr.ph93.split
  %47 = getelementptr inbounds i8, ptr %.05491, i64 8
  %.054 = load ptr, ptr %47, align 8, !tbaa !5
  %.not66 = icmp eq ptr %.054, null
  br i1 %.not66, label %._crit_edge94.loopexit103, label %.lr.ph93.split, !llvm.loop !26

._crit_edge94.loopexit103:                        ; preds = %._crit_edge88
  %.pre = load i32, ptr %0, align 8, !tbaa !17
  br label %._crit_edge94

._crit_edge94:                                    ; preds = %._crit_edge81, %._crit_edge81.thread, %._crit_edge94.loopexit103
  %.159.lcssa116 = phi ptr [ %.260, %._crit_edge94.loopexit103 ], [ %.260, %._crit_edge81 ], [ %.05895, %._crit_edge81.thread ]
  %48 = phi i32 [ %.pre, %._crit_edge94.loopexit103 ], [ %18, %._crit_edge81 ], [ %18, %._crit_edge81.thread ]
  %49 = add nuw nsw i32 %.096, 1
  %50 = icmp slt i32 %49, %48
  br i1 %50, label %.preheader, label %._crit_edge97, !llvm.loop !28

._crit_edge97:                                    ; preds = %._crit_edge94, %.preheader70
  tail call void @list_init(ptr noundef %2, ptr noundef null) #3
  %.398 = load ptr, ptr %5, align 8, !tbaa !5
  %.not6399 = icmp eq ptr %.398, null
  br i1 %.not6399, label %.loopexit, label %.lr.ph102

.lr.ph102:                                        ; preds = %._crit_edge97
  %51 = getelementptr inbounds i8, ptr %2, i64 32
  br label %52

52:                                               ; preds = %.lr.ph102, %62
  %.3100 = phi ptr [ %.398, %.lr.ph102 ], [ %.3, %62 ]
  %53 = load ptr, ptr %.3100, align 8, !tbaa !9
  %54 = load ptr, ptr %53, align 8, !tbaa !11
  %55 = getelementptr inbounds i8, ptr %54, i64 16
  %56 = load i32, ptr %55, align 8, !tbaa !19
  %57 = icmp eq i32 %56, 2
  br i1 %57, label %58, label %62

58:                                               ; preds = %52
  %59 = load ptr, ptr %51, align 8, !tbaa !29
  %60 = tail call i32 @list_ins_next(ptr noundef %2, ptr noundef %59, ptr noundef nonnull %54) #3
  %.not64 = icmp eq i32 %60, 0
  br i1 %.not64, label %62, label %61

61:                                               ; preds = %58
  tail call void @list_destroy(ptr noundef nonnull %2) #3
  br label %.loopexit

62:                                               ; preds = %52, %58
  %63 = getelementptr inbounds i8, ptr %.3100, i64 8
  %.3 = load ptr, ptr %63, align 8, !tbaa !5
  %.not63 = icmp eq ptr %.3, null
  br i1 %.not63, label %.loopexit, label %52, !llvm.loop !30

.loopexit:                                        ; preds = %62, %4, %._crit_edge97, %._crit_edge, %61
  %.057 = phi i32 [ -1, %61 ], [ -1, %._crit_edge ], [ 0, %._crit_edge97 ], [ -1, %4 ], [ 0, %62 ]
  ret i32 %.057
}

; Function Attrs: nounwind uwtable
declare hidden void @relax(ptr noundef, ptr noundef, double noundef) local_unnamed_addr #0

declare void @list_init(ptr noundef, ptr noundef) local_unnamed_addr #1

declare i32 @list_ins_next(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

declare void @list_destroy(ptr noundef) local_unnamed_addr #1

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2

attributes #0 = { 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 #1 = { "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 nounwind willreturn memory(argmem: write) }
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, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !6, i64 0}
!10 = !{!"ListElmt_", !6, i64 0, !6, i64 8}
!11 = !{!12, !6, i64 0}
!12 = !{!"AdjList_", !6, i64 0, !13, i64 8}
!13 = !{!"List_", !14, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32}
!14 = !{!"int", !7, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = !{!18, !14, i64 0}
!18 = !{!"Graph_", !14, i64 0, !14, i64 4, !6, i64 8, !6, i64 16, !13, i64 24}
!19 = !{!20, !14, i64 16}
!20 = !{!"PathVertex_", !6, i64 0, !21, i64 8, !14, i64 16, !21, i64 24, !6, i64 32}
!21 = !{!"double", !7, i64 0}
!22 = !{!20, !21, i64 24}
!23 = distinct !{!23, !16}
!24 = !{!20, !21, i64 8}
!25 = distinct !{!25, !16}
!26 = distinct !{!26, !16, !27}
!27 = !{!"llvm.loop.unswitch.partial.disable"}
!28 = distinct !{!28, !16}
!29 = !{!13, !6, i64 32}
!30 = distinct !{!30, !16}


; Effective O3 passes: ADCEPass,CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,MemCpyOptPass,MergedLoadStoreMotionPass,PostOrderFunctionAttrsPass,SROAPass,SimpleLoopUnswitchPass,SimplifyCFGPass,TailCallElimPass