; LLVM IR from bqi343/cp-notebook :: Contests/USACO Solutions/2013-14/Open 2014/14 Open G1.ll (Z3genv)

; 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::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<int, int>, std::allocator<std::pair<int, int>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.std::pair" = type { i32, i32 }

@N = external dso_local global i32, align 4
@MB = external dso_local global [100000 x [8 x i32]], align 16
@MF = external dso_local global [100000 x [8 x i32]], align 16
@PS = external dso_local global [100001 x [8 x i32]], align 16
@cows = external dso_local global %"class.std::vector", align 8

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

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

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_Z3genv() #1 {
  %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
  call void @llvm.lifetime.start.p0(i64 4, ptr %1) #3
  store i32 0, ptr %1, align 4, !tbaa !5
  br label %11

11:                                               ; preds = %23, %0
  %12 = load i32, ptr %1, align 4, !tbaa !5
  %13 = icmp slt i32 %12, 8
  br i1 %13, label %15, label %14

14:                                               ; preds = %11
  call void @llvm.lifetime.end.p0(i64 4, ptr %1) #3
  br label %26

15:                                               ; preds = %11
  %16 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @cows, i64 noundef 0) #3
  %17 = getelementptr inbounds %"struct.std::pair", ptr %16, i32 0, i32 1
  %18 = load i32, ptr %17, align 4, !tbaa !9
  %19 = shl i32 1, %18
  %20 = load i32, ptr %1, align 4, !tbaa !5
  %21 = sext i32 %20 to i64
  %22 = getelementptr inbounds [8 x i32], ptr @MB, i64 0, i64 %21
  store i32 %19, ptr %22, align 4, !tbaa !5
  br label %23

23:                                               ; preds = %15
  %24 = load i32, ptr %1, align 4, !tbaa !5
  %25 = add nsw i32 %24, 1
  store i32 %25, ptr %1, align 4, !tbaa !5
  br label %11, !llvm.loop !11

26:                                               ; preds = %14
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #3
  store i32 1, ptr %2, align 4, !tbaa !5
  br label %27

27:                                               ; preds = %98, %26
  %28 = load i32, ptr %2, align 4, !tbaa !5
  %29 = load i32, ptr @N, align 4, !tbaa !5
  %30 = icmp slt i32 %28, %29
  br i1 %30, label %32, label %31

31:                                               ; preds = %27
  store i32 5, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #3
  br label %101

32:                                               ; preds = %27
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #3
  %33 = load i32, ptr %2, align 4, !tbaa !5
  %34 = sext i32 %33 to i64
  %35 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @cows, i64 noundef %34) #3
  %36 = getelementptr inbounds %"struct.std::pair", ptr %35, i32 0, i32 1
  %37 = load i32, ptr %36, align 4, !tbaa !9
  %38 = shl i32 1, %37
  store i32 %38, ptr %4, align 4, !tbaa !5
  %39 = load i32, ptr %4, align 4, !tbaa !5
  %40 = load i32, ptr %2, align 4, !tbaa !5
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds [100000 x [8 x i32]], ptr @MB, i64 0, i64 %41
  %43 = getelementptr inbounds [8 x i32], ptr %42, i64 0, i64 0
  store i32 %39, ptr %43, align 16, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #3
  store i32 1, ptr %5, align 4, !tbaa !5
  br label %44

44:                                               ; preds = %94, %32
  %45 = load i32, ptr %5, align 4, !tbaa !5
  %46 = icmp slt i32 %45, 8
  br i1 %46, label %48, label %47

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

48:                                               ; preds = %44
  %49 = load i32, ptr %2, align 4, !tbaa !5
  %50 = sub nsw i32 %49, 1
  %51 = sext i32 %50 to i64
  %52 = getelementptr inbounds [100000 x [8 x i32]], ptr @MB, i64 0, i64 %51
  %53 = load i32, ptr %5, align 4, !tbaa !5
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds [8 x i32], ptr %52, i64 0, i64 %54
  %56 = load i32, ptr %55, align 4, !tbaa !5
  %57 = load i32, ptr %4, align 4, !tbaa !5
  %58 = and i32 %56, %57
  %59 = icmp ne i32 %58, 0
  br i1 %59, label %60, label %75

