; LLVM IR from eyangch/competitive-programming :: USACOtraining/4.2 (job)

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

@N = external dso_local global i32, align 4
@M1 = external dso_local global i32, align 4
@M2 = external dso_local global i32, align 4
@a = external dso_local global [30 x i32], align 16
@b = external dso_local global [30 x i32], align 16
@aq = external dso_local global [30 x i32], align 16
@bq = external dso_local global [30 x i32], align 16
@ao = external dso_local global [1000 x i32], align 16
@.str = external hidden unnamed_addr constant [7 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1
@stdin = external global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1
@stdout = external global ptr, align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str.4 = external hidden unnamed_addr constant [2 x i8], align 1

; 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 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
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %17 = load ptr, ptr @stdin, align 8, !tbaa !5
  %18 = call ptr @freopen(ptr noundef @.str, ptr noundef @.str.1, ptr noundef %17)
  %19 = load ptr, ptr @stdout, align 8, !tbaa !5
  %20 = call ptr @freopen(ptr noundef @.str.2, ptr noundef @.str.3, ptr noundef %19)
  %21 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %22 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !9
  %23 = getelementptr i8, ptr %22, i64 -24
  %24 = load i64, ptr %23, align 8
  %25 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %24
  %26 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %25, ptr noundef null)
  %27 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @N)
  %28 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %27, ptr noundef nonnull align 4 dereferenceable(4) @M1)
  %29 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %28, ptr noundef nonnull align 4 dereferenceable(4) @M2)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #7
  store i32 0, ptr %2, align 4, !tbaa !11
  br label %30

30:                                               ; preds = %45, %0
  %31 = load i32, ptr %2, align 4, !tbaa !11
  %32 = load i32, ptr @M1, align 4, !tbaa !11
  %33 = icmp slt i32 %31, %32
  br i1 %33, label %35, label %34

34:                                               ; preds = %30
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #7
  br label %48

35:                                               ; preds = %30
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #7
  %36 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %37 = load i32, ptr %3, align 4, !tbaa !11
  %38 = load i32, ptr %2, align 4, !tbaa !11
  %39 = sext i32 %38 to i64
  %40 = getelementptr inbounds [30 x i32], ptr @a, i64 0, i64 %39
  store i32 %37, ptr %40, align 4, !tbaa !11
  %41 = load i32, ptr %3, align 4, !tbaa !11
  %42 = load i32, ptr %2, align 4, !tbaa !11
  %43 = sext i32 %42 to i64
  %44 = getelementptr inbounds [30 x i32], ptr @aq, i64 0, i64 %43
  store i32 %41, ptr %44, align 4, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #7
  br label %45

45:                                               ; preds = %35
  %46 = load i32, ptr %2, align 4, !tbaa !11
  %47 = add nsw i32 %46, 1
  store i32 %47, ptr %2, align 4, !tbaa !11
  br label %30, !llvm.loop !13

48:                                               ; preds = %34
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #7
  store i32 0, ptr %4, align 4, !tbaa !11
  br label %49

49:                                               ; preds = %64, %48
  %50 = load i32, ptr %4, align 4, !tbaa !11
  %51 = load i32, ptr @M2, align 4, !tbaa !11
  %52 = icmp slt i32 %50, %51
  br i1 %52, label %54, label %53

53:                                               ; preds = %49
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #7
  br label %67

54:                                               ; preds = %49
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #7
  %55 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %5)
  %56 = load i32, ptr %5, align 4, !tbaa !11
  %57 = load i32, ptr %4, align 4, !tbaa !11
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds [30 x i32], ptr @b, i64 0, i64 %58
  store i32 %56, ptr %59, align 4, !tbaa !11
  %60 = load i32, ptr %5, align 4, !tbaa !11
  %61 = load i32, ptr %4, align 4, !tbaa !11
  %62 = sext i32 %61 to i64
  %63 = getelementptr inbounds [30 x i32], ptr @bq, i64 0, i64 %62
  store i32 %60, ptr %63, align 4, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #7
  br label %64

64:                                               ; preds = %54
  %65 = load i32, ptr %4, align 4, !tbaa !11
  %66 = add nsw i32 %65, 1
  store i32 %66, ptr %4, align 4, !tbaa !11
  br label %49, !llvm.loop !15

67:                                               ; preds = %53
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  store i32 0, ptr %6, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #7
  store i32 0, ptr %7, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #7
  store i32 0, ptr %8, align 4, !tbaa !11
  br label %68

