; LLVM IR from Tunghohin/Competitive_Coding :: Codeforces (cf817_B)

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

@a = external dso_local global [100010 x i32], align 16
@C = external dso_local global [100010 x [3 x i64]], align 16
@_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 i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i64, align 8
  %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
  store i32 0, ptr %1, align 4
  %15 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %16 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %17 = getelementptr i8, ptr %16, i64 -24
  %18 = load i64, ptr %17, align 8
  %19 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %18
  %20 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %19, ptr noundef null)
  %21 = load ptr, ptr @_ZSt4cout, align 8, !tbaa !5
  %22 = getelementptr i8, ptr %21, i64 -24
  %23 = load i64, ptr %22, align 8
  %24 = getelementptr inbounds i8, ptr @_ZSt4cout, i64 %23
  %25 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %24, ptr noundef null)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #7
  %26 = 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)
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #7
  store i32 1, ptr %3, align 4, !tbaa !8
  br label %27

27:                                               ; preds = %37, %0
  %28 = load i32, ptr %3, align 4, !tbaa !8
  %29 = load i32, ptr %2, align 4, !tbaa !8
  %30 = icmp sle i32 %28, %29
  br i1 %30, label %32, label %31

31:                                               ; preds = %27
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #7
  br label %40

32:                                               ; preds = %27
  %33 = load i32, ptr %3, align 4, !tbaa !8
  %34 = sext i32 %33 to i64
  %35 = getelementptr inbounds [100010 x i32], ptr @a, i64 0, i64 %34
  %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) %35)
  br label %37

37:                                               ; preds = %32
  %38 = load i32, ptr %3, align 4, !tbaa !8
  %39 = add nsw i32 %38, 1
  store i32 %39, ptr %3, align 4, !tbaa !8
  br label %27, !llvm.loop !11

40:                                               ; preds = %31
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #7
  store i32 0, ptr %4, align 4, !tbaa !8
  br label %41

41:                                               ; preds = %93, %40
  %42 = load i32, ptr %4, align 4, !tbaa !8
  %43 = load i32, ptr %2, align 4, !tbaa !8
  %44 = icmp sle i32 %42, %43
  br i1 %44, label %46, label %45

45:                                               ; preds = %41
  store i32 5, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #7
  br label %96

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

47:                                               ; preds = %89, %46
  %48 = load i32, ptr %6, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #7
  store i32 3, ptr %7, align 4, !tbaa !8
  %49 = 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) %7)
  %50 = load i32, ptr %49, align 4, !tbaa !8
  %51 = icmp slt i32 %48, %50
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  br i1 %51, label %53, label %52

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

53:                                               ; preds = %47
  %54 = load i32, ptr %6, align 4, !tbaa !8
  %55 = icmp eq i32 %54, 0
  br i1 %55, label %56, label %63

56:                                               ; preds = %53
  %57 = load i32, ptr %4, align 4, !tbaa !8
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds [100010 x [3 x i64]], ptr @C, i64 0, i64 %58
  %60 = load i32, ptr %6, align 4, !tbaa !8
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds [3 x i64], ptr %59, i64 0, i64 %61
  store i64 1, ptr %62, align 8, !tbaa !13
  br label %88

63:                                               ; preds = %53
  %64 = load i32, ptr %4, align 4, !tbaa !8
  %65 = sub nsw i32 %64, 1
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds [100010 x [3 x i64]], ptr @C, i64 0, i64 %66
  %68 = load i32, ptr %6, align 4, !tbaa !8
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds [3 x i64], ptr %67, i64 0, i64 %69
  %71 = load i64, ptr %70, align 8, !tbaa !13
  %72 = load i32, ptr %4, align 4, !tbaa !8
  %73 = sub nsw i32 %72, 1
  %74 = sext i32 %73 to i64
  %75 = getelementptr inbounds [100010 x [3 x i64]], ptr @C, i64 0, i64 %74
  %76 = load i32, ptr %6, align 4, !tbaa !8
  %77 = sub nsw i32 %76, 1
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds [3 x i64], ptr %75, i64 0, i64 %78
  %80 = load i64, ptr %79, align 8, !tbaa !13
  %81 = add nsw i64 %71, %80
  %82 = load i32, ptr %4, align 4, !tbaa !8
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds [100010 x [3 x i64]], ptr @C, i64 0, i64 %83
  %85 = load i32, ptr %6, align 4, !tbaa !8
  %86 = sext i32 %85 to i64
  %87 = getelementptr inbounds [3 x i64], ptr %84, i64 0, i64 %86
  store i64 %81, ptr %87, align 8, !tbaa !13
  br label %88

