; LLVM IR from eyangch/competitive-programming :: Codeforces/1700 (f)

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

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

@N = external dso_local global i64, align 8
@a = external dso_local global [2 x [200000 x i64]], align 16
@b = external dso_local global [2 x [200000 x i64]], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i64, align 8
  %3 = alloca i64, align 8
  %4 = alloca i32, align 4
  %5 = alloca i64, align 8
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  store i32 0, ptr %1, align 4
  %12 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %13 = getelementptr i8, ptr %12, i64 -24
  %14 = load i64, ptr %13, align 8
  %15 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %14
  %16 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %15, ptr noundef null)
  %17 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %18 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @N)
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #7
  store i64 0, ptr %2, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #7
  store i64 0, ptr %3, align 8, !tbaa !8
  br label %19

19:                                               ; preds = %46, %0
  %20 = load i64, ptr %3, align 8, !tbaa !8
  %21 = icmp slt i64 %20, 2
  br i1 %21, label %23, label %22

22:                                               ; preds = %19
  store i32 2, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #7
  br label %49

23:                                               ; preds = %19
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #7
  store i64 0, ptr %5, align 8, !tbaa !8
  br label %24

24:                                               ; preds = %42, %23
  %25 = load i64, ptr %5, align 8, !tbaa !8
  %26 = load i64, ptr @N, align 8, !tbaa !8
  %27 = icmp slt i64 %25, %26
  br i1 %27, label %29, label %28

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

29:                                               ; preds = %24
  %30 = load i64, ptr %3, align 8, !tbaa !8
  %31 = getelementptr inbounds [2 x [200000 x i64]], ptr @a, i64 0, i64 %30
  %32 = load i64, ptr %5, align 8, !tbaa !8
  %33 = getelementptr inbounds [200000 x i64], ptr %31, i64 0, i64 %32
  %34 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %33)
  %35 = load i64, ptr %3, align 8, !tbaa !8
  %36 = getelementptr inbounds [2 x [200000 x i64]], ptr @a, i64 0, i64 %35
  %37 = load i64, ptr %5, align 8, !tbaa !8
  %38 = getelementptr inbounds [200000 x i64], ptr %36, i64 0, i64 %37
  %39 = load i64, ptr %38, align 8, !tbaa !8
  %40 = load i64, ptr %2, align 8, !tbaa !8
  %41 = add nsw i64 %40, %39
  store i64 %41, ptr %2, align 8, !tbaa !8
  br label %42

42:                                               ; preds = %29
  %43 = load i64, ptr %5, align 8, !tbaa !8
  %44 = add nsw i64 %43, 1
  store i64 %44, ptr %5, align 8, !tbaa !8
  br label %24, !llvm.loop !11

45:                                               ; preds = %28
  br label %46

46:                                               ; preds = %45
  %47 = load i64, ptr %3, align 8, !tbaa !8
  %48 = add nsw i64 %47, 1
  store i64 %48, ptr %3, align 8, !tbaa !8
  br label %19, !llvm.loop !13

49:                                               ; preds = %22
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #7
  store i64 0, ptr %6, align 8, !tbaa !8
  br label %50

50:                                               ; preds = %77, %49
  %51 = load i64, ptr %6, align 8, !tbaa !8
  %52 = icmp slt i64 %51, 2
  br i1 %52, label %54, label %53

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

54:                                               ; preds = %50
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #7
  store i64 0, ptr %7, align 8, !tbaa !8
  br label %55

55:                                               ; preds = %73, %54
  %56 = load i64, ptr %7, align 8, !tbaa !8
  %57 = load i64, ptr @N, align 8, !tbaa !8
  %58 = icmp slt i64 %56, %57
  br i1 %58, label %60, label %59

59:                                               ; preds = %55
  store i32 11, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #7
  br label %76

60:                                               ; preds = %55
  %61 = load i64, ptr %6, align 8, !tbaa !8
  %62 = getelementptr inbounds [2 x [200000 x i64]], ptr @b, i64 0, i64 %61
  %63 = load i64, ptr %7, align 8, !tbaa !8
  %64 = getelementptr inbounds [200000 x i64], ptr %62, i64 0, i64 %63
  %65 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %64)
  %66 = load i64, ptr %6, align 8, !tbaa !8
  %67 = getelementptr inbounds [2 x [200000 x i64]], ptr @b, i64 0, i64 %66
  %68 = load i64, ptr %7, align 8, !tbaa !8
  %69 = getelementptr inbounds [200000 x i64], ptr %67, i64 0, i64 %68
  %70 = load i64, ptr %69, align 8, !tbaa !8
  %71 = load i64, ptr %2, align 8, !tbaa !8
  %72 = sub nsw i64 %71, %70
  store i64 %72, ptr %2, align 8, !tbaa !8
  br label %73

73:                                               ; preds = %60
  %74 = load i64, ptr %7, align 8, !tbaa !8
  %75 = add nsw i64 %74, 1
  store i64 %75, ptr %7, align 8, !tbaa !8
  br label %55, !llvm.loop !14

76:                                               ; preds = %59
  br label %77

77:                                               ; preds = %76
  %78 = load i64, ptr %6, align 8, !tbaa !8
  %79 = add nsw i64 %78, 1
  store i64 %79, ptr %6, align 8, !tbaa !8
  br label %50, !llvm.loop !15

80:                                               ; preds = %53
  %81 = load i64, ptr %2, align 8, !tbaa !8
  %82 = icmp ne i64 %81, 0
  br i1 %82, label %83, label %86

83:                                               ; preds = %80
  %84 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef -1)
  %85 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %84, i8 noundef signext 10)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %4, align 4
  br label %175

86:                                               ; preds = %80
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #7
  store i64 0, ptr %8, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #7
  store i64 0, ptr %9, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #7
  store i64 0, ptr %10, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #7
  store i64 0, ptr %11, align 8, !tbaa !8
  br label %87

87:                                               ; preds = %168, %86
  %88 = load i64, ptr %11, align 8, !tbaa !8
  %89 = load i64, ptr @N, align 8, !tbaa !8
  %90 = icmp slt i64 %88, %89
  br i1 %90, label %92, label %91

91:                                               ; preds = %87
  store i32 14, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  br label %171

92:                                               ; preds = %87
  %93 = load i64, ptr %11, align 8, !tbaa !8
  %94 = getelementptr inbounds [200000 x i64], ptr @a, i64 0, i64 %93
  %95 = load i64, ptr %94, align 8, !tbaa !8
  %96 = load i64, ptr %11, align 8, !tbaa !8
  %97 = getelementptr inbounds [200000 x i64], ptr @b, i64 0, i64 %96
  %98 = load i64, ptr %97, align 8, !tbaa !8
  %99 = sub nsw i64 %95, %98
  %100 = load i64, ptr %8, align 8, !tbaa !8
  %101 = add nsw i64 %100, %99
  store i64 %101, ptr %8, align 8, !tbaa !8
  %102 = load i64, ptr %11, align 8, !tbaa !8
  %103 = getelementptr inbounds [200000 x i64], ptr getelementptr inbounds ([2 x [200000 x i64]], ptr @a, i64 0, i64 1), i64 0, i64 %102
  %104 = load i64, ptr %103, align 8, !tbaa !8
  %105 = load i64, ptr %11, align 8, !tbaa !8
  %106 = getelementptr inbounds [200000 x i64], ptr getelementptr inbounds ([2 x [200000 x i64]], ptr @b, i64 0, i64 1), i64 0, i64 %105
  %107 = load i64, ptr %106, align 8, !tbaa !8
  %108 = sub nsw i64 %104, %107
  %109 = load i64, ptr %9, align 8, !tbaa !8
  %110 = add nsw i64 %109, %108
  store i64 %110, ptr %9, align 8, !tbaa !8
  %111 = load i64, ptr %8, align 8, !tbaa !8
  %112 = call noundef i64 @_ZSt3absx(i64 noundef %111)
  %113 = load i64, ptr %9, align 8, !tbaa !8
  %114 = call noundef i64 @_ZSt3absx(i64 noundef %113)
  %115 = add nsw i64 %112, %114
  %116 = load i64, ptr %10, align 8, !tbaa !8
  %117 = add nsw i64 %116, %115
  store i64 %117, ptr %10, align 8, !tbaa !8
  %118 = load i64, ptr %8, align 8, !tbaa !8
  %119 = load i64, ptr %9, align 8, !tbaa !8
  %120 = mul nsw i64 %118, %119
  %121 = icmp sge i64 %120, 0
  br i1 %121, label %122, label %123