68:                                               ; preds = %111, %67
  %69 = load i32, ptr %8, align 4, !tbaa !11
  %70 = load i32, ptr @N, align 4, !tbaa !11
  %71 = icmp slt i32 %69, %70
  br i1 %71, label %73, label %72

72:                                               ; preds = %68
  store i32 8, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  br label %114

73:                                               ; preds = %68
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  store i32 2147483647, ptr %10, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #7
  store i32 0, ptr %11, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  store i32 0, ptr %12, align 4, !tbaa !11
  br label %74

74:                                               ; preds = %93, %73
  %75 = load i32, ptr %12, align 4, !tbaa !11
  %76 = load i32, ptr @M1, align 4, !tbaa !11
  %77 = icmp slt i32 %75, %76
  br i1 %77, label %79, label %78

78:                                               ; preds = %74
  store i32 11, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  br label %96

79:                                               ; preds = %74
  %80 = load i32, ptr %12, align 4, !tbaa !11
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds [30 x i32], ptr @aq, i64 0, i64 %81
  %83 = load i32, ptr %82, align 4, !tbaa !11
  %84 = load i32, ptr %10, align 4, !tbaa !11
  %85 = icmp slt i32 %83, %84
  br i1 %85, label %86, label %92

86:                                               ; preds = %79
  %87 = load i32, ptr %12, align 4, !tbaa !11
  %88 = sext i32 %87 to i64
  %89 = getelementptr inbounds [30 x i32], ptr @aq, i64 0, i64 %88
  %90 = load i32, ptr %89, align 4, !tbaa !11
  store i32 %90, ptr %10, align 4, !tbaa !11
  %91 = load i32, ptr %12, align 4, !tbaa !11
  store i32 %91, ptr %11, align 4, !tbaa !11
  br label %92

92:                                               ; preds = %86, %79
  br label %93

93:                                               ; preds = %92
  %94 = load i32, ptr %12, align 4, !tbaa !11
  %95 = add nsw i32 %94, 1
  store i32 %95, ptr %12, align 4, !tbaa !11
  br label %74, !llvm.loop !16

96:                                               ; preds = %78
  %97 = load i32, ptr %11, align 4, !tbaa !11
  %98 = sext i32 %97 to i64
  %99 = getelementptr inbounds [30 x i32], ptr @a, i64 0, i64 %98
  %100 = load i32, ptr %99, align 4, !tbaa !11
  %101 = load i32, ptr %11, align 4, !tbaa !11
  %102 = sext i32 %101 to i64
  %103 = getelementptr inbounds [30 x i32], ptr @aq, i64 0, i64 %102
  %104 = load i32, ptr %103, align 4, !tbaa !11
  %105 = add nsw i32 %104, %100
  store i32 %105, ptr %103, align 4, !tbaa !11
  %106 = load i32, ptr %10, align 4, !tbaa !11
  store i32 %106, ptr %6, align 4, !tbaa !11
  %107 = load i32, ptr %10, align 4, !tbaa !11
  %108 = load i32, ptr %8, align 4, !tbaa !11
  %109 = sext i32 %108 to i64
  %110 = getelementptr inbounds [1000 x i32], ptr @ao, i64 0, i64 %109
  store i32 %107, ptr %110, align 4, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  br label %111

111:                                              ; preds = %96
  %112 = load i32, ptr %8, align 4, !tbaa !11
  %113 = add nsw i32 %112, 1
  store i32 %113, ptr %8, align 4, !tbaa !11
  br label %68, !llvm.loop !17

114:                                              ; preds = %72
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #7
  %115 = load i32, ptr @N, align 4, !tbaa !11
  %116 = sub nsw i32 %115, 1
  store i32 %116, ptr %13, align 4, !tbaa !11
  br label %117

117:                                              ; preds = %166, %114
  %118 = load i32, ptr %13, align 4, !tbaa !11
  %119 = icmp sge i32 %118, 0
  br i1 %119, label %121, label %120

120:                                              ; preds = %117
  store i32 14, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  br label %169

121:                                              ; preds = %117
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #7
  store i32 2147483647, ptr %14, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #7
  store i32 0, ptr %15, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #7
  store i32 0, ptr %16, align 4, !tbaa !11
  br label %122

122:                                              ; preds = %151, %121
  %123 = load i32, ptr %16, align 4, !tbaa !11
  %124 = load i32, ptr @M2, align 4, !tbaa !11
  %125 = icmp slt i32 %123, %124
  br i1 %125, label %127, label %126

126:                                              ; preds = %122
  store i32 17, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #7
  br label %154

