; LLVM IR from kazunetakahashi/atcoder :: 201510_201609/0731_AGC002 (D2)

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

%struct.state = type <{ i32, i32, i32, i32, i32, i32, i32, i8, [3 x i8] }>
%"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
@M = external dso_local global i32, align 4
@a = external dso_local global [100010 x i32], align 16
@b = external dso_local global [100010 x i32], align 16
@Q = external dso_local global i32, align 4
@V = external dso_local global [100010 x %struct.state], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@.str = external hidden unnamed_addr constant [17 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [90 x i8], align 1
@__PRETTY_FUNCTION__.main = external hidden unnamed_addr constant [11 x i8], align 1
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z4initv() #0

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_Z6issameii(i32 noundef, i32 noundef) #2

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z5uniteii(i32 noundef, i32 noundef) #2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z5counti(i32 noundef) #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z3bytRK5stateS1_(ptr noundef nonnull align 4 dereferenceable(29), ptr noundef nonnull align 4 dereferenceable(29)) #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z4byidRK5stateS1_(ptr noundef nonnull align 4 dereferenceable(29), ptr noundef nonnull align 4 dereferenceable(29)) #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #3 {
  %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 %struct.state, 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
  %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) @N)
  %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) @M)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #8
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %15

15:                                               ; preds = %39, %0
  %16 = load i32, ptr %2, align 4, !tbaa !5
  %17 = load i32, ptr @M, align 4, !tbaa !5
  %18 = icmp slt i32 %16, %17
  br i1 %18, label %20, label %19

19:                                               ; preds = %15
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #8
  br label %42

20:                                               ; preds = %15
  %21 = load i32, ptr %2, align 4, !tbaa !5
  %22 = sext i32 %21 to i64
  %23 = getelementptr inbounds [100010 x i32], ptr @a, 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 %2, align 4, !tbaa !5
  %26 = sext i32 %25 to i64
  %27 = getelementptr inbounds [100010 x i32], ptr @b, 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)
  %29 = load i32, ptr %2, align 4, !tbaa !5
  %30 = sext i32 %29 to i64
  %31 = getelementptr inbounds [100010 x i32], ptr @a, i64 0, i64 %30
  %32 = load i32, ptr %31, align 4, !tbaa !5
  %33 = add nsw i32 %32, -1
  store i32 %33, ptr %31, align 4, !tbaa !5
  %34 = load i32, ptr %2, align 4, !tbaa !5
  %35 = sext i32 %34 to i64
  %36 = getelementptr inbounds [100010 x i32], ptr @b, i64 0, i64 %35
  %37 = load i32, ptr %36, align 4, !tbaa !5
  %38 = add nsw i32 %37, -1
  store i32 %38, ptr %36, align 4, !tbaa !5
  br label %39

39:                                               ; preds = %20
  %40 = load i32, ptr %2, align 4, !tbaa !5
  %41 = add nsw i32 %40, 1
  store i32 %41, ptr %2, align 4, !tbaa !5
  br label %15, !llvm.loop !9

42:                                               ; preds = %19
  %43 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @Q)
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #8
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %44

44:                                               ; preds = %67, %42
  %45 = load i32, ptr %3, align 4, !tbaa !5
  %46 = load i32, ptr @Q, align 4, !tbaa !5
  %47 = icmp slt i32 %45, %46
  br i1 %47, label %49, label %48

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

49:                                               ; preds = %44
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #8
  %50 = 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)
  %51 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %50, ptr noundef nonnull align 4 dereferenceable(4) %5)
  %52 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %51, ptr noundef nonnull align 4 dereferenceable(4) %6)
  %53 = load i32, ptr %4, align 4, !tbaa !5
  %54 = add nsw i32 %53, -1
  store i32 %54, ptr %4, align 4, !tbaa !5
  %55 = load i32, ptr %5, align 4, !tbaa !5
  %56 = add nsw i32 %55, -1
  store i32 %56, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 32, ptr %7) #8
  %57 = load i32, ptr %3, align 4, !tbaa !5
  %58 = load i32, ptr %4, align 4, !tbaa !5
  %59 = load i32, ptr %5, align 4, !tbaa !5
  %60 = load i32, ptr %6, align 4, !tbaa !5
  %61 = load i32, ptr @M, align 4, !tbaa !5
  %62 = load i32, ptr @M, align 4, !tbaa !5
  %63 = sdiv i32 %62, 2
  call void @_ZN5stateC2Eiiiiiii(ptr noundef nonnull align 4 dereferenceable(29) %7, i32 noundef %57, i32 noundef %58, i32 noundef %59, i32 noundef %60, i32 noundef %61, i32 noundef 0, i32 noundef %63)
  %64 = load i32, ptr %3, align 4, !tbaa !5
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds [100010 x %struct.state], ptr @V, i64 0, i64 %65
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %66, ptr align 4 %7, i64 29, i1 false), !tbaa.struct !11
  call void @llvm.lifetime.end.p0(i64 32, ptr %7) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #8
  br label %67

