; LLVM IR from lzyrapx/Competitive-Programming :: ACdream/1083（博弈+有向无环图dp）.ll (Z5solvei)

; 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, i32, i32 }

@edge = external dso_local global [246912 x %struct.Edge], align 16
@head = external dso_local global [12345 x i32], align 16
@n = external dso_local global i32, align 4
@dp = external dso_local global [12345 x [2 x i32]], align 16
@a = external dso_local global [123456 x i32], align 16

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z5solvei(i32 noundef %0) #1 {
  %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
  %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
  %14 = load i32, ptr %2, align 4, !tbaa !5
  %15 = load i32, ptr @n, align 4, !tbaa !5
  %16 = sub nsw i32 %15, 1
  %17 = icmp eq i32 %14, %16
  br i1 %17, label %18, label %27

18:                                               ; preds = %1
  %19 = load i32, ptr %2, align 4, !tbaa !5
  %20 = sext i32 %19 to i64
  %21 = getelementptr inbounds [12345 x [2 x i32]], ptr @dp, i64 0, i64 %20
  %22 = getelementptr inbounds [2 x i32], ptr %21, i64 0, i64 1
  store i32 0, ptr %22, align 4, !tbaa !5
  %23 = load i32, ptr %2, align 4, !tbaa !5
  %24 = sext i32 %23 to i64
  %25 = getelementptr inbounds [12345 x [2 x i32]], ptr @dp, i64 0, i64 %24
  %26 = getelementptr inbounds [2 x i32], ptr %25, i64 0, i64 0
  store i32 0, ptr %26, align 8, !tbaa !5
  br label %157

27:                                               ; preds = %1
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #3
  store i32 0, ptr %3, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #3
  store i32 1061109567, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #3
  %28 = load i32, ptr %2, align 4, !tbaa !5
  %29 = sext i32 %28 to i64
  %30 = getelementptr inbounds [12345 x i32], ptr @head, i64 0, i64 %29
  %31 = load i32, ptr %30, align 4, !tbaa !5
  store i32 %31, ptr %5, align 4, !tbaa !5
  br label %32

32:                                               ; preds = %97, %27
  %33 = load i32, ptr %5, align 4, !tbaa !5
  %34 = xor i32 %33, -1
  %35 = icmp ne i32 %34, 0
  br i1 %35, label %37, label %36

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

37:                                               ; preds = %32
  %38 = load i32, ptr %5, align 4, !tbaa !5
  %39 = and i32 %38, 1
  %40 = icmp ne i32 %39, 0
  br i1 %40, label %96, label %41

41:                                               ; preds = %37
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #3
  %42 = load i32, ptr %5, align 4, !tbaa !5
  %43 = sext i32 %42 to i64
  %44 = getelementptr inbounds [246912 x %struct.Edge], ptr @edge, i64 0, i64 %43
  %45 = getelementptr inbounds %struct.Edge, ptr %44, i32 0, i32 1
  %46 = load i32, ptr %45, align 4, !tbaa !9
  store i32 %46, ptr %6, align 4, !tbaa !5
  %47 = load i32, ptr %2, align 4, !tbaa !5
  %48 = sext i32 %47 to i64
  %49 = getelementptr inbounds [12345 x [2 x i32]], ptr @dp, i64 0, i64 %48
  %50 = getelementptr inbounds [2 x i32], ptr %49, i64 0, i64 0
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #3
  %51 = load i32, ptr %6, align 4, !tbaa !5
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds [12345 x [2 x i32]], ptr @dp, i64 0, i64 %52
  %54 = getelementptr inbounds [2 x i32], ptr %53, i64 0, i64 0
  %55 = load i32, ptr %54, align 8, !tbaa !5
  %56 = load i32, ptr %5, align 4, !tbaa !5
  %57 = sext i32 %56 to i64
  %58 = getelementptr inbounds [246912 x %struct.Edge], ptr @edge, i64 0, i64 %57
  %59 = getelementptr inbounds %struct.Edge, ptr %58, i32 0, i32 2
  %60 = load i32, ptr %59, align 8, !tbaa !11
  %61 = add nsw i32 %55, %60
  store i32 %61, ptr %7, align 4, !tbaa !5
  %62 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %50, ptr noundef nonnull align 4 dereferenceable(4) %7)
  %63 = load i32, ptr %62, align 4, !tbaa !5
  %64 = load i32, ptr %2, align 4, !tbaa !5
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds [12345 x [2 x i32]], ptr @dp, i64 0, i64 %65
  %67 = getelementptr inbounds [2 x i32], ptr %66, i64 0, i64 0
  store i32 %63, ptr %67, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #3
  %68 = load i32, ptr %6, align 4, !tbaa !5
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds [12345 x [2 x i32]], ptr @dp, i64 0, i64 %69
  %71 = getelementptr inbounds [2 x i32], ptr %70, i64 0, i64 1
  %72 = load i32, ptr %71, align 4, !tbaa !5
  %73 = load i32, ptr %5, align 4, !tbaa !5
  %74 = sext i32 %73 to i64
  %75 = getelementptr inbounds [246912 x %struct.Edge], ptr @edge, i64 0, i64 %74
  %76 = getelementptr inbounds %struct.Edge, ptr %75, i32 0, i32 2
  %77 = load i32, ptr %76, align 8, !tbaa !11
  %78 = add nsw i32 %72, %77
  store i32 %78, ptr %8, align 4, !tbaa !5
  %79 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %4, ptr noundef nonnull align 4 dereferenceable(4) %8)
  %80 = load i32, ptr %79, align 4, !tbaa !5
  store i32 %80, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #3
  %81 = load i32, ptr %6, align 4, !tbaa !5
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds [12345 x [2 x i32]], ptr @dp, i64 0, i64 %82
  %84 = getelementptr inbounds [2 x i32], ptr %83, i64 0, i64 0
  %85 = load i32, ptr %84, align 8, !tbaa !5
  %86 = load i32, ptr %5, align 4, !tbaa !5
  %87 = sext i32 %86 to i64
  %88 = getelementptr inbounds [246912 x %struct.Edge], ptr @edge, i64 0, i64 %87
  %89 = getelementptr inbounds %struct.Edge, ptr %88, i32 0, i32 2
  %90 = load i32, ptr %89, align 8, !tbaa !11
  %91 = add nsw i32 %85, %90
  %92 = load i32, ptr %3, align 4, !tbaa !5
  %93 = add nsw i32 %92, 1
  store i32 %93, ptr %3, align 4, !tbaa !5
  %94 = sext i32 %92 to i64
  %95 = getelementptr inbounds [123456 x i32], ptr @a, i64 0, i64 %94
  store i32 %91, ptr %95, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #3
  br label %96

96:                                               ; preds = %41, %37
  br label %97

97:                                               ; preds = %96
  %98 = load i32, ptr %5, align 4, !tbaa !5
  %99 = sext i32 %98 to i64
  %100 = getelementptr inbounds [246912 x %struct.Edge], ptr @edge, i64 0, i64 %99
  %101 = getelementptr inbounds %struct.Edge, ptr %100, i32 0, i32 3
  %102 = load i32, ptr %101, align 4, !tbaa !12
  store i32 %102, ptr %5, align 4, !tbaa !5
  br label %32, !llvm.loop !13

103:                                              ; preds = %36
  %104 = load i32, ptr %3, align 4, !tbaa !5
  %105 = icmp slt i32 %104, 2
  br i1 %105, label %106, label %111

106:                                              ; preds = %103
  %107 = load i32, ptr %2, align 4, !tbaa !5
  %108 = sext i32 %107 to i64
  %109 = getelementptr inbounds [12345 x [2 x i32]], ptr @dp, i64 0, i64 %108
  %110 = getelementptr inbounds [2 x i32], ptr %109, i64 0, i64 1
  store i32 1061109567, ptr %110, align 4, !tbaa !5
  store i32 1, ptr %9, align 4
  br label %155

111:                                              ; preds = %103
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #3
  %112 = load i32, ptr @a, align 16, !tbaa !5
  store i32 %112, ptr %10, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #3
  %113 = load i32, ptr getelementptr inbounds ([123456 x i32], ptr @a, i64 0, i64 1), align 4, !tbaa !5
  store i32 %113, ptr %11, align 4, !tbaa !5
  %114 = load i32, ptr %10, align 4, !tbaa !5
  %115 = load i32, ptr %11, align 4, !tbaa !5
  %116 = icmp sgt i32 %114, %115
  br i1 %116, label %117, label %118

117:                                              ; preds = %111
  call void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4) %10, ptr noundef nonnull align 4 dereferenceable(4) %11) #3
  br label %118

118:                                              ; preds = %117, %111
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #3
  store i32 2, ptr %12, align 4, !tbaa !5
  br label %119

119:                                              ; preds = %144, %118
  %120 = load i32, ptr %12, align 4, !tbaa !5
  %121 = load i32, ptr %3, align 4, !tbaa !5
  %122 = icmp slt i32 %120, %121
  br i1 %122, label %124, label %123

123:                                              ; preds = %119
  store i32 5, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #3
  br label %147

124:                                              ; preds = %119
  %125 = load i32, ptr %12, align 4, !tbaa !5
  %126 = sext i32 %125 to i64
  %127 = getelementptr inbounds [123456 x i32], ptr @a, i64 0, i64 %126
  %128 = load i32, ptr %127, align 4, !tbaa !5
  %129 = load i32, ptr %10, align 4, !tbaa !5
  %130 = icmp sle i32 %128, %129
  br i1 %130, label %131, label %137

131:                                              ; preds = %124
  %132 = load i32, ptr %10, align 4, !tbaa !5
  store i32 %132, ptr %11, align 4, !tbaa !5
  %133 = load i32, ptr %12, align 4, !tbaa !5
  %134 = sext i32 %133 to i64
  %135 = getelementptr inbounds [123456 x i32], ptr @a, i64 0, i64 %134
  %136 = load i32, ptr %135, align 4, !tbaa !5
  store i32 %136, ptr %10, align 4, !tbaa !5
  br label %143

137:                                              ; preds = %124
  %138 = load i32, ptr %12, align 4, !tbaa !5
  %139 = sext i32 %138 to i64
  %140 = getelementptr inbounds [123456 x i32], ptr @a, i64 0, i64 %139
  %141 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %11, ptr noundef nonnull align 4 dereferenceable(4) %140)
  %142 = load i32, ptr %141, align 4, !tbaa !5
  store i32 %142, ptr %11, align 4, !tbaa !5
  br label %143

143:                                              ; preds = %137, %131
  br label %144

144:                                              ; preds = %143
  %145 = load i32, ptr %12, align 4, !tbaa !5
  %146 = add nsw i32 %145, 1
  store i32 %146, ptr %12, align 4, !tbaa !5
  br label %119, !llvm.loop !15

147:                                              ; preds = %123
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #3
  %148 = load i32, ptr %11, align 4, !tbaa !5
  store i32 %148, ptr %13, align 4, !tbaa !5
  %149 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %4, ptr noundef nonnull align 4 dereferenceable(4) %13)
  %150 = load i32, ptr %149, align 4, !tbaa !5
  %151 = load i32, ptr %2, align 4, !tbaa !5
  %152 = sext i32 %151 to i64
  %153 = getelementptr inbounds [12345 x [2 x i32]], ptr @dp, i64 0, i64 %152
  %154 = getelementptr inbounds [2 x i32], ptr %153, i64 0, i64 1
  store i32 %150, ptr %154, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #3
  store i32 0, ptr %9, align 4
  br label %155

155:                                              ; preds = %147, %106
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #3
  %156 = load i32, ptr %9, align 4
  switch i32 %156, label %158 [
    i32 0, label %157
    i32 1, label %157
  ]

157:                                              ; preds = %155, %155, %18
  ret void

158:                                              ; preds = %155
  unreachable
}

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #2

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { 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 #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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !6, i64 4}
!10 = !{!"_ZTS4Edge", !6, i64 0, !6, i64 4, !6, i64 8, !6, i64 12}
!11 = !{!10, !6, i64 8}
!12 = !{!10, !6, i64 12}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}


; 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, i32, i32 }

@edge = external dso_local local_unnamed_addr global [246912 x %struct.Edge], align 16
@head = external dso_local local_unnamed_addr global [12345 x i32], align 16
@n = external dso_local local_unnamed_addr global i32, align 4
@dp = external dso_local global [12345 x [2 x i32]], align 16
@a = external dso_local global [123456 x i32], align 16

; 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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_Z5solvei(i32 noundef %0) local_unnamed_addr #1 {
  %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 = load i32, ptr @n, align 4, !tbaa !5
  %9 = add nsw i32 %8, -1
  %10 = icmp eq i32 %9, %0
  br i1 %10, label %11, label %15

11:                                               ; preds = %1
  %12 = sext i32 %0 to i64
  %13 = getelementptr inbounds [12345 x [2 x i32]], ptr @dp, i64 0, i64 %12
  %14 = getelementptr inbounds i8, ptr %13, i64 4
  store i32 0, ptr %14, align 4, !tbaa !5
  store i32 0, ptr %13, align 8, !tbaa !5
  br label %68

15:                                               ; preds = %1
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #3
  store i32 1061109567, ptr %2, align 4, !tbaa !5
  %16 = sext i32 %0 to i64
  %17 = getelementptr inbounds [12345 x i32], ptr @head, i64 0, i64 %16
  %.02733 = load i32, ptr %17, align 4, !tbaa !5
  %.not34 = icmp eq i32 %.02733, -1
  br i1 %.not34, label %._crit_edge.thread, label %.lr.ph

.lr.ph:                                           ; preds = %15
  %18 = getelementptr inbounds [12345 x [2 x i32]], ptr @dp, i64 0, i64 %16
  br label %20

._crit_edge:                                      ; preds = %._crit_edge43
  %19 = icmp slt i32 %.1, 2
  br i1 %19, label %._crit_edge.thread, label %49

20:                                               ; preds = %.lr.ph, %._crit_edge43
  %.02736 = phi i32 [ %.02733, %.lr.ph ], [ %.027, %._crit_edge43 ]
  %.02635 = phi i32 [ 0, %.lr.ph ], [ %.1, %._crit_edge43 ]
  %21 = and i32 %.02736, 1
  %.not32 = icmp eq i32 %21, 0
  %22 = sext i32 %.02736 to i64
  br i1 %.not32, label %23, label %._crit_edge43

23:                                               ; preds = %20
  %24 = getelementptr inbounds [246912 x %struct.Edge], ptr @edge, i64 0, i64 %22
  %25 = getelementptr inbounds i8, ptr %24, i64 4
  %26 = load i32, ptr %25, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #3
  %27 = sext i32 %26 to i64
  %28 = getelementptr inbounds [12345 x [2 x i32]], ptr @dp, i64 0, i64 %27
  %29 = load i32, ptr %28, align 8, !tbaa !5
  %30 = getelementptr inbounds i8, ptr %24, i64 8
  %31 = load i32, ptr %30, align 8, !tbaa !11
  %32 = add nsw i32 %31, %29
  store i32 %32, ptr %3, align 4, !tbaa !5
  %33 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %18, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %34 = load i32, ptr %33, align 4, !tbaa !5
  store i32 %34, ptr %18, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #3
  %35 = getelementptr inbounds i8, ptr %28, i64 4
  %36 = load i32, ptr %35, align 4, !tbaa !5
  %37 = load i32, ptr %30, align 8, !tbaa !11
  %38 = add nsw i32 %37, %36
  store i32 %38, ptr %4, align 4, !tbaa !5
  %39 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %2, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %40 = load i32, ptr %39, align 4, !tbaa !5
  store i32 %40, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #3
  %41 = load i32, ptr %28, align 8, !tbaa !5
  %42 = load i32, ptr %30, align 8, !tbaa !11
  %43 = add nsw i32 %42, %41
  %44 = add nsw i32 %.02635, 1
  %45 = sext i32 %.02635 to i64
  %46 = getelementptr inbounds [123456 x i32], ptr @a, i64 0, i64 %45
  store i32 %43, ptr %46, align 4, !tbaa !5
  br label %._crit_edge43

