; LLVM IR from AllAlgorithms/c :: algorithms/graphs (Dijkstra)

; 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.Node = type { i32, ptr, ptr, i32, i32, i32 }

@vertices = external dso_local global ptr, align 8
@N = external dso_local global i32, align 4
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [39 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [42 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [49 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [2 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: nounwind allocsize(0)
declare noalias ptr @malloc(i64 noundef) #1

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

; Function Attrs: nounwind uwtable
declare dso_local void @addEdge(ptr noundef, i32 noundef, ptr noundef) #2

; Function Attrs: nounwind uwtable
declare dso_local void @Dijks(ptr noundef) #2

; Function Attrs: nounwind uwtable
declare dso_local void @printPath(ptr noundef) #2

declare i32 @printf(ptr noundef, ...) #3

; Function Attrs: nounwind uwtable
define dso_local i32 @main() #2 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  %9 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef @N)
  %10 = load i32, ptr @N, align 4, !tbaa !5
  %11 = sext i32 %10 to i64
  %12 = mul i64 8, %11
  %13 = call noalias ptr @malloc(i64 noundef %12) #6
  store ptr %13, ptr @vertices, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %14

14:                                               ; preds = %67, %0
  %15 = load i32, ptr %3, align 4, !tbaa !5
  %16 = load i32, ptr @N, align 4, !tbaa !5
  %17 = icmp slt i32 %15, %16
  br i1 %17, label %19, label %18

18:                                               ; preds = %14
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  br label %70

19:                                               ; preds = %14
  %20 = call noalias ptr @malloc(i64 noundef 40) #6
  %21 = load ptr, ptr @vertices, align 8, !tbaa !9
  %22 = load i32, ptr %3, align 4, !tbaa !5
  %23 = sext i32 %22 to i64
  %24 = getelementptr inbounds ptr, ptr %21, i64 %23
  store ptr %20, ptr %24, align 8, !tbaa !9
  %25 = load i32, ptr %3, align 4, !tbaa !5
  %26 = add nsw i32 %25, 1
  %27 = load ptr, ptr @vertices, align 8, !tbaa !9
  %28 = load i32, ptr %3, align 4, !tbaa !5
  %29 = sext i32 %28 to i64
  %30 = getelementptr inbounds ptr, ptr %27, i64 %29
  %31 = load ptr, ptr %30, align 8, !tbaa !9
  %32 = getelementptr inbounds %struct.Node, ptr %31, i32 0, i32 0
  store i32 %26, ptr %32, align 8, !tbaa !11
  %33 = load i32, ptr @N, align 4, !tbaa !5
  %34 = sext i32 %33 to i64
  %35 = mul i64 8, %34
  %36 = call noalias ptr @malloc(i64 noundef %35) #6
  %37 = load ptr, ptr @vertices, align 8, !tbaa !9
  %38 = load i32, ptr %3, align 4, !tbaa !5
  %39 = sext i32 %38 to i64
  %40 = getelementptr inbounds ptr, ptr %37, i64 %39
  %41 = load ptr, ptr %40, align 8, !tbaa !9
  %42 = getelementptr inbounds %struct.Node, ptr %41, i32 0, i32 1
  store ptr %36, ptr %42, align 8, !tbaa !13
  %43 = load ptr, ptr @vertices, align 8, !tbaa !9
  %44 = load i32, ptr %3, align 4, !tbaa !5
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds ptr, ptr %43, i64 %45
  %47 = load ptr, ptr %46, align 8, !tbaa !9
  %48 = getelementptr inbounds %struct.Node, ptr %47, i32 0, i32 2
  store ptr null, ptr %48, align 8, !tbaa !14
  %49 = load ptr, ptr @vertices, align 8, !tbaa !9
  %50 = load i32, ptr %3, align 4, !tbaa !5
  %51 = sext i32 %50 to i64
  %52 = getelementptr inbounds ptr, ptr %49, i64 %51
  %53 = load ptr, ptr %52, align 8, !tbaa !9
  %54 = getelementptr inbounds %struct.Node, ptr %53, i32 0, i32 3
  store i32 0, ptr %54, align 8, !tbaa !15
  %55 = load ptr, ptr @vertices, align 8, !tbaa !9
  %56 = load i32, ptr %3, align 4, !tbaa !5
  %57 = sext i32 %56 to i64
  %58 = getelementptr inbounds ptr, ptr %55, i64 %57
  %59 = load ptr, ptr %58, align 8, !tbaa !9
  %60 = getelementptr inbounds %struct.Node, ptr %59, i32 0, i32 4
  store i32 -1, ptr %60, align 4, !tbaa !16
  %61 = load ptr, ptr @vertices, align 8, !tbaa !9
  %62 = load i32, ptr %3, align 4, !tbaa !5
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds ptr, ptr %61, i64 %63
  %65 = load ptr, ptr %64, align 8, !tbaa !9
  %66 = getelementptr inbounds %struct.Node, ptr %65, i32 0, i32 5
  store i32 0, ptr %66, align 8, !tbaa !17
  br label %67

67:                                               ; preds = %19
  %68 = load i32, ptr %3, align 4, !tbaa !5
  %69 = add nsw i32 %68, 1
  store i32 %69, ptr %3, align 4, !tbaa !5
  br label %14, !llvm.loop !18

70:                                               ; preds = %18
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #5
  store i32 1, ptr %4, align 4, !tbaa !5
  br label %71

71:                                               ; preds = %139, %70
  %72 = load i32, ptr %4, align 4, !tbaa !5
  %73 = load i32, ptr @N, align 4, !tbaa !5
  %74 = icmp sle i32 %72, %73
  br i1 %74, label %76, label %75

75:                                               ; preds = %71
  store i32 5, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  br label %142

76:                                               ; preds = %71
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  store i32 1, ptr %6, align 4, !tbaa !5
  br label %77

77:                                               ; preds = %135, %76
  %78 = load i32, ptr %6, align 4, !tbaa !5
  %79 = load i32, ptr @N, align 4, !tbaa !5
  %80 = icmp sle i32 %78, %79
  br i1 %80, label %82, label %81

81:                                               ; preds = %77
  store i32 8, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  br label %138

82:                                               ; preds = %77
  %83 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %2)
  %84 = load i32, ptr %6, align 4, !tbaa !5
  %85 = load i32, ptr %4, align 4, !tbaa !5
  %86 = icmp eq i32 %84, %85
  br i1 %86, label %87, label %94

87:                                               ; preds = %82
  %88 = load i32, ptr %2, align 4, !tbaa !5
  %89 = icmp ne i32 %88, 0
  br i1 %89, label %90, label %94

90:                                               ; preds = %87
  %91 = load i32, ptr %4, align 4, !tbaa !5
  %92 = load i32, ptr %6, align 4, !tbaa !5
  %93 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %91, i32 noundef %92)
  call void @exit(i32 noundef 0) #7
  unreachable

94:                                               ; preds = %87, %82
  %95 = load i32, ptr %6, align 4, !tbaa !5
  %96 = load i32, ptr %4, align 4, !tbaa !5
  %97 = icmp ne i32 %95, %96
  br i1 %97, label %98, label %105

98:                                               ; preds = %94
  %99 = load i32, ptr %2, align 4, !tbaa !5
  %100 = icmp eq i32 %99, 0
  br i1 %100, label %101, label %105

101:                                              ; preds = %98
  %102 = load i32, ptr %4, align 4, !tbaa !5
  %103 = load i32, ptr %6, align 4, !tbaa !5
  %104 = call i32 (ptr, ...) @printf(ptr noundef @.str.3, i32 noundef %102, i32 noundef %103)
  call void @exit(i32 noundef 0) #7
  unreachable

105:                                              ; preds = %98, %94
  br label %106

106:                                              ; preds = %105
  %107 = load i32, ptr %2, align 4, !tbaa !5
  %108 = icmp slt i32 %107, -1
  br i1 %108, label %109, label %113

109:                                              ; preds = %106
  %110 = load i32, ptr %4, align 4, !tbaa !5
  %111 = load i32, ptr %6, align 4, !tbaa !5
  %112 = call i32 (ptr, ...) @printf(ptr noundef @.str.4, i32 noundef %110, i32 noundef %111)
  call void @exit(i32 noundef 0) #7
  unreachable

113:                                              ; preds = %106
  %114 = load i32, ptr %2, align 4, !tbaa !5
  %115 = icmp ne i32 %114, -1
  br i1 %115, label %116, label %133

116:                                              ; preds = %113
  %117 = load i32, ptr %2, align 4, !tbaa !5
  %118 = icmp ne i32 %117, 0
  br i1 %118, label %119, label %133

119:                                              ; preds = %116
  %120 = load ptr, ptr @vertices, align 8, !tbaa !9
  %121 = load i32, ptr %4, align 4, !tbaa !5
  %122 = sub nsw i32 %121, 1
  %123 = sext i32 %122 to i64
  %124 = getelementptr inbounds ptr, ptr %120, i64 %123
  %125 = load ptr, ptr %124, align 8, !tbaa !9
  %126 = load i32, ptr %2, align 4, !tbaa !5
  %127 = load ptr, ptr @vertices, align 8, !tbaa !9
  %128 = load i32, ptr %6, align 4, !tbaa !5
  %129 = sub nsw i32 %128, 1
  %130 = sext i32 %129 to i64
  %131 = getelementptr inbounds ptr, ptr %127, i64 %130
  %132 = load ptr, ptr %131, align 8, !tbaa !9
  call void @addEdge(ptr noundef %125, i32 noundef %126, ptr noundef %132)
  br label %133

133:                                              ; preds = %119, %116, %113
  br label %134

134:                                              ; preds = %133
  br label %135

135:                                              ; preds = %134
  %136 = load i32, ptr %6, align 4, !tbaa !5
  %137 = add nsw i32 %136, 1
  store i32 %137, ptr %6, align 4, !tbaa !5
  br label %77, !llvm.loop !20

138:                                              ; preds = %81
  br label %139

139:                                              ; preds = %138
  %140 = load i32, ptr %4, align 4, !tbaa !5
  %141 = add nsw i32 %140, 1
  store i32 %141, ptr %4, align 4, !tbaa !5
  br label %71, !llvm.loop !21

142:                                              ; preds = %75
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  %143 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %7)
  %144 = load ptr, ptr @vertices, align 8, !tbaa !9
  %145 = load i32, ptr %7, align 4, !tbaa !5
  %146 = sub nsw i32 %145, 1
  %147 = sext i32 %146 to i64
  %148 = getelementptr inbounds ptr, ptr %144, i64 %147
  %149 = load ptr, ptr %148, align 8, !tbaa !9
  %150 = getelementptr inbounds %struct.Node, ptr %149, i32 0, i32 4
  store i32 0, ptr %150, align 4, !tbaa !16
  %151 = load ptr, ptr @vertices, align 8, !tbaa !9
  %152 = load i32, ptr %7, align 4, !tbaa !5
  %153 = sub nsw i32 %152, 1
  %154 = sext i32 %153 to i64
  %155 = getelementptr inbounds ptr, ptr %151, i64 %154
  %156 = load ptr, ptr %155, align 8, !tbaa !9
  call void @Dijks(ptr noundef %156)
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  store i32 0, ptr %8, align 4, !tbaa !5
  br label %157

157:                                              ; preds = %180, %142
  %158 = load i32, ptr %8, align 4, !tbaa !5
  %159 = load i32, ptr @N, align 4, !tbaa !5
  %160 = icmp slt i32 %158, %159
  br i1 %160, label %162, label %161

161:                                              ; preds = %157
  store i32 11, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  br label %183

162:                                              ; preds = %157
  %163 = load i32, ptr %8, align 4, !tbaa !5
  %164 = add nsw i32 %163, 1
  %165 = load ptr, ptr @vertices, align 8, !tbaa !9
  %166 = load i32, ptr %8, align 4, !tbaa !5
  %167 = sext i32 %166 to i64
  %168 = getelementptr inbounds ptr, ptr %165, i64 %167
  %169 = load ptr, ptr %168, align 8, !tbaa !9
  %170 = getelementptr inbounds %struct.Node, ptr %169, i32 0, i32 4
  %171 = load i32, ptr %170, align 4, !tbaa !16
  %172 = load i32, ptr %7, align 4, !tbaa !5
  %173 = call i32 (ptr, ...) @printf(ptr noundef @.str.5, i32 noundef %164, i32 noundef %171, i32 noundef %172)
  %174 = load ptr, ptr @vertices, align 8, !tbaa !9
  %175 = load i32, ptr %8, align 4, !tbaa !5
  %176 = sext i32 %175 to i64
  %177 = getelementptr inbounds ptr, ptr %174, i64 %176
  %178 = load ptr, ptr %177, align 8, !tbaa !9
  call void @printPath(ptr noundef %178)
  %179 = call i32 (ptr, ...) @printf(ptr noundef @.str.6)
  br label %180

180:                                              ; preds = %162
  %181 = load i32, ptr %8, align 4, !tbaa !5
  %182 = add nsw i32 %181, 1
  store i32 %182, ptr %8, align 4, !tbaa !5
  br label %157, !llvm.loop !22

183:                                              ; preds = %161
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #5
  %184 = load i32, ptr %1, align 4
  ret i32 %184
}