60:                                               ; preds = %48
  %61 = load i32, ptr %2, align 4, !tbaa !5
  %62 = sub nsw i32 %61, 1
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds [100000 x [8 x i32]], ptr @MB, i64 0, i64 %63
  %65 = load i32, ptr %5, align 4, !tbaa !5
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds [8 x i32], ptr %64, i64 0, i64 %66
  %68 = load i32, ptr %67, align 4, !tbaa !5
  %69 = load i32, ptr %2, align 4, !tbaa !5
  %70 = sext i32 %69 to i64
  %71 = getelementptr inbounds [100000 x [8 x i32]], ptr @MB, i64 0, i64 %70
  %72 = load i32, ptr %5, align 4, !tbaa !5
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds [8 x i32], ptr %71, i64 0, i64 %73
  store i32 %68, ptr %74, align 4, !tbaa !5
  br label %93

75:                                               ; preds = %48
  %76 = load i32, ptr %2, align 4, !tbaa !5
  %77 = sub nsw i32 %76, 1
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds [100000 x [8 x i32]], ptr @MB, i64 0, i64 %78
  %80 = load i32, ptr %5, align 4, !tbaa !5
  %81 = sub nsw i32 %80, 1
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds [8 x i32], ptr %79, i64 0, i64 %82
  %84 = load i32, ptr %83, align 4, !tbaa !5
  %85 = load i32, ptr %4, align 4, !tbaa !5
  %86 = or i32 %84, %85
  %87 = load i32, ptr %2, align 4, !tbaa !5
  %88 = sext i32 %87 to i64
  %89 = getelementptr inbounds [100000 x [8 x i32]], ptr @MB, i64 0, i64 %88
  %90 = load i32, ptr %5, align 4, !tbaa !5
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds [8 x i32], ptr %89, i64 0, i64 %91
  store i32 %86, ptr %92, align 4, !tbaa !5
  br label %93

93:                                               ; preds = %75, %60
  br label %94

94:                                               ; preds = %93
  %95 = load i32, ptr %5, align 4, !tbaa !5
  %96 = add nsw i32 %95, 1
  store i32 %96, ptr %5, align 4, !tbaa !5
  br label %44, !llvm.loop !13

97:                                               ; preds = %47
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #3
  br label %98

98:                                               ; preds = %97
  %99 = load i32, ptr %2, align 4, !tbaa !5
  %100 = add nsw i32 %99, 1
  store i32 %100, ptr %2, align 4, !tbaa !5
  br label %27, !llvm.loop !14

101:                                              ; preds = %31
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #3
  store i32 0, ptr %6, align 4, !tbaa !5
  br label %102

102:                                              ; preds = %121, %101
  %103 = load i32, ptr %6, align 4, !tbaa !5
  %104 = icmp slt i32 %103, 8
  br i1 %104, label %106, label %105

105:                                              ; preds = %102
  store i32 11, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #3
  br label %124

106:                                              ; preds = %102
  %107 = load i32, ptr @N, align 4, !tbaa !5
  %108 = sub nsw i32 %107, 1
  %109 = sext i32 %108 to i64
  %110 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @cows, i64 noundef %109) #3
  %111 = getelementptr inbounds %"struct.std::pair", ptr %110, i32 0, i32 1
  %112 = load i32, ptr %111, align 4, !tbaa !9
  %113 = shl i32 1, %112
  %114 = load i32, ptr @N, align 4, !tbaa !5
  %115 = sub nsw i32 %114, 1
  %116 = sext i32 %115 to i64
  %117 = getelementptr inbounds [100000 x [8 x i32]], ptr @MF, i64 0, i64 %116
  %118 = load i32, ptr %6, align 4, !tbaa !5
  %119 = sext i32 %118 to i64
  %120 = getelementptr inbounds [8 x i32], ptr %117, i64 0, i64 %119
  store i32 %113, ptr %120, align 4, !tbaa !5
  br label %121

121:                                              ; preds = %106
  %122 = load i32, ptr %6, align 4, !tbaa !5
  %123 = add nsw i32 %122, 1
  store i32 %123, ptr %6, align 4, !tbaa !5
  br label %102, !llvm.loop !15

124:                                              ; preds = %105
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #3
  %125 = load i32, ptr @N, align 4, !tbaa !5
  %126 = sub nsw i32 %125, 1
  %127 = sub nsw i32 %126, 1
  store i32 %127, ptr %7, align 4, !tbaa !5
  br label %128

128:                                              ; preds = %198, %124
  %129 = load i32, ptr %7, align 4, !tbaa !5
  %130 = icmp sge i32 %129, 0
  br i1 %130, label %132, label %131