127:                                              ; preds = %122
  %128 = load i32, ptr %13, align 4, !tbaa !11
  %129 = sext i32 %128 to i64
  %130 = getelementptr inbounds [1000 x i32], ptr @ao, i64 0, i64 %129
  %131 = load i32, ptr %130, align 4, !tbaa !11
  %132 = load i32, ptr %16, align 4, !tbaa !11
  %133 = sext i32 %132 to i64
  %134 = getelementptr inbounds [30 x i32], ptr @bq, i64 0, i64 %133
  %135 = load i32, ptr %134, align 4, !tbaa !11
  %136 = add nsw i32 %131, %135
  %137 = load i32, ptr %14, align 4, !tbaa !11
  %138 = icmp slt i32 %136, %137
  br i1 %138, label %139, label %150

139:                                              ; preds = %127
  %140 = load i32, ptr %13, align 4, !tbaa !11
  %141 = sext i32 %140 to i64
  %142 = getelementptr inbounds [1000 x i32], ptr @ao, i64 0, i64 %141
  %143 = load i32, ptr %142, align 4, !tbaa !11
  %144 = load i32, ptr %16, align 4, !tbaa !11
  %145 = sext i32 %144 to i64
  %146 = getelementptr inbounds [30 x i32], ptr @bq, i64 0, i64 %145
  %147 = load i32, ptr %146, align 4, !tbaa !11
  %148 = add nsw i32 %143, %147
  store i32 %148, ptr %14, align 4, !tbaa !11
  %149 = load i32, ptr %16, align 4, !tbaa !11
  store i32 %149, ptr %15, align 4, !tbaa !11
  br label %150

150:                                              ; preds = %139, %127
  br label %151

151:                                              ; preds = %150
  %152 = load i32, ptr %16, align 4, !tbaa !11
  %153 = add nsw i32 %152, 1
  store i32 %153, ptr %16, align 4, !tbaa !11
  br label %122, !llvm.loop !18

154:                                              ; preds = %126
  %155 = load i32, ptr %15, align 4, !tbaa !11
  %156 = sext i32 %155 to i64
  %157 = getelementptr inbounds [30 x i32], ptr @b, i64 0, i64 %156
  %158 = load i32, ptr %157, align 4, !tbaa !11
  %159 = load i32, ptr %15, align 4, !tbaa !11
  %160 = sext i32 %159 to i64
  %161 = getelementptr inbounds [30 x i32], ptr @bq, i64 0, i64 %160
  %162 = load i32, ptr %161, align 4, !tbaa !11
  %163 = add nsw i32 %162, %158
  store i32 %163, ptr %161, align 4, !tbaa !11
  %164 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %7, ptr noundef nonnull align 4 dereferenceable(4) %14)
  %165 = load i32, ptr %164, align 4, !tbaa !11
  store i32 %165, ptr %7, align 4, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  br label %166

166:                                              ; preds = %154
  %167 = load i32, ptr %13, align 4, !tbaa !11
  %168 = add nsw i32 %167, -1
  store i32 %168, ptr %13, align 4, !tbaa !11
  br label %117, !llvm.loop !19

169:                                              ; preds = %120
  %170 = load i32, ptr %6, align 4, !tbaa !11
  %171 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %170)
  %172 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %171, ptr noundef @.str.4)
  %173 = load i32, ptr %7, align 4, !tbaa !11
  %174 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %172, i32 noundef %173)
  %175 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %174, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  %176 = load i32, ptr %1, align 4
  ret i32 %176
}

declare ptr @freopen(ptr noundef, ptr noundef, ptr noundef) #1

declare noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext) #1

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264), ptr noundef) #2 align 2

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

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

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

; 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)) #4

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #5

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #6 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)) #5

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 = { "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 = { 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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 #5 = { 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 #6 = { 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 #7 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"vtable pointer", !8, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = distinct !{!16, !14}
!17 = distinct !{!17, !14}
!18 = distinct !{!18, !14}
!19 = distinct !{!19, !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"

%"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" }

@N = external dso_local global i32, align 4
@M1 = external dso_local global i32, align 4
@M2 = external dso_local global i32, align 4
@a = external dso_local local_unnamed_addr global [30 x i32], align 16
@b = external dso_local local_unnamed_addr global [30 x i32], align 16
@aq = external dso_local local_unnamed_addr global [30 x i32], align 16
@bq = external dso_local local_unnamed_addr global [30 x i32], align 16
@ao = external dso_local local_unnamed_addr global [1000 x i32], align 16
@.str = external hidden unnamed_addr constant [7 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [2 x i8], align 1
@stdin = external local_unnamed_addr global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [2 x i8], align 1
@stdout = external local_unnamed_addr global ptr, align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str.4 = external hidden unnamed_addr constant [2 x i8], align 1

; 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 i32, align 4
  %5 = load ptr, ptr @stdin, align 8, !tbaa !5
  %6 = tail call ptr @freopen(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, ptr noundef %5)
  %7 = load ptr, ptr @stdout, align 8, !tbaa !5
  %8 = tail call ptr @freopen(ptr noundef nonnull @.str.2, ptr noundef nonnull @.str.3, ptr noundef %7)
  %9 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %10 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !9
  %11 = getelementptr i8, ptr %10, i64 -24
  %12 = load i64, ptr %11, align 8
  %13 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %12
  %14 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %13, ptr noundef null)
  %15 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @N)
  %16 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %15, ptr noundef nonnull align 4 dereferenceable(4) @M1)
  %17 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %16, ptr noundef nonnull align 4 dereferenceable(4) @M2)
  %18 = load i32, ptr @M1, align 4, !tbaa !11
  %19 = icmp sgt i32 %18, 0
  br i1 %19, label %.lr.ph, label %.preheader50

.preheader50:                                     ; preds = %.lr.ph, %0
  %20 = load i32, ptr @M2, align 4, !tbaa !11
  %21 = icmp sgt i32 %20, 0
  br i1 %21, label %.lr.ph53, label %._crit_edge

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %0 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #8
  %22 = 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)
  %23 = load i32, ptr %1, align 4, !tbaa !11
  %24 = getelementptr inbounds [30 x i32], ptr @a, i64 0, i64 %indvars.iv
  store i32 %23, ptr %24, align 4, !tbaa !11
  %25 = getelementptr inbounds [30 x i32], ptr @aq, i64 0, i64 %indvars.iv
  store i32 %23, ptr %25, align 4, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #8
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %26 = load i32, ptr @M1, align 4, !tbaa !11
  %27 = sext i32 %26 to i64
  %28 = icmp slt i64 %indvars.iv.next, %27
  br i1 %28, label %.lr.ph, label %.preheader50, !llvm.loop !13

._crit_edge:                                      ; preds = %.lr.ph53, %.preheader50
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #8
  store i32 0, ptr %3, align 4, !tbaa !11
  %29 = load i32, ptr @N, align 4, !tbaa !11
  %30 = icmp sgt i32 %29, 0
  br i1 %30, label %.preheader49.lr.ph, label %._crit_edge73

.preheader49.lr.ph:                               ; preds = %._crit_edge
  %31 = load i32, ptr @M1, align 4, !tbaa !11
  %32 = icmp sgt i32 %31, 0
  br i1 %32, label %.preheader49.us.preheader, label %.preheader49.lr.ph.split

.preheader49.us.preheader:                        ; preds = %.preheader49.lr.ph
  %wide.trip.count89 = zext nneg i32 %29 to i64
  %wide.trip.count84 = zext nneg i32 %31 to i64
  %xtraiter = and i64 %wide.trip.count84, 3
  %33 = icmp ult i32 %31, 4
  %unroll_iter = and i64 %wide.trip.count84, 2147483644
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br label %.preheader49.us

.preheader49.us:                                  ; preds = %.preheader49.us.preheader, %._crit_edge58.us
  %indvars.iv86 = phi i64 [ 0, %.preheader49.us.preheader ], [ %indvars.iv.next87, %._crit_edge58.us ]
  br i1 %33, label %._crit_edge58.us.unr-lcssa, label %.preheader49.us.new

