; LLVM IR from AlgoGenesis/C :: Dynamic Programming/Longest Path in DAG (program)

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

@adj = external dso_local global [5 x [5 x %struct.Edge]], align 16
@edge_count = external dso_local global [5 x i32], align 16
@.str = external hidden unnamed_addr constant [42 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [59 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [26 x i8], align 1

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

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

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

; Function Attrs: nounwind uwtable
define dso_local void @longestPath(i32 noundef %0) #0 {
  %2 = alloca i32, align 4
  %3 = alloca [5 x i32], align 16
  %4 = alloca [5 x i32], align 16
  %5 = alloca i32, align 4
  %6 = alloca [5 x i32], align 16
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  store i32 %0, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 20, ptr %3) #4
  call void @llvm.memset.p0.i64(ptr align 16 %3, i8 0, i64 20, i1 false)
  call void @llvm.lifetime.start.p0(i64 20, ptr %4) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #4
  store i32 0, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 20, ptr %6) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %14

14:                                               ; preds = %29, %1
  %15 = load i32, ptr %7, align 4, !tbaa !5
  %16 = icmp slt i32 %15, 5
  br i1 %16, label %18, label %17

17:                                               ; preds = %14
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  br label %32

18:                                               ; preds = %14
  %19 = load i32, ptr %7, align 4, !tbaa !5
  %20 = sext i32 %19 to i64
  %21 = getelementptr inbounds [5 x i32], ptr %3, i64 0, i64 %20
  %22 = load i32, ptr %21, align 4, !tbaa !5
  %23 = icmp ne i32 %22, 0
  br i1 %23, label %28, label %24

24:                                               ; preds = %18
  %25 = load i32, ptr %7, align 4, !tbaa !5
  %26 = getelementptr inbounds [5 x i32], ptr %3, i64 0, i64 0
  %27 = getelementptr inbounds [5 x i32], ptr %4, i64 0, i64 0
  call void @topologicalSortUtil(i32 noundef %25, ptr noundef %26, ptr noundef %27, ptr noundef %5)
  br label %28

28:                                               ; preds = %24, %18
  br label %29

29:                                               ; preds = %28
  %30 = load i32, ptr %7, align 4, !tbaa !5
  %31 = add nsw i32 %30, 1
  store i32 %31, ptr %7, align 4, !tbaa !5
  br label %14, !llvm.loop !9

32:                                               ; preds = %17
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  store i32 0, ptr %8, align 4, !tbaa !5
  br label %33

33:                                               ; preds = %41, %32
  %34 = load i32, ptr %8, align 4, !tbaa !5
  %35 = icmp slt i32 %34, 5
  br i1 %35, label %37, label %36

36:                                               ; preds = %33
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  br label %44

37:                                               ; preds = %33
  %38 = load i32, ptr %8, align 4, !tbaa !5
  %39 = sext i32 %38 to i64
  %40 = getelementptr inbounds [5 x i32], ptr %6, i64 0, i64 %39
  store i32 -2147483648, ptr %40, align 4, !tbaa !5
  br label %41

41:                                               ; preds = %37
  %42 = load i32, ptr %8, align 4, !tbaa !5
  %43 = add nsw i32 %42, 1
  store i32 %43, ptr %8, align 4, !tbaa !5
  br label %33, !llvm.loop !11

44:                                               ; preds = %36
  %45 = load i32, ptr %2, align 4, !tbaa !5
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds [5 x i32], ptr %6, i64 0, i64 %46
  store i32 0, ptr %47, align 4, !tbaa !5
  br label %48

48:                                               ; preds = %114, %44
  %49 = load i32, ptr %5, align 4, !tbaa !5
  %50 = icmp sgt i32 %49, 0
  br i1 %50, label %51, label %115

51:                                               ; preds = %48
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  %52 = load i32, ptr %5, align 4, !tbaa !5
  %53 = add nsw i32 %52, -1
  store i32 %53, ptr %5, align 4, !tbaa !5
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds [5 x i32], ptr %4, i64 0, i64 %54
  %56 = load i32, ptr %55, align 4, !tbaa !5
  store i32 %56, ptr %9, align 4, !tbaa !5
  %57 = load i32, ptr %9, align 4, !tbaa !5
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds [5 x i32], ptr %6, i64 0, i64 %58
  %60 = load i32, ptr %59, align 4, !tbaa !5
  %61 = icmp ne i32 %60, -2147483648
  br i1 %61, label %62, label %114