88:                                               ; preds = %63, %56
  br label %89

89:                                               ; preds = %88
  %90 = load i32, ptr %6, align 4, !tbaa !8
  %91 = add nsw i32 %90, 1
  store i32 %91, ptr %6, align 4, !tbaa !8
  br label %47, !llvm.loop !15

92:                                               ; preds = %52
  br label %93

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

96:                                               ; preds = %45
  %97 = load i32, ptr %2, align 4, !tbaa !8
  %98 = sext i32 %97 to i64
  %99 = getelementptr inbounds i32, ptr getelementptr inbounds (i32, ptr @a, i64 1), i64 %98
  call void @_ZSt4sortIPiEvT_S1_(ptr noundef getelementptr inbounds (i32, ptr @a, i64 1), ptr noundef %99)
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #7
  store i64 0, ptr %8, align 8, !tbaa !13
  %100 = load i32, ptr getelementptr inbounds ([100010 x i32], ptr @a, i64 0, i64 1), align 4, !tbaa !8
  %101 = load i32, ptr getelementptr inbounds ([100010 x i32], ptr @a, i64 0, i64 2), align 8, !tbaa !8
  %102 = icmp sle i32 %100, %101
  br i1 %102, label %103, label %130

103:                                              ; preds = %96
  %104 = load i32, ptr getelementptr inbounds ([100010 x i32], ptr @a, i64 0, i64 2), align 8, !tbaa !8
  %105 = load i32, ptr getelementptr inbounds ([100010 x i32], ptr @a, i64 0, i64 3), align 4, !tbaa !8
  %106 = icmp slt i32 %104, %105
  br i1 %106, label %107, label %130

107:                                              ; preds = %103
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #7
  store i32 0, ptr %9, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  store i32 4, ptr %10, align 4, !tbaa !8
  br label %108

108:                                              ; preds = %122, %107
  %109 = load i32, ptr %10, align 4, !tbaa !8
  %110 = sext i32 %109 to i64
  %111 = getelementptr inbounds [100010 x i32], ptr @a, i64 0, i64 %110
  %112 = load i32, ptr %111, align 4, !tbaa !8
  %113 = load i32, ptr %10, align 4, !tbaa !8
  %114 = sub nsw i32 %113, 1
  %115 = sext i32 %114 to i64
  %116 = getelementptr inbounds [100010 x i32], ptr @a, i64 0, i64 %115
  %117 = load i32, ptr %116, align 4, !tbaa !8
  %118 = icmp eq i32 %112, %117
  br i1 %118, label %120, label %119

119:                                              ; preds = %108
  store i32 11, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  br label %125

120:                                              ; preds = %108
  %121 = load i32, ptr %10, align 4, !tbaa !8
  store i32 %121, ptr %9, align 4, !tbaa !8
  br label %122

122:                                              ; preds = %120
  %123 = load i32, ptr %10, align 4, !tbaa !8
  %124 = add nsw i32 %123, 1
  store i32 %124, ptr %10, align 4, !tbaa !8
  br label %108, !llvm.loop !17

125:                                              ; preds = %119
  %126 = load i32, ptr %9, align 4, !tbaa !8
  %127 = sub nsw i32 %126, 2
  %128 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %127)
  %129 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %128, i8 noundef signext 10)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  br label %200

130:                                              ; preds = %103, %96
  %131 = load i32, ptr getelementptr inbounds ([100010 x i32], ptr @a, i64 0, i64 1), align 4, !tbaa !8
  %132 = load i32, ptr getelementptr inbounds ([100010 x i32], ptr @a, i64 0, i64 2), align 8, !tbaa !8
  %133 = icmp slt i32 %131, %132
  br i1 %133, label %134, label %165

134:                                              ; preds = %130
  %135 = load i32, ptr getelementptr inbounds ([100010 x i32], ptr @a, i64 0, i64 2), align 8, !tbaa !8
  %136 = load i32, ptr getelementptr inbounds ([100010 x i32], ptr @a, i64 0, i64 3), align 4, !tbaa !8
  %137 = icmp eq i32 %135, %136
  br i1 %137, label %138, label %165

138:                                              ; preds = %134
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #7
  store i32 0, ptr %11, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  store i32 4, ptr %12, align 4, !tbaa !8
  br label %139

139:                                              ; preds = %153, %138
  %140 = load i32, ptr %12, align 4, !tbaa !8
  %141 = sext i32 %140 to i64
  %142 = getelementptr inbounds [100010 x i32], ptr @a, i64 0, i64 %141
  %143 = load i32, ptr %142, align 4, !tbaa !8
  %144 = load i32, ptr %12, align 4, !tbaa !8
  %145 = sub nsw i32 %144, 1
  %146 = sext i32 %145 to i64
  %147 = getelementptr inbounds [100010 x i32], ptr @a, i64 0, i64 %146
  %148 = load i32, ptr %147, align 4, !tbaa !8
  %149 = icmp eq i32 %143, %148
  br i1 %149, label %151, label %150

150:                                              ; preds = %139
  store i32 14, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  br label %156

151:                                              ; preds = %139
  %152 = load i32, ptr %12, align 4, !tbaa !8
  store i32 %152, ptr %11, align 4, !tbaa !8
  br label %153

153:                                              ; preds = %151
  %154 = load i32, ptr %12, align 4, !tbaa !8
  %155 = add nsw i32 %154, 1
  store i32 %155, ptr %12, align 4, !tbaa !8
  br label %139, !llvm.loop !18

156:                                              ; preds = %150
  %157 = load i32, ptr %11, align 4, !tbaa !8
  %158 = sub nsw i32 %157, 1
  %159 = sext i32 %158 to i64
  %160 = getelementptr inbounds [100010 x [3 x i64]], ptr @C, i64 0, i64 %159
  %161 = getelementptr inbounds [3 x i64], ptr %160, i64 0, i64 2
  %162 = load i64, ptr %161, align 8, !tbaa !13
  %163 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %162)
  %164 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %163, i8 noundef signext 10)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  br label %200

165:                                              ; preds = %134, %130
  %166 = load i32, ptr getelementptr inbounds ([100010 x i32], ptr @a, i64 0, i64 1), align 4, !tbaa !8
  %167 = load i32, ptr getelementptr inbounds ([100010 x i32], ptr @a, i64 0, i64 2), align 8, !tbaa !8
  %168 = icmp eq i32 %166, %167
  br i1 %168, label %169, label %199

169:                                              ; preds = %165
  %170 = load i32, ptr getelementptr inbounds ([100010 x i32], ptr @a, i64 0, i64 2), align 8, !tbaa !8
  %171 = load i32, ptr getelementptr inbounds ([100010 x i32], ptr @a, i64 0, i64 3), align 4, !tbaa !8
  %172 = icmp eq i32 %170, %171
  br i1 %172, label %173, label %199

173:                                              ; preds = %169
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #7
  store i32 0, ptr %13, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #7
  store i32 4, ptr %14, align 4, !tbaa !8
  br label %174

174:                                              ; preds = %188, %173
  %175 = load i32, ptr %14, align 4, !tbaa !8
  %176 = sext i32 %175 to i64
  %177 = getelementptr inbounds [100010 x i32], ptr @a, i64 0, i64 %176
  %178 = load i32, ptr %177, align 4, !tbaa !8
  %179 = load i32, ptr %14, align 4, !tbaa !8
  %180 = sub nsw i32 %179, 1
  %181 = sext i32 %180 to i64
  %182 = getelementptr inbounds [100010 x i32], ptr @a, i64 0, i64 %181
  %183 = load i32, ptr %182, align 4, !tbaa !8
  %184 = icmp eq i32 %178, %183
  br i1 %184, label %186, label %185

185:                                              ; preds = %174
  store i32 17, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  br label %191

186:                                              ; preds = %174
  %187 = load i32, ptr %14, align 4, !tbaa !8
  store i32 %187, ptr %13, align 4, !tbaa !8
  br label %188

188:                                              ; preds = %186
  %189 = load i32, ptr %14, align 4, !tbaa !8
  %190 = add nsw i32 %189, 1
  store i32 %190, ptr %14, align 4, !tbaa !8
  br label %174, !llvm.loop !19

191:                                              ; preds = %185
  %192 = load i32, ptr %13, align 4, !tbaa !8
  %193 = sext i32 %192 to i64
  %194 = getelementptr inbounds [100010 x [3 x i64]], ptr @C, i64 0, i64 %193
  %195 = getelementptr inbounds [3 x i64], ptr %194, i64 0, i64 3
  %196 = load i64, ptr %195, align 8, !tbaa !13
  %197 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %196)
  %198 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %197, i8 noundef signext 10)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  br label %200

199:                                              ; preds = %169, %165
  store i32 0, ptr %5, align 4
  br label %200

200:                                              ; preds = %199, %191, %156, %125
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #7
  %201 = load i32, ptr %5, align 4
  switch i32 %201, label %204 [
    i32 0, label %202
    i32 1, label %202
  ]

202:                                              ; preds = %200, %200
  %203 = load i32, ptr %1, align 4
  ret i32 %203

204:                                              ; preds = %200
  unreachable
}

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

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

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.end.p0(i64 immarg, ptr nocapture) #3

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8), i8 noundef signext) #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 @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) #6 align 2

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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!14, !14, i64 0}
!14 = !{!"long long", !10, i64 0}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !12}
!19 = distinct !{!19, !12}


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

@a = external dso_local global [100010 x i32], align 16
@C = external dso_local local_unnamed_addr global [100010 x [3 x i64]], align 16
@_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 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %5 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %6 = getelementptr i8, ptr %5, i64 -24
  %7 = load i64, ptr %6, align 8
  %8 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %7
  %9 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %8, ptr noundef null)
  %10 = load ptr, ptr @_ZSt4cout, align 8, !tbaa !5
  %11 = getelementptr i8, ptr %10, i64 -24
  %12 = load i64, ptr %11, align 8
  %13 = getelementptr inbounds i8, ptr @_ZSt4cout, i64 %12
  %14 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %13, ptr noundef null)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #7
  %15 = 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)
  %16 = load i32, ptr %1, align 4, !tbaa !8
  %.not47 = icmp slt i32 %16, 1
  br i1 %.not47, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %.lr.ph, %0
  %17 = phi i32 [ %16, %0 ], [ %20, %.lr.ph ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #7
  store i32 0, ptr %2, align 4, !tbaa !8
  %.not3752 = icmp slt i32 %17, 0
  br i1 %.not3752, label %._crit_edge53, label %.preheader46

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 1, %0 ]
  %18 = getelementptr inbounds [100010 x i32], ptr @a, i64 0, i64 %indvars.iv
  %19 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %18)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %20 = load i32, ptr %1, align 4, !tbaa !8
  %21 = sext i32 %20 to i64
  %.not.not = icmp slt i64 %indvars.iv, %21
  br i1 %.not.not, label %.lr.ph, label %._crit_edge, !llvm.loop !11

.preheader46:                                     ; preds = %._crit_edge, %._crit_edge51
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #7
  store i32 3, ptr %3, align 4, !tbaa !8
  %22 = 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) %3)
  %23 = load i32, ptr %22, align 4, !tbaa !8
  %24 = icmp sgt i32 %23, 0
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #7
  br i1 %24, label %25, label %._crit_edge51