67:                                               ; preds = %49
  %68 = load i32, ptr %3, align 4, !tbaa !5
  %69 = add nsw i32 %68, 1
  store i32 %69, ptr %3, align 4, !tbaa !5
  br label %44, !llvm.loop !14

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

71:                                               ; preds = %225, %70
  %72 = load i32, ptr %8, align 4, !tbaa !5
  %73 = load i32, ptr @Q, align 4, !tbaa !5
  %74 = icmp slt i32 %72, %73
  br i1 %74, label %75, label %226

75:                                               ; preds = %71
  call void @_Z4initv()
  %76 = load i32, ptr @Q, align 4, !tbaa !5
  %77 = sext i32 %76 to i64
  %78 = getelementptr inbounds %struct.state, ptr @V, i64 %77
  call void @_ZSt4sortIP5statePFbRKS0_S3_EEvT_S6_T0_(ptr noundef @V, ptr noundef %78, ptr noundef @_Z3bytRK5stateS1_)
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #8
  store i32 0, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #8
  store i32 0, ptr %10, align 4, !tbaa !5
  br label %79

79:                                               ; preds = %224, %120, %75
  %80 = load i32, ptr %10, align 4, !tbaa !5
  %81 = load i32, ptr @Q, align 4, !tbaa !5
  %82 = icmp slt i32 %80, %81
  br i1 %82, label %83, label %225

83:                                               ; preds = %79
  %84 = load i32, ptr %10, align 4, !tbaa !5
  %85 = sext i32 %84 to i64
  %86 = getelementptr inbounds [100010 x %struct.state], ptr @V, i64 0, i64 %85
  %87 = getelementptr inbounds %struct.state, ptr %86, i32 0, i32 6
  %88 = load i32, ptr %87, align 8, !tbaa !15
  %89 = load i32, ptr %9, align 4, !tbaa !5
  %90 = icmp sgt i32 %88, %89
  br i1 %90, label %91, label %102

91:                                               ; preds = %83
  %92 = load i32, ptr %9, align 4, !tbaa !5
  %93 = sext i32 %92 to i64
  %94 = getelementptr inbounds [100010 x i32], ptr @a, i64 0, i64 %93
  %95 = load i32, ptr %94, align 4, !tbaa !5
  %96 = load i32, ptr %9, align 4, !tbaa !5
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds [100010 x i32], ptr @b, i64 0, i64 %97
  %99 = load i32, ptr %98, align 4, !tbaa !5
  call void @_Z5uniteii(i32 noundef %95, i32 noundef %99)
  %100 = load i32, ptr %9, align 4, !tbaa !5
  %101 = add nsw i32 %100, 1
  store i32 %101, ptr %9, align 4, !tbaa !5
  br label %224

102:                                              ; preds = %83
  %103 = load i32, ptr %10, align 4, !tbaa !5
  %104 = sext i32 %103 to i64
  %105 = getelementptr inbounds [100010 x %struct.state], ptr @V, i64 0, i64 %104
  %106 = getelementptr inbounds %struct.state, ptr %105, i32 0, i32 6
  %107 = load i32, ptr %106, align 8, !tbaa !15
  %108 = load i32, ptr %9, align 4, !tbaa !5
  %109 = icmp eq i32 %107, %108
  br i1 %109, label %110, label %111

110:                                              ; preds = %102
  br label %113

111:                                              ; preds = %102
  call void @__assert_fail(ptr noundef @.str, ptr noundef @.str.2, i32 noundef 114, ptr noundef @__PRETTY_FUNCTION__.main) #9
  unreachable

112:                                              ; No predecessors!
  br label %113

113:                                              ; preds = %112, %110
  %114 = load i32, ptr %10, align 4, !tbaa !5
  %115 = sext i32 %114 to i64
  %116 = getelementptr inbounds [100010 x %struct.state], ptr @V, i64 0, i64 %115
  %117 = getelementptr inbounds %struct.state, ptr %116, i32 0, i32 7
  %118 = load i8, ptr %117, align 4, !tbaa !17, !range !18, !noundef !19
  %119 = trunc i8 %118 to i1
  br i1 %119, label %120, label %123

120:                                              ; preds = %113
  %121 = load i32, ptr %10, align 4, !tbaa !5
  %122 = add nsw i32 %121, 1
  store i32 %122, ptr %10, align 4, !tbaa !5
  br label %79, !llvm.loop !20

123:                                              ; preds = %113
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #8
  %124 = load i32, ptr %10, align 4, !tbaa !5
  %125 = sext i32 %124 to i64
  %126 = getelementptr inbounds [100010 x %struct.state], ptr @V, i64 0, i64 %125
  %127 = getelementptr inbounds %struct.state, ptr %126, i32 0, i32 1
  %128 = load i32, ptr %127, align 4, !tbaa !21
  %129 = load i32, ptr %10, align 4, !tbaa !5
  %130 = sext i32 %129 to i64
  %131 = getelementptr inbounds [100010 x %struct.state], ptr @V, i64 0, i64 %130
  %132 = getelementptr inbounds %struct.state, ptr %131, i32 0, i32 2
  %133 = load i32, ptr %132, align 8, !tbaa !22
  %134 = call noundef zeroext i1 @_Z6issameii(i32 noundef %128, i32 noundef %133)
  br i1 %134, label %135, label %142

135:                                              ; preds = %123
  %136 = load i32, ptr %10, align 4, !tbaa !5
  %137 = sext i32 %136 to i64
  %138 = getelementptr inbounds [100010 x %struct.state], ptr @V, i64 0, i64 %137
  %139 = getelementptr inbounds %struct.state, ptr %138, i32 0, i32 1
  %140 = load i32, ptr %139, align 4, !tbaa !21
  %141 = call noundef i32 @_Z5counti(i32 noundef %140)
  store i32 %141, ptr %11, align 4, !tbaa !5
  br label %156

142:                                              ; preds = %123
  %143 = load i32, ptr %10, align 4, !tbaa !5
  %144 = sext i32 %143 to i64
  %145 = getelementptr inbounds [100010 x %struct.state], ptr @V, i64 0, i64 %144
  %146 = getelementptr inbounds %struct.state, ptr %145, i32 0, i32 1
  %147 = load i32, ptr %146, align 4, !tbaa !21
  %148 = call noundef i32 @_Z5counti(i32 noundef %147)
  %149 = load i32, ptr %10, align 4, !tbaa !5
  %150 = sext i32 %149 to i64
  %151 = getelementptr inbounds [100010 x %struct.state], ptr @V, i64 0, i64 %150
  %152 = getelementptr inbounds %struct.state, ptr %151, i32 0, i32 2
  %153 = load i32, ptr %152, align 8, !tbaa !22
  %154 = call noundef i32 @_Z5counti(i32 noundef %153)
  %155 = add nsw i32 %148, %154
  store i32 %155, ptr %11, align 4, !tbaa !5
  br label %156

156:                                              ; preds = %142, %135
  %157 = load i32, ptr %11, align 4, !tbaa !5
  %158 = load i32, ptr %10, align 4, !tbaa !5
  %159 = sext i32 %158 to i64
  %160 = getelementptr inbounds [100010 x %struct.state], ptr @V, i64 0, i64 %159
  %161 = getelementptr inbounds %struct.state, ptr %160, i32 0, i32 3
  %162 = load i32, ptr %161, align 4, !tbaa !23
  %163 = icmp sge i32 %157, %162
  br i1 %163, label %164, label %174

164:                                              ; preds = %156
  %165 = load i32, ptr %10, align 4, !tbaa !5
  %166 = sext i32 %165 to i64
  %167 = getelementptr inbounds [100010 x %struct.state], ptr @V, i64 0, i64 %166
  %168 = getelementptr inbounds %struct.state, ptr %167, i32 0, i32 6
  %169 = load i32, ptr %168, align 8, !tbaa !15
  %170 = load i32, ptr %10, align 4, !tbaa !5
  %171 = sext i32 %170 to i64
  %172 = getelementptr inbounds [100010 x %struct.state], ptr @V, i64 0, i64 %171
  %173 = getelementptr inbounds %struct.state, ptr %172, i32 0, i32 4
  store i32 %169, ptr %173, align 16, !tbaa !24
  br label %184

