; LLVM IR from abeaumont/competitive-programming :: kattis (parking)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }

@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca [3 x i32], align 4
  %6 = alloca [3 x 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
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #5
  call void @llvm.lifetime.start.p0(i64 12, ptr %5) #5
  call void @llvm.lifetime.start.p0(i64 12, ptr %6) #5
  %13 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %14 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %13, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %15 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %14, ptr noundef nonnull align 4 dereferenceable(4) %4)
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %16

16:                                               ; preds = %29, %0
  %17 = load i32, ptr %7, align 4, !tbaa !5
  %18 = icmp slt i32 %17, 3
  br i1 %18, label %20, label %19

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

20:                                               ; preds = %16
  %21 = load i32, ptr %7, align 4, !tbaa !5
  %22 = sext i32 %21 to i64
  %23 = getelementptr inbounds [3 x i32], ptr %5, i64 0, i64 %22
  %24 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %23)
  %25 = load i32, ptr %7, align 4, !tbaa !5
  %26 = sext i32 %25 to i64
  %27 = getelementptr inbounds [3 x i32], ptr %6, i64 0, i64 %26
  %28 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %24, ptr noundef nonnull align 4 dereferenceable(4) %27)
  br label %29

29:                                               ; preds = %20
  %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 %16, !llvm.loop !9

32:                                               ; preds = %19
  %33 = getelementptr inbounds [3 x i32], ptr %5, i64 0, i64 0
  %34 = getelementptr inbounds [3 x i32], ptr %5, i64 0, i64 0
  %35 = getelementptr inbounds i32, ptr %34, i64 3
  call void @_ZSt4sortIPiEvT_S1_(ptr noundef %33, ptr noundef %35)
  %36 = getelementptr inbounds [3 x i32], ptr %6, i64 0, i64 0
  %37 = getelementptr inbounds [3 x i32], ptr %6, i64 0, i64 0
  %38 = getelementptr inbounds i32, ptr %37, i64 3
  call void @_ZSt4sortIPiEvT_S1_(ptr noundef %36, ptr noundef %38)
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  store i32 0, ptr %8, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  store i32 0, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  store i32 0, ptr %10, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  store i32 0, ptr %11, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  store i32 0, ptr %12, align 4, !tbaa !5
  br label %39

39:                                               ; preds = %144, %32
  %40 = load i32, ptr %10, align 4, !tbaa !5
  %41 = icmp slt i32 %40, 3
  br i1 %41, label %42, label %145

42:                                               ; preds = %39
  %43 = load i32, ptr %10, align 4, !tbaa !5
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds [3 x i32], ptr %5, i64 0, i64 %44
  %46 = load i32, ptr %45, align 4, !tbaa !5
  %47 = load i32, ptr %11, align 4, !tbaa !5
  %48 = sext i32 %47 to i64
  %49 = getelementptr inbounds [3 x i32], ptr %6, i64 0, i64 %48
  %50 = load i32, ptr %49, align 4, !tbaa !5
  %51 = icmp sle i32 %46, %50
  br i1 %51, label %52, label %98

52:                                               ; preds = %42
  %53 = load i32, ptr %9, align 4, !tbaa !5
  switch i32 %53, label %77 [
    i32 0, label %89
    i32 1, label %54
    i32 2, label %65
  ]

54:                                               ; preds = %52
  %55 = load i32, ptr %10, align 4, !tbaa !5
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds [3 x i32], ptr %5, i64 0, i64 %56
  %58 = load i32, ptr %57, align 4, !tbaa !5
  %59 = load i32, ptr %12, align 4, !tbaa !5
  %60 = sub nsw i32 %58, %59
  %61 = load i32, ptr %2, align 4, !tbaa !5
  %62 = mul nsw i32 %60, %61
  %63 = load i32, ptr %8, align 4, !tbaa !5
  %64 = add nsw i32 %63, %62
  store i32 %64, ptr %8, align 4, !tbaa !5
  br label %89