122:                                              ; preds = %92
  br label %167

123:                                              ; preds = %92
  %124 = load i64, ptr %8, align 8, !tbaa !8
  %125 = load i64, ptr %9, align 8, !tbaa !8
  %126 = icmp slt i64 %124, %125
  br i1 %126, label %127, label %144

127:                                              ; preds = %123
  %128 = load i64, ptr %11, align 8, !tbaa !8
  %129 = getelementptr inbounds [200000 x i64], ptr getelementptr inbounds ([2 x [200000 x i64]], ptr @a, i64 0, i64 1), i64 0, i64 %128
  %130 = load i64, ptr %129, align 8, !tbaa !8
  %131 = icmp ne i64 %130, 0
  br i1 %131, label %137, label %132

132:                                              ; preds = %127
  %133 = load i64, ptr %11, align 8, !tbaa !8
  %134 = getelementptr inbounds [200000 x i64], ptr @b, i64 0, i64 %133
  %135 = load i64, ptr %134, align 8, !tbaa !8
  %136 = icmp ne i64 %135, 0
  br i1 %136, label %137, label %144

137:                                              ; preds = %132, %127
  %138 = load i64, ptr %8, align 8, !tbaa !8
  %139 = add nsw i64 %138, 1
  store i64 %139, ptr %8, align 8, !tbaa !8
  %140 = load i64, ptr %9, align 8, !tbaa !8
  %141 = add nsw i64 %140, -1
  store i64 %141, ptr %9, align 8, !tbaa !8
  %142 = load i64, ptr %10, align 8, !tbaa !8
  %143 = add nsw i64 %142, -1
  store i64 %143, ptr %10, align 8, !tbaa !8
  br label %166

144:                                              ; preds = %132, %123
  %145 = load i64, ptr %8, align 8, !tbaa !8
  %146 = load i64, ptr %9, align 8, !tbaa !8
  %147 = icmp sgt i64 %145, %146
  br i1 %147, label %148, label %165

148:                                              ; preds = %144
  %149 = load i64, ptr %11, align 8, !tbaa !8
  %150 = getelementptr inbounds [200000 x i64], ptr @a, i64 0, i64 %149
  %151 = load i64, ptr %150, align 8, !tbaa !8
  %152 = icmp ne i64 %151, 0
  br i1 %152, label %158, label %153

153:                                              ; preds = %148
  %154 = load i64, ptr %11, align 8, !tbaa !8
  %155 = getelementptr inbounds [200000 x i64], ptr getelementptr inbounds ([2 x [200000 x i64]], ptr @b, i64 0, i64 1), i64 0, i64 %154
  %156 = load i64, ptr %155, align 8, !tbaa !8
  %157 = icmp ne i64 %156, 0
  br i1 %157, label %158, label %165

158:                                              ; preds = %153, %148
  %159 = load i64, ptr %9, align 8, !tbaa !8
  %160 = add nsw i64 %159, 1
  store i64 %160, ptr %9, align 8, !tbaa !8
  %161 = load i64, ptr %8, align 8, !tbaa !8
  %162 = add nsw i64 %161, -1
  store i64 %162, ptr %8, align 8, !tbaa !8
  %163 = load i64, ptr %10, align 8, !tbaa !8
  %164 = add nsw i64 %163, -1
  store i64 %164, ptr %10, align 8, !tbaa !8
  br label %165

165:                                              ; preds = %158, %153, %144
  br label %166

166:                                              ; preds = %165, %137
  br label %167

167:                                              ; preds = %166, %122
  br label %168

168:                                              ; preds = %167
  %169 = load i64, ptr %11, align 8, !tbaa !8
  %170 = add nsw i64 %169, 1
  store i64 %170, ptr %11, align 8, !tbaa !8
  br label %87, !llvm.loop !16

171:                                              ; preds = %91
  %172 = load i64, ptr %10, align 8, !tbaa !8
  %173 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %172)
  %174 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %173, i8 noundef signext 10)
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  store i32 0, ptr %4, align 4
  br label %175

175:                                              ; preds = %171, %83
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #7
  %176 = load i32, ptr %4, align 4
  switch i32 %176, label %179 [
    i32 0, label %177
    i32 1, label %177
  ]

177:                                              ; preds = %175, %175
  %178 = load i32, ptr %1, align 4
  ret i32 %178

179:                                              ; preds = %175
  unreachable
}

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

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(8)) #3 align 2

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

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZSt3absx(i64 noundef) #6

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) #3 align 2

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

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

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


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

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

@N = external dso_local global i64, align 8
@a = external dso_local global [2 x [200000 x i64]], align 16
@b = external dso_local global [2 x [200000 x i64]], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %2 = getelementptr i8, ptr %1, i64 -24
  %3 = load i64, ptr %2, align 8
  %4 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %3
  %5 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %4, ptr noundef null)
  %6 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %7 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @N)
  %8 = load i64, ptr @N, align 8, !tbaa !8
  %9 = icmp sgt i64 %8, 0
  br i1 %9, label %.lr.ph, label %._crit_edge93

.preheader71:                                     ; preds = %.lr.ph.1
  %10 = icmp sgt i64 %17, 0
  br i1 %10, label %.lr.ph79, label %.split86.us

._crit_edge:                                      ; preds = %.lr.ph
  %11 = icmp sgt i64 %24, 0
  br i1 %11, label %.lr.ph.1, label %.split86.us

.lr.ph.1:                                         ; preds = %._crit_edge, %.lr.ph.1
  %.05574.1 = phi i64 [ %16, %.lr.ph.1 ], [ 0, %._crit_edge ]
  %.15873.1 = phi i64 [ %15, %.lr.ph.1 ], [ %22, %._crit_edge ]
  %12 = getelementptr inbounds [2 x [200000 x i64]], ptr @a, i64 0, i64 1, i64 %.05574.1
  %13 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %12)
  %14 = load i64, ptr %12, align 8, !tbaa !8
  %15 = add nsw i64 %14, %.15873.1
  %16 = add nuw nsw i64 %.05574.1, 1
  %17 = load i64, ptr @N, align 8, !tbaa !8
  %18 = icmp slt i64 %16, %17
  br i1 %18, label %.lr.ph.1, label %.preheader71, !llvm.loop !11

.lr.ph:                                           ; preds = %0, %.lr.ph
  %.05574 = phi i64 [ %23, %.lr.ph ], [ 0, %0 ]
  %.15873 = phi i64 [ %22, %.lr.ph ], [ 0, %0 ]
  %19 = getelementptr inbounds [2 x [200000 x i64]], ptr @a, i64 0, i64 0, i64 %.05574
  %20 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %19)
  %21 = load i64, ptr %19, align 8, !tbaa !8
  %22 = add nsw i64 %21, %.15873
  %23 = add nuw nsw i64 %.05574, 1
  %24 = load i64, ptr @N, align 8, !tbaa !8
  %25 = icmp slt i64 %23, %24
  br i1 %25, label %.lr.ph, label %._crit_edge, !llvm.loop !11

.split86.us:                                      ; preds = %._crit_edge80, %._crit_edge80.loopexit.1, %._crit_edge, %.preheader71
  %26 = phi i1 [ false, %.preheader71 ], [ false, %._crit_edge ], [ false, %._crit_edge80 ], [ %35, %._crit_edge80.loopexit.1 ]
  %.us-phi87 = phi i64 [ %15, %.preheader71 ], [ %22, %._crit_edge ], [ %39, %._crit_edge80 ], [ %31, %._crit_edge80.loopexit.1 ]
  %.not = icmp eq i64 %.us-phi87, 0
  br i1 %.not, label %.preheader, label %43

.preheader:                                       ; preds = %.split86.us
  br i1 %26, label %.lr.ph92, label %._crit_edge93

._crit_edge80:                                    ; preds = %.lr.ph79
  %27 = icmp sgt i64 %41, 0
  br i1 %27, label %.lr.ph79.1, label %.split86.us

.lr.ph79.1:                                       ; preds = %._crit_edge80, %.lr.ph79.1
  %.05378.1 = phi i64 [ %32, %.lr.ph79.1 ], [ 0, %._crit_edge80 ]
  %.377.1 = phi i64 [ %31, %.lr.ph79.1 ], [ %39, %._crit_edge80 ]
  %28 = getelementptr inbounds [2 x [200000 x i64]], ptr @b, i64 0, i64 1, i64 %.05378.1
  %29 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %28)
  %30 = load i64, ptr %28, align 8, !tbaa !8
  %31 = sub nsw i64 %.377.1, %30
  %32 = add nuw nsw i64 %.05378.1, 1
  %33 = load i64, ptr @N, align 8, !tbaa !8
  %34 = icmp slt i64 %32, %33
  br i1 %34, label %.lr.ph79.1, label %._crit_edge80.loopexit.1, !llvm.loop !13

._crit_edge80.loopexit.1:                         ; preds = %.lr.ph79.1
  %35 = icmp sgt i64 %33, 0
  br label %.split86.us

.lr.ph79:                                         ; preds = %.preheader71, %.lr.ph79
  %.05378 = phi i64 [ %40, %.lr.ph79 ], [ 0, %.preheader71 ]
  %.377 = phi i64 [ %39, %.lr.ph79 ], [ %15, %.preheader71 ]
  %36 = getelementptr inbounds [2 x [200000 x i64]], ptr @b, i64 0, i64 0, i64 %.05378
  %37 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %36)
  %38 = load i64, ptr %36, align 8, !tbaa !8
  %39 = sub nsw i64 %.377, %38
  %40 = add nuw nsw i64 %.05378, 1
  %41 = load i64, ptr @N, align 8, !tbaa !8
  %42 = icmp slt i64 %40, %41
  br i1 %42, label %.lr.ph79, label %._crit_edge80, !llvm.loop !13

43:                                               ; preds = %.split86.us
  %44 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef -1)
  br label %88

._crit_edge93:                                    ; preds = %84, %0, %.preheader
  %.048.lcssa = phi i64 [ 0, %.preheader ], [ 0, %0 ], [ %.1, %84 ]
  %45 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %.048.lcssa)
  br label %88