62:                                               ; preds = %51
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  store i32 0, ptr %10, align 4, !tbaa !5
  br label %63

63:                                               ; preds = %110, %62
  %64 = load i32, ptr %10, align 4, !tbaa !5
  %65 = load i32, ptr %9, align 4, !tbaa !5
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds [5 x i32], ptr @edge_count, i64 0, i64 %66
  %68 = load i32, ptr %67, align 4, !tbaa !5
  %69 = icmp slt i32 %64, %68
  br i1 %69, label %71, label %70

70:                                               ; preds = %63
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  br label %113

71:                                               ; preds = %63
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  %72 = load i32, ptr %9, align 4, !tbaa !5
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds [5 x [5 x %struct.Edge]], ptr @adj, i64 0, i64 %73
  %75 = load i32, ptr %10, align 4, !tbaa !5
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds [5 x %struct.Edge], ptr %74, i64 0, i64 %76
  %78 = getelementptr inbounds %struct.Edge, ptr %77, i32 0, i32 0
  %79 = load i32, ptr %78, align 8, !tbaa !12
  store i32 %79, ptr %11, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #4
  %80 = load i32, ptr %9, align 4, !tbaa !5
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds [5 x [5 x %struct.Edge]], ptr @adj, i64 0, i64 %81
  %83 = load i32, ptr %10, align 4, !tbaa !5
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds [5 x %struct.Edge], ptr %82, i64 0, i64 %84
  %86 = getelementptr inbounds %struct.Edge, ptr %85, i32 0, i32 1
  %87 = load i32, ptr %86, align 4, !tbaa !14
  store i32 %87, ptr %12, align 4, !tbaa !5
  %88 = load i32, ptr %11, align 4, !tbaa !5
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds [5 x i32], ptr %6, i64 0, i64 %89
  %91 = load i32, ptr %90, align 4, !tbaa !5
  %92 = load i32, ptr %9, align 4, !tbaa !5
  %93 = sext i32 %92 to i64
  %94 = getelementptr inbounds [5 x i32], ptr %6, i64 0, i64 %93
  %95 = load i32, ptr %94, align 4, !tbaa !5
  %96 = load i32, ptr %12, align 4, !tbaa !5
  %97 = add nsw i32 %95, %96
  %98 = icmp slt i32 %91, %97
  br i1 %98, label %99, label %109

99:                                               ; preds = %71
  %100 = load i32, ptr %9, align 4, !tbaa !5
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds [5 x i32], ptr %6, i64 0, i64 %101
  %103 = load i32, ptr %102, align 4, !tbaa !5
  %104 = load i32, ptr %12, align 4, !tbaa !5
  %105 = add nsw i32 %103, %104
  %106 = load i32, ptr %11, align 4, !tbaa !5
  %107 = sext i32 %106 to i64
  %108 = getelementptr inbounds [5 x i32], ptr %6, i64 0, i64 %107
  store i32 %105, ptr %108, align 4, !tbaa !5
  br label %109

109:                                              ; preds = %99, %71
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  br label %110

110:                                              ; preds = %109
  %111 = load i32, ptr %10, align 4, !tbaa !5
  %112 = add nsw i32 %111, 1
  store i32 %112, ptr %10, align 4, !tbaa !5
  br label %63, !llvm.loop !15

113:                                              ; preds = %70
  br label %114

114:                                              ; preds = %113, %51
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  br label %48, !llvm.loop !16

115:                                              ; preds = %48
  %116 = load i32, ptr %2, align 4, !tbaa !5
  %117 = call i32 (ptr, ...) @printf(ptr noundef @.str, i32 noundef %116)
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #4
  store i32 0, ptr %13, align 4, !tbaa !5
  br label %118

118:                                              ; preds = %139, %115
  %119 = load i32, ptr %13, align 4, !tbaa !5
  %120 = icmp slt i32 %119, 5
  br i1 %120, label %122, label %121

121:                                              ; preds = %118
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #4
  br label %142

122:                                              ; preds = %118
  %123 = load i32, ptr %13, align 4, !tbaa !5
  %124 = sext i32 %123 to i64
  %125 = getelementptr inbounds [5 x i32], ptr %6, i64 0, i64 %124
  %126 = load i32, ptr %125, align 4, !tbaa !5
  %127 = icmp eq i32 %126, -2147483648
  br i1 %127, label %128, label %131