declare i32 @__isoc99_scanf(ptr noundef, ...) #3

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) #4

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nounwind 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 #2 = { 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 = { noreturn 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 #5 = { nounwind }
attributes #6 = { nounwind allocsize(0) }
attributes #7 = { noreturn 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !6, i64 0}
!12 = !{!"Node", !6, i64 0, !10, i64 8, !10, i64 16, !6, i64 24, !6, i64 28, !6, i64 32}
!13 = !{!12, !10, i64 8}
!14 = !{!12, !10, i64 16}
!15 = !{!12, !6, i64 24}
!16 = !{!12, !6, i64 28}
!17 = !{!12, !6, i64 32}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}
!20 = distinct !{!20, !19}
!21 = distinct !{!21, !19}
!22 = distinct !{!22, !19}


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

@vertices = external dso_local local_unnamed_addr global ptr, align 8
@N = external dso_local global i32, align 4
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [39 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [42 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [49 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [2 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 nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #1

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

; Function Attrs: nounwind uwtable
declare dso_local void @addEdge(ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare dso_local void @Dijks(ptr noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare dso_local void @printPath(ptr noundef) local_unnamed_addr #2

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
define dso_local noundef i32 @main() local_unnamed_addr #2 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #5
  %3 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull @N)
  %4 = load i32, ptr @N, align 4, !tbaa !5
  %5 = sext i32 %4 to i64
  %6 = shl nsw i64 %5, 3
  %7 = tail call noalias ptr @malloc(i64 noundef %6) #6
  store ptr %7, ptr @vertices, align 8, !tbaa !9
  %8 = icmp sgt i32 %4, 0
  br i1 %8, label %.lr.ph, label %._crit_edge55

.preheader42:                                     ; preds = %.lr.ph
  %.not53 = icmp slt i32 %16, 1
  br i1 %.not53, label %._crit_edge55, label %.preheader

.lr.ph:                                           ; preds = %0, %.lr.ph
  %9 = phi ptr [ %12, %.lr.ph ], [ %7, %0 ]
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %0 ]
  %10 = tail call noalias dereferenceable_or_null(40) ptr @malloc(i64 noundef 40) #6
  %11 = getelementptr inbounds ptr, ptr %9, i64 %indvars.iv
  store ptr %10, ptr %11, align 8, !tbaa !9
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %12 = load ptr, ptr @vertices, align 8, !tbaa !9
  %13 = getelementptr inbounds ptr, ptr %12, i64 %indvars.iv
  %14 = load ptr, ptr %13, align 8, !tbaa !9
  %15 = trunc nuw nsw i64 %indvars.iv.next to i32
  store i32 %15, ptr %14, align 8, !tbaa !11
  %16 = load i32, ptr @N, align 4, !tbaa !5
  %17 = sext i32 %16 to i64
  %18 = shl nsw i64 %17, 3
  %19 = tail call noalias ptr @malloc(i64 noundef %18) #6
  %20 = getelementptr inbounds i8, ptr %14, i64 8
  store ptr %19, ptr %20, align 8, !tbaa !13
  %21 = load ptr, ptr %13, align 8, !tbaa !9
  %22 = getelementptr inbounds i8, ptr %21, i64 16
  store ptr null, ptr %22, align 8, !tbaa !14
  %23 = load ptr, ptr %13, align 8, !tbaa !9
  %24 = getelementptr inbounds i8, ptr %23, i64 24
  store i32 0, ptr %24, align 8, !tbaa !15
  %25 = getelementptr inbounds i8, ptr %23, i64 28
  store i32 -1, ptr %25, align 4, !tbaa !16
  %26 = getelementptr inbounds i8, ptr %23, i64 32
  store i32 0, ptr %26, align 8, !tbaa !17
  %27 = icmp slt i64 %indvars.iv.next, %17
  br i1 %27, label %.lr.ph, label %.preheader42, !llvm.loop !18

.preheader:                                       ; preds = %.preheader42, %._crit_edge
  %28 = phi i32 [ %39, %._crit_edge ], [ %16, %.preheader42 ]
  %indvars.iv71 = phi i64 [ %indvars.iv.next72, %._crit_edge ], [ 1, %.preheader42 ]
  %.not4150 = icmp slt i32 %28, 1
  br i1 %.not4150, label %.preheader.._crit_edge_crit_edge, label %.lr.ph52

.preheader.._crit_edge_crit_edge:                 ; preds = %.preheader
  %.pre = sext i32 %28 to i64
  br label %._crit_edge

._crit_edge55:                                    ; preds = %._crit_edge, %0, %.preheader42
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #5
  %29 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %2)
  %30 = load ptr, ptr @vertices, align 8, !tbaa !9
  %31 = load i32, ptr %2, align 4, !tbaa !5
  %32 = sext i32 %31 to i64
  %33 = getelementptr ptr, ptr %30, i64 %32
  %34 = getelementptr i8, ptr %33, i64 -8
  %35 = load ptr, ptr %34, align 8, !tbaa !9
  %36 = getelementptr inbounds i8, ptr %35, i64 28
  store i32 0, ptr %36, align 4, !tbaa !16
  call void @Dijks(ptr noundef %35)
  %37 = load i32, ptr @N, align 4, !tbaa !5
  %38 = icmp sgt i32 %37, 0
  br i1 %38, label %.lr.ph58, label %._crit_edge59

._crit_edge:                                      ; preds = %70, %.preheader.._crit_edge_crit_edge
  %.pre-phi = phi i64 [ %.pre, %.preheader.._crit_edge_crit_edge ], [ %72, %70 ]
  %39 = phi i32 [ %28, %.preheader.._crit_edge_crit_edge ], [ %71, %70 ]
  %indvars.iv.next72 = add nuw nsw i64 %indvars.iv71, 1
  %.not.not = icmp slt i64 %indvars.iv71, %.pre-phi
  br i1 %.not.not, label %.preheader, label %._crit_edge55, !llvm.loop !20

.lr.ph52:                                         ; preds = %.preheader, %70
  %indvars.iv68 = phi i64 [ %indvars.iv.next69, %70 ], [ 1, %.preheader ]
  %40 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %1)
  %41 = icmp eq i64 %indvars.iv68, %indvars.iv71
  %42 = load i32, ptr %1, align 4
  %43 = icmp ne i32 %42, 0
  %or.cond = select i1 %41, i1 %43, i1 false
  br i1 %or.cond, label %44, label %47

44:                                               ; preds = %.lr.ph52
  %45 = trunc nuw nsw i64 %indvars.iv71 to i32
  %46 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %45, i32 noundef %45)
  call void @exit(i32 noundef 0) #7
  unreachable

47:                                               ; preds = %.lr.ph52
  %48 = icmp ne i64 %indvars.iv68, %indvars.iv71
  %49 = icmp eq i32 %42, 0
  %or.cond3 = select i1 %48, i1 %49, i1 false
  br i1 %or.cond3, label %50, label %54

50:                                               ; preds = %47
  %51 = trunc nuw nsw i64 %indvars.iv71 to i32
  %52 = trunc nuw nsw i64 %indvars.iv68 to i32
  %53 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %51, i32 noundef %52)
  call void @exit(i32 noundef 0) #7
  unreachable

54:                                               ; preds = %47
  %55 = icmp slt i32 %42, -1
  br i1 %55, label %56, label %60

56:                                               ; preds = %54
  %57 = trunc nuw nsw i64 %indvars.iv71 to i32
  %58 = trunc nuw nsw i64 %indvars.iv68 to i32
  %59 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.4, i32 noundef %57, i32 noundef %58)
  call void @exit(i32 noundef 0) #7
  unreachable

60:                                               ; preds = %54
  %61 = add nsw i32 %42, -1
  %or.cond5 = icmp ult i32 %61, -2
  br i1 %or.cond5, label %62, label %70

62:                                               ; preds = %60
  %63 = load ptr, ptr @vertices, align 8, !tbaa !9
  %64 = getelementptr ptr, ptr %63, i64 %indvars.iv71
  %65 = getelementptr i8, ptr %64, i64 -8
  %66 = load ptr, ptr %65, align 8, !tbaa !9
  %67 = getelementptr ptr, ptr %63, i64 %indvars.iv68
  %68 = getelementptr i8, ptr %67, i64 -8
  %69 = load ptr, ptr %68, align 8, !tbaa !9
  call void @addEdge(ptr noundef %66, i32 noundef %42, ptr noundef %69)
  br label %70

70:                                               ; preds = %62, %60
  %indvars.iv.next69 = add nuw nsw i64 %indvars.iv68, 1
  %71 = load i32, ptr @N, align 4, !tbaa !5
  %72 = sext i32 %71 to i64
  %.not41.not = icmp slt i64 %indvars.iv68, %72
  br i1 %.not41.not, label %.lr.ph52, label %._crit_edge, !llvm.loop !22