174:                                              ; preds = %156
  %175 = load i32, ptr %10, align 4, !tbaa !5
  %176 = sext i32 %175 to i64
  %177 = getelementptr inbounds [100010 x %struct.state], ptr @V, i64 0, i64 %176
  %178 = getelementptr inbounds %struct.state, ptr %177, i32 0, i32 6
  %179 = load i32, ptr %178, align 8, !tbaa !15
  %180 = load i32, ptr %10, align 4, !tbaa !5
  %181 = sext i32 %180 to i64
  %182 = getelementptr inbounds [100010 x %struct.state], ptr @V, i64 0, i64 %181
  %183 = getelementptr inbounds %struct.state, ptr %182, i32 0, i32 5
  store i32 %179, ptr %183, align 4, !tbaa !25
  br label %184

184:                                              ; preds = %174, %164
  %185 = load i32, ptr %10, align 4, !tbaa !5
  %186 = sext i32 %185 to i64
  %187 = getelementptr inbounds [100010 x %struct.state], ptr @V, i64 0, i64 %186
  %188 = getelementptr inbounds %struct.state, ptr %187, i32 0, i32 4
  %189 = load i32, ptr %188, align 16, !tbaa !24
  %190 = load i32, ptr %10, align 4, !tbaa !5
  %191 = sext i32 %190 to i64
  %192 = getelementptr inbounds [100010 x %struct.state], ptr @V, i64 0, i64 %191
  %193 = getelementptr inbounds %struct.state, ptr %192, i32 0, i32 5
  %194 = load i32, ptr %193, align 4, !tbaa !25
  %195 = sub nsw i32 %189, %194
  %196 = icmp eq i32 %195, 1
  br i1 %196, label %197, label %204

197:                                              ; preds = %184
  %198 = load i32, ptr %10, align 4, !tbaa !5
  %199 = sext i32 %198 to i64
  %200 = getelementptr inbounds [100010 x %struct.state], ptr @V, i64 0, i64 %199
  %201 = getelementptr inbounds %struct.state, ptr %200, i32 0, i32 7
  store i8 1, ptr %201, align 4, !tbaa !17
  %202 = load i32, ptr %8, align 4, !tbaa !5
  %203 = add nsw i32 %202, 1
  store i32 %203, ptr %8, align 4, !tbaa !5
  br label %223

204:                                              ; preds = %184
  %205 = load i32, ptr %10, align 4, !tbaa !5
  %206 = sext i32 %205 to i64
  %207 = getelementptr inbounds [100010 x %struct.state], ptr @V, i64 0, i64 %206
  %208 = getelementptr inbounds %struct.state, ptr %207, i32 0, i32 4
  %209 = load i32, ptr %208, align 16, !tbaa !24
  %210 = load i32, ptr %10, align 4, !tbaa !5
  %211 = sext i32 %210 to i64
  %212 = getelementptr inbounds [100010 x %struct.state], ptr @V, i64 0, i64 %211
  %213 = getelementptr inbounds %struct.state, ptr %212, i32 0, i32 5
  %214 = load i32, ptr %213, align 4, !tbaa !25
  %215 = add nsw i32 %209, %214
  %216 = sdiv i32 %215, 2
  %217 = load i32, ptr %10, align 4, !tbaa !5
  %218 = sext i32 %217 to i64
  %219 = getelementptr inbounds [100010 x %struct.state], ptr @V, i64 0, i64 %218
  %220 = getelementptr inbounds %struct.state, ptr %219, i32 0, i32 6
  store i32 %216, ptr %220, align 8, !tbaa !15
  %221 = load i32, ptr %10, align 4, !tbaa !5
  %222 = add nsw i32 %221, 1
  store i32 %222, ptr %10, align 4, !tbaa !5
  br label %223

223:                                              ; preds = %204, %197
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #8
  br label %224

224:                                              ; preds = %223, %91
  br label %79, !llvm.loop !20

225:                                              ; preds = %79
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #8
  br label %71, !llvm.loop !26

226:                                              ; preds = %71
  %227 = load i32, ptr @Q, align 4, !tbaa !5
  %228 = sext i32 %227 to i64
  %229 = getelementptr inbounds %struct.state, ptr @V, i64 %228
  call void @_ZSt4sortIP5statePFbRKS0_S3_EEvT_S6_T0_(ptr noundef @V, ptr noundef %229, ptr noundef @_Z4byidRK5stateS1_)
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #8
  store i32 0, ptr %12, align 4, !tbaa !5
  br label %230

