; LLVM IR from Tunghohin/Competitive_Coding :: Codeforces/cf1674_D.ll (Z5solvev)

; 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 [200010 x i32], align 16
@od_a1 = external dso_local global [200010 x i32], align 16
@od_a2 = external dso_local global [200010 x i32], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local void @_Z5solvev() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i8, align 1
  %4 = alloca i8, align 1
  %5 = alloca i8, align 1
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %1) #5
  %13 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %1)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #5
  store i32 1, ptr %2, align 4, !tbaa !5
  br label %14

14:                                               ; preds = %24, %0
  %15 = load i32, ptr %2, align 4, !tbaa !5
  %16 = load i32, ptr %1, align 4, !tbaa !5
  %17 = icmp sle i32 %15, %16
  br i1 %17, label %19, label %18

18:                                               ; preds = %14
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #5
  br label %27

19:                                               ; preds = %14
  %20 = load i32, ptr %2, align 4, !tbaa !5
  %21 = sext i32 %20 to i64
  %22 = getelementptr inbounds [200010 x i32], ptr @a, i64 0, i64 %21
  %23 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %22)
  br label %24

24:                                               ; preds = %19
  %25 = load i32, ptr %2, align 4, !tbaa !5
  %26 = add nsw i32 %25, 1
  store i32 %26, ptr %2, align 4, !tbaa !5
  br label %14, !llvm.loop !9

27:                                               ; preds = %18
  call void @llvm.lifetime.start.p0(i64 1, ptr %3) #5
  store i8 1, ptr %3, align 1, !tbaa !11
  %28 = load i32, ptr %1, align 4, !tbaa !5
  %29 = srem i32 %28, 2
  %30 = icmp ne i32 %29, 0
  br i1 %30, label %31, label %152

31:                                               ; preds = %27
  call void @llvm.lifetime.start.p0(i64 1, ptr %4) #5
  store i8 1, ptr %4, align 1, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 1, ptr %5) #5
  store i8 1, ptr %5, align 1, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  store i32 1, ptr %6, align 4, !tbaa !5
  br label %32

32:                                               ; preds = %48, %31
  %33 = load i32, ptr %6, align 4, !tbaa !5
  %34 = load i32, ptr %1, align 4, !tbaa !5
  %35 = icmp sle i32 %33, %34
  br i1 %35, label %37, label %36

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

37:                                               ; preds = %32
  %38 = load i32, ptr %6, align 4, !tbaa !5
  %39 = sext i32 %38 to i64
  %40 = getelementptr inbounds [200010 x i32], ptr @a, i64 0, i64 %39
  %41 = load i32, ptr %40, align 4, !tbaa !5
  %42 = load i32, ptr %6, align 4, !tbaa !5
  %43 = sext i32 %42 to i64
  %44 = getelementptr inbounds [200010 x i32], ptr @od_a2, i64 0, i64 %43
  store i32 %41, ptr %44, align 4, !tbaa !5
  %45 = load i32, ptr %6, align 4, !tbaa !5
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds [200010 x i32], ptr @od_a1, i64 0, i64 %46
  store i32 %41, ptr %47, align 4, !tbaa !5
  br label %48

48:                                               ; preds = %37
  %49 = load i32, ptr %6, align 4, !tbaa !5
  %50 = add nsw i32 %49, 1
  store i32 %50, ptr %6, align 4, !tbaa !5
  br label %32, !llvm.loop !13

51:                                               ; preds = %36
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  store i32 1, ptr %7, align 4, !tbaa !5
  br label %52

52:                                               ; preds = %82, %51
  %53 = load i32, ptr %7, align 4, !tbaa !5
  %54 = load i32, ptr %1, align 4, !tbaa !5
  %55 = icmp sle i32 %53, %54
  br i1 %55, label %57, label %56

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

57:                                               ; preds = %52
  %58 = load i32, ptr %7, align 4, !tbaa !5
  %59 = add nsw i32 %58, 1
  %60 = load i32, ptr %1, align 4, !tbaa !5
  %61 = icmp sle i32 %59, %60
  br i1 %61, label %62, label %81

62:                                               ; preds = %57
  %63 = load i32, ptr %7, align 4, !tbaa !5
  %64 = sext i32 %63 to i64
  %65 = getelementptr inbounds [200010 x i32], ptr @od_a1, i64 0, i64 %64
  %66 = load i32, ptr %65, align 4, !tbaa !5
  %67 = load i32, ptr %7, align 4, !tbaa !5
  %68 = add nsw i32 %67, 1
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds [200010 x i32], ptr @od_a1, i64 0, i64 %69
  %71 = load i32, ptr %70, align 4, !tbaa !5
  %72 = icmp sgt i32 %66, %71
  br i1 %72, label %73, label %81

73:                                               ; preds = %62
  %74 = load i32, ptr %7, align 4, !tbaa !5
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds [200010 x i32], ptr @od_a1, i64 0, i64 %75
  %77 = load i32, ptr %7, align 4, !tbaa !5
  %78 = add nsw i32 %77, 1
  %79 = sext i32 %78 to i64
  %80 = getelementptr inbounds [200010 x i32], ptr @od_a1, i64 0, i64 %79
  call void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4) %76, ptr noundef nonnull align 4 dereferenceable(4) %80) #5
  br label %81

81:                                               ; preds = %73, %62, %57
  br label %82

82:                                               ; preds = %81
  %83 = load i32, ptr %7, align 4, !tbaa !5
  %84 = add nsw i32 %83, 2
  store i32 %84, ptr %7, align 4, !tbaa !5
  br label %52, !llvm.loop !14

85:                                               ; preds = %56
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  store i32 2, ptr %8, align 4, !tbaa !5
  br label %86

86:                                               ; preds = %111, %85
  %87 = load i32, ptr %8, align 4, !tbaa !5
  %88 = load i32, ptr %1, align 4, !tbaa !5
  %89 = icmp sle i32 %87, %88
  br i1 %89, label %91, label %90

90:                                               ; preds = %86
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  br label %114

91:                                               ; preds = %86
  %92 = load i32, ptr %8, align 4, !tbaa !5
  %93 = sext i32 %92 to i64
  %94 = getelementptr inbounds [200010 x i32], ptr @od_a2, i64 0, i64 %93
  %95 = load i32, ptr %94, align 4, !tbaa !5
  %96 = load i32, ptr %8, align 4, !tbaa !5
  %97 = add nsw i32 %96, 1
  %98 = sext i32 %97 to i64
  %99 = getelementptr inbounds [200010 x i32], ptr @od_a2, i64 0, i64 %98
  %100 = load i32, ptr %99, align 4, !tbaa !5
  %101 = icmp sgt i32 %95, %100
  br i1 %101, label %102, label %110

102:                                              ; preds = %91
  %103 = load i32, ptr %8, align 4, !tbaa !5
  %104 = sext i32 %103 to i64
  %105 = getelementptr inbounds [200010 x i32], ptr @od_a2, i64 0, i64 %104
  %106 = load i32, ptr %8, align 4, !tbaa !5
  %107 = add nsw i32 %106, 1
  %108 = sext i32 %107 to i64
  %109 = getelementptr inbounds [200010 x i32], ptr @od_a2, i64 0, i64 %108
  call void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4) %105, ptr noundef nonnull align 4 dereferenceable(4) %109) #5
  br label %110

110:                                              ; preds = %102, %91
  br label %111

111:                                              ; preds = %110
  %112 = load i32, ptr %8, align 4, !tbaa !5
  %113 = add nsw i32 %112, 2
  store i32 %113, ptr %8, align 4, !tbaa !5
  br label %86, !llvm.loop !15

114:                                              ; preds = %90
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  store i32 1, ptr %9, align 4, !tbaa !5
  br label %115

115:                                              ; preds = %145, %114
  %116 = load i32, ptr %9, align 4, !tbaa !5
  %117 = load i32, ptr %1, align 4, !tbaa !5
  %118 = icmp slt i32 %116, %117
  br i1 %118, label %120, label %119

119:                                              ; preds = %115
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  br label %148

