; LLVM IR from kazunetakahashi/atcoder :: 2019/0217_nikkei2019-final (C)

; 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" }

@H = external dso_local global [2 x i64], align 16
@K = external dso_local global i64, align 8
@R = external dso_local global [100010 x i64], align 16
@C = external dso_local global [100010 x i64], align 16
@X = external dso_local global [2 x [100010 x i64]], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@__const.main.mini = external hidden unnamed_addr constant [2 x i64], align 16
@_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 i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca [2 x i64], align 16
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i64, align 8
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  %12 = alloca i64, align 8
  %13 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %14 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @H)
  %15 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %14, ptr noundef nonnull align 8 dereferenceable(8) getelementptr inbounds ([2 x i64], ptr @H, i64 0, i64 1))
  %16 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %15, ptr noundef nonnull align 8 dereferenceable(8) @K)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  store i32 0, ptr %2, align 4, !tbaa !5
  br label %17

17:                                               ; preds = %42, %0
  %18 = load i32, ptr %2, align 4, !tbaa !5
  %19 = sext i32 %18 to i64
  %20 = load i64, ptr @K, align 8, !tbaa !9
  %21 = icmp slt i64 %19, %20
  br i1 %21, label %23, label %22

22:                                               ; preds = %17
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  br label %45

23:                                               ; preds = %17
  %24 = load i32, ptr %2, align 4, !tbaa !5
  %25 = sext i32 %24 to i64
  %26 = getelementptr inbounds [100010 x i64], ptr @R, i64 0, i64 %25
  %27 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %26)
  %28 = load i32, ptr %2, align 4, !tbaa !5
  %29 = sext i32 %28 to i64
  %30 = getelementptr inbounds [100010 x i64], ptr @C, i64 0, i64 %29
  %31 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %27, ptr noundef nonnull align 8 dereferenceable(8) %30)
  %32 = load i32, ptr %2, align 4, !tbaa !5
  %33 = sext i32 %32 to i64
  %34 = getelementptr inbounds [100010 x i64], ptr @R, i64 0, i64 %33
  %35 = load i64, ptr %34, align 8, !tbaa !9
  %36 = add nsw i64 %35, -1
  store i64 %36, ptr %34, align 8, !tbaa !9
  %37 = load i32, ptr %2, align 4, !tbaa !5
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds [100010 x i64], ptr @C, i64 0, i64 %38
  %40 = load i64, ptr %39, align 8, !tbaa !9
  %41 = add nsw i64 %40, -1
  store i64 %41, ptr %39, align 8, !tbaa !9
  br label %42

42:                                               ; preds = %23
  %43 = load i32, ptr %2, align 4, !tbaa !5
  %44 = add nsw i32 %43, 1
  store i32 %44, ptr %2, align 4, !tbaa !5
  br label %17, !llvm.loop !11

45:                                               ; preds = %22
  %46 = load i64, ptr @K, align 8, !tbaa !9
  %47 = getelementptr inbounds i64, ptr @R, i64 %46
  call void @_ZSt4sortIPxEvT_S1_(ptr noundef @R, ptr noundef %47)
  %48 = load i64, ptr @K, align 8, !tbaa !9
  %49 = getelementptr inbounds i64, ptr @C, i64 %48
  call void @_ZSt4sortIPxEvT_S1_(ptr noundef @C, ptr noundef %49)
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  store i32 0, ptr %3, align 4, !tbaa !5
  call void @_ZSt4fillIPxiEvT_S1_RKT0_(ptr noundef @X, ptr noundef getelementptr inbounds (i64, ptr @X, i64 200020), ptr noundef nonnull align 4 dereferenceable(4) %3)
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  store i32 0, ptr %4, align 4, !tbaa !5
  br label %50

50:                                               ; preds = %64, %45
  %51 = load i32, ptr %4, align 4, !tbaa !5
  %52 = sext i32 %51 to i64
  %53 = load i64, ptr @K, align 8, !tbaa !9
  %54 = icmp slt i64 %52, %53
  br i1 %54, label %56, label %55

55:                                               ; preds = %50
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  br label %67

56:                                               ; preds = %50
  %57 = load i32, ptr %4, align 4, !tbaa !5
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds [100010 x i64], ptr @R, i64 0, i64 %58
  %60 = load i64, ptr %59, align 8, !tbaa !9
  %61 = getelementptr inbounds [100010 x i64], ptr @X, i64 0, i64 %60
  %62 = load i64, ptr %61, align 8, !tbaa !9
  %63 = add nsw i64 %62, 1
  store i64 %63, ptr %61, align 8, !tbaa !9
  br label %64

64:                                               ; preds = %56
  %65 = load i32, ptr %4, align 4, !tbaa !5
  %66 = add nsw i32 %65, 1
  store i32 %66, ptr %4, align 4, !tbaa !5
  br label %50, !llvm.loop !13

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

68:                                               ; preds = %82, %67
  %69 = load i32, ptr %5, align 4, !tbaa !5
  %70 = sext i32 %69 to i64
  %71 = load i64, ptr @K, align 8, !tbaa !9
  %72 = icmp slt i64 %70, %71
  br i1 %72, label %74, label %73

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

74:                                               ; preds = %68
  %75 = load i32, ptr %5, align 4, !tbaa !5
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds [100010 x i64], ptr @C, i64 0, i64 %76
  %78 = load i64, ptr %77, align 8, !tbaa !9
  %79 = getelementptr inbounds [100010 x i64], ptr getelementptr inbounds ([2 x [100010 x i64]], ptr @X, i64 0, i64 1), i64 0, i64 %78
  %80 = load i64, ptr %79, align 8, !tbaa !9
  %81 = add nsw i64 %80, 1
  store i64 %81, ptr %79, align 8, !tbaa !9
  br label %82

82:                                               ; preds = %74
  %83 = load i32, ptr %5, align 4, !tbaa !5
  %84 = add nsw i32 %83, 1
  store i32 %84, ptr %5, align 4, !tbaa !5
  br label %68, !llvm.loop !14

85:                                               ; preds = %73
  call void @llvm.lifetime.start.p0(i64 16, ptr %6) #6
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %6, ptr align 16 @__const.main.mini, i64 16, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %86

86:                                               ; preds = %186, %85
  %87 = load i32, ptr %7, align 4, !tbaa !5
  %88 = icmp slt i32 %87, 2
  br i1 %88, label %90, label %89

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

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

91:                                               ; preds = %127, %90
  %92 = load i64, ptr %10, align 8, !tbaa !9
  %93 = load i32, ptr %7, align 4, !tbaa !5
  %94 = sext i32 %93 to i64
  %95 = getelementptr inbounds [2 x i64], ptr @H, i64 0, i64 %94
  %96 = load i64, ptr %95, align 8, !tbaa !9
  %97 = icmp slt i64 %92, %96
  br i1 %97, label %99, label %98

98:                                               ; preds = %91
  store i32 14, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  br label %130

99:                                               ; preds = %91
  %100 = load i32, ptr %7, align 4, !tbaa !5
  %101 = sub nsw i32 1, %100
  %102 = sext i32 %101 to i64
  %103 = getelementptr inbounds [2 x i64], ptr @H, i64 0, i64 %102
  %104 = load i64, ptr %103, align 8, !tbaa !9
  %105 = load i32, ptr %7, align 4, !tbaa !5
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds [2 x [100010 x i64]], ptr @X, i64 0, i64 %106
  %108 = load i64, ptr %10, align 8, !tbaa !9
  %109 = getelementptr inbounds [100010 x i64], ptr %107, i64 0, i64 %108
  %110 = load i64, ptr %109, align 8, !tbaa !9
  %111 = sub nsw i64 %104, %110
  %112 = load i32, ptr %7, align 4, !tbaa !5
  %113 = sext i32 %112 to i64
  %114 = getelementptr inbounds [2 x [100010 x i64]], ptr @X, i64 0, i64 %113
  %115 = load i64, ptr %10, align 8, !tbaa !9
  %116 = getelementptr inbounds [100010 x i64], ptr %114, i64 0, i64 %115
  store i64 %111, ptr %116, align 8, !tbaa !9
  %117 = load i64, ptr %10, align 8, !tbaa !9
  %118 = load i32, ptr %7, align 4, !tbaa !5
  %119 = sext i32 %118 to i64
  %120 = getelementptr inbounds [2 x [100010 x i64]], ptr @X, i64 0, i64 %119
  %121 = load i64, ptr %10, align 8, !tbaa !9
  %122 = getelementptr inbounds [100010 x i64], ptr %120, i64 0, i64 %121
  %123 = load i64, ptr %122, align 8, !tbaa !9
  %124 = mul nsw i64 %117, %123
  %125 = load i64, ptr %9, align 8, !tbaa !9
  %126 = add nsw i64 %125, %124
  store i64 %126, ptr %9, align 8, !tbaa !9
  br label %127

127:                                              ; preds = %99
  %128 = load i64, ptr %10, align 8, !tbaa !9
  %129 = add nsw i64 %128, 1
  store i64 %129, ptr %10, align 8, !tbaa !9
  br label %91, !llvm.loop !15

130:                                              ; preds = %98
  %131 = load i64, ptr %9, align 8, !tbaa !9
  %132 = load i32, ptr %7, align 4, !tbaa !5
  %133 = sext i32 %132 to i64
  %134 = getelementptr inbounds [2 x i64], ptr %6, i64 0, i64 %133
  store i64 %131, ptr %134, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  store i64 0, ptr %11, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  %135 = load i64, ptr @H, align 16, !tbaa !9
  %136 = load i64, ptr getelementptr inbounds ([2 x i64], ptr @H, i64 0, i64 1), align 8, !tbaa !9
  %137 = mul nsw i64 %135, %136
  %138 = load i64, ptr @K, align 8, !tbaa !9
  %139 = sub nsw i64 %137, %138
  store i64 %139, ptr %12, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  store i32 0, ptr %13, align 4, !tbaa !5
  br label %140

140:                                              ; preds = %182, %130
  %141 = load i32, ptr %13, align 4, !tbaa !5
  %142 = sext i32 %141 to i64
  %143 = load i32, ptr %7, align 4, !tbaa !5
  %144 = sext i32 %143 to i64
  %145 = getelementptr inbounds [2 x i64], ptr @H, i64 0, i64 %144
  %146 = load i64, ptr %145, align 8, !tbaa !9
  %147 = sub nsw i64 %146, 1
  %148 = icmp slt i64 %142, %147
  br i1 %148, label %150, label %149

149:                                              ; preds = %140
  store i32 17, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  br label %185

150:                                              ; preds = %140
  %151 = load i32, ptr %7, align 4, !tbaa !5
  %152 = sext i32 %151 to i64
  %153 = getelementptr inbounds [2 x [100010 x i64]], ptr @X, i64 0, i64 %152
  %154 = load i32, ptr %13, align 4, !tbaa !5
  %155 = sext i32 %154 to i64
  %156 = getelementptr inbounds [100010 x i64], ptr %153, i64 0, i64 %155
  %157 = load i64, ptr %156, align 8, !tbaa !9
  %158 = load i64, ptr %11, align 8, !tbaa !9
  %159 = add nsw i64 %158, %157
  store i64 %159, ptr %11, align 8, !tbaa !9
  %160 = load i32, ptr %7, align 4, !tbaa !5
  %161 = sext i32 %160 to i64
  %162 = getelementptr inbounds [2 x [100010 x i64]], ptr @X, i64 0, i64 %161
  %163 = load i32, ptr %13, align 4, !tbaa !5
  %164 = sext i32 %163 to i64
  %165 = getelementptr inbounds [100010 x i64], ptr %162, i64 0, i64 %164
  %166 = load i64, ptr %165, align 8, !tbaa !9
  %167 = load i64, ptr %12, align 8, !tbaa !9
  %168 = sub nsw i64 %167, %166
  store i64 %168, ptr %12, align 8, !tbaa !9
  %169 = load i64, ptr %9, align 8, !tbaa !9
  %170 = load i64, ptr %11, align 8, !tbaa !9
  %171 = add nsw i64 %169, %170
  %172 = load i64, ptr %12, align 8, !tbaa !9
  %173 = sub nsw i64 %171, %172
  store i64 %173, ptr %9, align 8, !tbaa !9
  %174 = load i32, ptr %7, align 4, !tbaa !5
  %175 = sext i32 %174 to i64
  %176 = getelementptr inbounds [2 x i64], ptr %6, i64 0, i64 %175
  %177 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %176, ptr noundef nonnull align 8 dereferenceable(8) %9)
  %178 = load i64, ptr %177, align 8, !tbaa !9
  %179 = load i32, ptr %7, align 4, !tbaa !5
  %180 = sext i32 %179 to i64
  %181 = getelementptr inbounds [2 x i64], ptr %6, i64 0, i64 %180
  store i64 %178, ptr %181, align 8, !tbaa !9
  br label %182

182:                                              ; preds = %150
  %183 = load i32, ptr %13, align 4, !tbaa !5
  %184 = add nsw i32 %183, 1
  store i32 %184, ptr %13, align 4, !tbaa !5
  br label %140, !llvm.loop !16

185:                                              ; preds = %149
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  br label %186

186:                                              ; preds = %185
  %187 = load i32, ptr %7, align 4, !tbaa !5
  %188 = add nsw i32 %187, 1
  store i32 %188, ptr %7, align 4, !tbaa !5
  br label %86, !llvm.loop !17

189:                                              ; preds = %89
  %190 = getelementptr inbounds [2 x i64], ptr %6, i64 0, i64 0
  %191 = load i64, ptr %190, align 16, !tbaa !9
  %192 = getelementptr inbounds [2 x i64], ptr %6, i64 0, i64 1
  %193 = load i64, ptr %192, align 8, !tbaa !9
  %194 = add nsw i64 %191, %193
  %195 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %194)
  %196 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %195, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.end.p0(i64 16, ptr %6) #6
  %197 = load i32, ptr %1, align 4
  ret i32 %197
}

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

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

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

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #5

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

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long long", !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}
!17 = distinct !{!17, !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" }

@H = external dso_local global [2 x i64], align 16
@K = external dso_local global i64, align 8
@R = external dso_local global [100010 x i64], align 16
@C = external dso_local global [100010 x i64], align 16
@X = external dso_local global [2 x [100010 x i64]], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@__const.main.mini = external hidden unnamed_addr constant [2 x i64], align 16
@_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 = alloca i32, align 4
  %2 = alloca [2 x i64], align 16
  %3 = alloca i64, align 8
  %4 = 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) @H)
  %5 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %4, ptr noundef nonnull align 8 dereferenceable(8) getelementptr inbounds (i8, ptr @H, i64 8))
  %6 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %5, ptr noundef nonnull align 8 dereferenceable(8) @K)
  %7 = load i64, ptr @K, align 8, !tbaa !5
  %8 = icmp sgt i64 %7, 0
  br i1 %8, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %0
  %.lcssa54 = phi i64 [ %7, %0 ], [ %23, %.lr.ph ]
  %9 = getelementptr inbounds i64, ptr @R, i64 %.lcssa54
  tail call void @_ZSt4sortIPxEvT_S1_(ptr noundef nonnull @R, ptr noundef nonnull %9)
  %10 = load i64, ptr @K, align 8, !tbaa !5
  %11 = getelementptr inbounds i64, ptr @C, i64 %10
  tail call void @_ZSt4sortIPxEvT_S1_(ptr noundef nonnull @C, ptr noundef nonnull %11)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #7
  store i32 0, ptr %1, align 4, !tbaa !9
  call void @_ZSt4fillIPxiEvT_S1_RKT0_(ptr noundef nonnull @X, ptr noundef nonnull getelementptr inbounds (i8, ptr @X, i64 1600160), ptr noundef nonnull align 4 dereferenceable(4) %1)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #7
  %12 = load i64, ptr @K, align 8, !tbaa !5
  %13 = icmp sgt i64 %12, 0
  br i1 %13, label %.lr.ph58.preheader, label %._crit_edge62

.lr.ph58.preheader:                               ; preds = %._crit_edge
  %xtraiter = and i64 %12, 3
  %14 = icmp ult i64 %12, 4
  br i1 %14, label %.preheader.unr-lcssa, label %.lr.ph58.preheader.new

.lr.ph58.preheader.new:                           ; preds = %.lr.ph58.preheader
  %unroll_iter = and i64 %12, 9223372036854775804
  br label %.lr.ph58

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %0 ]
  %15 = getelementptr inbounds [100010 x i64], ptr @R, i64 0, i64 %indvars.iv
  %16 = 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) %15)
  %17 = getelementptr inbounds [100010 x i64], ptr @C, i64 0, i64 %indvars.iv
  %18 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %16, ptr noundef nonnull align 8 dereferenceable(8) %17)
  %19 = load i64, ptr %15, align 8, !tbaa !5
  %20 = add nsw i64 %19, -1
  store i64 %20, ptr %15, align 8, !tbaa !5
  %21 = load i64, ptr %17, align 8, !tbaa !5
  %22 = add nsw i64 %21, -1
  store i64 %22, ptr %17, align 8, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %23 = load i64, ptr @K, align 8, !tbaa !5
  %24 = icmp sgt i64 %23, %indvars.iv.next
  br i1 %24, label %.lr.ph, label %._crit_edge, !llvm.loop !11

.preheader.unr-lcssa:                             ; preds = %.lr.ph58, %.lr.ph58.preheader
  %indvars.iv79.unr = phi i64 [ 0, %.lr.ph58.preheader ], [ %indvars.iv.next80.3, %.lr.ph58 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.preheader, label %.lr.ph58.epil

.lr.ph58.epil:                                    ; preds = %.preheader.unr-lcssa, %.lr.ph58.epil
  %indvars.iv79.epil = phi i64 [ %indvars.iv.next80.epil, %.lr.ph58.epil ], [ %indvars.iv79.unr, %.preheader.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.lr.ph58.epil ], [ 0, %.preheader.unr-lcssa ]
  %25 = getelementptr inbounds [100010 x i64], ptr @R, i64 0, i64 %indvars.iv79.epil
  %26 = load i64, ptr %25, align 8, !tbaa !5
  %27 = getelementptr inbounds [100010 x i64], ptr @X, i64 0, i64 %26
  %28 = load i64, ptr %27, align 8, !tbaa !5
  %29 = add nsw i64 %28, 1
  store i64 %29, ptr %27, align 8, !tbaa !5
  %indvars.iv.next80.epil = add nuw nsw i64 %indvars.iv79.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
  br i1 %epil.iter.cmp.not, label %.preheader, label %.lr.ph58.epil, !llvm.loop !13

.preheader:                                       ; preds = %.lr.ph58.epil, %.preheader.unr-lcssa
  br i1 %13, label %.lr.ph61.preheader, label %._crit_edge62

.lr.ph61.preheader:                               ; preds = %.preheader
  %xtraiter146 = and i64 %12, 3
  %30 = icmp ult i64 %12, 4
  br i1 %30, label %._crit_edge62.loopexit.unr-lcssa, label %.lr.ph61.preheader.new

.lr.ph61.preheader.new:                           ; preds = %.lr.ph61.preheader
  %unroll_iter149 = and i64 %12, 9223372036854775804
  br label %.lr.ph61

.lr.ph58:                                         ; preds = %.lr.ph58, %.lr.ph58.preheader.new
  %indvars.iv79 = phi i64 [ 0, %.lr.ph58.preheader.new ], [ %indvars.iv.next80.3, %.lr.ph58 ]
  %niter = phi i64 [ 0, %.lr.ph58.preheader.new ], [ %niter.next.3, %.lr.ph58 ]
  %31 = getelementptr inbounds [100010 x i64], ptr @R, i64 0, i64 %indvars.iv79
  %32 = load i64, ptr %31, align 16, !tbaa !5
  %33 = getelementptr inbounds [100010 x i64], ptr @X, i64 0, i64 %32
  %34 = load i64, ptr %33, align 8, !tbaa !5
  %35 = add nsw i64 %34, 1
  store i64 %35, ptr %33, align 8, !tbaa !5
  %indvars.iv.next80 = or disjoint i64 %indvars.iv79, 1
  %36 = getelementptr inbounds [100010 x i64], ptr @R, i64 0, i64 %indvars.iv.next80
  %37 = load i64, ptr %36, align 8, !tbaa !5
  %38 = getelementptr inbounds [100010 x i64], ptr @X, i64 0, i64 %37
  %39 = load i64, ptr %38, align 8, !tbaa !5
  %40 = add nsw i64 %39, 1
  store i64 %40, ptr %38, align 8, !tbaa !5
  %indvars.iv.next80.1 = or disjoint i64 %indvars.iv79, 2
  %41 = getelementptr inbounds [100010 x i64], ptr @R, i64 0, i64 %indvars.iv.next80.1
  %42 = load i64, ptr %41, align 16, !tbaa !5
  %43 = getelementptr inbounds [100010 x i64], ptr @X, i64 0, i64 %42
  %44 = load i64, ptr %43, align 8, !tbaa !5
  %45 = add nsw i64 %44, 1
  store i64 %45, ptr %43, align 8, !tbaa !5
  %indvars.iv.next80.2 = or disjoint i64 %indvars.iv79, 3
  %46 = getelementptr inbounds [100010 x i64], ptr @R, i64 0, i64 %indvars.iv.next80.2
  %47 = load i64, ptr %46, align 8, !tbaa !5
  %48 = getelementptr inbounds [100010 x i64], ptr @X, i64 0, i64 %47
  %49 = load i64, ptr %48, align 8, !tbaa !5
  %50 = add nsw i64 %49, 1
  store i64 %50, ptr %48, align 8, !tbaa !5
  %indvars.iv.next80.3 = add nuw nsw i64 %indvars.iv79, 4
  %niter.next.3 = add i64 %niter, 4
  %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3, label %.preheader.unr-lcssa, label %.lr.ph58, !llvm.loop !15

._crit_edge62.loopexit.unr-lcssa:                 ; preds = %.lr.ph61, %.lr.ph61.preheader
  %indvars.iv82.unr = phi i64 [ 0, %.lr.ph61.preheader ], [ %indvars.iv.next83.3, %.lr.ph61 ]
  %lcmp.mod148.not = icmp eq i64 %xtraiter146, 0
  br i1 %lcmp.mod148.not, label %._crit_edge62, label %.lr.ph61.epil

.lr.ph61.epil:                                    ; preds = %._crit_edge62.loopexit.unr-lcssa, %.lr.ph61.epil
  %indvars.iv82.epil = phi i64 [ %indvars.iv.next83.epil, %.lr.ph61.epil ], [ %indvars.iv82.unr, %._crit_edge62.loopexit.unr-lcssa ]
  %epil.iter147 = phi i64 [ %epil.iter147.next, %.lr.ph61.epil ], [ 0, %._crit_edge62.loopexit.unr-lcssa ]
  %51 = getelementptr inbounds [100010 x i64], ptr @C, i64 0, i64 %indvars.iv82.epil
  %52 = load i64, ptr %51, align 8, !tbaa !5
  %53 = getelementptr inbounds [100010 x i64], ptr getelementptr inbounds (i8, ptr @X, i64 800080), i64 0, i64 %52
  %54 = load i64, ptr %53, align 8, !tbaa !5
  %55 = add nsw i64 %54, 1
  store i64 %55, ptr %53, align 8, !tbaa !5
  %indvars.iv.next83.epil = add nuw nsw i64 %indvars.iv82.epil, 1
  %epil.iter147.next = add i64 %epil.iter147, 1
  %epil.iter147.cmp.not = icmp eq i64 %epil.iter147.next, %xtraiter146
  br i1 %epil.iter147.cmp.not, label %._crit_edge62, label %.lr.ph61.epil, !llvm.loop !16

._crit_edge62:                                    ; preds = %._crit_edge62.loopexit.unr-lcssa, %.lr.ph61.epil, %._crit_edge, %.preheader
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %2) #7
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %2, ptr noundef nonnull align 16 dereferenceable(16) @__const.main.mini, i64 16, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #7
  %56 = load i64, ptr @H, align 16, !tbaa !5
  %57 = icmp sgt i64 %56, 0
  %.pre = load i64, ptr getelementptr inbounds (i8, ptr @H, i64 8), align 8, !tbaa !5
  br i1 %57, label %.lr.ph66.preheader, label %.thread

.lr.ph66.preheader:                               ; preds = %._crit_edge62
  %min.iters.check = icmp ult i64 %56, 4
  br i1 %min.iters.check, label %.lr.ph66.preheader140, label %vector.ph

.lr.ph66.preheader140:                            ; preds = %middle.block, %.lr.ph66.preheader
  %.04264.ph = phi i64 [ 0, %.lr.ph66.preheader ], [ %n.vec, %middle.block ]
  %.ph141 = phi i64 [ 0, %.lr.ph66.preheader ], [ %67, %middle.block ]
  br label %.lr.ph66

vector.ph:                                        ; preds = %.lr.ph66.preheader
  %n.vec = and i64 %56, 9223372036854775804
  %broadcast.splatinsert = insertelement <2 x i64> poison, i64 %.pre, i64 0
  %broadcast.splat = shufflevector <2 x i64> %broadcast.splatinsert, <2 x i64> poison, <2 x i32> zeroinitializer
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %vec.ind = phi <2 x i64> [ <i64 0, i64 1>, %vector.ph ], [ %vec.ind.next, %vector.body ]
  %vec.phi = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %64, %vector.body ]
  %vec.phi108 = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %65, %vector.body ]
  %step.add = add <2 x i64> %vec.ind, <i64 2, i64 2>
  %58 = getelementptr inbounds [2 x [100010 x i64]], ptr @X, i64 0, i64 0, i64 %index
  %59 = getelementptr inbounds i8, ptr %58, i64 16
  %wide.load = load <2 x i64>, ptr %58, align 16, !tbaa !5
  %wide.load109 = load <2 x i64>, ptr %59, align 16, !tbaa !5
  %60 = sub nsw <2 x i64> %broadcast.splat, %wide.load
  %61 = sub nsw <2 x i64> %broadcast.splat, %wide.load109
  store <2 x i64> %60, ptr %58, align 16, !tbaa !5
  store <2 x i64> %61, ptr %59, align 16, !tbaa !5
  %62 = mul nsw <2 x i64> %60, %vec.ind
  %63 = mul nsw <2 x i64> %61, %step.add
  %64 = add <2 x i64> %vec.phi, %62
  %65 = add <2 x i64> %vec.phi108, %63
  %index.next = add nuw i64 %index, 4
  %vec.ind.next = add <2 x i64> %vec.ind, <i64 4, i64 4>
  %66 = icmp eq i64 %index.next, %n.vec
  br i1 %66, label %middle.block, label %vector.body, !llvm.loop !17

middle.block:                                     ; preds = %vector.body
  %bin.rdx = add <2 x i64> %65, %64
  %67 = call i64 @llvm.vector.reduce.add.v2i64(<2 x i64> %bin.rdx)
  %cmp.n = icmp eq i64 %56, %n.vec
  br i1 %cmp.n, label %.loopexit133, label %.lr.ph66.preheader140

.thread:                                          ; preds = %._crit_edge62
  store i64 0, ptr %2, align 16, !tbaa !5
  br label %._crit_edge75

.lr.ph61:                                         ; preds = %.lr.ph61, %.lr.ph61.preheader.new
  %indvars.iv82 = phi i64 [ 0, %.lr.ph61.preheader.new ], [ %indvars.iv.next83.3, %.lr.ph61 ]
  %niter150 = phi i64 [ 0, %.lr.ph61.preheader.new ], [ %niter150.next.3, %.lr.ph61 ]
  %68 = getelementptr inbounds [100010 x i64], ptr @C, i64 0, i64 %indvars.iv82
  %69 = load i64, ptr %68, align 16, !tbaa !5
  %70 = getelementptr inbounds [100010 x i64], ptr getelementptr inbounds (i8, ptr @X, i64 800080), i64 0, i64 %69
  %71 = load i64, ptr %70, align 8, !tbaa !5
  %72 = add nsw i64 %71, 1
  store i64 %72, ptr %70, align 8, !tbaa !5
  %indvars.iv.next83 = or disjoint i64 %indvars.iv82, 1
  %73 = getelementptr inbounds [100010 x i64], ptr @C, i64 0, i64 %indvars.iv.next83
  %74 = load i64, ptr %73, align 8, !tbaa !5
  %75 = getelementptr inbounds [100010 x i64], ptr getelementptr inbounds (i8, ptr @X, i64 800080), i64 0, i64 %74
  %76 = load i64, ptr %75, align 8, !tbaa !5
  %77 = add nsw i64 %76, 1
  store i64 %77, ptr %75, align 8, !tbaa !5
  %indvars.iv.next83.1 = or disjoint i64 %indvars.iv82, 2
  %78 = getelementptr inbounds [100010 x i64], ptr @C, i64 0, i64 %indvars.iv.next83.1
  %79 = load i64, ptr %78, align 16, !tbaa !5
  %80 = getelementptr inbounds [100010 x i64], ptr getelementptr inbounds (i8, ptr @X, i64 800080), i64 0, i64 %79
  %81 = load i64, ptr %80, align 8, !tbaa !5
  %82 = add nsw i64 %81, 1
  store i64 %82, ptr %80, align 8, !tbaa !5
  %indvars.iv.next83.2 = or disjoint i64 %indvars.iv82, 3
  %83 = getelementptr inbounds [100010 x i64], ptr @C, i64 0, i64 %indvars.iv.next83.2
  %84 = load i64, ptr %83, align 8, !tbaa !5
  %85 = getelementptr inbounds [100010 x i64], ptr getelementptr inbounds (i8, ptr @X, i64 800080), i64 0, i64 %84
  %86 = load i64, ptr %85, align 8, !tbaa !5
  %87 = add nsw i64 %86, 1
  store i64 %87, ptr %85, align 8, !tbaa !5
  %indvars.iv.next83.3 = add nuw nsw i64 %indvars.iv82, 4
  %niter150.next.3 = add i64 %niter150, 4
  %niter150.ncmp.3 = icmp eq i64 %niter150.next.3, %unroll_iter149
  br i1 %niter150.ncmp.3, label %._crit_edge62.loopexit.unr-lcssa, label %.lr.ph61, !llvm.loop !20

.loopexit133:                                     ; preds = %.lr.ph66, %middle.block
  %.lcssa105 = phi i64 [ %67, %middle.block ], [ %95, %.lr.ph66 ]
  store i64 %.lcssa105, ptr %3, align 8, !tbaa !5
  store i64 %.lcssa105, ptr %2, align 16, !tbaa !5
  %.not = icmp eq i64 %56, 1
  br i1 %.not, label %._crit_edge75, label %.lr.ph74.preheader

.lr.ph74.preheader:                               ; preds = %.loopexit133
  %88 = mul nsw i64 %.pre, %56
  %89 = sub nsw i64 %88, %12
  br label %.lr.ph74

.lr.ph66:                                         ; preds = %.lr.ph66.preheader140, %.lr.ph66
  %.04264 = phi i64 [ %96, %.lr.ph66 ], [ %.04264.ph, %.lr.ph66.preheader140 ]
  %90 = phi i64 [ %95, %.lr.ph66 ], [ %.ph141, %.lr.ph66.preheader140 ]
  %91 = getelementptr inbounds [2 x [100010 x i64]], ptr @X, i64 0, i64 0, i64 %.04264
  %92 = load i64, ptr %91, align 8, !tbaa !5
  %93 = sub nsw i64 %.pre, %92
  store i64 %93, ptr %91, align 8, !tbaa !5
  %94 = mul nsw i64 %93, %.04264
  %95 = add nsw i64 %90, %94
  %96 = add nuw nsw i64 %.04264, 1
  %exitcond86.not = icmp eq i64 %96, %56
  br i1 %exitcond86.not, label %.loopexit133, label %.lr.ph66, !llvm.loop !21

._crit_edge75.loopexit:                           ; preds = %.lr.ph74
  %.pre93 = load i64, ptr getelementptr inbounds (i8, ptr @H, i64 8), align 8, !tbaa !5
  br label %._crit_edge75

._crit_edge75:                                    ; preds = %.thread, %._crit_edge75.loopexit, %.loopexit133
  %97 = phi i64 [ %148, %._crit_edge75.loopexit ], [ %.lcssa105, %.loopexit133 ], [ 0, %.thread ]
  %98 = phi i64 [ %149, %._crit_edge75.loopexit ], [ %56, %.loopexit133 ], [ %56, %.thread ]
  %99 = phi i64 [ %.pre93, %._crit_edge75.loopexit ], [ %.pre, %.loopexit133 ], [ %.pre, %.thread ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #7
  %100 = icmp sgt i64 %99, 0
  br i1 %100, label %.lr.ph66.1.preheader, label %.thread95

.lr.ph66.1.preheader:                             ; preds = %._crit_edge75
  %min.iters.check112 = icmp ult i64 %99, 4
  br i1 %min.iters.check112, label %.lr.ph66.1.preheader134, label %vector.ph113

.lr.ph66.1.preheader134:                          ; preds = %middle.block110, %.lr.ph66.1.preheader
  %.04264.1.ph = phi i64 [ 0, %.lr.ph66.1.preheader ], [ %n.vec115, %middle.block110 ]
  %.ph = phi i64 [ 0, %.lr.ph66.1.preheader ], [ %110, %middle.block110 ]
  br label %.lr.ph66.1

vector.ph113:                                     ; preds = %.lr.ph66.1.preheader
  %n.vec115 = and i64 %99, 9223372036854775804
  %broadcast.splatinsert127 = insertelement <2 x i64> poison, i64 %98, i64 0
  %broadcast.splat128 = shufflevector <2 x i64> %broadcast.splatinsert127, <2 x i64> poison, <2 x i32> zeroinitializer
  br label %vector.body117

vector.body117:                                   ; preds = %vector.body117, %vector.ph113
  %index118 = phi i64 [ 0, %vector.ph113 ], [ %index.next129, %vector.body117 ]
  %vec.ind119 = phi <2 x i64> [ <i64 0, i64 1>, %vector.ph113 ], [ %vec.ind.next122, %vector.body117 ]
  %vec.phi123 = phi <2 x i64> [ zeroinitializer, %vector.ph113 ], [ %107, %vector.body117 ]
  %vec.phi124 = phi <2 x i64> [ zeroinitializer, %vector.ph113 ], [ %108, %vector.body117 ]
  %step.add120 = add <2 x i64> %vec.ind119, <i64 2, i64 2>
  %101 = getelementptr inbounds [2 x [100010 x i64]], ptr @X, i64 0, i64 1, i64 %index118
  %102 = getelementptr inbounds i8, ptr %101, i64 16
  %wide.load125 = load <2 x i64>, ptr %101, align 16, !tbaa !5
  %wide.load126 = load <2 x i64>, ptr %102, align 16, !tbaa !5
  %103 = sub nsw <2 x i64> %broadcast.splat128, %wide.load125
  %104 = sub nsw <2 x i64> %broadcast.splat128, %wide.load126
  store <2 x i64> %103, ptr %101, align 16, !tbaa !5
  store <2 x i64> %104, ptr %102, align 16, !tbaa !5
  %105 = mul nsw <2 x i64> %103, %vec.ind119
  %106 = mul nsw <2 x i64> %104, %step.add120
  %107 = add <2 x i64> %vec.phi123, %105
  %108 = add <2 x i64> %vec.phi124, %106
  %index.next129 = add nuw i64 %index118, 4
  %vec.ind.next122 = add <2 x i64> %vec.ind119, <i64 4, i64 4>
  %109 = icmp eq i64 %index.next129, %n.vec115
  br i1 %109, label %middle.block110, label %vector.body117, !llvm.loop !22

middle.block110:                                  ; preds = %vector.body117
  %bin.rdx130 = add <2 x i64> %108, %107
  %110 = call i64 @llvm.vector.reduce.add.v2i64(<2 x i64> %bin.rdx130)
  %cmp.n131 = icmp eq i64 %99, %n.vec115
  br i1 %cmp.n131, label %.loopexit, label %.lr.ph66.1.preheader134

.thread95:                                        ; preds = %._crit_edge75
  %111 = getelementptr inbounds i8, ptr %2, i64 8
  store i64 0, ptr %111, align 8, !tbaa !5
  br label %._crit_edge75.1

.lr.ph66.1:                                       ; preds = %.lr.ph66.1.preheader134, %.lr.ph66.1
  %.04264.1 = phi i64 [ %118, %.lr.ph66.1 ], [ %.04264.1.ph, %.lr.ph66.1.preheader134 ]
  %112 = phi i64 [ %117, %.lr.ph66.1 ], [ %.ph, %.lr.ph66.1.preheader134 ]
  %113 = getelementptr inbounds [2 x [100010 x i64]], ptr @X, i64 0, i64 1, i64 %.04264.1
  %114 = load i64, ptr %113, align 8, !tbaa !5
  %115 = sub nsw i64 %98, %114
  store i64 %115, ptr %113, align 8, !tbaa !5
  %116 = mul nsw i64 %115, %.04264.1
  %117 = add nsw i64 %112, %116
  %118 = add nuw nsw i64 %.04264.1, 1
  %exitcond86.1.not = icmp eq i64 %118, %99
  br i1 %exitcond86.1.not, label %.loopexit, label %.lr.ph66.1, !llvm.loop !23

.loopexit:                                        ; preds = %.lr.ph66.1, %middle.block110
  %.lcssa102 = phi i64 [ %110, %middle.block110 ], [ %117, %.lr.ph66.1 ]
  store i64 %.lcssa102, ptr %3, align 8, !tbaa !5
  %119 = getelementptr inbounds i8, ptr %2, i64 8
  store i64 %.lcssa102, ptr %119, align 8, !tbaa !5
  %.not101 = icmp eq i64 %99, 1
  br i1 %.not101, label %._crit_edge75.1, label %.lr.ph74.preheader.1

.lr.ph74.preheader.1:                             ; preds = %.loopexit
  %120 = mul nsw i64 %99, %98
  %121 = load i64, ptr @K, align 8, !tbaa !5
  %122 = sub nsw i64 %120, %121
  br label %.lr.ph74.1

.lr.ph74.1:                                       ; preds = %.lr.ph74.1, %.lr.ph74.preheader.1
  %indvars.iv87.1 = phi i64 [ 0, %.lr.ph74.preheader.1 ], [ %indvars.iv.next88.1, %.lr.ph74.1 ]
  %.04071.1 = phi i64 [ %122, %.lr.ph74.preheader.1 ], [ %126, %.lr.ph74.1 ]
  %.04170.1 = phi i64 [ 0, %.lr.ph74.preheader.1 ], [ %125, %.lr.ph74.1 ]
  %123 = getelementptr inbounds [2 x [100010 x i64]], ptr @X, i64 0, i64 1, i64 %indvars.iv87.1
  %124 = load i64, ptr %123, align 8, !tbaa !5
  %125 = add nsw i64 %124, %.04170.1
  %126 = sub nsw i64 %.04071.1, %124
  %127 = load i64, ptr %3, align 8, !tbaa !5
  %128 = add nsw i64 %127, %125
  %129 = sub i64 %128, %126
  store i64 %129, ptr %3, align 8, !tbaa !5
  %130 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %119, ptr noundef nonnull align 8 dereferenceable(8) %3)
  %131 = load i64, ptr %130, align 8, !tbaa !5
  store i64 %131, ptr %119, align 8, !tbaa !5
  %indvars.iv.next88.1 = add nuw nsw i64 %indvars.iv87.1, 1
  %132 = load i64, ptr getelementptr inbounds (i8, ptr @H, i64 8), align 8, !tbaa !5
  %133 = add nsw i64 %132, -1
  %134 = icmp sgt i64 %133, %indvars.iv.next88.1
  br i1 %134, label %.lr.ph74.1, label %._crit_edge75.loopexit.1, !llvm.loop !24

._crit_edge75.loopexit.1:                         ; preds = %.lr.ph74.1
  %.pre94 = load i64, ptr %2, align 16, !tbaa !5
  br label %._crit_edge75.1

._crit_edge75.1:                                  ; preds = %.thread95, %._crit_edge75.loopexit.1, %.loopexit
  %135 = phi i64 [ %131, %._crit_edge75.loopexit.1 ], [ %.lcssa102, %.loopexit ], [ 0, %.thread95 ]
  %136 = phi i64 [ %.pre94, %._crit_edge75.loopexit.1 ], [ %97, %.loopexit ], [ %97, %.thread95 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #7
  %137 = add nsw i64 %135, %136
  %138 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %137)
  %139 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %138, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %2) #7
  ret i32 0

.lr.ph74:                                         ; preds = %.lr.ph74.preheader, %.lr.ph74
  %indvars.iv87 = phi i64 [ 0, %.lr.ph74.preheader ], [ %indvars.iv.next88, %.lr.ph74 ]
  %.04071 = phi i64 [ %89, %.lr.ph74.preheader ], [ %143, %.lr.ph74 ]
  %.04170 = phi i64 [ 0, %.lr.ph74.preheader ], [ %142, %.lr.ph74 ]
  %140 = getelementptr inbounds [2 x [100010 x i64]], ptr @X, i64 0, i64 0, i64 %indvars.iv87
  %141 = load i64, ptr %140, align 8, !tbaa !5
  %142 = add nsw i64 %141, %.04170
  %143 = sub nsw i64 %.04071, %141
  %144 = load i64, ptr %3, align 8, !tbaa !5
  %145 = add nsw i64 %144, %142
  %146 = sub i64 %145, %143
  store i64 %146, ptr %3, align 8, !tbaa !5
  %147 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 8 dereferenceable(8) %3)
  %148 = load i64, ptr %147, align 8, !tbaa !5
  store i64 %148, ptr %2, align 16, !tbaa !5
  %indvars.iv.next88 = add nuw nsw i64 %indvars.iv87, 1
  %149 = load i64, ptr @H, align 16, !tbaa !5
  %150 = add nsw i64 %149, -1
  %151 = icmp sgt i64 %150, %indvars.iv.next88
  br i1 %151, label %.lr.ph74, label %._crit_edge75.loopexit, !llvm.loop !24
}

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

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

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

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

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

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

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

; 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 #1 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)) #3

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.vector.reduce.add.v2i64(<2 x i64>) #6

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 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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 #4 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 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 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.unroll.disable"}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !14}
!17 = distinct !{!17, !12, !18, !19}
!18 = !{!"llvm.loop.isvectorized", i32 1}
!19 = !{!"llvm.loop.unroll.runtime.disable"}
!20 = distinct !{!20, !12}
!21 = distinct !{!21, !12, !19, !18}
!22 = distinct !{!22, !12, !18, !19}
!23 = distinct !{!23, !12, !19, !18}
!24 = distinct !{!24, !12}


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