230:                                              ; preds = %243, %226
  %231 = load i32, ptr %12, align 4, !tbaa !5
  %232 = load i32, ptr @Q, align 4, !tbaa !5
  %233 = icmp slt i32 %231, %232
  br i1 %233, label %235, label %234

234:                                              ; preds = %230
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #8
  br label %246

235:                                              ; preds = %230
  %236 = load i32, ptr %12, align 4, !tbaa !5
  %237 = sext i32 %236 to i64
  %238 = getelementptr inbounds [100010 x %struct.state], ptr @V, i64 0, i64 %237
  %239 = getelementptr inbounds %struct.state, ptr %238, i32 0, i32 4
  %240 = load i32, ptr %239, align 16, !tbaa !24
  %241 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %240)
  %242 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %241, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %243

243:                                              ; preds = %235
  %244 = load i32, ptr %12, align 4, !tbaa !5
  %245 = add nsw i32 %244, 1
  store i32 %245, ptr %12, align 4, !tbaa !5
  br label %230, !llvm.loop !27

246:                                              ; preds = %234
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #8
  %247 = load i32, ptr %1, align 4
  ret i32 %247
}

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN5stateC2Eiiiiiii(ptr noundef nonnull align 4 dereferenceable(29), i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) unnamed_addr #0 align 2

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #5

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

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #7

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

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

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { 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 #4 = { "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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #6 = { 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 #7 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #8 = { nounwind }
attributes #9 = { noreturn 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 = !{i64 0, i64 4, !5, i64 4, i64 4, !5, i64 8, i64 4, !5, i64 12, i64 4, !5, i64 16, i64 4, !5, i64 20, i64 4, !5, i64 24, i64 4, !5, i64 28, i64 1, !12}
!12 = !{!13, !13, i64 0}
!13 = !{!"bool", !7, i64 0}
!14 = distinct !{!14, !10}
!15 = !{!16, !6, i64 24}
!16 = !{!"_ZTS5state", !6, i64 0, !6, i64 4, !6, i64 8, !6, i64 12, !6, i64 16, !6, i64 20, !6, i64 24, !13, i64 28}
!17 = !{!16, !13, i64 28}
!18 = !{i8 0, i8 2}
!19 = !{}
!20 = distinct !{!20, !10}
!21 = !{!16, !6, i64 4}
!22 = !{!16, !6, i64 8}
!23 = !{!16, !6, i64 12}
!24 = !{!16, !6, i64 16}
!25 = !{!16, !6, i64 20}
!26 = distinct !{!26, !10}
!27 = distinct !{!27, !10}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.state = type <{ i32, i32, i32, i32, i32, i32, i32, i8, [3 x i8] }>
%"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
@M = external dso_local global i32, align 4
@a = external dso_local global [100010 x i32], align 16
@b = external dso_local global [100010 x i32], align 16
@Q = external dso_local global i32, align 4
@V = external dso_local global [100010 x %struct.state], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@.str = external hidden unnamed_addr constant [17 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [90 x i8], align 1
@__PRETTY_FUNCTION__.main = external hidden unnamed_addr constant [11 x i8], align 1
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z4initv() local_unnamed_addr #0

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_Z6issameii(i32 noundef, i32 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z5uniteii(i32 noundef, i32 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z5counti(i32 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z3bytRK5stateS1_(ptr noundef nonnull align 4 dereferenceable(29), ptr noundef nonnull align 4 dereferenceable(29)) #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z4byidRK5stateS1_(ptr noundef nonnull align 4 dereferenceable(29), ptr noundef nonnull align 4 dereferenceable(29)) #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #3 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca %struct.state, align 4
  %5 = 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)
  %6 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %5, ptr noundef nonnull align 4 dereferenceable(4) @M)
  %7 = load i32, ptr @M, align 4, !tbaa !5
  %8 = icmp sgt i32 %7, 0
  br i1 %8, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %0
  %9 = 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) @Q)
  %10 = load i32, ptr @Q, align 4, !tbaa !5
  %11 = icmp sgt i32 %10, 0
  br i1 %11, label %.lr.ph69, label %._crit_edge81

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %0 ]
  %12 = getelementptr inbounds [100010 x i32], ptr @a, i64 0, i64 %indvars.iv
  %13 = 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) %12)
  %14 = getelementptr inbounds [100010 x i32], ptr @b, i64 0, i64 %indvars.iv
  %15 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %13, ptr noundef nonnull align 4 dereferenceable(4) %14)
  %16 = load i32, ptr %12, align 4, !tbaa !5
  %17 = add nsw i32 %16, -1
  store i32 %17, ptr %12, align 4, !tbaa !5
  %18 = load i32, ptr %14, align 4, !tbaa !5
  %19 = add nsw i32 %18, -1
  store i32 %19, ptr %14, align 4, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %20 = load i32, ptr @M, align 4, !tbaa !5
  %21 = sext i32 %20 to i64
  %22 = icmp slt i64 %indvars.iv.next, %21
  br i1 %22, label %.lr.ph, label %._crit_edge, !llvm.loop !9

.preheader:                                       ; preds = %.lr.ph69
  %23 = icmp sgt i32 %36, 0
  br i1 %23, label %.lr.ph80, label %._crit_edge81

.lr.ph69:                                         ; preds = %._crit_edge, %.lr.ph69
  %indvars.iv99 = phi i64 [ %indvars.iv.next100, %.lr.ph69 ], [ 0, %._crit_edge ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #8
  %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) %1)
  %25 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %24, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %26 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %25, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %27 = load i32, ptr %1, align 4, !tbaa !5
  %28 = add nsw i32 %27, -1
  store i32 %28, ptr %1, align 4, !tbaa !5
  %29 = load i32, ptr %2, align 4, !tbaa !5
  %30 = add nsw i32 %29, -1
  store i32 %30, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %4) #8
  %31 = load i32, ptr %3, align 4, !tbaa !5
  %32 = load i32, ptr @M, align 4, !tbaa !5
  %33 = sdiv i32 %32, 2
  %34 = trunc nuw nsw i64 %indvars.iv99 to i32
  call void @_ZN5stateC2Eiiiiiii(ptr noundef nonnull align 4 dereferenceable(29) %4, i32 noundef %34, i32 noundef %28, i32 noundef %30, i32 noundef %31, i32 noundef %32, i32 noundef 0, i32 noundef %33)
  %35 = getelementptr inbounds [100010 x %struct.state], ptr @V, i64 0, i64 %indvars.iv99
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(29) %35, ptr noundef nonnull align 4 dereferenceable(29) %4, i64 29, i1 false), !tbaa.struct !11
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %4) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #8
  %indvars.iv.next100 = add nuw nsw i64 %indvars.iv99, 1
  %36 = load i32, ptr @Q, align 4, !tbaa !5
  %37 = sext i32 %36 to i64
  %38 = icmp slt i64 %indvars.iv.next100, %37
  br i1 %38, label %.lr.ph69, label %.preheader, !llvm.loop !14

.loopexit:                                        ; preds = %.outer, %69, %.lr.ph80
  %39 = phi i32 [ %44, %.lr.ph80 ], [ %46, %69 ], [ %105, %.outer ]
  %.149.ph.lcssa64 = phi i32 [ %.04879, %.lr.ph80 ], [ %.149.ph75, %69 ], [ %.3, %.outer ]
  %40 = icmp slt i32 %.149.ph.lcssa64, %39
  br i1 %40, label %.lr.ph80, label %._crit_edge81, !llvm.loop !15

.lr.ph80:                                         ; preds = %.preheader, %.loopexit
  %.04879 = phi i32 [ %.149.ph.lcssa64, %.loopexit ], [ 0, %.preheader ]
  call void @_Z4initv()
  %41 = load i32, ptr @Q, align 4, !tbaa !5
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds %struct.state, ptr @V, i64 %42
  call void @_ZSt4sortIP5statePFbRKS0_S3_EEvT_S6_T0_(ptr noundef nonnull @V, ptr noundef nonnull %43, ptr noundef nonnull @_Z3bytRK5stateS1_)
  %44 = load i32, ptr @Q, align 4, !tbaa !5
  %45 = icmp sgt i32 %44, 0
  br i1 %45, label %.lr.ph73, label %.loopexit

.lr.ph73:                                         ; preds = %.lr.ph80, %.outer
  %46 = phi i32 [ %105, %.outer ], [ %44, %.lr.ph80 ]
  %.045.ph77 = phi i32 [ %.2, %.outer ], [ 0, %.lr.ph80 ]
  %.046.ph76 = phi i32 [ %.147, %.outer ], [ 0, %.lr.ph80 ]
  %.149.ph75 = phi i32 [ %.3, %.outer ], [ %.04879, %.lr.ph80 ]
  %47 = sext i32 %.045.ph77 to i64
  %48 = sext i32 %46 to i64
  br label %49