._crit_edge43:                                    ; preds = %20, %23
  %.1 = phi i32 [ %44, %23 ], [ %.02635, %20 ]
  %47 = getelementptr inbounds [246912 x %struct.Edge], ptr @edge, i64 0, i64 %22, i32 3
  %.027 = load i32, ptr %47, align 4, !tbaa !5
  %.not = icmp eq i32 %.027, -1
  br i1 %.not, label %._crit_edge, label %20, !llvm.loop !12

._crit_edge.thread:                               ; preds = %15, %._crit_edge
  %48 = getelementptr inbounds [12345 x [2 x i32]], ptr @dp, i64 0, i64 %16, i64 1
  store i32 1061109567, ptr %48, align 4, !tbaa !5
  br label %67

49:                                               ; preds = %._crit_edge
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #3
  %50 = load i32, ptr @a, align 16, !tbaa !5
  store i32 %50, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #3
  %51 = load i32, ptr getelementptr inbounds (i8, ptr @a, i64 4), align 4, !tbaa !5
  store i32 %51, ptr %6, align 4, !tbaa !5
  %52 = icmp sgt i32 %50, %51
  br i1 %52, label %53, label %54

53:                                               ; preds = %49
  call void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull align 4 dereferenceable(4) %6) #3
  br label %54

54:                                               ; preds = %53, %49
  %.not41 = icmp eq i32 %.1, 2
  br i1 %.not41, label %.._crit_edge40_crit_edge, label %.lr.ph39.preheader

.._crit_edge40_crit_edge:                         ; preds = %54
  %.pre = load i32, ptr %6, align 4, !tbaa !5
  br label %._crit_edge40

.lr.ph39.preheader:                               ; preds = %54
  %wide.trip.count = zext nneg i32 %.1 to i64
  br label %.lr.ph39

._crit_edge40:                                    ; preds = %66, %.._crit_edge40_crit_edge
  %55 = phi i32 [ %.pre, %.._crit_edge40_crit_edge ], [ %.sink, %66 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #3
  store i32 %55, ptr %7, align 4, !tbaa !5
  %56 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %2, ptr noundef nonnull align 4 dereferenceable(4) %7)
  %57 = load i32, ptr %56, align 4, !tbaa !5
  %58 = getelementptr inbounds [12345 x [2 x i32]], ptr @dp, i64 0, i64 %16, i64 1
  store i32 %57, ptr %58, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #3
  br label %67

.lr.ph39:                                         ; preds = %.lr.ph39.preheader, %66
  %indvars.iv = phi i64 [ 2, %.lr.ph39.preheader ], [ %indvars.iv.next, %66 ]
  %59 = getelementptr inbounds [123456 x i32], ptr @a, i64 0, i64 %indvars.iv
  %60 = load i32, ptr %59, align 4, !tbaa !5
  %61 = load i32, ptr %5, align 4, !tbaa !5
  %.not31 = icmp sgt i32 %60, %61
  br i1 %.not31, label %63, label %62

62:                                               ; preds = %.lr.ph39
  store i32 %60, ptr %5, align 4, !tbaa !5
  br label %66

63:                                               ; preds = %.lr.ph39
  %64 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %6, ptr noundef nonnull align 4 dereferenceable(4) %59)
  %65 = load i32, ptr %64, align 4, !tbaa !5
  br label %66

66:                                               ; preds = %62, %63
  %.sink = phi i32 [ %65, %63 ], [ %61, %62 ]
  store i32 %.sink, ptr %6, align 4
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge40, label %.lr.ph39, !llvm.loop !14

67:                                               ; preds = %._crit_edge40, %._crit_edge.thread
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #3
  br label %68

68:                                               ; preds = %67, %11
  ret void
}

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #2

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 #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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !6, i64 4}
!10 = !{!"_ZTS4Edge", !6, i64 0, !6, i64 4, !6, i64 8, !6, i64 12}
!11 = !{!10, !6, i64 8}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = distinct !{!14, !13}


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