.lr.ph92:                                         ; preds = %.preheader, %84
  %.091 = phi i64 [ %85, %84 ], [ 0, %.preheader ]
  %.04890 = phi i64 [ %.1, %84 ], [ 0, %.preheader ]
  %.04989 = phi i64 [ %.150, %84 ], [ 0, %.preheader ]
  %.05188 = phi i64 [ %.152, %84 ], [ 0, %.preheader ]
  %46 = getelementptr inbounds [200000 x i64], ptr @a, i64 0, i64 %.091
  %47 = load i64, ptr %46, align 8, !tbaa !8
  %48 = getelementptr inbounds [200000 x i64], ptr @b, i64 0, i64 %.091
  %49 = load i64, ptr %48, align 8, !tbaa !8
  %50 = sub nsw i64 %47, %49
  %51 = add nsw i64 %50, %.05188
  %52 = getelementptr inbounds [200000 x i64], ptr getelementptr inbounds (i8, ptr @a, i64 1600000), i64 0, i64 %.091
  %53 = load i64, ptr %52, align 8, !tbaa !8
  %54 = getelementptr inbounds [200000 x i64], ptr getelementptr inbounds (i8, ptr @b, i64 1600000), i64 0, i64 %.091
  %55 = load i64, ptr %54, align 8, !tbaa !8
  %56 = sub nsw i64 %53, %55
  %57 = add nsw i64 %56, %.04989
  %58 = tail call noundef i64 @_ZSt3absx(i64 noundef %51)
  %59 = tail call noundef i64 @_ZSt3absx(i64 noundef %57)
  %60 = add i64 %58, %.04890
  %61 = add i64 %60, %59
  %62 = mul nsw i64 %57, %51
  %63 = icmp sgt i64 %62, -1
  br i1 %63, label %84, label %64

64:                                               ; preds = %.lr.ph92
  %65 = icmp slt i64 %51, %57
  br i1 %65, label %66, label %74

66:                                               ; preds = %64
  %67 = load i64, ptr %52, align 8, !tbaa !8
  %.not66 = icmp eq i64 %67, 0
  br i1 %.not66, label %68, label %70

68:                                               ; preds = %66
  %69 = load i64, ptr %48, align 8, !tbaa !8
  %.not67 = icmp eq i64 %69, 0
  br i1 %.not67, label %74, label %70

70:                                               ; preds = %68, %66
  %71 = add nsw i64 %51, 1
  %72 = add nsw i64 %57, -1
  %73 = add nsw i64 %61, -1
  br label %84

74:                                               ; preds = %68, %64
  %75 = icmp sgt i64 %51, %57
  br i1 %75, label %76, label %84

76:                                               ; preds = %74
  %77 = load i64, ptr %46, align 8, !tbaa !8
  %.not68 = icmp eq i64 %77, 0
  br i1 %.not68, label %78, label %80

78:                                               ; preds = %76
  %79 = load i64, ptr %54, align 8, !tbaa !8
  %.not69 = icmp eq i64 %79, 0
  br i1 %.not69, label %84, label %80

80:                                               ; preds = %78, %76
  %81 = add nsw i64 %57, 1
  %82 = add nsw i64 %51, -1
  %83 = add nsw i64 %61, -1
  br label %84

84:                                               ; preds = %.lr.ph92, %74, %78, %80, %70
  %.152 = phi i64 [ %51, %.lr.ph92 ], [ %71, %70 ], [ %82, %80 ], [ %51, %78 ], [ %51, %74 ]
  %.150 = phi i64 [ %57, %.lr.ph92 ], [ %72, %70 ], [ %81, %80 ], [ %57, %78 ], [ %57, %74 ]
  %.1 = phi i64 [ %61, %.lr.ph92 ], [ %73, %70 ], [ %83, %80 ], [ %61, %78 ], [ %61, %74 ]
  %85 = add nuw nsw i64 %.091, 1
  %86 = load i64, ptr @N, align 8, !tbaa !8
  %87 = icmp slt i64 %85, %86
  br i1 %87, label %.lr.ph92, label %._crit_edge93, !llvm.loop !14

88:                                               ; preds = %._crit_edge93, %43
  %.sink = phi ptr [ %45, %._crit_edge93 ], [ %44, %43 ]
  %89 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %.sink, i8 noundef signext 10)
  ret i32 0
}

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

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

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #3 align 2

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZSt3absx(i64 noundef) local_unnamed_addr #5

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) local_unnamed_addr #3 align 2

attributes #0 = { mustprogress norecurse uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { 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 = { "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 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 = { 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" }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"long long", !10, i64 0}
!10 = !{!"omnipotent char", !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,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SCCPPass,SROAPass,SimpleLoopUnswitchPass,SimplifyCFGPass,TailCallElimPass