25:                                               ; preds = %.preheader46
  %26 = load i32, ptr %2, align 4, !tbaa !8
  %27 = sext i32 %26 to i64
  %28 = getelementptr inbounds [100010 x [3 x i64]], ptr @C, i64 0, i64 %27
  store i64 1, ptr %28, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #7
  store i32 3, ptr %3, align 4, !tbaa !8
  %29 = 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) %3)
  %30 = load i32, ptr %29, align 4, !tbaa !8
  %31 = icmp sgt i32 %30, 1
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #7
  br i1 %31, label %.lr.ph50.peel.next, label %._crit_edge51

._crit_edge53:                                    ; preds = %._crit_edge51, %._crit_edge
  %.lcssa = phi i32 [ %17, %._crit_edge ], [ %40, %._crit_edge51 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #7
  %32 = sext i32 %.lcssa to i64
  %33 = getelementptr inbounds i32, ptr getelementptr inbounds (i8, ptr @a, i64 4), i64 %32
  call void @_ZSt4sortIPiEvT_S1_(ptr noundef nonnull getelementptr inbounds (i8, ptr @a, i64 4), ptr noundef nonnull %33)
  %34 = load i32, ptr getelementptr inbounds (i8, ptr @a, i64 4), align 4, !tbaa !8
  %35 = load i32, ptr getelementptr inbounds (i8, ptr @a, i64 8), align 8, !tbaa !8
  %.not38 = icmp sle i32 %34, %35
  %36 = load i32, ptr getelementptr inbounds (i8, ptr @a, i64 12), align 4
  %37 = icmp slt i32 %35, %36
  %or.cond = select i1 %.not38, i1 %37, i1 false
  br i1 %or.cond, label %.preheader, label %63

._crit_edge51:                                    ; preds = %.lr.ph50.peel.next, %25, %.preheader46
  %38 = load i32, ptr %2, align 4, !tbaa !8
  %39 = add nsw i32 %38, 1
  store i32 %39, ptr %2, align 4, !tbaa !8
  %40 = load i32, ptr %1, align 4, !tbaa !8
  %.not37.not = icmp slt i32 %38, %40
  br i1 %.not37.not, label %.preheader46, label %._crit_edge53, !llvm.loop !15

.lr.ph50.peel.next:                               ; preds = %25, %.lr.ph50.peel.next
  %indvars.iv56 = phi i64 [ %indvars.iv.next57, %.lr.ph50.peel.next ], [ 1, %25 ]
  %41 = load i32, ptr %2, align 4, !tbaa !8
  %42 = add nsw i32 %41, -1
  %43 = sext i32 %42 to i64
  %44 = getelementptr inbounds [100010 x [3 x i64]], ptr @C, i64 0, i64 %43, i64 %indvars.iv56
  %45 = load i64, ptr %44, align 8, !tbaa !13
  %46 = add nsw i64 %indvars.iv56, -1
  %47 = getelementptr inbounds [100010 x [3 x i64]], ptr @C, i64 0, i64 %43, i64 %46
  %48 = load i64, ptr %47, align 8, !tbaa !13
  %49 = add nsw i64 %48, %45
  %50 = sext i32 %41 to i64
  %51 = getelementptr inbounds [100010 x [3 x i64]], ptr @C, i64 0, i64 %50, i64 %indvars.iv56
  store i64 %49, ptr %51, align 8, !tbaa !13
  %indvars.iv.next57 = add nuw nsw i64 %indvars.iv56, 1
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #7
  store i32 3, ptr %3, align 4, !tbaa !8
  %52 = 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) %3)
  %53 = load i32, ptr %52, align 4, !tbaa !8
  %54 = sext i32 %53 to i64
  %55 = icmp slt i64 %indvars.iv.next57, %54
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #7
  br i1 %55, label %.lr.ph50.peel.next, label %._crit_edge51, !llvm.loop !16

.preheader:                                       ; preds = %._crit_edge53, %.preheader
  %indvars.iv66 = phi i64 [ %indvars.iv.next67, %.preheader ], [ 4, %._crit_edge53 ]
  %.030 = phi i32 [ %59, %.preheader ], [ 0, %._crit_edge53 ]
  %56 = getelementptr inbounds [100010 x i32], ptr @a, i64 0, i64 %indvars.iv66
  %57 = load i32, ptr %56, align 4, !tbaa !8
  %58 = icmp eq i32 %57, %36
  %indvars.iv.next67 = add nuw nsw i64 %indvars.iv66, 1
  %59 = trunc nuw nsw i64 %indvars.iv66 to i32
  br i1 %58, label %.preheader, label %60, !llvm.loop !18

60:                                               ; preds = %.preheader
  %61 = add nsw i32 %.030, -2
  %62 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %61)
  br label %.sink.split

63:                                               ; preds = %._crit_edge53
  %64 = icmp slt i32 %34, %35
  %65 = icmp eq i32 %35, %36
  %or.cond41 = select i1 %64, i1 %65, i1 false
  br i1 %or.cond41, label %.preheader44, label %75

.preheader44:                                     ; preds = %63, %.preheader44
  %indvars.iv63 = phi i64 [ %indvars.iv.next64, %.preheader44 ], [ 4, %63 ]
  %.028 = phi i64 [ %indvars.iv63, %.preheader44 ], [ 0, %63 ]
  %66 = getelementptr inbounds [100010 x i32], ptr @a, i64 0, i64 %indvars.iv63
  %67 = load i32, ptr %66, align 4, !tbaa !8
  %68 = icmp eq i32 %67, %35
  %indvars.iv.next64 = add nuw nsw i64 %indvars.iv63, 1
  br i1 %68, label %.preheader44, label %69, !llvm.loop !19

69:                                               ; preds = %.preheader44
  %70 = shl i64 %.028, 32
  %sext = add i64 %70, -4294967296
  %71 = ashr exact i64 %sext, 32
  %72 = getelementptr inbounds [100010 x [3 x i64]], ptr @C, i64 0, i64 %71, i64 2
  %73 = load i64, ptr %72, align 8, !tbaa !13
  %74 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %73)
  br label %.sink.split

75:                                               ; preds = %63
  %76 = icmp eq i32 %34, %35
  %or.cond43 = select i1 %76, i1 %65, i1 false
  br i1 %or.cond43, label %.preheader45, label %87

.preheader45:                                     ; preds = %75, %.preheader45
  %indvars.iv60 = phi i64 [ %indvars.iv.next61, %.preheader45 ], [ 4, %75 ]
  %.026 = phi i64 [ %indvars.iv60, %.preheader45 ], [ 0, %75 ]
  %77 = getelementptr inbounds [100010 x i32], ptr @a, i64 0, i64 %indvars.iv60
  %78 = load i32, ptr %77, align 4, !tbaa !8
  %79 = icmp eq i32 %78, %34
  %indvars.iv.next61 = add nuw nsw i64 %indvars.iv60, 1
  br i1 %79, label %.preheader45, label %80, !llvm.loop !20

80:                                               ; preds = %.preheader45
  %81 = and i64 %.026, 4294967295
  %82 = getelementptr inbounds [100010 x [3 x i64]], ptr @C, i64 0, i64 %81
  %83 = getelementptr inbounds i8, ptr %82, i64 24
  %84 = load i64, ptr %83, align 8, !tbaa !13
  %85 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %84)
  br label %.sink.split

.sink.split:                                      ; preds = %60, %69, %80
  %.sink = phi ptr [ %85, %80 ], [ %74, %69 ], [ %62, %60 ]
  %86 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %.sink, i8 noundef signext 10)
  br label %87

87:                                               ; preds = %.sink.split, %75
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #7
  ret i32 0
}

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

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

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.end.p0(i64 immarg, ptr nocapture) #3

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8), i8 noundef signext) 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 @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) local_unnamed_addr #6 align 2

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 = { 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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!14, !14, i64 0}
!14 = !{!"long long", !10, i64 0}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12, !17}
!17 = !{!"llvm.loop.peeled.count", i32 1}
!18 = distinct !{!18, !12}
!19 = distinct !{!19, !12}
!20 = distinct !{!20, !12}


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