49:                                               ; preds = %.lr.ph73, %69
  %indvars.iv102 = phi i64 [ %47, %.lr.ph73 ], [ %indvars.iv.next103, %69 ]
  %50 = getelementptr inbounds [100010 x %struct.state], ptr @V, i64 0, i64 %indvars.iv102
  %51 = getelementptr inbounds i8, ptr %50, i64 24
  %52 = load i32, ptr %51, align 8, !tbaa !16
  %53 = icmp sgt i32 %52, %.046.ph76
  br i1 %53, label %54, label %62

54:                                               ; preds = %49
  %55 = trunc nsw i64 %indvars.iv102 to i32
  %56 = sext i32 %.046.ph76 to i64
  %57 = getelementptr inbounds [100010 x i32], ptr @a, i64 0, i64 %56
  %58 = load i32, ptr %57, align 4, !tbaa !5
  %59 = getelementptr inbounds [100010 x i32], ptr @b, i64 0, i64 %56
  %60 = load i32, ptr %59, align 4, !tbaa !5
  call void @_Z5uniteii(i32 noundef %58, i32 noundef %60)
  %61 = add nsw i32 %.046.ph76, 1
  br label %.outer

62:                                               ; preds = %49
  %63 = icmp eq i32 %52, %.046.ph76
  br i1 %63, label %65, label %64

64:                                               ; preds = %62
  call void @__assert_fail(ptr noundef nonnull @.str, ptr noundef nonnull @.str.2, i32 noundef 114, ptr noundef nonnull @__PRETTY_FUNCTION__.main) #9
  unreachable

65:                                               ; preds = %62
  %66 = getelementptr inbounds i8, ptr %50, i64 28
  %67 = load i8, ptr %66, align 4, !tbaa !18, !range !19, !noundef !20
  %68 = trunc nuw i8 %67 to i1
  br i1 %68, label %69, label %71

69:                                               ; preds = %65
  %indvars.iv.next103 = add nsw i64 %indvars.iv102, 1
  %70 = icmp slt i64 %indvars.iv.next103, %48
  br i1 %70, label %49, label %.loopexit, !llvm.loop !21

71:                                               ; preds = %65
  %72 = getelementptr inbounds i8, ptr %50, i64 24
  %73 = getelementptr inbounds i8, ptr %50, i64 28
  %74 = trunc nsw i64 %indvars.iv102 to i32
  %75 = getelementptr inbounds i8, ptr %50, i64 4
  %76 = load i32, ptr %75, align 4, !tbaa !22
  %77 = getelementptr inbounds i8, ptr %50, i64 8
  %78 = load i32, ptr %77, align 8, !tbaa !23
  %79 = call noundef zeroext i1 @_Z6issameii(i32 noundef %76, i32 noundef %78)
  %80 = load i32, ptr %75, align 4, !tbaa !22
  %81 = call noundef i32 @_Z5counti(i32 noundef %80)
  br i1 %79, label %86, label %82

82:                                               ; preds = %71
  %83 = load i32, ptr %77, align 8, !tbaa !23
  %84 = call noundef i32 @_Z5counti(i32 noundef %83)
  %85 = add nsw i32 %84, %81
  br label %86

86:                                               ; preds = %71, %82
  %.044 = phi i32 [ %85, %82 ], [ %81, %71 ]
  %87 = getelementptr inbounds i8, ptr %50, i64 12
  %88 = load i32, ptr %87, align 4, !tbaa !24
  %.not = icmp slt i32 %.044, %88
  %89 = load i32, ptr %72, align 8, !tbaa !16
  br i1 %.not, label %92, label %90

90:                                               ; preds = %86
  %91 = getelementptr inbounds i8, ptr %50, i64 16
  store i32 %89, ptr %91, align 16, !tbaa !25
  %.phi.trans.insert108 = getelementptr inbounds i8, ptr %50, i64 20
  %.pre109 = load i32, ptr %.phi.trans.insert108, align 4, !tbaa !26
  br label %94

92:                                               ; preds = %86
  %93 = getelementptr inbounds i8, ptr %50, i64 20
  store i32 %89, ptr %93, align 4, !tbaa !26
  %.phi.trans.insert = getelementptr inbounds i8, ptr %50, i64 16
  %.pre = load i32, ptr %.phi.trans.insert, align 16, !tbaa !25
  br label %94