.preheader49.us.new:                              ; preds = %.preheader49.us, %.preheader49.us.new
  %indvars.iv81 = phi i64 [ %indvars.iv.next82.3, %.preheader49.us.new ], [ 0, %.preheader49.us ]
  %.03755.us = phi i32 [ %spec.select48.us.3, %.preheader49.us.new ], [ 0, %.preheader49.us ]
  %.03954.us = phi i32 [ %spec.select.us.3, %.preheader49.us.new ], [ 2147483647, %.preheader49.us ]
  %niter = phi i64 [ %niter.next.3, %.preheader49.us.new ], [ 0, %.preheader49.us ]
  %34 = getelementptr inbounds [30 x i32], ptr @aq, i64 0, i64 %indvars.iv81
  %35 = load i32, ptr %34, align 16, !tbaa !11
  %36 = icmp slt i32 %35, %.03954.us
  %spec.select.us = call i32 @llvm.smin.i32(i32 %35, i32 %.03954.us)
  %37 = trunc nuw nsw i64 %indvars.iv81 to i32
  %spec.select48.us = select i1 %36, i32 %37, i32 %.03755.us
  %indvars.iv.next82 = or disjoint i64 %indvars.iv81, 1
  %38 = getelementptr inbounds [30 x i32], ptr @aq, i64 0, i64 %indvars.iv.next82
  %39 = load i32, ptr %38, align 4, !tbaa !11
  %40 = icmp slt i32 %39, %spec.select.us
  %spec.select.us.1 = call i32 @llvm.smin.i32(i32 %39, i32 %spec.select.us)
  %41 = trunc nuw nsw i64 %indvars.iv.next82 to i32
  %spec.select48.us.1 = select i1 %40, i32 %41, i32 %spec.select48.us
  %indvars.iv.next82.1 = or disjoint i64 %indvars.iv81, 2
  %42 = getelementptr inbounds [30 x i32], ptr @aq, i64 0, i64 %indvars.iv.next82.1
  %43 = load i32, ptr %42, align 8, !tbaa !11
  %44 = icmp slt i32 %43, %spec.select.us.1
  %spec.select.us.2 = call i32 @llvm.smin.i32(i32 %43, i32 %spec.select.us.1)
  %45 = trunc nuw nsw i64 %indvars.iv.next82.1 to i32
  %spec.select48.us.2 = select i1 %44, i32 %45, i32 %spec.select48.us.1
  %indvars.iv.next82.2 = or disjoint i64 %indvars.iv81, 3
  %46 = getelementptr inbounds [30 x i32], ptr @aq, i64 0, i64 %indvars.iv.next82.2
  %47 = load i32, ptr %46, align 4, !tbaa !11
  %48 = icmp slt i32 %47, %spec.select.us.2
  %spec.select.us.3 = call i32 @llvm.smin.i32(i32 %47, i32 %spec.select.us.2)
  %49 = trunc nuw nsw i64 %indvars.iv.next82.2 to i32
  %spec.select48.us.3 = select i1 %48, i32 %49, i32 %spec.select48.us.2
  %indvars.iv.next82.3 = add nuw nsw i64 %indvars.iv81, 4
  %niter.next.3 = add i64 %niter, 4
  %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3, label %._crit_edge58.us.unr-lcssa, label %.preheader49.us.new, !llvm.loop !15

._crit_edge58.us.unr-lcssa:                       ; preds = %.preheader49.us.new, %.preheader49.us
  %spec.select.us.lcssa.ph = phi i32 [ poison, %.preheader49.us ], [ %spec.select.us.3, %.preheader49.us.new ]
  %spec.select48.us.lcssa.ph = phi i32 [ poison, %.preheader49.us ], [ %spec.select48.us.3, %.preheader49.us.new ]
  %indvars.iv81.unr = phi i64 [ 0, %.preheader49.us ], [ %indvars.iv.next82.3, %.preheader49.us.new ]
  %.03755.us.unr = phi i32 [ 0, %.preheader49.us ], [ %spec.select48.us.3, %.preheader49.us.new ]
  %.03954.us.unr = phi i32 [ 2147483647, %.preheader49.us ], [ %spec.select.us.3, %.preheader49.us.new ]
  br i1 %lcmp.mod.not, label %._crit_edge58.us, label %.epil.preheader

.epil.preheader:                                  ; preds = %._crit_edge58.us.unr-lcssa, %.epil.preheader
  %indvars.iv81.epil = phi i64 [ %indvars.iv.next82.epil, %.epil.preheader ], [ %indvars.iv81.unr, %._crit_edge58.us.unr-lcssa ]
  %.03755.us.epil = phi i32 [ %spec.select48.us.epil, %.epil.preheader ], [ %.03755.us.unr, %._crit_edge58.us.unr-lcssa ]
  %.03954.us.epil = phi i32 [ %spec.select.us.epil, %.epil.preheader ], [ %.03954.us.unr, %._crit_edge58.us.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.epil.preheader ], [ 0, %._crit_edge58.us.unr-lcssa ]
  %50 = getelementptr inbounds [30 x i32], ptr @aq, i64 0, i64 %indvars.iv81.epil
  %51 = load i32, ptr %50, align 4, !tbaa !11
  %52 = icmp slt i32 %51, %.03954.us.epil
  %spec.select.us.epil = call i32 @llvm.smin.i32(i32 %51, i32 %.03954.us.epil)
  %53 = trunc nuw nsw i64 %indvars.iv81.epil to i32
  %spec.select48.us.epil = select i1 %52, i32 %53, i32 %.03755.us.epil
  %indvars.iv.next82.epil = add nuw nsw i64 %indvars.iv81.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
  br i1 %epil.iter.cmp.not, label %._crit_edge58.us, label %.epil.preheader, !llvm.loop !16

._crit_edge58.us:                                 ; preds = %.epil.preheader, %._crit_edge58.us.unr-lcssa
  %spec.select.us.lcssa = phi i32 [ %spec.select.us.lcssa.ph, %._crit_edge58.us.unr-lcssa ], [ %spec.select.us.epil, %.epil.preheader ]
  %spec.select48.us.lcssa = phi i32 [ %spec.select48.us.lcssa.ph, %._crit_edge58.us.unr-lcssa ], [ %spec.select48.us.epil, %.epil.preheader ]
  %54 = sext i32 %spec.select48.us.lcssa to i64
  %55 = getelementptr inbounds [30 x i32], ptr @a, i64 0, i64 %54
  %56 = load i32, ptr %55, align 4, !tbaa !11
  %57 = getelementptr inbounds [30 x i32], ptr @aq, i64 0, i64 %54
  %58 = load i32, ptr %57, align 4, !tbaa !11
  %59 = add nsw i32 %58, %56
  store i32 %59, ptr %57, align 4, !tbaa !11
  %60 = getelementptr inbounds [1000 x i32], ptr @ao, i64 0, i64 %indvars.iv86
  store i32 %spec.select.us.lcssa, ptr %60, align 4, !tbaa !11
  %indvars.iv.next87 = add nuw nsw i64 %indvars.iv86, 1
  %exitcond90.not = icmp eq i64 %indvars.iv.next87, %wide.trip.count89
  br i1 %exitcond90.not, label %.preheader, label %.preheader49.us, !llvm.loop !18

.preheader49.lr.ph.split:                         ; preds = %.preheader49.lr.ph
  %61 = load i32, ptr @a, align 16, !tbaa !11
  %aq.promoted = load i32, ptr @aq, align 16, !tbaa !11
  %62 = mul i32 %61, %29
  %wide.trip.count = zext nneg i32 %29 to i64
  %min.iters.check = icmp ult i32 %29, 8
  br i1 %min.iters.check, label %.preheader49.preheader, label %vector.ph

.preheader49.preheader:                           ; preds = %middle.block, %.preheader49.lr.ph.split
  %indvars.iv78.ph = phi i64 [ 0, %.preheader49.lr.ph.split ], [ %n.vec, %middle.block ]
  br label %.preheader49

vector.ph:                                        ; preds = %.preheader49.lr.ph.split
  %n.vec = and i64 %wide.trip.count, 2147483640
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %63 = getelementptr inbounds [1000 x i32], ptr @ao, i64 0, i64 %index
  %64 = getelementptr inbounds i8, ptr %63, i64 16
  store <4 x i32> <i32 2147483647, i32 2147483647, i32 2147483647, i32 2147483647>, ptr %63, align 16, !tbaa !11
  store <4 x i32> <i32 2147483647, i32 2147483647, i32 2147483647, i32 2147483647>, ptr %64, align 16, !tbaa !11
  %index.next = add nuw i64 %index, 8
  %65 = icmp eq i64 %index.next, %n.vec
  br i1 %65, label %middle.block, label %vector.body, !llvm.loop !19

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %n.vec, %wide.trip.count
  br i1 %cmp.n, label %..preheader_crit_edge.split, label %.preheader49.preheader

.lr.ph53:                                         ; preds = %.preheader50, %.lr.ph53
  %indvars.iv75 = phi i64 [ %indvars.iv.next76, %.lr.ph53 ], [ 0, %.preheader50 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #8
  %66 = 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)
  %67 = load i32, ptr %2, align 4, !tbaa !11
  %68 = getelementptr inbounds [30 x i32], ptr @b, i64 0, i64 %indvars.iv75
  store i32 %67, ptr %68, align 4, !tbaa !11
  %69 = getelementptr inbounds [30 x i32], ptr @bq, i64 0, i64 %indvars.iv75
  store i32 %67, ptr %69, align 4, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #8
  %indvars.iv.next76 = add nuw nsw i64 %indvars.iv75, 1
  %70 = load i32, ptr @M2, align 4, !tbaa !11
  %71 = sext i32 %70 to i64
  %72 = icmp slt i64 %indvars.iv.next76, %71
  br i1 %72, label %.lr.ph53, label %._crit_edge, !llvm.loop !22