131:                                              ; preds = %128
  store i32 14, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #3
  br label %201

132:                                              ; preds = %128
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #3
  %133 = load i32, ptr %7, align 4, !tbaa !5
  %134 = sext i32 %133 to i64
  %135 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @cows, i64 noundef %134) #3
  %136 = getelementptr inbounds %"struct.std::pair", ptr %135, i32 0, i32 1
  %137 = load i32, ptr %136, align 4, !tbaa !9
  %138 = shl i32 1, %137
  store i32 %138, ptr %8, align 4, !tbaa !5
  %139 = load i32, ptr %8, align 4, !tbaa !5
  %140 = load i32, ptr %7, align 4, !tbaa !5
  %141 = sext i32 %140 to i64
  %142 = getelementptr inbounds [100000 x [8 x i32]], ptr @MF, i64 0, i64 %141
  %143 = getelementptr inbounds [8 x i32], ptr %142, i64 0, i64 0
  store i32 %139, ptr %143, align 16, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #3
  store i32 1, ptr %9, align 4, !tbaa !5
  br label %144

144:                                              ; preds = %194, %132
  %145 = load i32, ptr %9, align 4, !tbaa !5
  %146 = icmp slt i32 %145, 8
  br i1 %146, label %148, label %147

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

148:                                              ; preds = %144
  %149 = load i32, ptr %7, align 4, !tbaa !5
  %150 = add nsw i32 %149, 1
  %151 = sext i32 %150 to i64
  %152 = getelementptr inbounds [100000 x [8 x i32]], ptr @MF, i64 0, i64 %151
  %153 = load i32, ptr %9, align 4, !tbaa !5
  %154 = sext i32 %153 to i64
  %155 = getelementptr inbounds [8 x i32], ptr %152, i64 0, i64 %154
  %156 = load i32, ptr %155, align 4, !tbaa !5
  %157 = load i32, ptr %8, align 4, !tbaa !5
  %158 = and i32 %156, %157
  %159 = icmp ne i32 %158, 0
  br i1 %159, label %160, label %175

160:                                              ; preds = %148
  %161 = load i32, ptr %7, align 4, !tbaa !5
  %162 = add nsw i32 %161, 1
  %163 = sext i32 %162 to i64
  %164 = getelementptr inbounds [100000 x [8 x i32]], ptr @MF, i64 0, i64 %163
  %165 = load i32, ptr %9, align 4, !tbaa !5
  %166 = sext i32 %165 to i64
  %167 = getelementptr inbounds [8 x i32], ptr %164, i64 0, i64 %166
  %168 = load i32, ptr %167, align 4, !tbaa !5
  %169 = load i32, ptr %7, align 4, !tbaa !5
  %170 = sext i32 %169 to i64
  %171 = getelementptr inbounds [100000 x [8 x i32]], ptr @MF, i64 0, i64 %170
  %172 = load i32, ptr %9, align 4, !tbaa !5
  %173 = sext i32 %172 to i64
  %174 = getelementptr inbounds [8 x i32], ptr %171, i64 0, i64 %173
  store i32 %168, ptr %174, align 4, !tbaa !5
  br label %193

175:                                              ; preds = %148
  %176 = load i32, ptr %7, align 4, !tbaa !5
  %177 = add nsw i32 %176, 1
  %178 = sext i32 %177 to i64
  %179 = getelementptr inbounds [100000 x [8 x i32]], ptr @MF, i64 0, i64 %178
  %180 = load i32, ptr %9, align 4, !tbaa !5
  %181 = sub nsw i32 %180, 1
  %182 = sext i32 %181 to i64
  %183 = getelementptr inbounds [8 x i32], ptr %179, i64 0, i64 %182
  %184 = load i32, ptr %183, align 4, !tbaa !5
  %185 = load i32, ptr %8, align 4, !tbaa !5
  %186 = or i32 %184, %185
  %187 = load i32, ptr %7, align 4, !tbaa !5
  %188 = sext i32 %187 to i64
  %189 = getelementptr inbounds [100000 x [8 x i32]], ptr @MF, i64 0, i64 %188
  %190 = load i32, ptr %9, align 4, !tbaa !5
  %191 = sext i32 %190 to i64
  %192 = getelementptr inbounds [8 x i32], ptr %189, i64 0, i64 %191
  store i32 %186, ptr %192, align 4, !tbaa !5
  br label %193

193:                                              ; preds = %175, %160
  br label %194

194:                                              ; preds = %193
  %195 = load i32, ptr %9, align 4, !tbaa !5
  %196 = add nsw i32 %195, 1
  store i32 %196, ptr %9, align 4, !tbaa !5
  br label %144, !llvm.loop !16

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

198:                                              ; preds = %197
  %199 = load i32, ptr %7, align 4, !tbaa !5
  %200 = add nsw i32 %199, -1
  store i32 %200, ptr %7, align 4, !tbaa !5
  br label %128, !llvm.loop !17

201:                                              ; preds = %131
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #3
  store i32 0, ptr %10, align 4, !tbaa !5
  br label %202

202:                                              ; preds = %230, %201
  %203 = load i32, ptr %10, align 4, !tbaa !5
  %204 = load i32, ptr @N, align 4, !tbaa !5
  %205 = icmp slt i32 %203, %204
  br i1 %205, label %207, label %206

206:                                              ; preds = %202
  store i32 20, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #3
  br label %233

207:                                              ; preds = %202
  %208 = load i32, ptr %10, align 4, !tbaa !5
  %209 = add nsw i32 %208, 1
  %210 = sext i32 %209 to i64
  %211 = getelementptr inbounds [100001 x [8 x i32]], ptr @PS, i64 0, i64 %210
  %212 = getelementptr inbounds [8 x i32], ptr %211, i64 0, i64 0
  %213 = load i32, ptr %10, align 4, !tbaa !5
  %214 = sext i32 %213 to i64
  %215 = getelementptr inbounds [100001 x [8 x i32]], ptr @PS, i64 0, i64 %214
  %216 = getelementptr inbounds [8 x i32], ptr %215, i64 0, i64 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %212, ptr align 16 %216, i64 32, i1 false)
  %217 = load i32, ptr %10, align 4, !tbaa !5
  %218 = add nsw i32 %217, 1
  %219 = sext i32 %218 to i64
  %220 = getelementptr inbounds [100001 x [8 x i32]], ptr @PS, i64 0, i64 %219
  %221 = load i32, ptr %10, align 4, !tbaa !5
  %222 = sext i32 %221 to i64
  %223 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @cows, i64 noundef %222) #3
  %224 = getelementptr inbounds %"struct.std::pair", ptr %223, i32 0, i32 1
  %225 = load i32, ptr %224, align 4, !tbaa !9
  %226 = sext i32 %225 to i64
  %227 = getelementptr inbounds [8 x i32], ptr %220, i64 0, i64 %226
  %228 = load i32, ptr %227, align 4, !tbaa !5
  %229 = add nsw i32 %228, 1
  store i32 %229, ptr %227, align 4, !tbaa !5
  br label %230

230:                                              ; preds = %207
  %231 = load i32, ptr %10, align 4, !tbaa !5
  %232 = add nsw i32 %231, 1
  store i32 %232, ptr %10, align 4, !tbaa !5
  br label %202, !llvm.loop !18

233:                                              ; preds = %206
  ret void
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #1 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) #2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { nounwind }

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

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

@N = external dso_local local_unnamed_addr global i32, align 4
@MB = external dso_local local_unnamed_addr global [100000 x [8 x i32]], align 16
@MF = external dso_local local_unnamed_addr global [100000 x [8 x i32]], align 16
@PS = external dso_local local_unnamed_addr global [100001 x [8 x i32]], align 16
@cows = external dso_local global %"class.std::vector", align 8

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_Z3genv() local_unnamed_addr #0 {
.preheader58:
  %0 = tail call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @cows, i64 noundef 0) #2
  %1 = getelementptr inbounds i8, ptr %0, i64 4
  %2 = load i32, ptr %1, align 4, !tbaa !5
  %3 = shl nuw i32 1, %2
  store i32 %3, ptr @MB, align 16, !tbaa !10
  %4 = tail call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @cows, i64 noundef 0) #2
  %5 = getelementptr inbounds i8, ptr %4, i64 4
  %6 = load i32, ptr %5, align 4, !tbaa !5
  %7 = shl nuw i32 1, %6
  store i32 %7, ptr getelementptr inbounds (i8, ptr @MB, i64 4), align 4, !tbaa !10
  %8 = tail call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @cows, i64 noundef 0) #2
  %9 = getelementptr inbounds i8, ptr %8, i64 4
  %10 = load i32, ptr %9, align 4, !tbaa !5
  %11 = shl nuw i32 1, %10
  store i32 %11, ptr getelementptr inbounds (i8, ptr @MB, i64 8), align 8, !tbaa !10
  %12 = tail call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @cows, i64 noundef 0) #2
  %13 = getelementptr inbounds i8, ptr %12, i64 4
  %14 = load i32, ptr %13, align 4, !tbaa !5
  %15 = shl nuw i32 1, %14
  store i32 %15, ptr getelementptr inbounds (i8, ptr @MB, i64 12), align 4, !tbaa !10
  %16 = tail call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @cows, i64 noundef 0) #2
  %17 = getelementptr inbounds i8, ptr %16, i64 4
  %18 = load i32, ptr %17, align 4, !tbaa !5
  %19 = shl nuw i32 1, %18
  store i32 %19, ptr getelementptr inbounds (i8, ptr @MB, i64 16), align 16, !tbaa !10
  %20 = tail call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @cows, i64 noundef 0) #2
  %21 = getelementptr inbounds i8, ptr %20, i64 4
  %22 = load i32, ptr %21, align 4, !tbaa !5
  %23 = shl nuw i32 1, %22
  store i32 %23, ptr getelementptr inbounds (i8, ptr @MB, i64 20), align 4, !tbaa !10
  %24 = tail call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @cows, i64 noundef 0) #2
  %25 = getelementptr inbounds i8, ptr %24, i64 4
  %26 = load i32, ptr %25, align 4, !tbaa !5
  %27 = shl nuw i32 1, %26
  store i32 %27, ptr getelementptr inbounds (i8, ptr @MB, i64 24), align 8, !tbaa !10
  %28 = tail call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @cows, i64 noundef 0) #2
  %29 = getelementptr inbounds i8, ptr %28, i64 4
  %30 = load i32, ptr %29, align 4, !tbaa !5
  %31 = shl nuw i32 1, %30
  store i32 %31, ptr getelementptr inbounds (i8, ptr @MB, i64 28), align 4, !tbaa !10
  %32 = load i32, ptr @N, align 4, !tbaa !10
  %33 = icmp sgt i32 %32, 1
  br i1 %33, label %.lr.ph, label %.preheader57

.preheader57:                                     ; preds = %115, %.preheader58
  %34 = phi i32 [ %32, %.preheader58 ], [ %139, %115 ]
  %35 = add nsw i32 %34, -1
  %36 = sext i32 %35 to i64
  %37 = tail call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @cows, i64 noundef %36) #2
  %38 = getelementptr inbounds i8, ptr %37, i64 4
  %39 = load i32, ptr %38, align 4, !tbaa !5
  %40 = shl nuw i32 1, %39
  %41 = load i32, ptr @N, align 4, !tbaa !10
  %42 = add nsw i32 %41, -1
  %43 = sext i32 %42 to i64
  %44 = getelementptr inbounds [100000 x [8 x i32]], ptr @MF, i64 0, i64 %43, i64 0
  store i32 %40, ptr %44, align 16, !tbaa !10
  %45 = tail call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @cows, i64 noundef %43) #2
  %46 = getelementptr inbounds i8, ptr %45, i64 4
  %47 = load i32, ptr %46, align 4, !tbaa !5
  %48 = shl nuw i32 1, %47
  %49 = load i32, ptr @N, align 4, !tbaa !10
  %50 = add nsw i32 %49, -1
  %51 = sext i32 %50 to i64
  %52 = getelementptr inbounds [100000 x [8 x i32]], ptr @MF, i64 0, i64 %51, i64 1
  store i32 %48, ptr %52, align 4, !tbaa !10
  %53 = tail call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @cows, i64 noundef %51) #2
  %54 = getelementptr inbounds i8, ptr %53, i64 4
  %55 = load i32, ptr %54, align 4, !tbaa !5
  %56 = shl nuw i32 1, %55
  %57 = load i32, ptr @N, align 4, !tbaa !10
  %58 = add nsw i32 %57, -1
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds [100000 x [8 x i32]], ptr @MF, i64 0, i64 %59, i64 2
  store i32 %56, ptr %60, align 8, !tbaa !10
  %61 = tail call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @cows, i64 noundef %59) #2
  %62 = getelementptr inbounds i8, ptr %61, i64 4
  %63 = load i32, ptr %62, align 4, !tbaa !5
  %64 = shl nuw i32 1, %63
  %65 = load i32, ptr @N, align 4, !tbaa !10
  %66 = add nsw i32 %65, -1
  %67 = sext i32 %66 to i64
  %68 = getelementptr inbounds [100000 x [8 x i32]], ptr @MF, i64 0, i64 %67, i64 3
  store i32 %64, ptr %68, align 4, !tbaa !10
  %69 = tail call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @cows, i64 noundef %67) #2
  %70 = getelementptr inbounds i8, ptr %69, i64 4
  %71 = load i32, ptr %70, align 4, !tbaa !5
  %72 = shl nuw i32 1, %71
  %73 = load i32, ptr @N, align 4, !tbaa !10
  %74 = add nsw i32 %73, -1
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds [100000 x [8 x i32]], ptr @MF, i64 0, i64 %75, i64 4
  store i32 %72, ptr %76, align 16, !tbaa !10
  %77 = tail call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @cows, i64 noundef %75) #2
  %78 = getelementptr inbounds i8, ptr %77, i64 4
  %79 = load i32, ptr %78, align 4, !tbaa !5
  %80 = shl nuw i32 1, %79
  %81 = load i32, ptr @N, align 4, !tbaa !10
  %82 = add nsw i32 %81, -1
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds [100000 x [8 x i32]], ptr @MF, i64 0, i64 %83, i64 5
  store i32 %80, ptr %84, align 4, !tbaa !10
  %85 = tail call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @cows, i64 noundef %83) #2
  %86 = getelementptr inbounds i8, ptr %85, i64 4
  %87 = load i32, ptr %86, align 4, !tbaa !5
  %88 = shl nuw i32 1, %87
  %89 = load i32, ptr @N, align 4, !tbaa !10
  %90 = add nsw i32 %89, -1
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds [100000 x [8 x i32]], ptr @MF, i64 0, i64 %91, i64 6
  store i32 %88, ptr %92, align 8, !tbaa !10
  %93 = tail call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @cows, i64 noundef %91) #2
  %94 = getelementptr inbounds i8, ptr %93, i64 4
  %95 = load i32, ptr %94, align 4, !tbaa !5
  %96 = shl nuw i32 1, %95
  %97 = load i32, ptr @N, align 4, !tbaa !10
  %98 = add nsw i32 %97, -1
  %99 = sext i32 %98 to i64
  %100 = getelementptr inbounds [100000 x [8 x i32]], ptr @MF, i64 0, i64 %99, i64 7
  store i32 %96, ptr %100, align 4, !tbaa !10
  %101 = icmp sgt i32 %97, 1
  br i1 %101, label %.lr.ph65.preheader, label %.preheader

.lr.ph:                                           ; preds = %.preheader58, %115
  %indvars.iv = phi i64 [ %indvars.iv.next, %115 ], [ 1, %.preheader58 ]
  %102 = tail call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @cows, i64 noundef %indvars.iv) #2
  %103 = getelementptr inbounds i8, ptr %102, i64 4
  %104 = load i32, ptr %103, align 4, !tbaa !5
  %105 = shl nuw i32 1, %104
  %106 = getelementptr inbounds [100000 x [8 x i32]], ptr @MB, i64 0, i64 %indvars.iv
  store i32 %105, ptr %106, align 16, !tbaa !10
  %107 = add nsw i64 %indvars.iv, -1
  %108 = getelementptr inbounds [100000 x [8 x i32]], ptr @MB, i64 0, i64 %107, i64 1
  %109 = load i32, ptr %108, align 4, !tbaa !10
  %110 = and i32 %109, %105
  %.not56 = icmp eq i32 %110, 0
  br i1 %.not56, label %111, label %115

111:                                              ; preds = %.lr.ph
  %112 = getelementptr inbounds [100000 x [8 x i32]], ptr @MB, i64 0, i64 %107, i64 0
  %113 = load i32, ptr %112, align 16, !tbaa !10
  %114 = or i32 %113, %105
  br label %115

115:                                              ; preds = %.lr.ph, %111
  %.sink = phi i32 [ %114, %111 ], [ %109, %.lr.ph ]
  %116 = getelementptr inbounds [100000 x [8 x i32]], ptr @MB, i64 0, i64 %indvars.iv, i64 1
  store i32 %.sink, ptr %116, align 4
  %117 = getelementptr inbounds [100000 x [8 x i32]], ptr @MB, i64 0, i64 %107, i64 2
  %118 = getelementptr inbounds [100000 x [8 x i32]], ptr @MB, i64 0, i64 %indvars.iv, i64 2
  %119 = load <4 x i32>, ptr %117, align 8, !tbaa !10
  %120 = insertelement <4 x i32> poison, i32 %105, i64 0
  %121 = shufflevector <4 x i32> %120, <4 x i32> poison, <4 x i32> zeroinitializer
  %122 = and <4 x i32> %119, %121
  %123 = icmp eq <4 x i32> %122, zeroinitializer
  %124 = insertelement <4 x i32> poison, i32 %109, i64 0
  %125 = shufflevector <4 x i32> %124, <4 x i32> %119, <4 x i32> <i32 0, i32 4, i32 5, i32 6>
  %126 = or <4 x i32> %125, %121
  %127 = select <4 x i1> %123, <4 x i32> %126, <4 x i32> %119
  store <4 x i32> %127, ptr %118, align 8
  %128 = getelementptr inbounds [100000 x [8 x i32]], ptr @MB, i64 0, i64 %107, i64 6
  %129 = getelementptr inbounds [100000 x [8 x i32]], ptr @MB, i64 0, i64 %indvars.iv, i64 6
  %130 = load <2 x i32>, ptr %128, align 8, !tbaa !10
  %131 = insertelement <2 x i32> poison, i32 %105, i64 0
  %132 = shufflevector <2 x i32> %131, <2 x i32> poison, <2 x i32> zeroinitializer
  %133 = and <2 x i32> %130, %132
  %134 = icmp eq <2 x i32> %133, zeroinitializer
  %135 = shufflevector <4 x i32> %119, <4 x i32> poison, <2 x i32> <i32 3, i32 poison>
  %136 = shufflevector <2 x i32> %135, <2 x i32> %130, <2 x i32> <i32 0, i32 2>
  %137 = or <2 x i32> %136, %132
  %138 = select <2 x i1> %134, <2 x i32> %137, <2 x i32> %130
  store <2 x i32> %138, ptr %129, align 8
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %139 = load i32, ptr @N, align 4, !tbaa !10
  %140 = sext i32 %139 to i64
  %141 = icmp slt i64 %indvars.iv.next, %140
  br i1 %141, label %.lr.ph, label %.preheader57, !llvm.loop !11

.lr.ph65.preheader:                               ; preds = %.preheader57
  %142 = add nsw i32 %97, -2
  %143 = zext nneg i32 %142 to i64
  br label %.lr.ph65

.preheader.loopexit:                              ; preds = %159
  %.pre = load i32, ptr @N, align 4, !tbaa !10
  br label %.preheader

.preheader:                                       ; preds = %.preheader.loopexit, %.preheader57
  %144 = phi i32 [ %.pre, %.preheader.loopexit ], [ %97, %.preheader57 ]
  %145 = icmp sgt i32 %144, 0
  br i1 %145, label %.lr.ph67, label %._crit_edge

.lr.ph65:                                         ; preds = %.lr.ph65.preheader, %159
  %indvars.iv77 = phi i64 [ %143, %.lr.ph65.preheader ], [ %indvars.iv.next78, %159 ]
  %146 = tail call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @cows, i64 noundef %indvars.iv77) #2
  %147 = getelementptr inbounds i8, ptr %146, i64 4
  %148 = load i32, ptr %147, align 4, !tbaa !5
  %149 = shl nuw i32 1, %148
  %150 = getelementptr inbounds [100000 x [8 x i32]], ptr @MF, i64 0, i64 %indvars.iv77
  store i32 %149, ptr %150, align 16, !tbaa !10
  %151 = add nuw nsw i64 %indvars.iv77, 1
  %152 = getelementptr inbounds [100000 x [8 x i32]], ptr @MF, i64 0, i64 %151, i64 1
  %153 = load i32, ptr %152, align 4, !tbaa !10
  %154 = and i32 %153, %149
  %.not = icmp eq i32 %154, 0
  br i1 %.not, label %155, label %159

155:                                              ; preds = %.lr.ph65
  %156 = getelementptr inbounds [100000 x [8 x i32]], ptr @MF, i64 0, i64 %151, i64 0
  %157 = load i32, ptr %156, align 16, !tbaa !10
  %158 = or i32 %157, %149
  br label %159

159:                                              ; preds = %.lr.ph65, %155
  %.sink89 = phi i32 [ %158, %155 ], [ %153, %.lr.ph65 ]
  %160 = getelementptr inbounds [100000 x [8 x i32]], ptr @MF, i64 0, i64 %indvars.iv77, i64 1
  store i32 %.sink89, ptr %160, align 4
  %161 = getelementptr inbounds [100000 x [8 x i32]], ptr @MF, i64 0, i64 %151, i64 2
  %162 = getelementptr inbounds [100000 x [8 x i32]], ptr @MF, i64 0, i64 %indvars.iv77, i64 2
  %163 = load <4 x i32>, ptr %161, align 8, !tbaa !10
  %164 = insertelement <4 x i32> poison, i32 %149, i64 0
  %165 = shufflevector <4 x i32> %164, <4 x i32> poison, <4 x i32> zeroinitializer
  %166 = and <4 x i32> %163, %165
  %167 = icmp eq <4 x i32> %166, zeroinitializer
  %168 = insertelement <4 x i32> poison, i32 %153, i64 0
  %169 = shufflevector <4 x i32> %168, <4 x i32> %163, <4 x i32> <i32 0, i32 4, i32 5, i32 6>
  %170 = or <4 x i32> %169, %165
  %171 = select <4 x i1> %167, <4 x i32> %170, <4 x i32> %163
  store <4 x i32> %171, ptr %162, align 8
  %172 = getelementptr inbounds [100000 x [8 x i32]], ptr @MF, i64 0, i64 %151, i64 6
  %173 = getelementptr inbounds [100000 x [8 x i32]], ptr @MF, i64 0, i64 %indvars.iv77, i64 6
  %174 = load <2 x i32>, ptr %172, align 8, !tbaa !10
  %175 = insertelement <2 x i32> poison, i32 %149, i64 0
  %176 = shufflevector <2 x i32> %175, <2 x i32> poison, <2 x i32> zeroinitializer
  %177 = and <2 x i32> %174, %176
  %178 = icmp eq <2 x i32> %177, zeroinitializer
  %179 = shufflevector <4 x i32> %163, <4 x i32> poison, <2 x i32> <i32 3, i32 poison>
  %180 = shufflevector <2 x i32> %179, <2 x i32> %174, <2 x i32> <i32 0, i32 2>
  %181 = or <2 x i32> %180, %176
  %182 = select <2 x i1> %178, <2 x i32> %181, <2 x i32> %174
  store <2 x i32> %182, ptr %173, align 8
  %indvars.iv.next78 = add nsw i64 %indvars.iv77, -1
  %183 = icmp sgt i64 %indvars.iv77, 0
  br i1 %183, label %.lr.ph65, label %.preheader.loopexit, !llvm.loop !13

._crit_edge:                                      ; preds = %.lr.ph67, %.preheader
  ret void

.lr.ph67:                                         ; preds = %.preheader, %.lr.ph67
  %indvars.iv80 = phi i64 [ %indvars.iv.next81, %.lr.ph67 ], [ 0, %.preheader ]
  %indvars.iv.next81 = add nuw nsw i64 %indvars.iv80, 1
  %184 = getelementptr inbounds [100001 x [8 x i32]], ptr @PS, i64 0, i64 %indvars.iv.next81
  %185 = getelementptr inbounds [100001 x [8 x i32]], ptr @PS, i64 0, i64 %indvars.iv80
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(32) %184, ptr noundef nonnull align 16 dereferenceable(32) %185, i64 32, i1 false)
  %186 = tail call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) @cows, i64 noundef %indvars.iv80) #2
  %187 = getelementptr inbounds i8, ptr %186, i64 4
  %188 = load i32, ptr %187, align 4, !tbaa !5
  %189 = sext i32 %188 to i64
  %190 = getelementptr inbounds [100001 x [8 x i32]], ptr @PS, i64 0, i64 %indvars.iv.next81, i64 %189
  %191 = load i32, ptr %190, align 4, !tbaa !10
  %192 = add nsw i32 %191, 1
  store i32 %192, ptr %190, align 4, !tbaa !10
  %193 = load i32, ptr @N, align 4, !tbaa !10
  %194 = sext i32 %193 to i64
  %195 = icmp slt i64 %indvars.iv.next81, %194
  br i1 %195, label %.lr.ph67, label %._crit_edge, !llvm.loop !14
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt4pairIiiESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_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) #1

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


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