; LLVM IR from eyangch/competitive-programming :: COCI/2023_1 (cokolade)

; 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
@Q = external dso_local global i64, align 8
@C = external dso_local global [100000 x i64], align 16
@pfx = external dso_local global [100000 x i64], align 16
@sfx = external dso_local global [100000 x i64], align 16
@K = external dso_local global i64, align 8
@M = external dso_local global i64, align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@.str = external hidden unnamed_addr constant [9 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [90 x i8], align 1
@__PRETTY_FUNCTION__.main = external hidden unnamed_addr constant [15 x i8], align 1
@_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 i64, align 8
  %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
  %12 = alloca i64, align 8
  %13 = alloca i64, align 8
  %14 = alloca i64, align 8
  %15 = alloca i64, align 8
  %16 = alloca i64, align 8
  store i32 0, ptr %1, align 4
  %17 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %18 = getelementptr i8, ptr %17, i64 -24
  %19 = load i64, ptr %18, align 8
  %20 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %19
  %21 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %20, ptr noundef null)
  %22 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %23 = 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)
  %24 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %23, ptr noundef nonnull align 8 dereferenceable(8) @Q)
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #8
  store i64 0, ptr %2, align 8, !tbaa !8
  br label %25

25:                                               ; preds = %34, %0
  %26 = load i64, ptr %2, align 8, !tbaa !8
  %27 = load i64, ptr @N, align 8, !tbaa !8
  %28 = icmp slt i64 %26, %27
  br i1 %28, label %30, label %29

29:                                               ; preds = %25
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #8
  br label %37

30:                                               ; preds = %25
  %31 = load i64, ptr %2, align 8, !tbaa !8
  %32 = getelementptr inbounds [100000 x i64], ptr @C, i64 0, i64 %31
  %33 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %32)
  br label %34

34:                                               ; preds = %30
  %35 = load i64, ptr %2, align 8, !tbaa !8
  %36 = add nsw i64 %35, 1
  store i64 %36, ptr %2, align 8, !tbaa !8
  br label %25, !llvm.loop !11

37:                                               ; preds = %29
  %38 = load i64, ptr @N, align 8, !tbaa !8
  %39 = getelementptr inbounds i64, ptr @C, i64 %38
  call void @_ZSt4sortIPxEvT_S1_(ptr noundef @C, ptr noundef %39)
  %40 = load i64, ptr @C, align 16, !tbaa !8
  store i64 %40, ptr @pfx, align 16, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #8
  store i64 1, ptr %3, align 8, !tbaa !8
  br label %41

41:                                               ; preds = %57, %37
  %42 = load i64, ptr %3, align 8, !tbaa !8
  %43 = load i64, ptr @N, align 8, !tbaa !8
  %44 = icmp slt i64 %42, %43
  br i1 %44, label %46, label %45

45:                                               ; preds = %41
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #8
  br label %60

46:                                               ; preds = %41
  %47 = load i64, ptr %3, align 8, !tbaa !8
  %48 = sub nsw i64 %47, 1
  %49 = getelementptr inbounds [100000 x i64], ptr @pfx, i64 0, i64 %48
  %50 = load i64, ptr %49, align 8, !tbaa !8
  %51 = load i64, ptr %3, align 8, !tbaa !8
  %52 = getelementptr inbounds [100000 x i64], ptr @C, i64 0, i64 %51
  %53 = load i64, ptr %52, align 8, !tbaa !8
  %54 = add nsw i64 %50, %53
  %55 = load i64, ptr %3, align 8, !tbaa !8
  %56 = getelementptr inbounds [100000 x i64], ptr @pfx, i64 0, i64 %55
  store i64 %54, ptr %56, align 8, !tbaa !8
  br label %57

57:                                               ; preds = %46
  %58 = load i64, ptr %3, align 8, !tbaa !8
  %59 = add nsw i64 %58, 1
  store i64 %59, ptr %3, align 8, !tbaa !8
  br label %41, !llvm.loop !13

60:                                               ; preds = %45
  %61 = load i64, ptr @N, align 8, !tbaa !8
  %62 = sub nsw i64 %61, 1
  %63 = getelementptr inbounds [100000 x i64], ptr @C, i64 0, i64 %62
  %64 = load i64, ptr %63, align 8, !tbaa !8
  %65 = load i64, ptr @N, align 8, !tbaa !8
  %66 = sub nsw i64 %65, 1
  %67 = getelementptr inbounds [100000 x i64], ptr @sfx, i64 0, i64 %66
  store i64 %64, ptr %67, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #8
  %68 = load i64, ptr @N, align 8, !tbaa !8
  %69 = sub nsw i64 %68, 2
  store i64 %69, ptr %4, align 8, !tbaa !8
  br label %70

70:                                               ; preds = %85, %60
  %71 = load i64, ptr %4, align 8, !tbaa !8
  %72 = icmp sge i64 %71, 0
  br i1 %72, label %74, label %73

73:                                               ; preds = %70
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #8
  br label %88

74:                                               ; preds = %70
  %75 = load i64, ptr %4, align 8, !tbaa !8
  %76 = add nsw i64 %75, 1
  %77 = getelementptr inbounds [100000 x i64], ptr @sfx, i64 0, i64 %76
  %78 = load i64, ptr %77, align 8, !tbaa !8
  %79 = load i64, ptr %4, align 8, !tbaa !8
  %80 = getelementptr inbounds [100000 x i64], ptr @C, i64 0, i64 %79
  %81 = load i64, ptr %80, align 8, !tbaa !8
  %82 = add nsw i64 %78, %81
  %83 = load i64, ptr %4, align 8, !tbaa !8
  %84 = getelementptr inbounds [100000 x i64], ptr @sfx, i64 0, i64 %83
  store i64 %82, ptr %84, align 8, !tbaa !8
  br label %85

85:                                               ; preds = %74
  %86 = load i64, ptr %4, align 8, !tbaa !8
  %87 = add nsw i64 %86, -1
  store i64 %87, ptr %4, align 8, !tbaa !8
  br label %70, !llvm.loop !14

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

89:                                               ; preds = %197, %88
  %90 = load i64, ptr %5, align 8, !tbaa !8
  %91 = load i64, ptr @Q, align 8, !tbaa !8
  %92 = icmp slt i64 %90, %91
  br i1 %92, label %94, label %93

93:                                               ; preds = %89
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #8
  br label %200

94:                                               ; preds = %89
  %95 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @K)
  %96 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %95, ptr noundef nonnull align 8 dereferenceable(8) @M)
  %97 = load i64, ptr @M, align 8, !tbaa !8
  %98 = add nsw i64 %97, -1
  store i64 %98, ptr @M, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #8
  %99 = load i64, ptr @N, align 8, !tbaa !8
  %100 = getelementptr inbounds i64, ptr @C, i64 %99
  %101 = call noundef ptr @_ZSt11upper_boundIPxxET_S1_S1_RKT0_(ptr noundef @C, ptr noundef %100, ptr noundef nonnull align 8 dereferenceable(8) @K)
  %102 = ptrtoint ptr %101 to i64
  %103 = sub i64 %102, ptrtoint (ptr @C to i64)
  %104 = sdiv exact i64 %103, 8
  store i64 %104, ptr %6, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #8
  store i64 0, ptr %7, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #8
  %105 = load i64, ptr @M, align 8, !tbaa !8
  %106 = add nsw i64 %105, 1
  store i64 %106, ptr %8, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #8
  store i64 0, ptr %9, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #8
  store i64 1000000000000000, ptr %10, align 8, !tbaa !8
  %107 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %6)
  %108 = load i64, ptr %107, align 8, !tbaa !8
  store i64 %108, ptr %8, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #8
  %109 = load i64, ptr @M, align 8, !tbaa !8
  %110 = add nsw i64 %109, 1
  %111 = load i64, ptr @N, align 8, !tbaa !8
  %112 = load i64, ptr %6, align 8, !tbaa !8
  %113 = sub nsw i64 %111, %112
  %114 = sub nsw i64 %110, %113
  store i64 %114, ptr %11, align 8, !tbaa !8
  %115 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 8 dereferenceable(8) %11)
  %116 = load i64, ptr %115, align 8, !tbaa !8
  store i64 %116, ptr %7, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #8
  br label %117

117:                                              ; preds = %185, %94
  %118 = load i64, ptr %7, align 8, !tbaa !8
  %119 = load i64, ptr %8, align 8, !tbaa !8
  %120 = icmp sle i64 %118, %119
  br i1 %120, label %121, label %186

121:                                              ; preds = %117
  %122 = load i64, ptr %7, align 8, !tbaa !8
  %123 = load i64, ptr %8, align 8, !tbaa !8
  %124 = add nsw i64 %122, %123
  %125 = sdiv i64 %124, 2
  store i64 %125, ptr %9, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #8
  store i64 -1000000000000000, ptr %12, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #8
  store i64 0, ptr %13, align 8, !tbaa !8
  %126 = load i64, ptr %9, align 8, !tbaa !8
  %127 = icmp sgt i64 %126, 0
  br i1 %127, label %128, label %137

128:                                              ; preds = %121
  %129 = load i64, ptr %9, align 8, !tbaa !8
  %130 = sub nsw i64 %129, 1
  %131 = getelementptr inbounds [100000 x i64], ptr @C, i64 0, i64 %130
  %132 = load i64, ptr %131, align 8, !tbaa !8
  store i64 %132, ptr %12, align 8, !tbaa !8
  %133 = load i64, ptr %9, align 8, !tbaa !8
  %134 = sub nsw i64 %133, 1
  %135 = getelementptr inbounds [100000 x i64], ptr @pfx, i64 0, i64 %134
  %136 = load i64, ptr %135, align 8, !tbaa !8
  store i64 %136, ptr %13, align 8, !tbaa !8
  br label %137

137:                                              ; preds = %128, %121
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #8
  store i64 -1000000000000000, ptr %14, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #8
  store i64 0, ptr %15, align 8, !tbaa !8
  %138 = load i64, ptr %9, align 8, !tbaa !8
  %139 = load i64, ptr @M, align 8, !tbaa !8
  %140 = add nsw i64 %139, 1
  %141 = icmp slt i64 %138, %140
  br i1 %141, label %142, label %162

142:                                              ; preds = %137
  %143 = load i64, ptr @K, align 8, !tbaa !8
  %144 = mul nsw i64 %143, 2
  %145 = load i64, ptr @N, align 8, !tbaa !8
  %146 = load i64, ptr @M, align 8, !tbaa !8
  %147 = add nsw i64 %146, 1
  %148 = load i64, ptr %9, align 8, !tbaa !8
  %149 = sub nsw i64 %147, %148
  %150 = sub nsw i64 %145, %149
  %151 = getelementptr inbounds [100000 x i64], ptr @C, i64 0, i64 %150
  %152 = load i64, ptr %151, align 8, !tbaa !8
  %153 = sub nsw i64 %144, %152
  store i64 %153, ptr %14, align 8, !tbaa !8
  %154 = load i64, ptr @N, align 8, !tbaa !8
  %155 = load i64, ptr @M, align 8, !tbaa !8
  %156 = add nsw i64 %155, 1
  %157 = load i64, ptr %9, align 8, !tbaa !8
  %158 = sub nsw i64 %156, %157
  %159 = sub nsw i64 %154, %158
  %160 = getelementptr inbounds [100000 x i64], ptr @sfx, i64 0, i64 %159
  %161 = load i64, ptr %160, align 8, !tbaa !8
  store i64 %161, ptr %15, align 8, !tbaa !8
  br label %162

162:                                              ; preds = %142, %137
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #8
  %163 = load i64, ptr %13, align 8, !tbaa !8
  %164 = load i64, ptr @M, align 8, !tbaa !8
  %165 = add nsw i64 %164, 1
  %166 = load i64, ptr %9, align 8, !tbaa !8
  %167 = sub nsw i64 %165, %166
  %168 = load i64, ptr @K, align 8, !tbaa !8
  %169 = mul nsw i64 %167, %168
  %170 = mul nsw i64 %169, 2
  %171 = add nsw i64 %163, %170
  %172 = load i64, ptr %15, align 8, !tbaa !8
  %173 = sub nsw i64 %171, %172
  store i64 %173, ptr %16, align 8, !tbaa !8
  %174 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull align 8 dereferenceable(8) %16)
  %175 = load i64, ptr %174, align 8, !tbaa !8
  store i64 %175, ptr %10, align 8, !tbaa !8
  %176 = load i64, ptr %12, align 8, !tbaa !8
  %177 = load i64, ptr %14, align 8, !tbaa !8
  %178 = icmp slt i64 %176, %177
  br i1 %178, label %179, label %182

179:                                              ; preds = %162
  %180 = load i64, ptr %9, align 8, !tbaa !8
  %181 = add nsw i64 %180, 1
  store i64 %181, ptr %7, align 8, !tbaa !8
  br label %185

182:                                              ; preds = %162
  %183 = load i64, ptr %9, align 8, !tbaa !8
  %184 = sub nsw i64 %183, 1
  store i64 %184, ptr %8, align 8, !tbaa !8
  br label %185

185:                                              ; preds = %182, %179
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #8
  br label %117, !llvm.loop !15

186:                                              ; preds = %117
  %187 = load i64, ptr %10, align 8, !tbaa !8
  %188 = sitofp i64 %187 to double
  %189 = fcmp olt double %188, 5.000000e+14
  br i1 %189, label %190, label %191

190:                                              ; preds = %186
  br label %193

191:                                              ; preds = %186
  call void @__assert_fail(ptr noundef @.str, ptr noundef @.str.1, i32 noundef 55, ptr noundef @__PRETTY_FUNCTION__.main) #9
  unreachable

192:                                              ; No predecessors!
  br label %193

193:                                              ; preds = %192, %190
  %194 = load i64, ptr %10, align 8, !tbaa !8
  %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 @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %195, i8 noundef signext 10)
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #8
  br label %197

197:                                              ; preds = %193
  %198 = load i64, ptr %5, align 8, !tbaa !8
  %199 = add nsw i64 %198, 1
  store i64 %199, ptr %5, align 8, !tbaa !8
  br label %89, !llvm.loop !16

200:                                              ; preds = %93
  %201 = load i32, ptr %1, align 4
  ret i32 %201
}

; 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 dso_local void @_ZSt4sortIPxEvT_S1_(ptr noundef, ptr noundef) #5

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

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

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

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #7

; 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

; 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 = { noreturn nounwind "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 #8 = { nounwind }
attributes #9 = { noreturn 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
@Q = external dso_local global i64, align 8
@C = external dso_local global [100000 x i64], align 16
@pfx = external dso_local local_unnamed_addr global [100000 x i64], align 16
@sfx = external dso_local local_unnamed_addr global [100000 x i64], align 16
@K = external dso_local global i64, align 8
@M = external dso_local global i64, align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@.str = external hidden unnamed_addr constant [9 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [90 x i8], align 1
@__PRETTY_FUNCTION__.main = external hidden unnamed_addr constant [15 x i8], align 1
@_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 i64, align 8
  %2 = alloca i64, align 8
  %3 = alloca i64, align 8
  %4 = alloca i64, align 8
  %5 = alloca i64, align 8
  %6 = alloca i64, align 8
  %7 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %8 = getelementptr i8, ptr %7, i64 -24
  %9 = load i64, ptr %8, align 8
  %10 = getelementptr inbounds i8, ptr @_ZSt3cin, 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 zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %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) @N)
  %14 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %13, ptr noundef nonnull align 8 dereferenceable(8) @Q)
  %15 = load i64, ptr @N, align 8, !tbaa !8
  %16 = icmp sgt i64 %15, 0
  br i1 %16, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %0
  %.lcssa47 = phi i64 [ %15, %0 ], [ %31, %.lr.ph ]
  %17 = getelementptr inbounds i64, ptr @C, i64 %.lcssa47
  tail call void @_ZSt4sortIPxEvT_S1_(ptr noundef nonnull @C, ptr noundef nonnull %17)
  %18 = load i64, ptr @C, align 16, !tbaa !8
  store i64 %18, ptr @pfx, align 16, !tbaa !8
  %19 = load i64, ptr @N, align 8, !tbaa !8
  %20 = icmp sgt i64 %19, 1
  br i1 %20, label %.lr.ph51.preheader, label %._crit_edge52.thread

.lr.ph51.preheader:                               ; preds = %._crit_edge
  %21 = add nsw i64 %19, -1
  %22 = add nsw i64 %19, -2
  %xtraiter = and i64 %21, 3
  %23 = icmp ult i64 %22, 3
  br i1 %23, label %._crit_edge52.unr-lcssa, label %.lr.ph51.preheader.new

.lr.ph51.preheader.new:                           ; preds = %.lr.ph51.preheader
  %unroll_iter = and i64 %21, -4
  br label %.lr.ph51

._crit_edge52.thread:                             ; preds = %._crit_edge
  %24 = add nsw i64 %19, -1
  %25 = getelementptr inbounds [100000 x i64], ptr @C, i64 0, i64 %24
  %26 = load i64, ptr %25, align 8, !tbaa !8
  %27 = getelementptr inbounds [100000 x i64], ptr @sfx, i64 0, i64 %24
  store i64 %26, ptr %27, align 8, !tbaa !8
  br label %.preheader

.lr.ph:                                           ; preds = %0, %.lr.ph
  %.03548 = phi i64 [ %30, %.lr.ph ], [ 0, %0 ]
  %28 = getelementptr inbounds [100000 x i64], ptr @C, i64 0, i64 %.03548
  %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 = add nuw nsw i64 %.03548, 1
  %31 = load i64, ptr @N, align 8, !tbaa !8
  %32 = icmp slt i64 %30, %31
  br i1 %32, label %.lr.ph, label %._crit_edge, !llvm.loop !11

._crit_edge52.unr-lcssa:                          ; preds = %.lr.ph51, %.lr.ph51.preheader
  %.unr = phi i64 [ %18, %.lr.ph51.preheader ], [ %69, %.lr.ph51 ]
  %.03449.unr = phi i64 [ 1, %.lr.ph51.preheader ], [ %71, %.lr.ph51 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge52, label %.lr.ph51.epil

.lr.ph51.epil:                                    ; preds = %._crit_edge52.unr-lcssa, %.lr.ph51.epil
  %33 = phi i64 [ %36, %.lr.ph51.epil ], [ %.unr, %._crit_edge52.unr-lcssa ]
  %.03449.epil = phi i64 [ %38, %.lr.ph51.epil ], [ %.03449.unr, %._crit_edge52.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.lr.ph51.epil ], [ 0, %._crit_edge52.unr-lcssa ]
  %34 = getelementptr inbounds [100000 x i64], ptr @C, i64 0, i64 %.03449.epil
  %35 = load i64, ptr %34, align 8, !tbaa !8
  %36 = add nsw i64 %35, %33
  %37 = getelementptr inbounds [100000 x i64], ptr @pfx, i64 0, i64 %.03449.epil
  store i64 %36, ptr %37, align 8, !tbaa !8
  %38 = add nuw nsw i64 %.03449.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 %._crit_edge52, label %.lr.ph51.epil, !llvm.loop !13

._crit_edge52:                                    ; preds = %.lr.ph51.epil, %._crit_edge52.unr-lcssa
  %39 = add nsw i64 %19, -1
  %40 = getelementptr inbounds [100000 x i64], ptr @C, i64 0, i64 %39
  %41 = load i64, ptr %40, align 8, !tbaa !8
  %42 = getelementptr inbounds [100000 x i64], ptr @sfx, i64 0, i64 %39
  store i64 %41, ptr %42, align 8, !tbaa !8
  br i1 %20, label %.lr.ph56.preheader, label %.preheader

.lr.ph56.preheader:                               ; preds = %._crit_edge52
  %43 = add nsw i64 %19, -2
  %xtraiter71 = and i64 %21, 3
  %lcmp.mod72.not = icmp eq i64 %xtraiter71, 0
  br i1 %lcmp.mod72.not, label %.lr.ph56.prol.loopexit, label %.lr.ph56.prol

.lr.ph56.prol:                                    ; preds = %.lr.ph56.preheader, %.lr.ph56.prol
  %44 = phi i64 [ %47, %.lr.ph56.prol ], [ %41, %.lr.ph56.preheader ]
  %.03354.prol = phi i64 [ %49, %.lr.ph56.prol ], [ %43, %.lr.ph56.preheader ]
  %prol.iter = phi i64 [ %prol.iter.next, %.lr.ph56.prol ], [ 0, %.lr.ph56.preheader ]
  %45 = getelementptr inbounds [100000 x i64], ptr @C, i64 0, i64 %.03354.prol
  %46 = load i64, ptr %45, align 8, !tbaa !8
  %47 = add nsw i64 %46, %44
  %48 = getelementptr inbounds [100000 x i64], ptr @sfx, i64 0, i64 %.03354.prol
  store i64 %47, ptr %48, align 8, !tbaa !8
  %49 = add nsw i64 %.03354.prol, -1
  %prol.iter.next = add i64 %prol.iter, 1
  %prol.iter.cmp.not = icmp eq i64 %prol.iter.next, %xtraiter71
  br i1 %prol.iter.cmp.not, label %.lr.ph56.prol.loopexit, label %.lr.ph56.prol, !llvm.loop !15

.lr.ph56.prol.loopexit:                           ; preds = %.lr.ph56.prol, %.lr.ph56.preheader
  %.unr73 = phi i64 [ %41, %.lr.ph56.preheader ], [ %47, %.lr.ph56.prol ]
  %.03354.unr = phi i64 [ %43, %.lr.ph56.preheader ], [ %49, %.lr.ph56.prol ]
  %50 = icmp ult i64 %22, 3
  br i1 %50, label %.preheader, label %.lr.ph56

.lr.ph51:                                         ; preds = %.lr.ph51, %.lr.ph51.preheader.new
  %51 = phi i64 [ %18, %.lr.ph51.preheader.new ], [ %69, %.lr.ph51 ]
  %.03449 = phi i64 [ 1, %.lr.ph51.preheader.new ], [ %71, %.lr.ph51 ]
  %niter = phi i64 [ 0, %.lr.ph51.preheader.new ], [ %niter.next.3, %.lr.ph51 ]
  %52 = getelementptr inbounds [100000 x i64], ptr @C, i64 0, i64 %.03449
  %53 = load i64, ptr %52, align 8, !tbaa !8
  %54 = add nsw i64 %53, %51
  %55 = getelementptr inbounds [100000 x i64], ptr @pfx, i64 0, i64 %.03449
  store i64 %54, ptr %55, align 8, !tbaa !8
  %56 = add nuw nsw i64 %.03449, 1
  %57 = getelementptr inbounds [100000 x i64], ptr @C, i64 0, i64 %56
  %58 = load i64, ptr %57, align 8, !tbaa !8
  %59 = add nsw i64 %58, %54
  %60 = getelementptr inbounds [100000 x i64], ptr @pfx, i64 0, i64 %56
  store i64 %59, ptr %60, align 8, !tbaa !8
  %61 = add nuw nsw i64 %.03449, 2
  %62 = getelementptr inbounds [100000 x i64], ptr @C, i64 0, i64 %61
  %63 = load i64, ptr %62, align 8, !tbaa !8
  %64 = add nsw i64 %63, %59
  %65 = getelementptr inbounds [100000 x i64], ptr @pfx, i64 0, i64 %61
  store i64 %64, ptr %65, align 8, !tbaa !8
  %66 = add nuw nsw i64 %.03449, 3
  %67 = getelementptr inbounds [100000 x i64], ptr @C, i64 0, i64 %66
  %68 = load i64, ptr %67, align 8, !tbaa !8
  %69 = add nsw i64 %68, %64
  %70 = getelementptr inbounds [100000 x i64], ptr @pfx, i64 0, i64 %66
  store i64 %69, ptr %70, align 8, !tbaa !8
  %71 = add nuw nsw i64 %.03449, 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 %._crit_edge52.unr-lcssa, label %.lr.ph51, !llvm.loop !16

.preheader:                                       ; preds = %.lr.ph56.prol.loopexit, %.lr.ph56, %._crit_edge52.thread, %._crit_edge52
  %72 = load i64, ptr @Q, align 8, !tbaa !8
  %73 = icmp sgt i64 %72, 0
  br i1 %73, label %.lr.ph62, label %._crit_edge63

.lr.ph56:                                         ; preds = %.lr.ph56.prol.loopexit, %.lr.ph56
  %74 = phi i64 [ %92, %.lr.ph56 ], [ %.unr73, %.lr.ph56.prol.loopexit ]
  %.03354 = phi i64 [ %94, %.lr.ph56 ], [ %.03354.unr, %.lr.ph56.prol.loopexit ]
  %75 = getelementptr inbounds [100000 x i64], ptr @C, i64 0, i64 %.03354
  %76 = load i64, ptr %75, align 8, !tbaa !8
  %77 = add nsw i64 %76, %74
  %78 = getelementptr inbounds [100000 x i64], ptr @sfx, i64 0, i64 %.03354
  store i64 %77, ptr %78, align 8, !tbaa !8
  %79 = add nsw i64 %.03354, -1
  %80 = getelementptr inbounds [100000 x i64], ptr @C, i64 0, i64 %79
  %81 = load i64, ptr %80, align 8, !tbaa !8
  %82 = add nsw i64 %81, %77
  %83 = getelementptr inbounds [100000 x i64], ptr @sfx, i64 0, i64 %79
  store i64 %82, ptr %83, align 8, !tbaa !8
  %84 = add nsw i64 %.03354, -2
  %85 = getelementptr inbounds [100000 x i64], ptr @C, i64 0, i64 %84
  %86 = load i64, ptr %85, align 8, !tbaa !8
  %87 = add nsw i64 %86, %82
  %88 = getelementptr inbounds [100000 x i64], ptr @sfx, i64 0, i64 %84
  store i64 %87, ptr %88, align 8, !tbaa !8
  %89 = add nsw i64 %.03354, -3
  %90 = getelementptr inbounds [100000 x i64], ptr @C, i64 0, i64 %89
  %91 = load i64, ptr %90, align 8, !tbaa !8
  %92 = add nsw i64 %91, %87
  %93 = getelementptr inbounds [100000 x i64], ptr @sfx, i64 0, i64 %89
  store i64 %92, ptr %93, align 8, !tbaa !8
  %94 = add nsw i64 %.03354, -4
  %.not68.3 = icmp eq i64 %89, 0
  br i1 %.not68.3, label %.preheader, label %.lr.ph56, !llvm.loop !17

._crit_edge63:                                    ; preds = %158, %.preheader
  ret i32 0

.lr.ph62:                                         ; preds = %.preheader, %158
  %.03261 = phi i64 [ %161, %158 ], [ 0, %.preheader ]
  %95 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @K)
  %96 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %95, ptr noundef nonnull align 8 dereferenceable(8) @M)
  %97 = load i64, ptr @M, align 8, !tbaa !8
  %98 = add nsw i64 %97, -1
  store i64 %98, ptr @M, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #8
  %99 = load i64, ptr @N, align 8, !tbaa !8
  %100 = getelementptr inbounds i64, ptr @C, i64 %99
  %101 = call noundef ptr @_ZSt11upper_boundIPxxET_S1_S1_RKT0_(ptr noundef nonnull @C, ptr noundef nonnull %100, ptr noundef nonnull align 8 dereferenceable(8) @K)
  %102 = ptrtoint ptr %101 to i64
  %103 = sub i64 %102, ptrtoint (ptr @C to i64)
  %104 = ashr exact i64 %103, 3
  store i64 %104, ptr %1, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #8
  store i64 0, ptr %2, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #8
  %105 = load i64, ptr @M, align 8, !tbaa !8
  %106 = add nsw i64 %105, 1
  store i64 %106, ptr %3, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #8
  store i64 1000000000000000, ptr %4, align 8, !tbaa !8
  %107 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %1)
  %108 = load i64, ptr %107, align 8, !tbaa !8
  store i64 %108, ptr %3, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #8
  %109 = load i64, ptr @M, align 8, !tbaa !8
  %110 = load i64, ptr @N, align 8, !tbaa !8
  %111 = load i64, ptr %1, align 8, !tbaa !8
  %.neg = add i64 %109, 1
  %112 = sub i64 %.neg, %110
  %113 = add i64 %112, %111
  store i64 %113, ptr %5, align 8, !tbaa !8
  %114 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 8 dereferenceable(8) %5)
  %115 = load i64, ptr %114, align 8, !tbaa !8
  store i64 %115, ptr %2, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #8
  %116 = load i64, ptr %3, align 8, !tbaa !8
  %.not57 = icmp sgt i64 %115, %116
  br i1 %.not57, label %.lr.ph62.._crit_edge60_crit_edge, label %.lr.ph59

.lr.ph62.._crit_edge60_crit_edge:                 ; preds = %.lr.ph62
  %.pre66 = load i64, ptr %4, align 8, !tbaa !8
  br label %._crit_edge60

.lr.ph59:                                         ; preds = %.lr.ph62, %152
  %117 = phi i64 [ %153, %152 ], [ %116, %.lr.ph62 ]
  %118 = phi i64 [ %154, %152 ], [ %115, %.lr.ph62 ]
  %119 = add nsw i64 %117, %118
  %120 = sdiv i64 %119, 2
  %121 = icmp sgt i64 %119, 1
  br i1 %121, label %122, label %128

122:                                              ; preds = %.lr.ph59
  %123 = add nsw i64 %120, -1
  %124 = getelementptr inbounds [100000 x i64], ptr @C, i64 0, i64 %123
  %125 = load i64, ptr %124, align 8, !tbaa !8
  %126 = getelementptr inbounds [100000 x i64], ptr @pfx, i64 0, i64 %123
  %127 = load i64, ptr %126, align 8, !tbaa !8
  br label %128

128:                                              ; preds = %122, %.lr.ph59
  %.031 = phi i64 [ %125, %122 ], [ -1000000000000000, %.lr.ph59 ]
  %.030 = phi i64 [ %127, %122 ], [ 0, %.lr.ph59 ]
  %129 = load i64, ptr @M, align 8, !tbaa !8
  %.not42 = icmp sgt i64 %120, %129
  %.pre = load i64, ptr @K, align 8, !tbaa !8
  br i1 %.not42, label %139, label %130

130:                                              ; preds = %128
  %.neg44 = xor i64 %129, -1
  %131 = shl nsw i64 %.pre, 1
  %132 = load i64, ptr @N, align 8, !tbaa !8
  %.neg43 = add i64 %120, %.neg44
  %133 = add i64 %.neg43, %132
  %134 = getelementptr inbounds [100000 x i64], ptr @C, i64 0, i64 %133
  %135 = load i64, ptr %134, align 8, !tbaa !8
  %136 = sub nsw i64 %131, %135
  %137 = getelementptr inbounds [100000 x i64], ptr @sfx, i64 0, i64 %133
  %138 = load i64, ptr %137, align 8, !tbaa !8
  br label %139

139:                                              ; preds = %130, %128
  %.029 = phi i64 [ %136, %130 ], [ -1000000000000000, %128 ]
  %.0 = phi i64 [ %138, %130 ], [ 0, %128 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #8
  %reass.sub = sub i64 %129, %120
  %140 = shl i64 %reass.sub, 1
  %141 = add i64 %140, 2
  %142 = mul i64 %141, %.pre
  %143 = sub i64 %.030, %.0
  %144 = add i64 %143, %142
  store i64 %144, ptr %6, align 8, !tbaa !8
  %145 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %6)
  %146 = load i64, ptr %145, align 8, !tbaa !8
  store i64 %146, ptr %4, align 8, !tbaa !8
  %147 = icmp slt i64 %.031, %.029
  br i1 %147, label %148, label %150

148:                                              ; preds = %139
  %149 = add nsw i64 %120, 1
  store i64 %149, ptr %2, align 8, !tbaa !8
  %.pre65 = load i64, ptr %3, align 8, !tbaa !8
  br label %152

150:                                              ; preds = %139
  %151 = add nsw i64 %120, -1
  store i64 %151, ptr %3, align 8, !tbaa !8
  %.pre64 = load i64, ptr %2, align 8, !tbaa !8
  br label %152

152:                                              ; preds = %150, %148
  %153 = phi i64 [ %151, %150 ], [ %.pre65, %148 ]
  %154 = phi i64 [ %.pre64, %150 ], [ %149, %148 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #8
  %.not = icmp sgt i64 %154, %153
  br i1 %.not, label %._crit_edge60, label %.lr.ph59, !llvm.loop !18

._crit_edge60:                                    ; preds = %152, %.lr.ph62.._crit_edge60_crit_edge
  %155 = phi i64 [ %.pre66, %.lr.ph62.._crit_edge60_crit_edge ], [ %146, %152 ]
  %156 = icmp slt i64 %155, 500000000000000
  br i1 %156, label %158, label %157

157:                                              ; preds = %._crit_edge60
  call void @__assert_fail(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 55, ptr noundef nonnull @__PRETTY_FUNCTION__.main) #9
  unreachable

158:                                              ; preds = %._crit_edge60
  %159 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %155)
  %160 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %159, i8 noundef signext 10)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #8
  %161 = add nuw nsw i64 %.03261, 1
  %162 = load i64, ptr @Q, align 8, !tbaa !8
  %163 = icmp slt i64 %161, %162
  br i1 %163, label %.lr.ph62, label %._crit_edge63, !llvm.loop !19
}

; 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: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #4

; Function Attrs: mustprogress 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 dso_local void @_ZSt4sortIPxEvT_S1_(ptr noundef, ptr noundef) local_unnamed_addr #5

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

; 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 #6

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

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #7

; 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 #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 = { mustprogress 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 = { noreturn nounwind "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 #8 = { nounwind }
attributes #9 = { noreturn 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, !14}
!14 = !{!"llvm.loop.unroll.disable"}
!15 = distinct !{!15, !14}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !12}
!19 = distinct !{!19, !12}


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