.preheader49:                                     ; preds = %.preheader49.preheader, %.preheader49
  %indvars.iv78 = phi i64 [ %indvars.iv.next79, %.preheader49 ], [ %indvars.iv78.ph, %.preheader49.preheader ]
  %73 = getelementptr inbounds [1000 x i32], ptr @ao, i64 0, i64 %indvars.iv78
  store i32 2147483647, ptr %73, align 4, !tbaa !11
  %indvars.iv.next79 = add nuw nsw i64 %indvars.iv78, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next79, %wide.trip.count
  br i1 %exitcond.not, label %..preheader_crit_edge.split, label %.preheader49, !llvm.loop !23

..preheader_crit_edge.split:                      ; preds = %.preheader49, %middle.block
  %74 = add i32 %aq.promoted, %62
  store i32 %74, ptr @aq, align 16, !tbaa !11
  br label %.preheader

.preheader:                                       ; preds = %._crit_edge58.us, %..preheader_crit_edge.split
  %.042.lcssa = phi i32 [ 2147483647, %..preheader_crit_edge.split ], [ %spec.select.us.lcssa, %._crit_edge58.us ]
  br i1 %30, label %.lr.ph72.preheader, label %._crit_edge73

.lr.ph72.preheader:                               ; preds = %.preheader
  %75 = zext nneg i32 %29 to i64
  br label %.lr.ph72

._crit_edge73:                                    ; preds = %._crit_edge69, %._crit_edge, %.preheader
  %.042.lcssa100 = phi i32 [ %.042.lcssa, %.preheader ], [ 0, %._crit_edge ], [ %.042.lcssa, %._crit_edge69 ]
  %76 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %.042.lcssa100)
  %77 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %76, ptr noundef nonnull @.str.4)
  %78 = load i32, ptr %3, align 4, !tbaa !11
  %79 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %77, i32 noundef %78)
  %80 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %79, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #8
  ret i32 0

.lr.ph72:                                         ; preds = %.lr.ph72.preheader, %._crit_edge69
  %indvars.iv96 = phi i64 [ %75, %.lr.ph72.preheader ], [ %indvars.iv.next97, %._crit_edge69 ]
  %indvars.iv.next97 = add nsw i64 %indvars.iv96, -1
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #8
  store i32 2147483647, ptr %4, align 4, !tbaa !11
  %81 = load i32, ptr @M2, align 4, !tbaa !11
  %82 = icmp sgt i32 %81, 0
  br i1 %82, label %.lr.ph68, label %._crit_edge69

.lr.ph68:                                         ; preds = %.lr.ph72
  %83 = getelementptr inbounds [1000 x i32], ptr @ao, i64 0, i64 %indvars.iv.next97
  %84 = load i32, ptr %83, align 4, !tbaa !11
  %wide.trip.count94 = zext nneg i32 %81 to i64
  %xtraiter104 = and i64 %wide.trip.count94, 1
  %85 = icmp eq i32 %81, 1
  br i1 %85, label %._crit_edge69.loopexit.unr-lcssa, label %.lr.ph68.new

.lr.ph68.new:                                     ; preds = %.lr.ph68
  %unroll_iter108 = and i64 %wide.trip.count94, 2147483646
  br label %101

._crit_edge69.loopexit.unr-lcssa:                 ; preds = %117, %.lr.ph68
  %.1.lcssa.ph = phi i32 [ poison, %.lr.ph68 ], [ %.1.1, %117 ]
  %indvars.iv91.unr = phi i64 [ 0, %.lr.ph68 ], [ %indvars.iv.next92.1, %117 ]
  %.03465.unr = phi i32 [ 0, %.lr.ph68 ], [ %.1.1, %117 ]
  %.unr = phi i32 [ 2147483647, %.lr.ph68 ], [ %118, %117 ]
  %lcmp.mod106.not = icmp eq i64 %xtraiter104, 0
  br i1 %lcmp.mod106.not, label %._crit_edge69, label %.epil.preheader103

.epil.preheader103:                               ; preds = %._crit_edge69.loopexit.unr-lcssa
  %86 = getelementptr inbounds [30 x i32], ptr @bq, i64 0, i64 %indvars.iv91.unr
  %87 = load i32, ptr %86, align 4, !tbaa !11
  %88 = add nsw i32 %87, %84
  %89 = icmp slt i32 %88, %.unr
  br i1 %89, label %90, label %._crit_edge69