120:                                              ; preds = %115
  %121 = load i32, ptr %9, align 4, !tbaa !5
  %122 = sext i32 %121 to i64
  %123 = getelementptr inbounds [200010 x i32], ptr @od_a1, i64 0, i64 %122
  %124 = load i32, ptr %123, align 4, !tbaa !5
  %125 = load i32, ptr %9, align 4, !tbaa !5
  %126 = add nsw i32 %125, 1
  %127 = sext i32 %126 to i64
  %128 = getelementptr inbounds [200010 x i32], ptr @od_a1, i64 0, i64 %127
  %129 = load i32, ptr %128, align 4, !tbaa !5
  %130 = icmp sgt i32 %124, %129
  br i1 %130, label %131, label %132

131:                                              ; preds = %120
  store i8 0, ptr %4, align 1, !tbaa !11
  br label %132

132:                                              ; preds = %131, %120
  %133 = load i32, ptr %9, align 4, !tbaa !5
  %134 = sext i32 %133 to i64
  %135 = getelementptr inbounds [200010 x i32], ptr @od_a2, i64 0, i64 %134
  %136 = load i32, ptr %135, align 4, !tbaa !5
  %137 = load i32, ptr %9, align 4, !tbaa !5
  %138 = add nsw i32 %137, 1
  %139 = sext i32 %138 to i64
  %140 = getelementptr inbounds [200010 x i32], ptr @od_a2, i64 0, i64 %139
  %141 = load i32, ptr %140, align 4, !tbaa !5
  %142 = icmp sgt i32 %136, %141
  br i1 %142, label %143, label %144

143:                                              ; preds = %132
  store i8 0, ptr %5, align 1, !tbaa !11
  br label %144

144:                                              ; preds = %143, %132
  br label %145

145:                                              ; preds = %144
  %146 = load i32, ptr %9, align 4, !tbaa !5
  %147 = add nsw i32 %146, 1
  store i32 %147, ptr %9, align 4, !tbaa !5
  br label %115, !llvm.loop !16

148:                                              ; preds = %119
  %149 = load i8, ptr %5, align 1, !tbaa !11, !range !17, !noundef !18
  %150 = trunc i8 %149 to i1
  %151 = zext i1 %150 to i8
  store i8 %151, ptr %3, align 1, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 1, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %4) #5
  br label %205

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

153:                                              ; preds = %178, %152
  %154 = load i32, ptr %10, align 4, !tbaa !5
  %155 = load i32, ptr %1, align 4, !tbaa !5
  %156 = icmp sle i32 %154, %155
  br i1 %156, label %158, label %157

157:                                              ; preds = %153
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  br label %181

158:                                              ; preds = %153
  %159 = load i32, ptr %10, align 4, !tbaa !5
  %160 = sext i32 %159 to i64
  %161 = getelementptr inbounds [200010 x i32], ptr @a, i64 0, i64 %160
  %162 = load i32, ptr %161, align 4, !tbaa !5
  %163 = load i32, ptr %10, align 4, !tbaa !5
  %164 = add nsw i32 %163, 1
  %165 = sext i32 %164 to i64
  %166 = getelementptr inbounds [200010 x i32], ptr @a, i64 0, i64 %165
  %167 = load i32, ptr %166, align 4, !tbaa !5
  %168 = icmp sgt i32 %162, %167
  br i1 %168, label %169, label %177

169:                                              ; preds = %158
  %170 = load i32, ptr %10, align 4, !tbaa !5
  %171 = sext i32 %170 to i64
  %172 = getelementptr inbounds [200010 x i32], ptr @a, i64 0, i64 %171
  %173 = load i32, ptr %10, align 4, !tbaa !5
  %174 = add nsw i32 %173, 1
  %175 = sext i32 %174 to i64
  %176 = getelementptr inbounds [200010 x i32], ptr @a, i64 0, i64 %175
  call void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4) %172, ptr noundef nonnull align 4 dereferenceable(4) %176) #5
  br label %177

177:                                              ; preds = %169, %158
  br label %178

178:                                              ; preds = %177
  %179 = load i32, ptr %10, align 4, !tbaa !5
  %180 = add nsw i32 %179, 2
  store i32 %180, ptr %10, align 4, !tbaa !5
  br label %153, !llvm.loop !19

181:                                              ; preds = %157
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  store i32 1, ptr %11, align 4, !tbaa !5
  br label %182

182:                                              ; preds = %200, %181
  %183 = load i32, ptr %11, align 4, !tbaa !5
  %184 = load i32, ptr %1, align 4, !tbaa !5
  %185 = icmp slt i32 %183, %184
  br i1 %185, label %187, label %186

186:                                              ; preds = %182
  store i32 20, ptr %12, align 4
  br label %203

187:                                              ; preds = %182
  %188 = load i32, ptr %11, align 4, !tbaa !5
  %189 = sext i32 %188 to i64
  %190 = getelementptr inbounds [200010 x i32], ptr @a, i64 0, i64 %189
  %191 = load i32, ptr %190, align 4, !tbaa !5
  %192 = load i32, ptr %11, align 4, !tbaa !5
  %193 = add nsw i32 %192, 1
  %194 = sext i32 %193 to i64
  %195 = getelementptr inbounds [200010 x i32], ptr @a, i64 0, i64 %194
  %196 = load i32, ptr %195, align 4, !tbaa !5
  %197 = icmp sgt i32 %191, %196
  br i1 %197, label %198, label %199

198:                                              ; preds = %187
  store i8 0, ptr %3, align 1, !tbaa !11
  store i32 20, ptr %12, align 4
  br label %203

199:                                              ; preds = %187
  br label %200

200:                                              ; preds = %199
  %201 = load i32, ptr %11, align 4, !tbaa !5
  %202 = add nsw i32 %201, 1
  store i32 %202, ptr %11, align 4, !tbaa !5
  br label %182, !llvm.loop !20

203:                                              ; preds = %198, %186
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  br label %204

204:                                              ; preds = %203
  br label %205

205:                                              ; preds = %204, %148
  %206 = load i8, ptr %3, align 1, !tbaa !11, !range !17, !noundef !18
  %207 = trunc i8 %206 to i1
  br i1 %207, label %208, label %210

208:                                              ; preds = %205
  %209 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str)
  br label %212

210:                                              ; preds = %205
  %211 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.1)
  br label %212

212:                                              ; preds = %210, %208
  %213 = phi ptr [ %209, %208 ], [ %211, %210 ]
  call void @llvm.lifetime.end.p0(i64 1, ptr %3) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %1) #5
  ret void
}

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #3

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

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { inlinehint mustprogress 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 #4 = { 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 #5 = { nounwind }

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

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


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

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

@a = external dso_local global [200010 x i32], align 16
@od_a1 = external dso_local global [200010 x i32], align 16
@od_a2 = external dso_local global [200010 x i32], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local void @_Z5solvev() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #7
  %2 = 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)
  %3 = load i32, ptr %1, align 4, !tbaa !5
  %.not67 = icmp slt i32 %3, 1
  br i1 %.not67, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %.lr.ph, %0
  %4 = phi i32 [ %3, %0 ], [ %8, %.lr.ph ]
  %5 = and i32 %4, 1
  %.not51 = icmp eq i32 %5, 0
  %.not5284 = icmp slt i32 %4, 1
  br i1 %.not51, label %.preheader60, label %.preheader64

.preheader64:                                     ; preds = %._crit_edge
  br i1 %.not5284, label %.thread, label %.lr.ph74.preheader

.preheader60:                                     ; preds = %._crit_edge
  br i1 %.not5284, label %.preheader, label %.lr.ph86

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

.lr.ph74.preheader:                               ; preds = %.preheader64
  %10 = zext nneg i32 %4 to i64
  %11 = shl nuw nsw i64 %10, 2
  call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 4 getelementptr inbounds (i8, ptr @od_a2, i64 4), ptr nonnull align 4 getelementptr inbounds (i8, ptr @a, i64 4), i64 %11, i1 false), !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 4 getelementptr inbounds (i8, ptr @od_a1, i64 4), ptr nonnull align 4 getelementptr inbounds (i8, ptr @a, i64 4), i64 %11, i1 false), !tbaa !5
  br label %.lr.ph74

.preheader62:                                     ; preds = %22
  %.not5575 = icmp slt i32 %23, 2
  br i1 %.not5575, label %.thread, label %.lr.ph77

.lr.ph74:                                         ; preds = %.lr.ph74.preheader, %22
  %12 = phi i32 [ %4, %.lr.ph74.preheader ], [ %23, %22 ]
  %indvars.iv95 = phi i64 [ 1, %.lr.ph74.preheader ], [ %indvars.iv.next96, %22 ]
  %13 = sext i32 %12 to i64
  %.not56.not = icmp slt i64 %indvars.iv95, %13
  br i1 %.not56.not, label %14, label %22

14:                                               ; preds = %.lr.ph74
  %15 = add nuw nsw i64 %indvars.iv95, 1
  %16 = getelementptr inbounds [200010 x i32], ptr @od_a1, i64 0, i64 %indvars.iv95
  %17 = load i32, ptr %16, align 4, !tbaa !5
  %18 = getelementptr inbounds [200010 x i32], ptr @od_a1, i64 0, i64 %15
  %19 = load i32, ptr %18, align 4, !tbaa !5
  %20 = icmp sgt i32 %17, %19
  br i1 %20, label %21, label %22

21:                                               ; preds = %14
  call void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4) %16, ptr noundef nonnull align 4 dereferenceable(4) %18) #7
  %.pre = load i32, ptr %1, align 4, !tbaa !5
  br label %22

22:                                               ; preds = %.lr.ph74, %14, %21
  %23 = phi i32 [ %12, %.lr.ph74 ], [ %12, %14 ], [ %.pre, %21 ]
  %indvars.iv.next96 = add nuw nsw i64 %indvars.iv95, 2
  %24 = trunc nuw i64 %indvars.iv.next96 to i32
  %.not54 = icmp slt i32 %23, %24
  br i1 %.not54, label %.preheader62, label %.lr.ph74, !llvm.loop !11

.preheader61:                                     ; preds = %44
  %25 = icmp sgt i32 %45, 1
  br i1 %25, label %.lr.ph81.preheader, label %.thread

.lr.ph81.preheader:                               ; preds = %.preheader61
  %wide.trip.count = zext nneg i32 %45 to i64
  %.pre112 = load i32, ptr getelementptr inbounds (i8, ptr @od_a2, i64 4), align 4, !tbaa !5
  %26 = add nsw i64 %wide.trip.count, -1
  %min.iters.check = icmp ult i32 %45, 9
  br i1 %min.iters.check, label %.lr.ph81.preheader129, label %vector.ph

.lr.ph81.preheader129:                            ; preds = %middle.block, %.lr.ph81.preheader
  %.ph = phi i32 [ %.pre112, %.lr.ph81.preheader ], [ %vector.recur.extract, %middle.block ]
  %indvars.iv101.ph = phi i64 [ 1, %.lr.ph81.preheader ], [ %ind.end, %middle.block ]
  %.04479.ph = phi i1 [ true, %.lr.ph81.preheader ], [ %.not127, %middle.block ]
  br label %.lr.ph81

vector.ph:                                        ; preds = %.lr.ph81.preheader
  %n.vec = and i64 %26, -8
  %ind.end = or disjoint i64 %n.vec, 1
  %vector.recur.init = insertelement <4 x i32> poison, i32 %.pre112, i64 3
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %vector.recur = phi <4 x i32> [ %vector.recur.init, %vector.ph ], [ %wide.load125, %vector.body ]
  %vec.phi = phi <4 x i1> [ zeroinitializer, %vector.ph ], [ %32, %vector.body ]
  %vec.phi124 = phi <4 x i1> [ zeroinitializer, %vector.ph ], [ %33, %vector.body ]
  %27 = or disjoint i64 %index, 2
  %28 = getelementptr inbounds [200010 x i32], ptr @od_a2, i64 0, i64 %27
  %29 = getelementptr inbounds i8, ptr %28, i64 16
  %wide.load = load <4 x i32>, ptr %28, align 8, !tbaa !5
  %wide.load125 = load <4 x i32>, ptr %29, align 8, !tbaa !5
  %30 = shufflevector <4 x i32> %vector.recur, <4 x i32> %wide.load, <4 x i32> <i32 3, i32 4, i32 5, i32 6>
  %31 = shufflevector <4 x i32> %wide.load, <4 x i32> %wide.load125, <4 x i32> <i32 3, i32 4, i32 5, i32 6>
  %.not = icmp sgt <4 x i32> %30, %wide.load
  %.not126 = icmp sgt <4 x i32> %31, %wide.load125
  %32 = or <4 x i1> %vec.phi, %.not
  %33 = or <4 x i1> %vec.phi124, %.not126
  %index.next = add nuw i64 %index, 8
  %34 = icmp eq i64 %index.next, %n.vec
  br i1 %34, label %middle.block, label %vector.body, !llvm.loop !12

middle.block:                                     ; preds = %vector.body
  %bin.rdx = or <4 x i1> %33, %32
  %bin.rdx.fr = freeze <4 x i1> %bin.rdx
  %35 = bitcast <4 x i1> %bin.rdx.fr to i4
  %.not127 = icmp eq i4 %35, 0
  %vector.recur.extract = extractelement <4 x i32> %wide.load125, i64 3
  %cmp.n = icmp eq i64 %26, %n.vec
  br i1 %cmp.n, label %._crit_edge82, label %.lr.ph81.preheader129

.lr.ph77:                                         ; preds = %.preheader62, %44
  %36 = phi i32 [ %45, %44 ], [ %23, %.preheader62 ]
  %indvars.iv98 = phi i64 [ %indvars.iv.next99, %44 ], [ 2, %.preheader62 ]
  %37 = getelementptr inbounds [200010 x i32], ptr @od_a2, i64 0, i64 %indvars.iv98
  %38 = load i32, ptr %37, align 8, !tbaa !5
  %39 = or disjoint i64 %indvars.iv98, 1
  %40 = getelementptr inbounds [200010 x i32], ptr @od_a2, i64 0, i64 %39
  %41 = load i32, ptr %40, align 4, !tbaa !5
  %42 = icmp sgt i32 %38, %41
  br i1 %42, label %43, label %44

43:                                               ; preds = %.lr.ph77
  call void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4) %37, ptr noundef nonnull align 4 dereferenceable(4) %40) #7
  %.pre111 = load i32, ptr %1, align 4, !tbaa !5
  br label %44

44:                                               ; preds = %.lr.ph77, %43
  %45 = phi i32 [ %36, %.lr.ph77 ], [ %.pre111, %43 ]
  %indvars.iv.next99 = add nuw nsw i64 %indvars.iv98, 2
  %46 = trunc nuw i64 %indvars.iv.next99 to i32
  %.not55 = icmp slt i32 %45, %46
  br i1 %.not55, label %.preheader61, label %.lr.ph77, !llvm.loop !15

.lr.ph81:                                         ; preds = %.lr.ph81.preheader129, %.lr.ph81
  %47 = phi i32 [ %49, %.lr.ph81 ], [ %.ph, %.lr.ph81.preheader129 ]
  %indvars.iv101 = phi i64 [ %indvars.iv.next102, %.lr.ph81 ], [ %indvars.iv101.ph, %.lr.ph81.preheader129 ]
  %.04479 = phi i1 [ %.1, %.lr.ph81 ], [ %.04479.ph, %.lr.ph81.preheader129 ]
  %indvars.iv.next102 = add nuw nsw i64 %indvars.iv101, 1
  %48 = getelementptr inbounds [200010 x i32], ptr @od_a2, i64 0, i64 %indvars.iv.next102
  %49 = load i32, ptr %48, align 4, !tbaa !5
  %50 = icmp sle i32 %47, %49
  %.1 = select i1 %50, i1 %.04479, i1 false
  %exitcond.not = icmp eq i64 %indvars.iv.next102, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge82, label %.lr.ph81, !llvm.loop !16

.preheader:                                       ; preds = %59, %.preheader60
  %.lcssa = phi i32 [ %4, %.preheader60 ], [ %60, %59 ]
  %smax = call i32 @llvm.smax.i32(i32 %.lcssa, i32 1)
  %wide.trip.count109 = zext nneg i32 %smax to i64
  br label %62

.lr.ph86:                                         ; preds = %.preheader60, %59
  %51 = phi i32 [ %60, %59 ], [ %4, %.preheader60 ]
  %indvars.iv103 = phi i64 [ %indvars.iv.next104, %59 ], [ 1, %.preheader60 ]
  %52 = getelementptr inbounds [200010 x i32], ptr @a, i64 0, i64 %indvars.iv103
  %53 = load i32, ptr %52, align 4, !tbaa !5
  %54 = add nuw nsw i64 %indvars.iv103, 1
  %55 = getelementptr inbounds [200010 x i32], ptr @a, i64 0, i64 %54
  %56 = load i32, ptr %55, align 4, !tbaa !5
  %57 = icmp sgt i32 %53, %56
  br i1 %57, label %58, label %59

58:                                               ; preds = %.lr.ph86
  call void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4) %52, ptr noundef nonnull align 4 dereferenceable(4) %55) #7
  %.pre113 = load i32, ptr %1, align 4, !tbaa !5
  br label %59

59:                                               ; preds = %.lr.ph86, %58
  %60 = phi i32 [ %51, %.lr.ph86 ], [ %.pre113, %58 ]
  %indvars.iv.next104 = add nuw nsw i64 %indvars.iv103, 2
  %61 = trunc nuw i64 %indvars.iv.next104 to i32
  %.not52 = icmp slt i32 %60, %61
  br i1 %.not52, label %.preheader, label %.lr.ph86, !llvm.loop !17

62:                                               ; preds = %.preheader, %63
  %indvars.iv106 = phi i64 [ 1, %.preheader ], [ %indvars.iv.next107, %63 ]
  %exitcond110.not = icmp eq i64 %indvars.iv106, %wide.trip.count109
  br i1 %exitcond110.not, label %.thread, label %63

63:                                               ; preds = %62
  %64 = getelementptr inbounds [200010 x i32], ptr @a, i64 0, i64 %indvars.iv106
  %65 = load i32, ptr %64, align 4, !tbaa !5
  %indvars.iv.next107 = add nuw nsw i64 %indvars.iv106, 1
  %66 = getelementptr inbounds [200010 x i32], ptr @a, i64 0, i64 %indvars.iv.next107
  %67 = load i32, ptr %66, align 4, !tbaa !5
  %68 = icmp sgt i32 %65, %67
  br i1 %68, label %.thread58, label %62, !llvm.loop !18

._crit_edge82:                                    ; preds = %.lr.ph81, %middle.block
  %.1.lcssa = phi i1 [ %.not127, %middle.block ], [ %.1, %.lr.ph81 ]
  br i1 %.1.lcssa, label %.thread, label %.thread58

.thread58:                                        ; preds = %63, %._crit_edge82
  br label %.thread

.thread:                                          ; preds = %62, %._crit_edge82, %.preheader61, %.preheader62, %.preheader64, %.thread58
  %.str.1.sink = phi ptr [ @.str.1, %.thread58 ], [ @.str, %.preheader64 ], [ @.str, %.preheader62 ], [ @.str, %.preheader61 ], [ @.str, %._crit_edge82 ], [ @.str, %62 ]
  %69 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull %.str.1.sink)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #7
  ret void
}

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #3

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

; 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: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #6

attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { inlinehint mustprogress 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 #4 = { 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 #5 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10, !13, !14}
!13 = !{!"llvm.loop.isvectorized", i32 1}
!14 = !{!"llvm.loop.unroll.runtime.disable"}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10, !14, !13}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10}


; Effective O3 passes: AggressiveInstCombinePass,BDCEPass,CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalDCEPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LoopIdiomRecognizePass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,SCCPPass,SROAPass,SimplifyCFGPass