94:                                               ; preds = %92, %90
  %95 = phi i32 [ %89, %92 ], [ %.pre109, %90 ]
  %96 = phi i32 [ %.pre, %92 ], [ %89, %90 ]
  %97 = sub nsw i32 %96, %95
  %98 = icmp eq i32 %97, 1
  br i1 %98, label %99, label %101

99:                                               ; preds = %94
  store i8 1, ptr %73, align 4, !tbaa !18
  %100 = add nsw i32 %.149.ph75, 1
  br label %.outer

101:                                              ; preds = %94
  %102 = add nsw i32 %95, %96
  %103 = sdiv i32 %102, 2
  store i32 %103, ptr %72, align 8, !tbaa !16
  %104 = add nsw i32 %74, 1
  br label %.outer

.outer:                                           ; preds = %99, %101, %54
  %.3 = phi i32 [ %.149.ph75, %54 ], [ %100, %99 ], [ %.149.ph75, %101 ]
  %.147 = phi i32 [ %61, %54 ], [ %.046.ph76, %99 ], [ %.046.ph76, %101 ]
  %.2 = phi i32 [ %55, %54 ], [ %74, %99 ], [ %104, %101 ]
  %105 = load i32, ptr @Q, align 4, !tbaa !5
  %106 = icmp slt i32 %.2, %105
  br i1 %106, label %.lr.ph73, label %.loopexit, !llvm.loop !21

._crit_edge81:                                    ; preds = %.loopexit, %._crit_edge, %.preheader
  %.lcssa = phi i32 [ %36, %.preheader ], [ %10, %._crit_edge ], [ %39, %.loopexit ]
  %107 = sext i32 %.lcssa to i64
  %108 = getelementptr inbounds %struct.state, ptr @V, i64 %107
  call void @_ZSt4sortIP5statePFbRKS0_S3_EEvT_S6_T0_(ptr noundef nonnull @V, ptr noundef nonnull %108, ptr noundef nonnull @_Z4byidRK5stateS1_)
  %109 = load i32, ptr @Q, align 4, !tbaa !5
  %110 = icmp sgt i32 %109, 0
  br i1 %110, label %.lr.ph85, label %._crit_edge86

._crit_edge86:                                    ; preds = %.lr.ph85, %._crit_edge81
  ret i32 0

.lr.ph85:                                         ; preds = %._crit_edge81, %.lr.ph85
  %indvars.iv105 = phi i64 [ %indvars.iv.next106, %.lr.ph85 ], [ 0, %._crit_edge81 ]
  %111 = getelementptr inbounds [100010 x %struct.state], ptr @V, i64 0, i64 %indvars.iv105, i32 4
  %112 = load i32, ptr %111, align 16, !tbaa !25
  %113 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %112)
  %114 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %113, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  %indvars.iv.next106 = add nuw nsw i64 %indvars.iv105, 1
  %115 = load i32, ptr @Q, align 4, !tbaa !5
  %116 = sext i32 %115 to i64
  %117 = icmp slt i64 %indvars.iv.next106, %116
  br i1 %117, label %.lr.ph85, label %._crit_edge86, !llvm.loop !27
}

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN5stateC2Eiiiiiii(ptr noundef nonnull align 4 dereferenceable(29), i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) unnamed_addr #0 align 2

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #5

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

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #7

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

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

attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { 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 #4 = { "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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #6 = { 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 #7 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #8 = { nounwind }
attributes #9 = { noreturn 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 = !{i64 0, i64 4, !5, i64 4, i64 4, !5, i64 8, i64 4, !5, i64 12, i64 4, !5, i64 16, i64 4, !5, i64 20, i64 4, !5, i64 24, i64 4, !5, i64 28, i64 1, !12}
!12 = !{!13, !13, i64 0}
!13 = !{!"bool", !7, i64 0}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = !{!17, !6, i64 24}
!17 = !{!"_ZTS5state", !6, i64 0, !6, i64 4, !6, i64 8, !6, i64 12, !6, i64 16, !6, i64 20, !6, i64 24, !13, i64 28}
!18 = !{!17, !13, i64 28}
!19 = !{i8 0, i8 2}
!20 = !{}
!21 = distinct !{!21, !10}
!22 = !{!17, !6, i64 4}
!23 = !{!17, !6, i64 8}
!24 = !{!17, !6, i64 12}
!25 = !{!17, !6, i64 16}
!26 = !{!17, !6, i64 20}
!27 = distinct !{!27, !10}


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