128:                                              ; preds = %122
  %129 = load i32, ptr %13, align 4, !tbaa !5
  %130 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, i32 noundef %129)
  br label %138

131:                                              ; preds = %122
  %132 = load i32, ptr %13, align 4, !tbaa !5
  %133 = load i32, ptr %13, align 4, !tbaa !5
  %134 = sext i32 %133 to i64
  %135 = getelementptr inbounds [5 x i32], ptr %6, i64 0, i64 %134
  %136 = load i32, ptr %135, align 4, !tbaa !5
  %137 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %132, i32 noundef %136)
  br label %138

138:                                              ; preds = %131, %128
  br label %139

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

142:                                              ; preds = %121
  call void @llvm.lifetime.end.p0(i64 20, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 20, ptr %4) #4
  call void @llvm.lifetime.end.p0(i64 20, ptr %3) #4
  ret void
}

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

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

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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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 = { 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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = !{!13, !6, i64 0}
!13 = !{!"", !6, i64 0, !6, i64 4}
!14 = !{!13, !6, i64 4}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}


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

%struct.Edge = type { i32, i32 }

@adj = external dso_local local_unnamed_addr global [5 x [5 x %struct.Edge]], align 16
@edge_count = external dso_local local_unnamed_addr global [5 x i32], align 16
@.str = external hidden unnamed_addr constant [42 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [59 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [26 x i8], align 1

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

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

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

; Function Attrs: nounwind uwtable
define dso_local void @longestPath(i32 noundef %0) local_unnamed_addr #0 {
  %2 = alloca [5 x i32], align 16
  %3 = alloca [5 x i32], align 16
  %4 = alloca i32, align 4
  %5 = alloca [5 x i32], align 16
  call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %2) #5
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(20) %2, i8 0, i64 20, i1 false)
  call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %3) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #5
  store i32 0, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %5) #5
  call void @topologicalSortUtil(i32 noundef 0, ptr noundef nonnull %2, ptr noundef nonnull %3, ptr noundef nonnull %4)
  %.phi.trans.insert = getelementptr inbounds i8, ptr %2, i64 4
  %.pre = load i32, ptr %.phi.trans.insert, align 4, !tbaa !5
  %.not35.1 = icmp eq i32 %.pre, 0
  br i1 %.not35.1, label %6, label %7

6:                                                ; preds = %1
  call void @topologicalSortUtil(i32 noundef 1, ptr noundef nonnull %2, ptr noundef nonnull %3, ptr noundef nonnull %4)
  br label %7

7:                                                ; preds = %6, %1
  %8 = getelementptr inbounds i8, ptr %2, i64 8
  %9 = load i32, ptr %8, align 8, !tbaa !5
  %.not35.2 = icmp eq i32 %9, 0
  br i1 %.not35.2, label %10, label %11

10:                                               ; preds = %7
  call void @topologicalSortUtil(i32 noundef 2, ptr noundef nonnull %2, ptr noundef nonnull %3, ptr noundef nonnull %4)
  br label %11

11:                                               ; preds = %10, %7
  %12 = getelementptr inbounds i8, ptr %2, i64 12
  %13 = load i32, ptr %12, align 4, !tbaa !5
  %.not35.3 = icmp eq i32 %13, 0
  br i1 %.not35.3, label %14, label %15

14:                                               ; preds = %11
  call void @topologicalSortUtil(i32 noundef 3, ptr noundef nonnull %2, ptr noundef nonnull %3, ptr noundef nonnull %4)
  br label %15

15:                                               ; preds = %14, %11
  %16 = getelementptr inbounds i8, ptr %2, i64 16
  %17 = load i32, ptr %16, align 16, !tbaa !5
  %.not35.4 = icmp eq i32 %17, 0
  br i1 %.not35.4, label %18, label %.preheader36.preheader

18:                                               ; preds = %15
  call void @topologicalSortUtil(i32 noundef 4, ptr noundef nonnull %2, ptr noundef nonnull %3, ptr noundef nonnull %4)
  br label %.preheader36.preheader

.preheader36.preheader:                           ; preds = %18, %15
  %19 = getelementptr inbounds i8, ptr %5, i64 4
  %20 = getelementptr inbounds i8, ptr %5, i64 8
  %21 = getelementptr inbounds i8, ptr %5, i64 12
  store <4 x i32> <i32 -2147483648, i32 -2147483648, i32 -2147483648, i32 -2147483648>, ptr %5, align 16, !tbaa !5
  %22 = getelementptr inbounds i8, ptr %5, i64 16
  store i32 -2147483648, ptr %22, align 16, !tbaa !5
  %23 = sext i32 %0 to i64
  %24 = getelementptr inbounds [5 x i32], ptr %5, i64 0, i64 %23
  store i32 0, ptr %24, align 4, !tbaa !5
  %.promoted = load i32, ptr %4, align 4, !tbaa !5
  %25 = icmp sgt i32 %.promoted, 0
  br i1 %25, label %.lr.ph40.preheader, label %65

.lr.ph40.preheader:                               ; preds = %.preheader36.preheader
  %26 = zext nneg i32 %.promoted to i64
  br label %.lr.ph40

.lr.ph40:                                         ; preds = %.lr.ph40.preheader, %.loopexit
  %indvars.iv45 = phi i64 [ %26, %.lr.ph40.preheader ], [ %indvars.iv.next46, %.loopexit ]
  %indvars.iv.next46 = add nsw i64 %indvars.iv45, -1
  %27 = getelementptr inbounds [5 x i32], ptr %3, i64 0, i64 %indvars.iv.next46
  %28 = load i32, ptr %27, align 4, !tbaa !5
  %29 = sext i32 %28 to i64
  %30 = getelementptr inbounds [5 x i32], ptr %5, i64 0, i64 %29
  %31 = load i32, ptr %30, align 4, !tbaa !5
  %.not = icmp eq i32 %31, -2147483648
  br i1 %.not, label %.loopexit, label %.preheader

.preheader:                                       ; preds = %.lr.ph40
  %32 = getelementptr inbounds [5 x i32], ptr @edge_count, i64 0, i64 %29
  %33 = load i32, ptr %32, align 4, !tbaa !5
  %34 = icmp sgt i32 %33, 0
  br i1 %34, label %.lr.ph.preheader, label %.loopexit

.lr.ph.preheader:                                 ; preds = %.preheader
  %wide.trip.count = zext nneg i32 %33 to i64
  %xtraiter = and i64 %wide.trip.count, 1
  %35 = icmp eq i32 %33, 1
  br i1 %35, label %.loopexit.loopexit.unr-lcssa, label %.lr.ph.preheader.new

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

.lr.ph:                                           ; preds = %.lr.ph, %.lr.ph.preheader.new
  %indvars.iv = phi i64 [ 0, %.lr.ph.preheader.new ], [ %indvars.iv.next.1, %.lr.ph ]
  %niter = phi i64 [ 0, %.lr.ph.preheader.new ], [ %niter.next.1, %.lr.ph ]
  %36 = getelementptr inbounds [5 x [5 x %struct.Edge]], ptr @adj, i64 0, i64 %29, i64 %indvars.iv
  %37 = load i32, ptr %36, align 8, !tbaa !9
  %38 = getelementptr inbounds i8, ptr %36, i64 4
  %39 = load i32, ptr %38, align 4, !tbaa !11
  %40 = sext i32 %37 to i64
  %41 = getelementptr inbounds [5 x i32], ptr %5, i64 0, i64 %40
  %42 = load i32, ptr %41, align 4, !tbaa !5
  %43 = load i32, ptr %30, align 4, !tbaa !5
  %44 = add nsw i32 %43, %39
  %spec.store.select = call i32 @llvm.smax.i32(i32 %42, i32 %44)
  store i32 %spec.store.select, ptr %41, align 4
  %indvars.iv.next = or disjoint i64 %indvars.iv, 1
  %45 = getelementptr inbounds [5 x [5 x %struct.Edge]], ptr @adj, i64 0, i64 %29, i64 %indvars.iv.next
  %46 = load i32, ptr %45, align 8, !tbaa !9
  %47 = getelementptr inbounds i8, ptr %45, i64 4
  %48 = load i32, ptr %47, align 4, !tbaa !11
  %49 = sext i32 %46 to i64
  %50 = getelementptr inbounds [5 x i32], ptr %5, i64 0, i64 %49
  %51 = load i32, ptr %50, align 4, !tbaa !5
  %52 = load i32, ptr %30, align 4, !tbaa !5
  %53 = add nsw i32 %52, %48
  %spec.store.select.1 = call i32 @llvm.smax.i32(i32 %51, i32 %53)
  store i32 %spec.store.select.1, ptr %50, align 4
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %.loopexit.loopexit.unr-lcssa, label %.lr.ph, !llvm.loop !12

.loopexit.loopexit.unr-lcssa:                     ; preds = %.lr.ph, %.lr.ph.preheader
  %indvars.iv.unr = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next.1, %.lr.ph ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.loopexit, label %.lr.ph.epil

.lr.ph.epil:                                      ; preds = %.loopexit.loopexit.unr-lcssa
  %54 = getelementptr inbounds [5 x [5 x %struct.Edge]], ptr @adj, i64 0, i64 %29, i64 %indvars.iv.unr
  %55 = load i32, ptr %54, align 8, !tbaa !9
  %56 = getelementptr inbounds i8, ptr %54, i64 4
  %57 = load i32, ptr %56, align 4, !tbaa !11
  %58 = sext i32 %55 to i64
  %59 = getelementptr inbounds [5 x i32], ptr %5, i64 0, i64 %58
  %60 = load i32, ptr %59, align 4, !tbaa !5
  %61 = load i32, ptr %30, align 4, !tbaa !5
  %62 = add nsw i32 %61, %57
  %spec.store.select.epil = call i32 @llvm.smax.i32(i32 %60, i32 %62)
  store i32 %spec.store.select.epil, ptr %59, align 4
  br label %.loopexit

.loopexit:                                        ; preds = %.lr.ph.epil, %.loopexit.loopexit.unr-lcssa, %.preheader, %.lr.ph40
  %63 = icmp sgt i64 %indvars.iv45, 1
  br i1 %63, label %.lr.ph40, label %._crit_edge, !llvm.loop !14

._crit_edge:                                      ; preds = %.loopexit
  %64 = trunc nuw nsw i64 %indvars.iv.next46 to i32
  store i32 %64, ptr %4, align 4, !tbaa !5
  br label %65

65:                                               ; preds = %._crit_edge, %.preheader36.preheader
  %66 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %0)
  %67 = load i32, ptr %5, align 16, !tbaa !5
  %68 = icmp eq i32 %67, -2147483648
  br i1 %68, label %69, label %71

69:                                               ; preds = %65
  %70 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 0)
  br label %73

71:                                               ; preds = %65
  %72 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 0, i32 noundef %67)
  br label %73

73:                                               ; preds = %69, %71
  %74 = load i32, ptr %19, align 4, !tbaa !5
  %75 = icmp eq i32 %74, -2147483648
  br i1 %75, label %78, label %76

76:                                               ; preds = %73
  %77 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 1, i32 noundef %74)
  br label %80

78:                                               ; preds = %73
  %79 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 1)
  br label %80

80:                                               ; preds = %78, %76
  %81 = load i32, ptr %20, align 8, !tbaa !5
  %82 = icmp eq i32 %81, -2147483648
  br i1 %82, label %85, label %83

83:                                               ; preds = %80
  %84 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 2, i32 noundef %81)
  br label %87

85:                                               ; preds = %80
  %86 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 2)
  br label %87

87:                                               ; preds = %85, %83
  %88 = load i32, ptr %21, align 4, !tbaa !5
  %89 = icmp eq i32 %88, -2147483648
  br i1 %89, label %92, label %90

90:                                               ; preds = %87
  %91 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 3, i32 noundef %88)
  br label %94

92:                                               ; preds = %87
  %93 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 3)
  br label %94

94:                                               ; preds = %92, %90
  %95 = load i32, ptr %22, align 16, !tbaa !5
  %96 = icmp eq i32 %95, -2147483648
  br i1 %96, label %99, label %97

97:                                               ; preds = %94
  %98 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef 4, i32 noundef %95)
  br label %101

99:                                               ; preds = %94
  %100 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef 4)
  br label %101

101:                                              ; preds = %99, %97
  call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %5) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #5
  call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %3) #5
  call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %2) #5
  ret void
}

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

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

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

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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { 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, !6, i64 0}
!10 = !{!"", !6, i64 0, !6, i64 4}
!11 = !{!10, !6, i64 4}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = distinct !{!14, !13}


; Effective O3 passes: BDCEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SCCPPass,SLPVectorizerPass,SROAPass,SimplifyCFGPass