65:                                               ; preds = %52
  %66 = load i32, ptr %10, align 4, !tbaa !5
  %67 = sext i32 %66 to i64
  %68 = getelementptr inbounds [3 x i32], ptr %5, i64 0, i64 %67
  %69 = load i32, ptr %68, align 4, !tbaa !5
  %70 = load i32, ptr %12, align 4, !tbaa !5
  %71 = sub nsw i32 %69, %70
  %72 = load i32, ptr %3, align 4, !tbaa !5
  %73 = mul nsw i32 %71, %72
  %74 = mul nsw i32 %73, 2
  %75 = load i32, ptr %8, align 4, !tbaa !5
  %76 = add nsw i32 %75, %74
  store i32 %76, ptr %8, align 4, !tbaa !5
  br label %89

77:                                               ; preds = %52
  %78 = load i32, ptr %10, align 4, !tbaa !5
  %79 = sext i32 %78 to i64
  %80 = getelementptr inbounds [3 x i32], ptr %5, i64 0, i64 %79
  %81 = load i32, ptr %80, align 4, !tbaa !5
  %82 = load i32, ptr %12, align 4, !tbaa !5
  %83 = sub nsw i32 %81, %82
  %84 = load i32, ptr %4, align 4, !tbaa !5
  %85 = mul nsw i32 %83, %84
  %86 = mul nsw i32 %85, 3
  %87 = load i32, ptr %8, align 4, !tbaa !5
  %88 = add nsw i32 %87, %86
  store i32 %88, ptr %8, align 4, !tbaa !5
  br label %89

89:                                               ; preds = %77, %65, %54, %52
  %90 = load i32, ptr %10, align 4, !tbaa !5
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds [3 x i32], ptr %5, i64 0, i64 %91
  %93 = load i32, ptr %92, align 4, !tbaa !5
  store i32 %93, ptr %12, align 4, !tbaa !5
  %94 = load i32, ptr %9, align 4, !tbaa !5
  %95 = add nsw i32 %94, 1
  store i32 %95, ptr %9, align 4, !tbaa !5
  %96 = load i32, ptr %10, align 4, !tbaa !5
  %97 = add nsw i32 %96, 1
  store i32 %97, ptr %10, align 4, !tbaa !5
  br label %144

98:                                               ; preds = %42
  %99 = load i32, ptr %9, align 4, !tbaa !5
  switch i32 %99, label %123 [
    i32 1, label %100
    i32 2, label %111
  ]

100:                                              ; preds = %98
  %101 = load i32, ptr %11, align 4, !tbaa !5
  %102 = sext i32 %101 to i64
  %103 = getelementptr inbounds [3 x i32], ptr %6, i64 0, i64 %102
  %104 = load i32, ptr %103, align 4, !tbaa !5
  %105 = load i32, ptr %12, align 4, !tbaa !5
  %106 = sub nsw i32 %104, %105
  %107 = load i32, ptr %2, align 4, !tbaa !5
  %108 = mul nsw i32 %106, %107
  %109 = load i32, ptr %8, align 4, !tbaa !5
  %110 = add nsw i32 %109, %108
  store i32 %110, ptr %8, align 4, !tbaa !5
  br label %135

111:                                              ; preds = %98
  %112 = load i32, ptr %11, align 4, !tbaa !5
  %113 = sext i32 %112 to i64
  %114 = getelementptr inbounds [3 x i32], ptr %6, i64 0, i64 %113
  %115 = load i32, ptr %114, align 4, !tbaa !5
  %116 = load i32, ptr %12, align 4, !tbaa !5
  %117 = sub nsw i32 %115, %116
  %118 = load i32, ptr %3, align 4, !tbaa !5
  %119 = mul nsw i32 %117, %118
  %120 = mul nsw i32 %119, 2
  %121 = load i32, ptr %8, align 4, !tbaa !5
  %122 = add nsw i32 %121, %120
  store i32 %122, ptr %8, align 4, !tbaa !5
  br label %135

123:                                              ; preds = %98
  %124 = load i32, ptr %11, align 4, !tbaa !5
  %125 = sext i32 %124 to i64
  %126 = getelementptr inbounds [3 x i32], ptr %6, i64 0, i64 %125
  %127 = load i32, ptr %126, align 4, !tbaa !5
  %128 = load i32, ptr %12, align 4, !tbaa !5
  %129 = sub nsw i32 %127, %128
  %130 = load i32, ptr %4, align 4, !tbaa !5
  %131 = mul nsw i32 %129, %130
  %132 = mul nsw i32 %131, 3
  %133 = load i32, ptr %8, align 4, !tbaa !5
  %134 = add nsw i32 %133, %132
  store i32 %134, ptr %8, align 4, !tbaa !5
  br label %135

135:                                              ; preds = %123, %111, %100
  %136 = load i32, ptr %9, align 4, !tbaa !5
  %137 = add nsw i32 %136, -1
  store i32 %137, ptr %9, align 4, !tbaa !5
  %138 = load i32, ptr %11, align 4, !tbaa !5
  %139 = sext i32 %138 to i64
  %140 = getelementptr inbounds [3 x i32], ptr %6, i64 0, i64 %139
  %141 = load i32, ptr %140, align 4, !tbaa !5
  store i32 %141, ptr %12, align 4, !tbaa !5
  %142 = load i32, ptr %11, align 4, !tbaa !5
  %143 = add nsw i32 %142, 1
  store i32 %143, ptr %11, align 4, !tbaa !5
  br label %144

144:                                              ; preds = %135, %89
  br label %39, !llvm.loop !11

145:                                              ; preds = %39
  br label %146

146:                                              ; preds = %186, %145
  %147 = load i32, ptr %11, align 4, !tbaa !5
  %148 = icmp slt i32 %147, 3
  br i1 %148, label %149, label %195

149:                                              ; preds = %146
  %150 = load i32, ptr %9, align 4, !tbaa !5
  switch i32 %150, label %174 [
    i32 1, label %151
    i32 2, label %162
  ]

151:                                              ; preds = %149
  %152 = load i32, ptr %11, align 4, !tbaa !5
  %153 = sext i32 %152 to i64
  %154 = getelementptr inbounds [3 x i32], ptr %6, i64 0, i64 %153
  %155 = load i32, ptr %154, align 4, !tbaa !5
  %156 = load i32, ptr %12, align 4, !tbaa !5
  %157 = sub nsw i32 %155, %156
  %158 = load i32, ptr %2, align 4, !tbaa !5
  %159 = mul nsw i32 %157, %158
  %160 = load i32, ptr %8, align 4, !tbaa !5
  %161 = add nsw i32 %160, %159
  store i32 %161, ptr %8, align 4, !tbaa !5
  br label %186

162:                                              ; preds = %149
  %163 = load i32, ptr %11, align 4, !tbaa !5
  %164 = sext i32 %163 to i64
  %165 = getelementptr inbounds [3 x i32], ptr %6, i64 0, i64 %164
  %166 = load i32, ptr %165, align 4, !tbaa !5
  %167 = load i32, ptr %12, align 4, !tbaa !5
  %168 = sub nsw i32 %166, %167
  %169 = load i32, ptr %3, align 4, !tbaa !5
  %170 = mul nsw i32 %168, %169
  %171 = mul nsw i32 %170, 2
  %172 = load i32, ptr %8, align 4, !tbaa !5
  %173 = add nsw i32 %172, %171
  store i32 %173, ptr %8, align 4, !tbaa !5
  br label %186

174:                                              ; preds = %149
  %175 = load i32, ptr %11, align 4, !tbaa !5
  %176 = sext i32 %175 to i64
  %177 = getelementptr inbounds [3 x i32], ptr %6, i64 0, i64 %176
  %178 = load i32, ptr %177, align 4, !tbaa !5
  %179 = load i32, ptr %12, align 4, !tbaa !5
  %180 = sub nsw i32 %178, %179
  %181 = load i32, ptr %4, align 4, !tbaa !5
  %182 = mul nsw i32 %180, %181
  %183 = mul nsw i32 %182, 3
  %184 = load i32, ptr %8, align 4, !tbaa !5
  %185 = add nsw i32 %184, %183
  store i32 %185, ptr %8, align 4, !tbaa !5
  br label %186

186:                                              ; preds = %174, %162, %151
  %187 = load i32, ptr %9, align 4, !tbaa !5
  %188 = add nsw i32 %187, -1
  store i32 %188, ptr %9, align 4, !tbaa !5
  %189 = load i32, ptr %11, align 4, !tbaa !5
  %190 = sext i32 %189 to i64
  %191 = getelementptr inbounds [3 x i32], ptr %6, i64 0, i64 %190
  %192 = load i32, ptr %191, align 4, !tbaa !5
  store i32 %192, ptr %12, align 4, !tbaa !5
  %193 = load i32, ptr %11, align 4, !tbaa !5
  %194 = add nsw i32 %193, 1
  store i32 %194, ptr %11, align 4, !tbaa !5
  br label %146, !llvm.loop !12

195:                                              ; preds = %146
  %196 = load i32, ptr %8, align 4, !tbaa !5
  %197 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %196)
  %198 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %197, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 12, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 12, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #5
  %199 = load i32, ptr %1, align 4
  ret i32 %199
}

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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) #2

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIPiEvT_S1_(ptr noundef, ptr noundef) #3

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) #2

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #4 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #3

attributes #0 = { mustprogress norecurse 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 = { inlinehint 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 #4 = { 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 #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++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !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"

%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }

@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca [3 x i32], align 4
  %5 = alloca [3 x i32], align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #5
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %4) #5
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %5) #5
  %6 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %1)
  %7 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %6, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %8 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %7, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %9 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %10 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %9, ptr noundef nonnull align 4 dereferenceable(4) %5)
  %11 = getelementptr inbounds i8, ptr %4, i64 4
  %12 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %11)
  %13 = getelementptr inbounds i8, ptr %5, i64 4
  %14 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %12, ptr noundef nonnull align 4 dereferenceable(4) %13)
  %15 = getelementptr inbounds i8, ptr %4, i64 8
  %16 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %15)
  %17 = getelementptr inbounds i8, ptr %5, i64 8
  %18 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %16, ptr noundef nonnull align 4 dereferenceable(4) %17)
  %19 = getelementptr inbounds i8, ptr %4, i64 12
  call void @_ZSt4sortIPiEvT_S1_(ptr noundef nonnull %4, ptr noundef nonnull %19)
  %20 = getelementptr inbounds i8, ptr %5, i64 12
  call void @_ZSt4sortIPiEvT_S1_(ptr noundef nonnull %5, ptr noundef nonnull %20)
  %21 = load i32, ptr %2, align 4
  %factor.op.mul = shl i32 %21, 1
  %22 = load i32, ptr %1, align 4
  %23 = load i32, ptr %3, align 4
  %factor.op.mul70 = mul i32 %23, 3
  br label %26

.preheader:                                       ; preds = %56
  %24 = icmp slt i32 %.150, 3
  br i1 %24, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %.preheader
  %25 = sext i32 %.150 to i64
  br label %58

26:                                               ; preds = %0, %56
  %.069 = phi i32 [ 0, %0 ], [ %.1, %56 ]
  %.04968 = phi i32 [ 0, %0 ], [ %.150, %56 ]
  %.05267 = phi i32 [ 0, %0 ], [ %.153, %56 ]
  %.05466 = phi i32 [ 0, %0 ], [ %.155, %56 ]
  %.05765 = phi i32 [ 0, %0 ], [ %.3, %56 ]
  %27 = sext i32 %.05267 to i64
  %28 = getelementptr inbounds [3 x i32], ptr %4, i64 0, i64 %27
  %29 = load i32, ptr %28, align 4, !tbaa !5
  %30 = sext i32 %.04968 to i64
  %31 = getelementptr inbounds [3 x i32], ptr %5, i64 0, i64 %30
  %32 = load i32, ptr %31, align 4, !tbaa !5
  %.not = icmp sgt i32 %29, %32
  br i1 %.not, label %47, label %33

33:                                               ; preds = %26
  switch i32 %.05466, label %41 [
    i32 0, label %44
    i32 1, label %34
    i32 2, label %38
  ]

34:                                               ; preds = %33
  %35 = sub nsw i32 %29, %.069
  %36 = mul nsw i32 %22, %35
  %37 = add nsw i32 %36, %.05765
  br label %44

38:                                               ; preds = %33
  %39 = sub nsw i32 %29, %.069
  %.reass = mul i32 %39, %factor.op.mul
  %40 = add nsw i32 %.reass, %.05765
  br label %44

41:                                               ; preds = %33
  %42 = sub nsw i32 %29, %.069
  %.reass71 = mul i32 %42, %factor.op.mul70
  %43 = add nsw i32 %.reass71, %.05765
  br label %44

44:                                               ; preds = %41, %38, %34, %33
  %.158 = phi i32 [ %43, %41 ], [ %40, %38 ], [ %37, %34 ], [ %.05765, %33 ]
  %45 = add nsw i32 %.05466, 1
  %46 = add nsw i32 %.05267, 1
  br label %56

47:                                               ; preds = %26
  %48 = sub nsw i32 %32, %.069
  switch i32 %.05466, label %52 [
    i32 1, label %49
    i32 2, label %51
  ]

49:                                               ; preds = %47
  %50 = mul nsw i32 %22, %48
  br label %53

51:                                               ; preds = %47
  %.reass73 = mul i32 %48, %factor.op.mul
  br label %53

52:                                               ; preds = %47
  %.reass75 = mul i32 %48, %factor.op.mul70
  br label %53

53:                                               ; preds = %52, %51, %49
  %.pn63 = phi i32 [ %.reass75, %52 ], [ %.reass73, %51 ], [ %50, %49 ]
  %.259 = add nsw i32 %.pn63, %.05765
  %54 = add nsw i32 %.05466, -1
  %55 = add nsw i32 %.04968, 1
  br label %56

56:                                               ; preds = %53, %44
  %.1 = phi i32 [ %29, %44 ], [ %32, %53 ]
  %.3 = phi i32 [ %.158, %44 ], [ %.259, %53 ]
  %.155 = phi i32 [ %45, %44 ], [ %54, %53 ]
  %.153 = phi i32 [ %46, %44 ], [ %.05267, %53 ]
  %.150 = phi i32 [ %.04968, %44 ], [ %55, %53 ]
  %57 = icmp slt i32 %.153, 3
  br i1 %57, label %26, label %.preheader, !llvm.loop !9

58:                                               ; preds = %.lr.ph, %68
  %indvars.iv = phi i64 [ %25, %.lr.ph ], [ %indvars.iv.next, %68 ]
  %.279 = phi i32 [ %.1, %.lr.ph ], [ %60, %68 ]
  %.25677 = phi i32 [ %.155, %.lr.ph ], [ %69, %68 ]
  %.476 = phi i32 [ %.3, %.lr.ph ], [ %.5, %68 ]
  %59 = getelementptr inbounds [3 x i32], ptr %5, i64 0, i64 %indvars.iv
  %60 = load i32, ptr %59, align 4, !tbaa !5
  %61 = sub nsw i32 %60, %.279
  switch i32 %.25677, label %66 [
    i32 1, label %62
    i32 2, label %64
  ]

62:                                               ; preds = %58
  %63 = mul nsw i32 %61, %22
  br label %68

64:                                               ; preds = %58
  %65 = mul i32 %factor.op.mul, %61
  br label %68

66:                                               ; preds = %58
  %67 = mul i32 %factor.op.mul70, %61
  br label %68

68:                                               ; preds = %66, %64, %62
  %.pn = phi i32 [ %67, %66 ], [ %65, %64 ], [ %63, %62 ]
  %.5 = add nsw i32 %.pn, %.476
  %69 = add nsw i32 %.25677, -1
  %indvars.iv.next = add nsw i64 %indvars.iv, 1
  %70 = and i64 %indvars.iv.next, 4294967295
  %exitcond.not = icmp eq i64 %70, 3
  br i1 %exitcond.not, label %._crit_edge, label %58, !llvm.loop !11

._crit_edge:                                      ; preds = %68, %.preheader
  %.4.lcssa = phi i32 [ %.3, %.preheader ], [ %.5, %68 ]
  %71 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %.4.lcssa)
  %72 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %71, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %5) #5
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %4) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #5
  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
}

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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #2

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIPiEvT_S1_(ptr noundef, ptr noundef) local_unnamed_addr #3

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #4 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #3

attributes #0 = { mustprogress norecurse 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 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 #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++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}


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