; LLVM IR from VastoLorde95/Competitive-Programming :: Codeforces/VK Cup 2016 Round 1 /Problem B (B)

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

%"class.std::basic_ostream" = type { ptr, %"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_istream" = type { ptr, i64, %"class.std::basic_ios" }

@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@n = external dso_local global i32, align 4
@a = external dso_local global [200101 x i64], align 16
@b = external dso_local global [200101 x i64], align 16
@c = external dso_local global [200101 x i64], align 16
@k = external dso_local global i64, align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #0 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z7computev() #2

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

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #4 {
  %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
  %11 = alloca i32, align 4
  %12 = alloca i64, align 8
  %13 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %14 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %15 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %16 = getelementptr i8, ptr %15, i64 -24
  %17 = load i64, ptr %16, align 8
  %18 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %17
  %19 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %18, ptr noundef null)
  %20 = load ptr, ptr @_ZSt4cout, align 8, !tbaa !5
  %21 = getelementptr i8, ptr %20, i64 -24
  %22 = load i64, ptr %21, align 8
  %23 = getelementptr inbounds i8, ptr @_ZSt4cout, i64 %22
  %24 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %23, ptr noundef null)
  %25 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @n)
  %26 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %25, ptr noundef nonnull align 8 dereferenceable(8) @k)
  %27 = load i32, ptr @n, align 4, !tbaa !8
  %28 = add nsw i32 %27, 1
  store i32 %28, ptr @n, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #7
  store i32 0, ptr %2, align 4, !tbaa !8
  br label %29

29:                                               ; preds = %39, %0
  %30 = load i32, ptr %2, align 4, !tbaa !8
  %31 = load i32, ptr @n, align 4, !tbaa !8
  %32 = icmp slt i32 %30, %31
  br i1 %32, label %34, label %33

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

34:                                               ; preds = %29
  %35 = load i32, ptr %2, align 4, !tbaa !8
  %36 = sext i32 %35 to i64
  %37 = getelementptr inbounds [200101 x i64], ptr @a, i64 0, i64 %36
  %38 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %37)
  br label %39

39:                                               ; preds = %34
  %40 = load i32, ptr %2, align 4, !tbaa !8
  %41 = add nsw i32 %40, 1
  store i32 %41, ptr %2, align 4, !tbaa !8
  br label %29, !llvm.loop !11

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

43:                                               ; preds = %56, %42
  %44 = load i32, ptr %3, align 4, !tbaa !8
  %45 = load i32, ptr @n, align 4, !tbaa !8
  %46 = icmp slt i32 %44, %45
  br i1 %46, label %48, label %47

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

48:                                               ; preds = %43
  %49 = load i32, ptr %3, align 4, !tbaa !8
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds [200101 x i64], ptr @a, i64 0, i64 %50
  %52 = load i64, ptr %51, align 8, !tbaa !13
  %53 = load i32, ptr %3, align 4, !tbaa !8
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds [200101 x i64], ptr @c, i64 0, i64 %54
  store i64 %52, ptr %55, align 8, !tbaa !13
  br label %56

56:                                               ; preds = %48
  %57 = load i32, ptr %3, align 4, !tbaa !8
  %58 = add nsw i32 %57, 1
  store i32 %58, ptr %3, align 4, !tbaa !8
  br label %43, !llvm.loop !15

59:                                               ; preds = %47
  %60 = call noundef zeroext i1 @_Z7computev()
  br i1 %60, label %87, label %61

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

62:                                               ; preds = %82, %61
  %63 = load i32, ptr %4, align 4, !tbaa !8
  %64 = icmp sle i32 %63, 200100
  br i1 %64, label %66, label %65

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

66:                                               ; preds = %62
  %67 = load i32, ptr %4, align 4, !tbaa !8
  %68 = sext i32 %67 to i64
  %69 = getelementptr inbounds [200101 x i64], ptr @c, i64 0, i64 %68
  %70 = load i64, ptr %69, align 8, !tbaa !13
  %71 = sub nsw i64 0, %70
  %72 = load i32, ptr %4, align 4, !tbaa !8
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds [200101 x i64], ptr @c, i64 0, i64 %73
  store i64 %71, ptr %74, align 8, !tbaa !13
  %75 = load i32, ptr %4, align 4, !tbaa !8
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds [200101 x i64], ptr @c, i64 0, i64 %76
  %78 = load i64, ptr %77, align 8, !tbaa !13
  %79 = load i32, ptr %4, align 4, !tbaa !8
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds [200101 x i64], ptr @a, i64 0, i64 %80
  store i64 %78, ptr %81, align 8, !tbaa !13
  br label %82

82:                                               ; preds = %66
  %83 = load i32, ptr %4, align 4, !tbaa !8
  %84 = add nsw i32 %83, 1
  store i32 %84, ptr %4, align 4, !tbaa !8
  br label %62, !llvm.loop !16

85:                                               ; preds = %65
  %86 = call noundef zeroext i1 @_Z7computev()
  br label %87

87:                                               ; preds = %85, %59
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #7
  store i32 -1, ptr %5, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  store i32 0, ptr %6, align 4, !tbaa !8
  br label %88

88:                                               ; preds = %101, %87
  %89 = load i32, ptr %6, align 4, !tbaa !8
  %90 = icmp sle i32 %89, 200100
  br i1 %90, label %92, label %91

91:                                               ; preds = %88
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  br label %104

92:                                               ; preds = %88
  %93 = load i32, ptr %6, align 4, !tbaa !8
  %94 = sext i32 %93 to i64
  %95 = getelementptr inbounds [200101 x i64], ptr @b, i64 0, i64 %94
  %96 = load i64, ptr %95, align 8, !tbaa !13
  %97 = icmp ne i64 %96, 0
  br i1 %97, label %98, label %100

98:                                               ; preds = %92
  %99 = load i32, ptr %6, align 4, !tbaa !8
  store i32 %99, ptr %5, align 4, !tbaa !8
  br label %100

100:                                              ; preds = %98, %92
  br label %101

101:                                              ; preds = %100
  %102 = load i32, ptr %6, align 4, !tbaa !8
  %103 = add nsw i32 %102, 1
  store i32 %103, ptr %6, align 4, !tbaa !8
  br label %88, !llvm.loop !17

104:                                              ; preds = %91
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #7
  store i32 -1, ptr %7, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #7
  store i32 200100, ptr %8, align 4, !tbaa !8
  br label %105

105:                                              ; preds = %118, %104
  %106 = load i32, ptr %8, align 4, !tbaa !8
  %107 = icmp sge i32 %106, 0
  br i1 %107, label %109, label %108

108:                                              ; preds = %105
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  br label %121

109:                                              ; preds = %105
  %110 = load i32, ptr %8, align 4, !tbaa !8
  %111 = sext i32 %110 to i64
  %112 = getelementptr inbounds [200101 x i64], ptr @b, i64 0, i64 %111
  %113 = load i64, ptr %112, align 8, !tbaa !13
  %114 = icmp ne i64 %113, 0
  br i1 %114, label %115, label %117

115:                                              ; preds = %109
  %116 = load i32, ptr %8, align 4, !tbaa !8
  store i32 %116, ptr %7, align 4, !tbaa !8
  br label %117

117:                                              ; preds = %115, %109
  br label %118

118:                                              ; preds = %117
  %119 = load i32, ptr %8, align 4, !tbaa !8
  %120 = add nsw i32 %119, -1
  store i32 %120, ptr %8, align 4, !tbaa !8
  br label %105, !llvm.loop !18

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

122:                                              ; preds = %186, %121
  %123 = load i32, ptr %10, align 4, !tbaa !8
  %124 = load i32, ptr %7, align 4, !tbaa !8
  %125 = icmp sle i32 %123, %124
  br i1 %125, label %127, label %126

126:                                              ; preds = %122
  store i32 17, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  br label %189

127:                                              ; preds = %122
  %128 = load i32, ptr %5, align 4, !tbaa !8
  %129 = load i32, ptr %10, align 4, !tbaa !8
  %130 = sub nsw i32 %128, %129
  %131 = add nsw i32 %130, 1
  %132 = icmp sgt i32 %131, 32
  br i1 %132, label %133, label %134

133:                                              ; preds = %127
  br label %186

134:                                              ; preds = %127
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #7
  store i64 0, ptr %12, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #7
  %135 = load i32, ptr %5, align 4, !tbaa !8
  store i32 %135, ptr %13, align 4, !tbaa !8
  br label %136

136:                                              ; preds = %149, %134
  %137 = load i32, ptr %13, align 4, !tbaa !8
  %138 = load i32, ptr %10, align 4, !tbaa !8
  %139 = icmp sge i32 %137, %138
  br i1 %139, label %141, label %140

140:                                              ; preds = %136
  store i32 20, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  br label %152

141:                                              ; preds = %136
  %142 = load i64, ptr %12, align 8, !tbaa !13
  %143 = shl i64 %142, 1
  %144 = load i32, ptr %13, align 4, !tbaa !8
  %145 = sext i32 %144 to i64
  %146 = getelementptr inbounds [200101 x i64], ptr @b, i64 0, i64 %145
  %147 = load i64, ptr %146, align 8, !tbaa !13
  %148 = add nsw i64 %143, %147
  store i64 %148, ptr %12, align 8, !tbaa !13
  br label %149

149:                                              ; preds = %141
  %150 = load i32, ptr %13, align 4, !tbaa !8
  %151 = add nsw i32 %150, -1
  store i32 %151, ptr %13, align 4, !tbaa !8
  br label %136, !llvm.loop !19

152:                                              ; preds = %140
  %153 = load i32, ptr %10, align 4, !tbaa !8
  %154 = load i32, ptr @n, align 4, !tbaa !8
  %155 = icmp slt i32 %153, %154
  br i1 %155, label %156, label %182

156:                                              ; preds = %152
  %157 = load i32, ptr %10, align 4, !tbaa !8
  %158 = sext i32 %157 to i64
  %159 = getelementptr inbounds [200101 x i64], ptr @c, i64 0, i64 %158
  %160 = load i64, ptr %159, align 8, !tbaa !13
  %161 = load i64, ptr %12, align 8, !tbaa !13
  %162 = sub nsw i64 %160, %161
  %163 = call noundef i64 @_ZSt3absx(i64 noundef %162)
  %164 = load i64, ptr @k, align 8, !tbaa !13
  %165 = icmp sle i64 %163, %164
  br i1 %165, label %166, label %182

166:                                              ; preds = %156
  %167 = load i32, ptr %10, align 4, !tbaa !8
  %168 = load i32, ptr @n, align 4, !tbaa !8
  %169 = sub nsw i32 %168, 1
  %170 = icmp eq i32 %167, %169
  br i1 %170, label %171, label %179

171:                                              ; preds = %166
  %172 = load i64, ptr %12, align 8, !tbaa !13
  %173 = load i32, ptr %10, align 4, !tbaa !8
  %174 = sext i32 %173 to i64
  %175 = getelementptr inbounds [200101 x i64], ptr @c, i64 0, i64 %174
  %176 = load i64, ptr %175, align 8, !tbaa !13
  %177 = icmp eq i64 %172, %176
  br i1 %177, label %178, label %179

178:                                              ; preds = %171
  store i32 19, ptr %11, align 4
  br label %183

179:                                              ; preds = %171, %166
  %180 = load i32, ptr %9, align 4, !tbaa !8
  %181 = add nsw i32 %180, 1
  store i32 %181, ptr %9, align 4, !tbaa !8
  br label %182

182:                                              ; preds = %179, %156, %152
  store i32 0, ptr %11, align 4
  br label %183

183:                                              ; preds = %182, %178
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  %184 = load i32, ptr %11, align 4
  switch i32 %184, label %194 [
    i32 0, label %185
    i32 19, label %186
  ]

185:                                              ; preds = %183
  br label %186

186:                                              ; preds = %185, %183, %133
  %187 = load i32, ptr %10, align 4, !tbaa !8
  %188 = add nsw i32 %187, 1
  store i32 %188, ptr %10, align 4, !tbaa !8
  br label %122, !llvm.loop !20

189:                                              ; preds = %126
  %190 = load i32, ptr %9, align 4, !tbaa !8
  %191 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %190)
  %192 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %191, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #7
  %193 = load i32, ptr %1, align 4
  ret i32 %193

194:                                              ; preds = %183
  unreachable
}

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

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

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

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

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

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

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 = { 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 #2 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 #5 = { "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 = !{!"int", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!14, !14, i64 0}
!14 = !{!"long long", !10, i64 0}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !12}
!19 = distinct !{!19, !12}
!20 = distinct !{!20, !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_ostream" = type { ptr, %"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_istream" = type { ptr, i64, %"class.std::basic_ios" }

@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@n = external dso_local global i32, align 4
@a = external dso_local global [200101 x i64], align 16
@b = external dso_local local_unnamed_addr global [200101 x i64], align 16
@c = external dso_local local_unnamed_addr global [200101 x i64], align 16
@k = external dso_local global i64, align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z7computev() local_unnamed_addr #2

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #3 {
  %1 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %2 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %3 = getelementptr i8, ptr %2, i64 -24
  %4 = load i64, ptr %3, align 8
  %5 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %4
  %6 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %5, ptr noundef null)
  %7 = load ptr, ptr @_ZSt4cout, align 8, !tbaa !5
  %8 = getelementptr i8, ptr %7, i64 -24
  %9 = load i64, ptr %8, align 8
  %10 = getelementptr inbounds i8, ptr @_ZSt4cout, i64 %9
  %11 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %10, ptr noundef null)
  %12 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) @n)
  %13 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %12, ptr noundef nonnull align 8 dereferenceable(8) @k)
  %14 = load i32, ptr @n, align 4, !tbaa !8
  %15 = add nsw i32 %14, 1
  store i32 %15, ptr @n, align 4, !tbaa !8
  %16 = icmp sgt i32 %14, -1
  br i1 %16, label %.lr.ph, label %._crit_edge

.preheader61:                                     ; preds = %.lr.ph
  %17 = icmp sgt i32 %22, 0
  br i1 %17, label %.lr.ph64.preheader, label %._crit_edge

.lr.ph64.preheader:                               ; preds = %.preheader61
  %18 = zext nneg i32 %22 to i64
  %19 = shl nuw nsw i64 %18, 3
  tail call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 16 @c, ptr nonnull align 16 @a, i64 %19, i1 false), !tbaa !11
  br label %._crit_edge

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %0 ]
  %20 = getelementptr inbounds [200101 x i64], ptr @a, i64 0, i64 %indvars.iv
  %21 = 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) %20)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %22 = load i32, ptr @n, align 4, !tbaa !8
  %23 = sext i32 %22 to i64
  %24 = icmp slt i64 %indvars.iv.next, %23
  br i1 %24, label %.lr.ph, label %.preheader61, !llvm.loop !13

._crit_edge:                                      ; preds = %0, %.lr.ph64.preheader, %.preheader61
  %25 = tail call noundef zeroext i1 @_Z7computev()
  br i1 %25, label %.preheader109, label %vector.body

.preheader109:                                    ; preds = %.preheader60, %._crit_edge
  br label %42

vector.body:                                      ; preds = %._crit_edge, %vector.body.1
  %index = phi i64 [ %index.next.1, %vector.body.1 ], [ 0, %._crit_edge ]
  %26 = getelementptr inbounds [200101 x i64], ptr @c, i64 0, i64 %index
  %27 = getelementptr inbounds i8, ptr %26, i64 16
  %wide.load = load <2 x i64>, ptr %26, align 16, !tbaa !11
  %wide.load108 = load <2 x i64>, ptr %27, align 16, !tbaa !11
  %28 = sub nsw <2 x i64> zeroinitializer, %wide.load
  %29 = sub nsw <2 x i64> zeroinitializer, %wide.load108
  store <2 x i64> %28, ptr %26, align 16, !tbaa !11
  store <2 x i64> %29, ptr %27, align 16, !tbaa !11
  %30 = getelementptr inbounds [200101 x i64], ptr @a, i64 0, i64 %index
  %31 = getelementptr inbounds i8, ptr %30, i64 16
  store <2 x i64> %28, ptr %30, align 16, !tbaa !11
  store <2 x i64> %29, ptr %31, align 16, !tbaa !11
  %32 = icmp eq i64 %index, 200096
  br i1 %32, label %.preheader60, label %vector.body.1, !llvm.loop !15

vector.body.1:                                    ; preds = %vector.body
  %index.next = or disjoint i64 %index, 4
  %33 = getelementptr inbounds [200101 x i64], ptr @c, i64 0, i64 %index.next
  %34 = getelementptr inbounds i8, ptr %33, i64 16
  %wide.load.1 = load <2 x i64>, ptr %33, align 16, !tbaa !11
  %wide.load108.1 = load <2 x i64>, ptr %34, align 16, !tbaa !11
  %35 = sub nsw <2 x i64> zeroinitializer, %wide.load.1
  %36 = sub nsw <2 x i64> zeroinitializer, %wide.load108.1
  store <2 x i64> %35, ptr %33, align 16, !tbaa !11
  store <2 x i64> %36, ptr %34, align 16, !tbaa !11
  %37 = getelementptr inbounds [200101 x i64], ptr @a, i64 0, i64 %index.next
  %38 = getelementptr inbounds i8, ptr %37, i64 16
  store <2 x i64> %35, ptr %37, align 16, !tbaa !11
  store <2 x i64> %36, ptr %38, align 16, !tbaa !11
  %index.next.1 = add nuw nsw i64 %index, 8
  br label %vector.body

.preheader60:                                     ; preds = %vector.body
  %39 = load i64, ptr getelementptr inbounds (i8, ptr @c, i64 1600800), align 16, !tbaa !11
  %40 = sub nsw i64 0, %39
  store i64 %40, ptr getelementptr inbounds (i8, ptr @c, i64 1600800), align 16, !tbaa !11
  store i64 %40, ptr getelementptr inbounds (i8, ptr @a, i64 1600800), align 16, !tbaa !11
  %41 = tail call noundef zeroext i1 @_Z7computev()
  br label %.preheader109

42:                                               ; preds = %46, %.preheader109
  %indvars.iv91 = phi i64 [ 0, %.preheader109 ], [ %indvars.iv.next92.3, %46 ]
  %.04866 = phi i32 [ -1, %.preheader109 ], [ %spec.select.3, %46 ]
  %43 = getelementptr inbounds [200101 x i64], ptr @b, i64 0, i64 %indvars.iv91
  %44 = load i64, ptr %43, align 16, !tbaa !11
  %.not56 = icmp eq i64 %44, 0
  %45 = trunc nuw nsw i64 %indvars.iv91 to i32
  %spec.select = select i1 %.not56, i32 %.04866, i32 %45
  %exitcond94.not = icmp eq i64 %indvars.iv91, 200100
  br i1 %exitcond94.not, label %.preheader59, label %46, !llvm.loop !18

46:                                               ; preds = %42
  %indvars.iv.next92 = or disjoint i64 %indvars.iv91, 1
  %47 = getelementptr inbounds [200101 x i64], ptr @b, i64 0, i64 %indvars.iv.next92
  %48 = load i64, ptr %47, align 8, !tbaa !11
  %.not56.1 = icmp eq i64 %48, 0
  %49 = trunc nuw nsw i64 %indvars.iv.next92 to i32
  %spec.select.1 = select i1 %.not56.1, i32 %spec.select, i32 %49
  %indvars.iv.next92.1 = or disjoint i64 %indvars.iv91, 2
  %50 = getelementptr inbounds [200101 x i64], ptr @b, i64 0, i64 %indvars.iv.next92.1
  %51 = load i64, ptr %50, align 16, !tbaa !11
  %.not56.2 = icmp eq i64 %51, 0
  %52 = trunc nuw nsw i64 %indvars.iv.next92.1 to i32
  %spec.select.2 = select i1 %.not56.2, i32 %spec.select.1, i32 %52
  %indvars.iv.next92.2 = or disjoint i64 %indvars.iv91, 3
  %53 = getelementptr inbounds [200101 x i64], ptr @b, i64 0, i64 %indvars.iv.next92.2
  %54 = load i64, ptr %53, align 8, !tbaa !11
  %.not56.3 = icmp eq i64 %54, 0
  %55 = trunc nuw nsw i64 %indvars.iv.next92.2 to i32
  %spec.select.3 = select i1 %.not56.3, i32 %spec.select.2, i32 %55
  %indvars.iv.next92.3 = add nuw nsw i64 %indvars.iv91, 4
  br label %42

.preheader58:                                     ; preds = %.preheader59
  %.not76 = icmp slt i32 %spec.select57, 0
  br i1 %.not76, label %._crit_edge80, label %.lr.ph79.preheader

.lr.ph79.preheader:                               ; preds = %.preheader58
  %56 = sext i32 %spec.select to i64
  %57 = add nuw i32 %spec.select57, 1
  %wide.trip.count = zext i32 %57 to i64
  %invariant.op = add nsw i64 %56, -31
  br label %.lr.ph79

.preheader59:                                     ; preds = %42, %.preheader59.1
  %indvars.iv95 = phi i64 [ %indvars.iv.next96.3, %.preheader59.1 ], [ 200100, %42 ]
  %.04568 = phi i32 [ %spec.select57.3, %.preheader59.1 ], [ -1, %42 ]
  %58 = getelementptr inbounds [200101 x i64], ptr @b, i64 0, i64 %indvars.iv95
  %59 = load i64, ptr %58, align 16, !tbaa !11
  %.not55 = icmp eq i64 %59, 0
  %60 = trunc nuw nsw i64 %indvars.iv95 to i32
  %spec.select57 = select i1 %.not55, i32 %.04568, i32 %60
  %.not = icmp eq i64 %indvars.iv95, 0
  br i1 %.not, label %.preheader58, label %.preheader59.1, !llvm.loop !19

.preheader59.1:                                   ; preds = %.preheader59
  %indvars.iv.next96 = add nsw i64 %indvars.iv95, -1
  %61 = getelementptr inbounds [200101 x i64], ptr @b, i64 0, i64 %indvars.iv.next96
  %62 = load i64, ptr %61, align 8, !tbaa !11
  %.not55.1 = icmp eq i64 %62, 0
  %63 = trunc nuw nsw i64 %indvars.iv.next96 to i32
  %spec.select57.1 = select i1 %.not55.1, i32 %spec.select57, i32 %63
  %indvars.iv.next96.1 = add nsw i64 %indvars.iv95, -2
  %64 = getelementptr inbounds [200101 x i64], ptr @b, i64 0, i64 %indvars.iv.next96.1
  %65 = load i64, ptr %64, align 16, !tbaa !11
  %.not55.2 = icmp eq i64 %65, 0
  %66 = trunc nuw nsw i64 %indvars.iv.next96.1 to i32
  %spec.select57.2 = select i1 %.not55.2, i32 %spec.select57.1, i32 %66
  %indvars.iv.next96.2 = add nsw i64 %indvars.iv95, -3
  %67 = getelementptr inbounds [200101 x i64], ptr @b, i64 0, i64 %indvars.iv.next96.2
  %68 = load i64, ptr %67, align 8, !tbaa !11
  %.not55.3 = icmp eq i64 %68, 0
  %69 = trunc nuw nsw i64 %indvars.iv.next96.2 to i32
  %spec.select57.3 = select i1 %.not55.3, i32 %spec.select57.2, i32 %69
  %indvars.iv.next96.3 = add nsw i64 %indvars.iv95, -4
  br label %.preheader59

._crit_edge80:                                    ; preds = %96, %.preheader58
  %.043.lcssa = phi i32 [ 0, %.preheader58 ], [ %.3, %96 ]
  %70 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %.043.lcssa)
  %71 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %70, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  ret i32 0

.lr.ph79:                                         ; preds = %.lr.ph79.preheader, %96
  %indvars.iv101 = phi i64 [ 0, %.lr.ph79.preheader ], [ %indvars.iv.next102, %96 ]
  %.04377 = phi i32 [ 0, %.lr.ph79.preheader ], [ %.3, %96 ]
  %72 = icmp slt i64 %indvars.iv101, %invariant.op
  br i1 %72, label %96, label %.preheader

.preheader:                                       ; preds = %.lr.ph79
  %.not5370 = icmp sgt i64 %indvars.iv101, %56
  br i1 %.not5370, label %._crit_edge74, label %.lr.ph73

._crit_edge74:                                    ; preds = %.lr.ph73, %.preheader
  %.041.lcssa = phi i64 [ 0, %.preheader ], [ %79, %.lr.ph73 ]
  %73 = load i32, ptr @n, align 4, !tbaa !8
  %74 = sext i32 %73 to i64
  %75 = icmp slt i64 %indvars.iv101, %74
  br i1 %75, label %80, label %96

.lr.ph73:                                         ; preds = %.preheader, %.lr.ph73
  %indvars.iv98 = phi i64 [ %indvars.iv.next99, %.lr.ph73 ], [ %56, %.preheader ]
  %.04171 = phi i64 [ %79, %.lr.ph73 ], [ 0, %.preheader ]
  %76 = shl i64 %.04171, 1
  %77 = getelementptr inbounds [200101 x i64], ptr @b, i64 0, i64 %indvars.iv98
  %78 = load i64, ptr %77, align 8, !tbaa !11
  %79 = add nsw i64 %78, %76
  %indvars.iv.next99 = add nsw i64 %indvars.iv98, -1
  %.not53.not = icmp sgt i64 %indvars.iv98, %indvars.iv101
  br i1 %.not53.not, label %.lr.ph73, label %._crit_edge74, !llvm.loop !20

80:                                               ; preds = %._crit_edge74
  %81 = getelementptr inbounds [200101 x i64], ptr @c, i64 0, i64 %indvars.iv101
  %82 = load i64, ptr %81, align 8, !tbaa !11
  %83 = sub nsw i64 %82, %.041.lcssa
  %84 = tail call noundef i64 @_ZSt3absx(i64 noundef %83)
  %85 = load i64, ptr @k, align 8, !tbaa !11
  %.not54 = icmp sgt i64 %84, %85
  br i1 %.not54, label %96, label %86

86:                                               ; preds = %80
  %87 = load i32, ptr @n, align 4, !tbaa !8
  %88 = add nsw i32 %87, -1
  %89 = zext i32 %88 to i64
  %90 = icmp eq i64 %indvars.iv101, %89
  br i1 %90, label %91, label %94

91:                                               ; preds = %86
  %92 = load i64, ptr %81, align 8, !tbaa !11
  %93 = icmp eq i64 %.041.lcssa, %92
  br i1 %93, label %96, label %94

94:                                               ; preds = %91, %86
  %95 = add nsw i32 %.04377, 1
  br label %96

96:                                               ; preds = %91, %94, %80, %._crit_edge74, %.lr.ph79
  %.3 = phi i32 [ %.04377, %.lr.ph79 ], [ %.04377, %91 ], [ %95, %94 ], [ %.04377, %80 ], [ %.04377, %._crit_edge74 ]
  %indvars.iv.next102 = add nuw nsw i64 %indvars.iv101, 1
  %exitcond104.not = icmp eq i64 %indvars.iv.next102, %wide.trip.count
  br i1 %exitcond104.not, label %._crit_edge80, label %.lr.ph79, !llvm.loop !21
}

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

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

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

; Function Attrs: mustprogress 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 #0 align 2

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

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) local_unnamed_addr #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) #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 = { 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 #2 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress norecurse uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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 #6 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }

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

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


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