._crit_edge59:                                    ; preds = %.lr.ph58, %._crit_edge55
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #5
  ret i32 0

.lr.ph58:                                         ; preds = %._crit_edge55, %.lr.ph58
  %indvars.iv74 = phi i64 [ %indvars.iv.next75, %.lr.ph58 ], [ 0, %._crit_edge55 ]
  %indvars.iv.next75 = add nuw nsw i64 %indvars.iv74, 1
  %73 = load ptr, ptr @vertices, align 8, !tbaa !9
  %74 = getelementptr inbounds ptr, ptr %73, i64 %indvars.iv74
  %75 = load ptr, ptr %74, align 8, !tbaa !9
  %76 = getelementptr inbounds i8, ptr %75, i64 28
  %77 = load i32, ptr %76, align 4, !tbaa !16
  %78 = load i32, ptr %2, align 4, !tbaa !5
  %79 = trunc nuw nsw i64 %indvars.iv.next75 to i32
  %80 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.5, i32 noundef %79, i32 noundef %77, i32 noundef %78)
  %81 = load ptr, ptr @vertices, align 8, !tbaa !9
  %82 = getelementptr inbounds ptr, ptr %81, i64 %indvars.iv74
  %83 = load ptr, ptr %82, align 8, !tbaa !9
  call void @printPath(ptr noundef %83)
  %84 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.6)
  %85 = load i32, ptr @N, align 4, !tbaa !5
  %86 = sext i32 %85 to i64
  %87 = icmp slt i64 %indvars.iv.next75, %86
  br i1 %87, label %.lr.ph58, label %._crit_edge59, !llvm.loop !23
}

; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) local_unnamed_addr #4

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "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 = { 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 = { nofree 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 = { noreturn 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 #5 = { nounwind }
attributes #6 = { nounwind allocsize(0) }
attributes #7 = { noreturn 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !6, i64 0}
!12 = !{!"Node", !6, i64 0, !10, i64 8, !10, i64 16, !6, i64 24, !6, i64 28, !6, i64 32}
!13 = !{!12, !10, i64 8}
!14 = !{!12, !10, i64 16}
!15 = !{!12, !6, i64 24}
!16 = !{!12, !6, i64 28}
!17 = !{!12, !6, i64 32}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}
!20 = distinct !{!20, !19, !21}
!21 = !{!"llvm.loop.unswitch.partial.disable"}
!22 = distinct !{!22, !19}
!23 = distinct !{!23, !19}


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