90:                                               ; preds = %.epil.preheader103
  store i32 %88, ptr %4, align 4, !tbaa !11
  %91 = trunc nuw nsw i64 %indvars.iv91.unr to i32
  br label %._crit_edge69

._crit_edge69:                                    ; preds = %._crit_edge69.loopexit.unr-lcssa, %90, %.epil.preheader103, %.lr.ph72
  %.034.lcssa = phi i32 [ 0, %.lr.ph72 ], [ %.1.lcssa.ph, %._crit_edge69.loopexit.unr-lcssa ], [ %91, %90 ], [ %.03465.unr, %.epil.preheader103 ]
  %92 = sext i32 %.034.lcssa to i64
  %93 = getelementptr inbounds [30 x i32], ptr @b, i64 0, i64 %92
  %94 = load i32, ptr %93, align 4, !tbaa !11
  %95 = getelementptr inbounds [30 x i32], ptr @bq, i64 0, i64 %92
  %96 = load i32, ptr %95, align 4, !tbaa !11
  %97 = add nsw i32 %96, %94
  store i32 %97, ptr %95, align 4, !tbaa !11
  %98 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %99 = load i32, ptr %98, align 4, !tbaa !11
  store i32 %99, ptr %3, align 4, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #8
  %100 = icmp sgt i64 %indvars.iv96, 1
  br i1 %100, label %.lr.ph72, label %._crit_edge73, !llvm.loop !24

101:                                              ; preds = %117, %.lr.ph68.new
  %indvars.iv91 = phi i64 [ 0, %.lr.ph68.new ], [ %indvars.iv.next92.1, %117 ]
  %.03465 = phi i32 [ 0, %.lr.ph68.new ], [ %.1.1, %117 ]
  %102 = phi i32 [ 2147483647, %.lr.ph68.new ], [ %118, %117 ]
  %niter109 = phi i64 [ 0, %.lr.ph68.new ], [ %niter109.next.1, %117 ]
  %103 = getelementptr inbounds [30 x i32], ptr @bq, i64 0, i64 %indvars.iv91
  %104 = load i32, ptr %103, align 8, !tbaa !11
  %105 = add nsw i32 %104, %84
  %106 = icmp slt i32 %105, %102
  br i1 %106, label %107, label %109

107:                                              ; preds = %101
  store i32 %105, ptr %4, align 4, !tbaa !11
  %108 = trunc nuw nsw i64 %indvars.iv91 to i32
  br label %109

109:                                              ; preds = %101, %107
  %110 = phi i32 [ %105, %107 ], [ %102, %101 ]
  %.1 = phi i32 [ %108, %107 ], [ %.03465, %101 ]
  %indvars.iv.next92 = or disjoint i64 %indvars.iv91, 1
  %111 = getelementptr inbounds [30 x i32], ptr @bq, i64 0, i64 %indvars.iv.next92
  %112 = load i32, ptr %111, align 4, !tbaa !11
  %113 = add nsw i32 %112, %84
  %114 = icmp slt i32 %113, %110
  br i1 %114, label %115, label %117

115:                                              ; preds = %109
  store i32 %113, ptr %4, align 4, !tbaa !11
  %116 = trunc nuw nsw i64 %indvars.iv.next92 to i32
  br label %117

117:                                              ; preds = %115, %109
  %118 = phi i32 [ %113, %115 ], [ %110, %109 ]
  %.1.1 = phi i32 [ %116, %115 ], [ %.1, %109 ]
  %indvars.iv.next92.1 = add nuw nsw i64 %indvars.iv91, 2
  %niter109.next.1 = add i64 %niter109, 2
  %niter109.ncmp.1 = icmp eq i64 %niter109.next.1, %unroll_iter108
  br i1 %niter109.ncmp.1, label %._crit_edge69.loopexit.unr-lcssa, label %101, !llvm.loop !25
}

declare ptr @freopen(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

declare noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext) local_unnamed_addr #1

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

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 #1

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

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

; 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 #4

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #5

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

; 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 #6 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)) #5

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

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 = { "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 = { 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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 #5 = { 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 #6 = { 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 #7 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #8 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"vtable pointer", !8, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.unroll.disable"}
!18 = distinct !{!18, !14}
!19 = distinct !{!19, !14, !20, !21}
!20 = !{!"llvm.loop.isvectorized", i32 1}
!21 = !{!"llvm.loop.unroll.runtime.disable"}
!22 = distinct !{!22, !14}
!23 = distinct !{!23, !14, !21, !20}
!24 = distinct !{!24, !14}
!25 = distinct !{!25, !14}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopInstSimplifyPass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass