; LLVM IR from abeaumont/competitive-programming :: hackerearth/january-circuits-18 (arrays)

; 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::set" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<std::tuple<long long, long long, long long>, std::tuple<long long, long long, long long>, std::_Identity<std::tuple<long long, long long, long long>>, std::less<std::tuple<long long, long long, long long>>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<std::tuple<long long, long long, long long>, std::tuple<long long, long long, long long>, std::_Identity<std::tuple<long long, long long, long long>>, std::less<std::tuple<long long, long long, long long>>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%"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" }
%"class.std::tuple.10" = type { %"struct.std::_Tuple_impl.11" }
%"struct.std::_Tuple_impl.11" = type { %"struct.std::_Tuple_impl.12", %"struct.std::_Head_base.16" }
%"struct.std::_Tuple_impl.12" = type { %"struct.std::_Tuple_impl.13", %"struct.std::_Head_base.15" }
%"struct.std::_Tuple_impl.13" = type { %"struct.std::_Head_base.14" }
%"struct.std::_Head_base.14" = type { ptr }
%"struct.std::_Head_base.15" = type { ptr }
%"struct.std::_Head_base.16" = type { ptr }
%"struct.std::_Rb_tree_const_iterator" = type { ptr }
%"class.std::tuple" = type { %"struct.std::_Tuple_impl" }
%"struct.std::_Tuple_impl" = type { %"struct.std::_Tuple_impl.0", %"struct.std::_Head_base.3" }
%"struct.std::_Tuple_impl.0" = type { %"struct.std::_Tuple_impl.1", %"struct.std::_Head_base.2" }
%"struct.std::_Tuple_impl.1" = type { %"struct.std::_Head_base" }
%"struct.std::_Head_base" = type { i64 }
%"struct.std::_Head_base.2" = type { i64 }
%"struct.std::_Head_base.3" = type { i64 }

@ranges = external dso_local global %"class.std::set", align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z3addxxx(i64 noundef, i64 noundef, i64 noundef) #0

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorISt5tupleIJxxxEEES4_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNKSt3setISt5tupleIJxxxEESt4lessIS1_ESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(48)) #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZNKSt23_Rb_tree_const_iteratorISt5tupleIJxxxEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8)) #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZSt3tieIJxxxEESt5tupleIJDpRT_EES3_(ptr dead_on_unwind noalias writable sret(%"class.std::tuple.10") align 8, ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #2

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

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #4 {
  %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
  %17 = alloca i64, align 8
  %18 = alloca i64, align 8
  %19 = alloca ptr, align 8
  %20 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %21 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %22 = alloca %"class.std::tuple", align 8
  %23 = alloca i64, align 8
  %24 = alloca i64, align 8
  %25 = alloca i64, align 8
  %26 = alloca %"class.std::tuple.10", align 8
  %27 = alloca i64, align 8
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #7
  %28 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %2)
  %29 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %28, ptr noundef nonnull align 8 dereferenceable(8) %3)
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #7
  store i64 0, ptr %4, align 8, !tbaa !5
  br label %30

30:                                               ; preds = %186, %0
  %31 = load i64, ptr %4, align 8, !tbaa !5
  %32 = load i64, ptr %2, align 8, !tbaa !5
  %33 = icmp slt i64 %31, %32
  br i1 %33, label %35, label %34

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

35:                                               ; preds = %30
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #7
  %36 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %5)
  %37 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %36, ptr noundef nonnull align 8 dereferenceable(8) %6)
  %38 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %37, ptr noundef nonnull align 8 dereferenceable(8) %7)
  %39 = load i64, ptr %5, align 8, !tbaa !5
  %40 = load i64, ptr %6, align 8, !tbaa !5
  %41 = add nsw i64 %39, %40
  %42 = load i64, ptr %7, align 8, !tbaa !5
  %43 = add nsw i64 %41, %42
  store i64 %43, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #7
  %44 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %7)
  %45 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %44)
  %46 = load i64, ptr %45, align 8, !tbaa !5
  store i64 %46, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #7
  %47 = load i64, ptr %3, align 8, !tbaa !5
  %48 = load i64, ptr %10, align 8, !tbaa !5
  %49 = sub nsw i64 %47, %48
  %50 = sub nsw i64 %49, 1
  store i64 %50, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #7
  %51 = load i64, ptr %11, align 8, !tbaa !5
  store i64 %51, ptr %12, align 8, !tbaa !5
  %52 = load i64, ptr %8, align 8, !tbaa !5
  %53 = load i64, ptr %11, align 8, !tbaa !5
  call void @_Z3addxxx(i64 noundef %52, i64 noundef 0, i64 noundef %53)
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #7
  store i64 -1, ptr %13, align 8, !tbaa !5
  %54 = load i64, ptr %5, align 8, !tbaa !5
  %55 = load i64, ptr %10, align 8, !tbaa !5
  %56 = icmp ne i64 %54, %55
  br i1 %56, label %57, label %59

57:                                               ; preds = %35
  %58 = load i64, ptr %5, align 8, !tbaa !5
  store i64 %58, ptr %13, align 8, !tbaa !5
  br label %59

59:                                               ; preds = %57, %35
  %60 = load i64, ptr %6, align 8, !tbaa !5
  %61 = load i64, ptr %10, align 8, !tbaa !5
  %62 = icmp ne i64 %60, %61
  br i1 %62, label %63, label %66

63:                                               ; preds = %59
  %64 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %13, ptr noundef nonnull align 8 dereferenceable(8) %6)
  %65 = load i64, ptr %64, align 8, !tbaa !5
  store i64 %65, ptr %13, align 8, !tbaa !5
  br label %66

66:                                               ; preds = %63, %59
  %67 = load i64, ptr %7, align 8, !tbaa !5
  %68 = load i64, ptr %10, align 8, !tbaa !5
  %69 = icmp ne i64 %67, %68
  br i1 %69, label %70, label %73

70:                                               ; preds = %66
  %71 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %13, ptr noundef nonnull align 8 dereferenceable(8) %7)
  %72 = load i64, ptr %71, align 8, !tbaa !5
  store i64 %72, ptr %13, align 8, !tbaa !5
  br label %73

73:                                               ; preds = %70, %66
  %74 = load i64, ptr %13, align 8, !tbaa !5
  %75 = icmp ne i64 %74, -1
  br i1 %75, label %76, label %151

76:                                               ; preds = %73
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #7
  %77 = load i64, ptr %3, align 8, !tbaa !5
  %78 = load i64, ptr %13, align 8, !tbaa !5
  %79 = sub nsw i64 %77, %78
  %80 = sub nsw i64 %79, 1
  store i64 %80, ptr %14, align 8, !tbaa !5
  %81 = load i64, ptr %14, align 8, !tbaa !5
  store i64 %81, ptr %12, align 8, !tbaa !5
  %82 = load i64, ptr %5, align 8, !tbaa !5
  %83 = load i64, ptr %11, align 8, !tbaa !5
  %84 = add nsw i64 %82, %83
  %85 = add nsw i64 %84, 1
  %86 = load i64, ptr %3, align 8, !tbaa !5
  %87 = srem i64 %85, %86
  %88 = load i64, ptr %6, align 8, !tbaa !5
  %89 = load i64, ptr %11, align 8, !tbaa !5
  %90 = add nsw i64 %88, %89
  %91 = add nsw i64 %90, 1
  %92 = load i64, ptr %3, align 8, !tbaa !5
  %93 = srem i64 %91, %92
  %94 = add nsw i64 %87, %93
  %95 = load i64, ptr %7, align 8, !tbaa !5
  %96 = load i64, ptr %11, align 8, !tbaa !5
  %97 = add nsw i64 %95, %96
  %98 = add nsw i64 %97, 1
  %99 = load i64, ptr %3, align 8, !tbaa !5
  %100 = srem i64 %98, %99
  %101 = add nsw i64 %94, %100
  store i64 %101, ptr %8, align 8, !tbaa !5
  %102 = load i64, ptr %8, align 8, !tbaa !5
  %103 = load i64, ptr %11, align 8, !tbaa !5
  %104 = add nsw i64 %103, 1
  %105 = mul nsw i64 3, %104
  %106 = sub nsw i64 %102, %105
  %107 = load i64, ptr %11, align 8, !tbaa !5
  %108 = add nsw i64 %107, 1
  %109 = load i64, ptr %14, align 8, !tbaa !5
  call void @_Z3addxxx(i64 noundef %106, i64 noundef %108, i64 noundef %109)
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #7
  %110 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %7)
  %111 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %110)
  %112 = load i64, ptr %111, align 8, !tbaa !5
  store i64 %112, ptr %15, align 8, !tbaa !5
  %113 = load i64, ptr %15, align 8, !tbaa !5
  %114 = load i64, ptr %13, align 8, !tbaa !5
  %115 = icmp ne i64 %113, %114
  br i1 %115, label %116, label %150

116:                                              ; preds = %76
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #7
  %117 = load i64, ptr %3, align 8, !tbaa !5
  %118 = load i64, ptr %15, align 8, !tbaa !5
  %119 = sub nsw i64 %117, %118
  %120 = sub nsw i64 %119, 1
  store i64 %120, ptr %16, align 8, !tbaa !5
  %121 = load i64, ptr %5, align 8, !tbaa !5
  %122 = load i64, ptr %14, align 8, !tbaa !5
  %123 = add nsw i64 %121, %122
  %124 = add nsw i64 %123, 1
  %125 = load i64, ptr %3, align 8, !tbaa !5
  %126 = srem i64 %124, %125
  %127 = load i64, ptr %6, align 8, !tbaa !5
  %128 = load i64, ptr %14, align 8, !tbaa !5
  %129 = add nsw i64 %127, %128
  %130 = add nsw i64 %129, 1
  %131 = load i64, ptr %3, align 8, !tbaa !5
  %132 = srem i64 %130, %131
  %133 = add nsw i64 %126, %132
  %134 = load i64, ptr %7, align 8, !tbaa !5
  %135 = load i64, ptr %14, align 8, !tbaa !5
  %136 = add nsw i64 %134, %135
  %137 = add nsw i64 %136, 1
  %138 = load i64, ptr %3, align 8, !tbaa !5
  %139 = srem i64 %137, %138
  %140 = add nsw i64 %133, %139
  store i64 %140, ptr %8, align 8, !tbaa !5
  %141 = load i64, ptr %8, align 8, !tbaa !5
  %142 = load i64, ptr %14, align 8, !tbaa !5
  %143 = add nsw i64 %142, 1
  %144 = mul nsw i64 3, %143
  %145 = sub nsw i64 %141, %144
  %146 = load i64, ptr %14, align 8, !tbaa !5
  %147 = add nsw i64 %146, 1
  %148 = load i64, ptr %16, align 8, !tbaa !5
  call void @_Z3addxxx(i64 noundef %145, i64 noundef %147, i64 noundef %148)
  %149 = load i64, ptr %16, align 8, !tbaa !5
  store i64 %149, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  br label %150

150:                                              ; preds = %116, %76
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  br label %151

151:                                              ; preds = %150, %73
  %152 = load i64, ptr %12, align 8, !tbaa !5
  %153 = load i64, ptr %3, align 8, !tbaa !5
  %154 = icmp slt i64 %152, %153
  br i1 %154, label %155, label %185

155:                                              ; preds = %151
  %156 = load i64, ptr %5, align 8, !tbaa !5
  %157 = load i64, ptr %12, align 8, !tbaa !5
  %158 = add nsw i64 %156, %157
  %159 = add nsw i64 %158, 1
  %160 = load i64, ptr %3, align 8, !tbaa !5
  %161 = srem i64 %159, %160
  %162 = load i64, ptr %6, align 8, !tbaa !5
  %163 = load i64, ptr %12, align 8, !tbaa !5
  %164 = add nsw i64 %162, %163
  %165 = add nsw i64 %164, 1
  %166 = load i64, ptr %3, align 8, !tbaa !5
  %167 = srem i64 %165, %166
  %168 = add nsw i64 %161, %167
  %169 = load i64, ptr %7, align 8, !tbaa !5
  %170 = load i64, ptr %12, align 8, !tbaa !5
  %171 = add nsw i64 %169, %170
  %172 = add nsw i64 %171, 1
  %173 = load i64, ptr %3, align 8, !tbaa !5
  %174 = srem i64 %172, %173
  %175 = add nsw i64 %168, %174
  store i64 %175, ptr %8, align 8, !tbaa !5
  %176 = load i64, ptr %8, align 8, !tbaa !5
  %177 = load i64, ptr %12, align 8, !tbaa !5
  %178 = add nsw i64 %177, 1
  %179 = mul nsw i64 3, %178
  %180 = sub nsw i64 %176, %179
  %181 = load i64, ptr %12, align 8, !tbaa !5
  %182 = add nsw i64 %181, 1
  %183 = load i64, ptr %3, align 8, !tbaa !5
  %184 = sub nsw i64 %183, 1
  call void @_Z3addxxx(i64 noundef %180, i64 noundef %182, i64 noundef %184)
  br label %185

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

186:                                              ; preds = %185
  %187 = load i64, ptr %4, align 8, !tbaa !5
  %188 = add nsw i64 %187, 1
  store i64 %188, ptr %4, align 8, !tbaa !5
  br label %30, !llvm.loop !9

189:                                              ; preds = %34
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #7
  %190 = load i64, ptr %3, align 8, !tbaa !5
  %191 = mul nsw i64 %190, 3
  %192 = add nsw i64 %191, 1
  store i64 %192, ptr %17, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #7
  store i64 0, ptr %18, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #7
  store ptr @ranges, ptr %19, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #7
  %193 = call ptr @_ZNKSt3setISt5tupleIJxxxEESt4lessIS1_ESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) @ranges) #7
  %194 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %20, i32 0, i32 0
  store ptr %193, ptr %194, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #7
  %195 = call ptr @_ZNKSt3setISt5tupleIJxxxEESt4lessIS1_ESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(48) @ranges) #7
  %196 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %21, i32 0, i32 0
  store ptr %195, ptr %196, align 8
  br label %197

197:                                              ; preds = %214, %189
  %198 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorISt5tupleIJxxxEEES4_(ptr noundef nonnull align 8 dereferenceable(8) %20, ptr noundef nonnull align 8 dereferenceable(8) %21) #7
  br i1 %198, label %200, label %199

199:                                              ; preds = %197
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #7
  br label %216

200:                                              ; preds = %197
  call void @llvm.lifetime.start.p0(i64 24, ptr %22) #7
  %201 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNKSt23_Rb_tree_const_iteratorISt5tupleIJxxxEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %20) #7
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %22, ptr align 8 %201, i64 24, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #7
  call void @llvm.lifetime.start.p0(i64 24, ptr %26) #7
  call void @_ZSt3tieIJxxxEESt5tupleIJDpRT_EES3_(ptr dead_on_unwind writable sret(%"class.std::tuple.10") align 8 %26, ptr noundef nonnull align 8 dereferenceable(8) %23, ptr noundef nonnull align 8 dereferenceable(8) %24, ptr noundef nonnull align 8 dereferenceable(8) %25) #7
  %202 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt5tupleIJRxS0_S0_EEaSIJxxxEEENSt9enable_ifIXcl12__assignableIDpRKT_EEERS1_E4typeERKS_IJDpS4_EE(ptr noundef nonnull align 8 dereferenceable(24) %26, ptr noundef nonnull align 8 dereferenceable(24) %22) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %26) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #7
  %203 = load i64, ptr %24, align 8, !tbaa !5
  %204 = mul nsw i64 %203, 3
  %205 = load i64, ptr %25, align 8, !tbaa !5
  %206 = add nsw i64 %204, %205
  store i64 %206, ptr %27, align 8, !tbaa !5
  %207 = load i64, ptr %27, align 8, !tbaa !5
  %208 = load i64, ptr %17, align 8, !tbaa !5
  %209 = icmp slt i64 %207, %208
  br i1 %209, label %210, label %213

210:                                              ; preds = %200
  %211 = load i64, ptr %27, align 8, !tbaa !5
  store i64 %211, ptr %17, align 8, !tbaa !5
  %212 = load i64, ptr %24, align 8, !tbaa !5
  store i64 %212, ptr %18, align 8, !tbaa !5
  br label %213

213:                                              ; preds = %210, %200
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %22) #7
  br label %214

214:                                              ; preds = %213
  %215 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt23_Rb_tree_const_iteratorISt5tupleIJxxxEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %20) #7
  br label %197

216:                                              ; preds = %199
  %217 = load i64, ptr %17, align 8, !tbaa !5
  %218 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %217)
  %219 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %218, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #7
  %220 = load i32, ptr %1, align 4
  ret i32 %220
}

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNKSt3setISt5tupleIJxxxEESt4lessIS1_ESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(48)) #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt23_Rb_tree_const_iteratorISt5tupleIJxxxEEEppEv(ptr noundef nonnull align 8 dereferenceable(8)) #2 align 2

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8), i64 noundef) #0 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) #0 align 2

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

attributes #0 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { mustprogress norecurse uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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 = { 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 #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 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!12, !12, i64 0}
!12 = !{!"any pointer", !7, i64 0}


; 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::set" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<std::tuple<long long, long long, long long>, std::tuple<long long, long long, long long>, std::_Identity<std::tuple<long long, long long, long long>>, std::less<std::tuple<long long, long long, long long>>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<std::tuple<long long, long long, long long>, std::tuple<long long, long long, long long>, std::_Identity<std::tuple<long long, long long, long long>>, std::less<std::tuple<long long, long long, long long>>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%"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" }
%"class.std::tuple.10" = type { %"struct.std::_Tuple_impl.11" }
%"struct.std::_Tuple_impl.11" = type { %"struct.std::_Tuple_impl.12", %"struct.std::_Head_base.16" }
%"struct.std::_Tuple_impl.12" = type { %"struct.std::_Tuple_impl.13", %"struct.std::_Head_base.15" }
%"struct.std::_Tuple_impl.13" = type { %"struct.std::_Head_base.14" }
%"struct.std::_Head_base.14" = type { ptr }
%"struct.std::_Head_base.15" = type { ptr }
%"struct.std::_Head_base.16" = type { ptr }
%"struct.std::_Rb_tree_const_iterator" = type { ptr }
%"class.std::tuple" = type { %"struct.std::_Tuple_impl" }
%"struct.std::_Tuple_impl" = type { %"struct.std::_Tuple_impl.0", %"struct.std::_Head_base.3" }
%"struct.std::_Tuple_impl.0" = type { %"struct.std::_Tuple_impl.1", %"struct.std::_Head_base.2" }
%"struct.std::_Tuple_impl.1" = type { %"struct.std::_Head_base" }
%"struct.std::_Head_base" = type { i64 }
%"struct.std::_Head_base.2" = type { i64 }
%"struct.std::_Head_base.3" = type { i64 }

@ranges = external dso_local global %"class.std::set", align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z3addxxx(i64 noundef, i64 noundef, i64 noundef) local_unnamed_addr #0

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorISt5tupleIJxxxEEES4_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNKSt3setISt5tupleIJxxxEESt4lessIS1_ESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(48)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZNKSt23_Rb_tree_const_iteratorISt5tupleIJxxxEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZSt3tieIJxxxEESt5tupleIJDpRT_EES3_(ptr dead_on_unwind noalias writable sret(%"class.std::tuple.10") align 8, ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #2

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

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #4 {
  %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 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %8 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %9 = alloca %"class.std::tuple", align 8
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  %12 = alloca i64, align 8
  %13 = alloca %"class.std::tuple.10", align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #8
  %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) %1)
  %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) %2)
  %16 = load i64, ptr %1, align 8, !tbaa !5
  %17 = icmp sgt i64 %16, 0
  br i1 %17, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %103, %0
  %18 = load i64, ptr %2, align 8, !tbaa !5
  %19 = mul nsw i64 %18, 3
  %20 = add nsw i64 %19, 1
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #8
  %21 = call ptr @_ZNKSt3setISt5tupleIJxxxEESt4lessIS1_ESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) @ranges) #8
  store ptr %21, ptr %7, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #8
  %22 = call ptr @_ZNKSt3setISt5tupleIJxxxEESt4lessIS1_ESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(48) @ranges) #8
  store ptr %22, ptr %8, align 8
  %23 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorISt5tupleIJxxxEEES4_(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 8 dereferenceable(8) %8) #8
  br i1 %23, label %.lr.ph56, label %._crit_edge57

.lr.ph:                                           ; preds = %0, %103
  %.053 = phi i64 [ %104, %103 ], [ 0, %0 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #8
  %24 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %3)
  %25 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %24, ptr noundef nonnull align 8 dereferenceable(8) %4)
  %26 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %25, ptr noundef nonnull align 8 dereferenceable(8) %5)
  %27 = load i64, ptr %3, align 8, !tbaa !5
  %28 = load i64, ptr %4, align 8, !tbaa !5
  %29 = add nsw i64 %28, %27
  %30 = load i64, ptr %5, align 8, !tbaa !5
  %31 = add nsw i64 %29, %30
  %32 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %5)
  %33 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %3, ptr noundef nonnull align 8 dereferenceable(8) %32)
  %34 = load i64, ptr %33, align 8, !tbaa !5
  %35 = load i64, ptr %2, align 8, !tbaa !5
  %36 = sub nsw i64 %35, %34
  %37 = add nsw i64 %36, -1
  call void @_Z3addxxx(i64 noundef %31, i64 noundef 0, i64 noundef %37)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #8
  %38 = load i64, ptr %3, align 8, !tbaa !5
  %.not = icmp eq i64 %38, %34
  %spec.store.select = select i1 %.not, i64 -1, i64 %38
  store i64 %spec.store.select, ptr %6, align 8
  %39 = load i64, ptr %4, align 8, !tbaa !5
  %.not47 = icmp eq i64 %39, %34
  br i1 %.not47, label %43, label %40

40:                                               ; preds = %.lr.ph
  %41 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %4)
  %42 = load i64, ptr %41, align 8, !tbaa !5
  store i64 %42, ptr %6, align 8, !tbaa !5
  br label %43

43:                                               ; preds = %40, %.lr.ph
  %.pr = phi i64 [ %42, %40 ], [ %spec.store.select, %.lr.ph ]
  %44 = load i64, ptr %5, align 8, !tbaa !5
  %.not48 = icmp eq i64 %44, %34
  br i1 %.not48, label %thread-pre-split, label %45

45:                                               ; preds = %43
  %46 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %5)
  %47 = load i64, ptr %46, align 8, !tbaa !5
  store i64 %47, ptr %6, align 8, !tbaa !5
  br label %thread-pre-split

thread-pre-split:                                 ; preds = %43, %45
  %48 = phi i64 [ %47, %45 ], [ %.pr, %43 ]
  %.not49 = icmp eq i64 %48, -1
  br i1 %.not49, label %85, label %49

49:                                               ; preds = %thread-pre-split
  %50 = load i64, ptr %2, align 8, !tbaa !5
  %51 = sub nsw i64 %50, %48
  %52 = add nsw i64 %51, -1
  %53 = load i64, ptr %3, align 8, !tbaa !5
  %54 = add i64 %53, %36
  %55 = srem i64 %54, %50
  %56 = load i64, ptr %4, align 8, !tbaa !5
  %57 = add i64 %56, %36
  %58 = srem i64 %57, %50
  %59 = load i64, ptr %5, align 8, !tbaa !5
  %60 = add i64 %59, %36
  %61 = srem i64 %60, %50
  %.neg = mul i64 %36, -3
  %62 = add i64 %55, %.neg
  %63 = add i64 %62, %58
  %64 = add i64 %63, %61
  call void @_Z3addxxx(i64 noundef %64, i64 noundef %36, i64 noundef %52)
  %65 = 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) %5)
  %66 = 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) %65)
  %67 = load i64, ptr %66, align 8, !tbaa !5
  %68 = load i64, ptr %6, align 8, !tbaa !5
  %.not50 = icmp eq i64 %67, %68
  br i1 %.not50, label %85, label %69

69:                                               ; preds = %49
  %70 = load i64, ptr %2, align 8, !tbaa !5
  %71 = xor i64 %67, -1
  %72 = add i64 %70, %71
  %73 = load i64, ptr %3, align 8, !tbaa !5
  %74 = add i64 %73, %51
  %75 = srem i64 %74, %70
  %76 = load i64, ptr %4, align 8, !tbaa !5
  %77 = add i64 %76, %51
  %78 = srem i64 %77, %70
  %79 = load i64, ptr %5, align 8, !tbaa !5
  %80 = add i64 %79, %51
  %81 = srem i64 %80, %70
  %.neg51 = mul i64 %51, -3
  %82 = add i64 %75, %.neg51
  %83 = add i64 %82, %78
  %84 = add i64 %83, %81
  call void @_Z3addxxx(i64 noundef %84, i64 noundef %51, i64 noundef %72)
  br label %85

85:                                               ; preds = %49, %69, %thread-pre-split
  %.141 = phi i64 [ %37, %thread-pre-split ], [ %72, %69 ], [ %52, %49 ]
  %86 = load i64, ptr %2, align 8, !tbaa !5
  %87 = icmp slt i64 %.141, %86
  br i1 %87, label %88, label %103

88:                                               ; preds = %85
  %89 = load i64, ptr %3, align 8, !tbaa !5
  %90 = add nsw i64 %.141, 1
  %91 = add i64 %90, %89
  %92 = srem i64 %91, %86
  %93 = load i64, ptr %4, align 8, !tbaa !5
  %94 = add i64 %90, %93
  %95 = srem i64 %94, %86
  %96 = load i64, ptr %5, align 8, !tbaa !5
  %97 = add i64 %90, %96
  %98 = srem i64 %97, %86
  %.neg52 = mul i64 %90, -3
  %99 = add i64 %92, %.neg52
  %100 = add i64 %99, %95
  %101 = add i64 %100, %98
  %102 = add nsw i64 %86, -1
  call void @_Z3addxxx(i64 noundef %101, i64 noundef %90, i64 noundef %102)
  br label %103

103:                                              ; preds = %88, %85
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #8
  %104 = add nuw nsw i64 %.053, 1
  %105 = load i64, ptr %1, align 8, !tbaa !5
  %106 = icmp slt i64 %104, %105
  br i1 %106, label %.lr.ph, label %._crit_edge, !llvm.loop !9

._crit_edge57:                                    ; preds = %.lr.ph56, %._crit_edge
  %.039.lcssa = phi i64 [ %20, %._crit_edge ], [ %spec.select, %.lr.ph56 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #8
  %107 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %.039.lcssa)
  %108 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %107, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #8
  ret i32 0

.lr.ph56:                                         ; preds = %._crit_edge, %.lr.ph56
  %.03954 = phi i64 [ %spec.select, %.lr.ph56 ], [ %20, %._crit_edge ]
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %9) #8
  %109 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNKSt23_Rb_tree_const_iteratorISt5tupleIJxxxEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #8
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %9, ptr noundef nonnull align 8 dereferenceable(24) %109, i64 24, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #8
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %13) #8
  call void @_ZSt3tieIJxxxEESt5tupleIJDpRT_EES3_(ptr dead_on_unwind nonnull writable sret(%"class.std::tuple.10") align 8 %13, ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull align 8 dereferenceable(8) %11, ptr noundef nonnull align 8 dereferenceable(8) %12) #8
  %110 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt5tupleIJRxS0_S0_EEaSIJxxxEEENSt9enable_ifIXcl12__assignableIDpRKT_EEERS1_E4typeERKS_IJDpS4_EE(ptr noundef nonnull align 8 dereferenceable(24) %13, ptr noundef nonnull align 8 dereferenceable(24) %9) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %13) #8
  %111 = load i64, ptr %11, align 8, !tbaa !5
  %112 = mul nsw i64 %111, 3
  %113 = load i64, ptr %12, align 8, !tbaa !5
  %114 = add nsw i64 %112, %113
  %spec.select = call i64 @llvm.smin.i64(i64 %114, i64 %.03954)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %9) #8
  %115 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt23_Rb_tree_const_iteratorISt5tupleIJxxxEEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #8
  %116 = call noundef zeroext i1 @_ZStneRKSt23_Rb_tree_const_iteratorISt5tupleIJxxxEEES4_(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 8 dereferenceable(8) %8) #8
  br i1 %116, label %.lr.ph56, label %._crit_edge57
}

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef 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 #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 #5

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNKSt3setISt5tupleIJxxxEESt4lessIS1_ESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(48)) local_unnamed_addr #2 align 2

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

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

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.smin.i64(i64, i64) #7

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


; Effective O3 passes: CorrelatedValuePropagationPass,DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimplifyCFGPass