; LLVM IR from ritikbanger/Hacktoberfest2022-DSA :: 29. Codeforces Problems (array-walk)

; 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" }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl" }
%"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl" = type { %"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl_data" }
%"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::multiset" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<long long, long long, std::_Identity<long long>, std::less<long long>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<long long, long long, std::_Identity<long long>, std::less<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 }
%"struct.std::_Rb_tree_const_iterator" = type { ptr }

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

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

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #1 personality ptr @__gxx_personality_v0 {
  %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 i64, align 8
  %20 = alloca i64, align 8
  %21 = alloca ptr, align 8
  %22 = alloca i64, align 8
  %23 = alloca i64, align 8
  %24 = alloca i64, align 8
  %25 = alloca %"class.std::vector", align 8
  %26 = alloca %"class.std::multiset", align 8
  %27 = alloca ptr, align 8
  %28 = alloca i32, align 4
  %29 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %30 = alloca i64, align 8
  %31 = alloca i64, align 8
  %32 = alloca i64, align 8
  %33 = alloca i64, align 8
  store i32 0, ptr %1, align 4
  %34 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %35 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %36 = getelementptr i8, ptr %35, i64 -24
  %37 = load i64, ptr %36, align 8
  %38 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %37
  %39 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %38, ptr noundef null)
  %40 = load ptr, ptr @_ZSt4cout, align 8, !tbaa !5
  %41 = getelementptr i8, ptr %40, i64 -24
  %42 = load i64, ptr %41, align 8
  %43 = getelementptr inbounds i8, ptr @_ZSt4cout, i64 %42
  %44 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %43, ptr noundef null)
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #8
  %45 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %20)
  br label %46

46:                                               ; preds = %175, %0
  %47 = load i64, ptr %20, align 8, !tbaa !8
  %48 = add nsw i64 %47, -1
  store i64 %48, ptr %20, align 8, !tbaa !8
  %49 = icmp ne i64 %47, 0
  br i1 %49, label %50, label %183

50:                                               ; preds = %46
  %51 = 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)
  %52 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %51, ptr noundef nonnull align 8 dereferenceable(8) %9)
  %53 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %52, ptr noundef nonnull align 8 dereferenceable(8) %17)
  %54 = load i64, ptr %2, align 8, !tbaa !8
  %55 = call ptr @llvm.stacksave.p0()
  store ptr %55, ptr %21, align 8
  %56 = alloca i64, i64 %54, align 16
  store i64 %54, ptr %22, align 8
  store i64 0, ptr %3, align 8, !tbaa !8
  br label %57

57:                                               ; preds = %65, %50
  %58 = load i64, ptr %3, align 8, !tbaa !8
  %59 = load i64, ptr %2, align 8, !tbaa !8
  %60 = icmp slt i64 %58, %59
  br i1 %60, label %61, label %68

61:                                               ; preds = %57
  %62 = load i64, ptr %3, align 8, !tbaa !8
  %63 = getelementptr inbounds i64, ptr %56, i64 %62
  %64 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %63)
  br label %65

65:                                               ; preds = %61
  %66 = load i64, ptr %3, align 8, !tbaa !8
  %67 = add nsw i64 %66, 1
  store i64 %67, ptr %3, align 8, !tbaa !8
  br label %57, !llvm.loop !11

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

69:                                               ; preds = %79, %68
  %70 = load i64, ptr %3, align 8, !tbaa !8
  %71 = load i64, ptr %9, align 8, !tbaa !8
  %72 = icmp sle i64 %70, %71
  br i1 %72, label %73, label %82

73:                                               ; preds = %69
  %74 = load i64, ptr %3, align 8, !tbaa !8
  %75 = getelementptr inbounds i64, ptr %56, i64 %74
  %76 = load i64, ptr %75, align 8, !tbaa !8
  %77 = load i64, ptr %23, align 8, !tbaa !8
  %78 = add nsw i64 %77, %76
  store i64 %78, ptr %23, align 8, !tbaa !8
  br label %79

79:                                               ; preds = %73
  %80 = load i64, ptr %3, align 8, !tbaa !8
  %81 = add nsw i64 %80, 1
  store i64 %81, ptr %3, align 8, !tbaa !8
  br label %69, !llvm.loop !13

82:                                               ; preds = %69
  call void @llvm.lifetime.start.p0(i64 24, ptr %25) #8
  call void @_ZNSt6vectorIxSaIxEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %25) #8
  call void @llvm.lifetime.start.p0(i64 48, ptr %26) #8
  call void @_ZNSt8multisetIxSt4lessIxESaIxEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %26) #8
  store i64 0, ptr %3, align 8, !tbaa !8
  br label %83

83:                                               ; preds = %93, %82
  %84 = load i64, ptr %3, align 8, !tbaa !8
  %85 = load i64, ptr %9, align 8, !tbaa !8
  %86 = icmp sle i64 %84, %85
  br i1 %86, label %87, label %100

87:                                               ; preds = %83
  %88 = load i64, ptr %3, align 8, !tbaa !8
  %89 = getelementptr inbounds i64, ptr %56, i64 %88
  %90 = invoke ptr @_ZNSt8multisetIxSt4lessIxESaIxEE6insertERKx(ptr noundef nonnull align 8 dereferenceable(48) %26, ptr noundef nonnull align 8 dereferenceable(8) %89)
          to label %91 unwind label %96

91:                                               ; preds = %87
  %92 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %29, i32 0, i32 0
  store ptr %90, ptr %92, align 8
  br label %93

93:                                               ; preds = %91
  %94 = load i64, ptr %3, align 8, !tbaa !8
  %95 = add nsw i64 %94, 1
  store i64 %95, ptr %3, align 8, !tbaa !8
  br label %83, !llvm.loop !14

96:                                               ; preds = %87
  %97 = landingpad { ptr, i32 }
          cleanup
  %98 = extractvalue { ptr, i32 } %97, 0
  store ptr %98, ptr %27, align 8
  %99 = extractvalue { ptr, i32 } %97, 1
  store i32 %99, ptr %28, align 4
  br label %182

100:                                              ; preds = %83
  %101 = load i64, ptr %23, align 8, !tbaa !8
  store i64 %101, ptr %24, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %30) #8
  %102 = load i64, ptr %17, align 8, !tbaa !8
  store i64 %102, ptr %30, align 8, !tbaa !8
  store i64 1, ptr %3, align 8, !tbaa !8
  br label %103

103:                                              ; preds = %162, %100
  %104 = load i64, ptr %3, align 8, !tbaa !8
  %105 = load i64, ptr %30, align 8, !tbaa !8
  %106 = icmp sle i64 %104, %105
  br i1 %106, label %107, label %170

107:                                              ; preds = %103
  call void @llvm.lifetime.start.p0(i64 8, ptr %31) #8
  store i64 0, ptr %31, align 8, !tbaa !8
  store i64 0, ptr %11, align 8, !tbaa !8
  br label %108

108:                                              ; preds = %127, %107
  %109 = load i64, ptr %11, align 8, !tbaa !8
  %110 = load i64, ptr %9, align 8, !tbaa !8
  %111 = load i64, ptr %3, align 8, !tbaa !8
  %112 = mul nsw i64 2, %111
  %113 = sub nsw i64 %110, %112
  %114 = icmp sle i64 %109, %113
  br i1 %114, label %115, label %134

115:                                              ; preds = %108
  call void @llvm.lifetime.start.p0(i64 8, ptr %32) #8
  %116 = load i64, ptr %11, align 8, !tbaa !8
  %117 = getelementptr inbounds i64, ptr %56, i64 %116
  %118 = load i64, ptr %117, align 8, !tbaa !8
  %119 = load i64, ptr %11, align 8, !tbaa !8
  %120 = add nsw i64 %119, 1
  %121 = getelementptr inbounds i64, ptr %56, i64 %120
  %122 = load i64, ptr %121, align 8, !tbaa !8
  %123 = add nsw i64 %118, %122
  store i64 %123, ptr %32, align 8, !tbaa !8
  %124 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %31, ptr noundef nonnull align 8 dereferenceable(8) %32)
          to label %125 unwind label %130

125:                                              ; preds = %115
  %126 = load i64, ptr %124, align 8, !tbaa !8
  store i64 %126, ptr %31, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr %32) #8
  br label %127

127:                                              ; preds = %125
  %128 = load i64, ptr %11, align 8, !tbaa !8
  %129 = add nsw i64 %128, 1
  store i64 %129, ptr %11, align 8, !tbaa !8
  br label %108, !llvm.loop !15

130:                                              ; preds = %115
  %131 = landingpad { ptr, i32 }
          cleanup
  %132 = extractvalue { ptr, i32 } %131, 0
  store ptr %132, ptr %27, align 8
  %133 = extractvalue { ptr, i32 } %131, 1
  store i32 %133, ptr %28, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %32) #8
  br label %169

134:                                              ; preds = %108
  call void @llvm.lifetime.start.p0(i64 8, ptr %33) #8
  %135 = load i64, ptr %23, align 8, !tbaa !8
  store i64 %135, ptr %33, align 8, !tbaa !8
  %136 = load i64, ptr %9, align 8, !tbaa !8
  store i64 %136, ptr %11, align 8, !tbaa !8
  br label %137

137:                                              ; preds = %150, %134
  %138 = load i64, ptr %11, align 8, !tbaa !8
  %139 = load i64, ptr %9, align 8, !tbaa !8
  %140 = load i64, ptr %3, align 8, !tbaa !8
  %141 = mul nsw i64 2, %140
  %142 = sub nsw i64 %139, %141
  %143 = icmp sgt i64 %138, %142
  br i1 %143, label %144, label %153

144:                                              ; preds = %137
  %145 = load i64, ptr %11, align 8, !tbaa !8
  %146 = getelementptr inbounds i64, ptr %56, i64 %145
  %147 = load i64, ptr %146, align 8, !tbaa !8
  %148 = load i64, ptr %33, align 8, !tbaa !8
  %149 = sub nsw i64 %148, %147
  store i64 %149, ptr %33, align 8, !tbaa !8
  br label %150

150:                                              ; preds = %144
  %151 = load i64, ptr %11, align 8, !tbaa !8
  %152 = add nsw i64 %151, -1
  store i64 %152, ptr %11, align 8, !tbaa !8
  br label %137, !llvm.loop !16

153:                                              ; preds = %137
  %154 = load i64, ptr %31, align 8, !tbaa !8
  %155 = load i64, ptr %3, align 8, !tbaa !8
  %156 = mul nsw i64 %154, %155
  %157 = load i64, ptr %33, align 8, !tbaa !8
  %158 = add nsw i64 %157, %156
  store i64 %158, ptr %33, align 8, !tbaa !8
  %159 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %24, ptr noundef nonnull align 8 dereferenceable(8) %33)
          to label %160 unwind label %165

160:                                              ; preds = %153
  %161 = load i64, ptr %159, align 8, !tbaa !8
  store i64 %161, ptr %24, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr %33) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %31) #8
  br label %162

162:                                              ; preds = %160
  %163 = load i64, ptr %3, align 8, !tbaa !8
  %164 = add nsw i64 %163, 1
  store i64 %164, ptr %3, align 8, !tbaa !8
  br label %103, !llvm.loop !17

165:                                              ; preds = %153
  %166 = landingpad { ptr, i32 }
          cleanup
  %167 = extractvalue { ptr, i32 } %166, 0
  store ptr %167, ptr %27, align 8
  %168 = extractvalue { ptr, i32 } %166, 1
  store i32 %168, ptr %28, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %33) #8
  br label %169

169:                                              ; preds = %165, %130
  call void @llvm.lifetime.end.p0(i64 8, ptr %31) #8
  br label %181

170:                                              ; preds = %103
  %171 = load i64, ptr %24, align 8, !tbaa !8
  %172 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %171)
          to label %173 unwind label %177

173:                                              ; preds = %170
  %174 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %172, i8 noundef signext 10)
          to label %175 unwind label %177

175:                                              ; preds = %173
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #8
  call void @_ZNSt8multisetIxSt4lessIxESaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %26) #8
  call void @llvm.lifetime.end.p0(i64 48, ptr %26) #8
  call void @_ZNSt6vectorIxSaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %25) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %25) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #8
  %176 = load ptr, ptr %21, align 8
  call void @llvm.stackrestore.p0(ptr %176)
  br label %46, !llvm.loop !18

177:                                              ; preds = %173, %170
  %178 = landingpad { ptr, i32 }
          cleanup
  %179 = extractvalue { ptr, i32 } %178, 0
  store ptr %179, ptr %27, align 8
  %180 = extractvalue { ptr, i32 } %178, 1
  store i32 %180, ptr %28, align 4
  br label %181

181:                                              ; preds = %177, %169
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #8
  br label %182

182:                                              ; preds = %181, %96
  call void @_ZNSt8multisetIxSt4lessIxESaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %26) #8
  call void @llvm.lifetime.end.p0(i64 48, ptr %26) #8
  call void @_ZNSt6vectorIxSaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %25) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %25) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #8
  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
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #8
  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
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #8
  br label %185

183:                                              ; preds = %46
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #8
  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
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #8
  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
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #8
  %184 = load i32, ptr %1, align 4
  ret i32 %184

185:                                              ; preds = %182
  %186 = load ptr, ptr %27, align 8
  %187 = load i32, ptr %28, align 4
  %188 = insertvalue { ptr, i32 } poison, ptr %186, 0
  %189 = insertvalue { ptr, i32 } %188, i32 %187, 1
  resume { ptr, i32 } %189
}

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

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

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

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

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #5

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

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

declare i32 @__gxx_personality_v0(...)

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

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

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

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

; Function Attrs: nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #5

attributes #0 = { 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 #1 = { 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 #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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nocallback nofree nosync nounwind willreturn }
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 = { 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 #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 = !{!"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}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !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" }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl" }
%"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl" = type { %"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl_data" }
%"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::multiset" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<long long, long long, std::_Identity<long long>, std::less<long long>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<long long, long long, std::_Identity<long long>, std::less<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 }

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

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

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #1 personality ptr @__gxx_personality_v0 {
  %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 %"class.std::vector", align 8
  %7 = alloca %"class.std::multiset", align 8
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca i64, align 8
  %11 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %12 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %13 = getelementptr i8, ptr %12, i64 -24
  %14 = load i64, ptr %13, align 8
  %15 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %14
  %16 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %15, ptr noundef null)
  %17 = load ptr, ptr @_ZSt4cout, align 8, !tbaa !5
  %18 = getelementptr i8, ptr %17, i64 -24
  %19 = load i64, ptr %18, align 8
  %20 = getelementptr inbounds i8, ptr @_ZSt4cout, i64 %19
  %21 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %20, ptr noundef null)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #9
  %22 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %4)
  %23 = load i64, ptr %4, align 8, !tbaa !8
  %24 = add nsw i64 %23, -1
  store i64 %24, ptr %4, align 8, !tbaa !8
  %.not68 = icmp eq i64 %23, 0
  br i1 %.not68, label %._crit_edge71, label %.lr.ph70

.lr.ph70:                                         ; preds = %0, %99
  %25 = 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)
  %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) %2)
  %27 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %26, ptr noundef nonnull align 8 dereferenceable(8) %3)
  %28 = load i64, ptr %1, align 8, !tbaa !8
  %29 = call ptr @llvm.stacksave.p0()
  %30 = alloca i64, i64 %28, align 16
  %31 = load i64, ptr %1, align 8, !tbaa !8
  %32 = icmp sgt i64 %31, 0
  br i1 %32, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %.lr.ph70, %.lr.ph
  %.039 = phi i64 [ %35, %.lr.ph ], [ 0, %.lr.ph70 ]
  %33 = getelementptr inbounds i64, ptr %30, i64 %.039
  %34 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %33)
  %35 = add nuw nsw i64 %.039, 1
  %36 = load i64, ptr %1, align 8, !tbaa !8
  %37 = icmp slt i64 %35, %36
  br i1 %37, label %.lr.ph, label %._crit_edge, !llvm.loop !11

._crit_edge:                                      ; preds = %.lr.ph, %.lr.ph70
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #9
  store i64 0, ptr %5, align 8, !tbaa !8
  %38 = load i64, ptr %2, align 8, !tbaa !8
  %.not3340 = icmp slt i64 %38, 0
  br i1 %.not3340, label %._crit_edge45, label %.lr.ph44.preheader

.lr.ph44.preheader:                               ; preds = %._crit_edge
  %39 = add nuw i64 %38, 1
  %min.iters.check94 = icmp ult i64 %38, 3
  br i1 %min.iters.check94, label %.lr.ph44.preheader110, label %vector.ph95

vector.ph95:                                      ; preds = %.lr.ph44.preheader
  %n.vec97 = and i64 %39, -4
  br label %vector.body99

vector.body99:                                    ; preds = %vector.body99, %vector.ph95
  %index100 = phi i64 [ 0, %vector.ph95 ], [ %index.next105, %vector.body99 ]
  %vec.phi101 = phi <2 x i64> [ zeroinitializer, %vector.ph95 ], [ %42, %vector.body99 ]
  %vec.phi102 = phi <2 x i64> [ zeroinitializer, %vector.ph95 ], [ %43, %vector.body99 ]
  %40 = getelementptr inbounds i64, ptr %30, i64 %index100
  %41 = getelementptr inbounds i8, ptr %40, i64 16
  %wide.load103 = load <2 x i64>, ptr %40, align 16, !tbaa !8
  %wide.load104 = load <2 x i64>, ptr %41, align 16, !tbaa !8
  %42 = add <2 x i64> %wide.load103, %vec.phi101
  %43 = add <2 x i64> %wide.load104, %vec.phi102
  %index.next105 = add nuw i64 %index100, 4
  %44 = icmp eq i64 %index.next105, %n.vec97
  br i1 %44, label %middle.block92, label %vector.body99, !llvm.loop !13

middle.block92:                                   ; preds = %vector.body99
  %bin.rdx106 = add <2 x i64> %43, %42
  %45 = call i64 @llvm.vector.reduce.add.v2i64(<2 x i64> %bin.rdx106)
  %cmp.n107 = icmp eq i64 %39, %n.vec97
  br i1 %cmp.n107, label %._crit_edge45, label %.lr.ph44.preheader110

.lr.ph44.preheader110:                            ; preds = %middle.block92, %.lr.ph44.preheader
  %.142.ph = phi i64 [ 0, %.lr.ph44.preheader ], [ %n.vec97, %middle.block92 ]
  %.03241.ph = phi i64 [ 0, %.lr.ph44.preheader ], [ %45, %middle.block92 ]
  br label %.lr.ph44

.lr.ph44:                                         ; preds = %.lr.ph44.preheader110, %.lr.ph44
  %.142 = phi i64 [ %49, %.lr.ph44 ], [ %.142.ph, %.lr.ph44.preheader110 ]
  %.03241 = phi i64 [ %48, %.lr.ph44 ], [ %.03241.ph, %.lr.ph44.preheader110 ]
  %46 = getelementptr inbounds i64, ptr %30, i64 %.142
  %47 = load i64, ptr %46, align 8, !tbaa !8
  %48 = add nsw i64 %47, %.03241
  %49 = add nuw i64 %.142, 1
  %exitcond.not = icmp eq i64 %.142, %38
  br i1 %exitcond.not, label %._crit_edge45, label %.lr.ph44, !llvm.loop !16

._crit_edge45:                                    ; preds = %.lr.ph44, %middle.block92, %._crit_edge
  %.032.lcssa = phi i64 [ 0, %._crit_edge ], [ %45, %middle.block92 ], [ %48, %.lr.ph44 ]
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %6) #9
  call void @_ZNSt6vectorIxSaIxEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #9
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %7) #9
  call void @_ZNSt8multisetIxSt4lessIxESaIxEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %7) #9
  %50 = load i64, ptr %2, align 8, !tbaa !8
  %.not3446 = icmp slt i64 %50, 0
  br i1 %.not3446, label %._crit_edge50, label %.lr.ph49

.lr.ph49:                                         ; preds = %._crit_edge45, %53
  %.247 = phi i64 [ %54, %53 ], [ 0, %._crit_edge45 ]
  %51 = getelementptr inbounds i64, ptr %30, i64 %.247
  %52 = invoke ptr @_ZNSt8multisetIxSt4lessIxESaIxEE6insertERKx(ptr noundef nonnull align 8 dereferenceable(48) %7, ptr noundef nonnull align 8 dereferenceable(8) %51)
          to label %53 unwind label %56

53:                                               ; preds = %.lr.ph49
  %54 = add nuw nsw i64 %.247, 1
  %55 = load i64, ptr %2, align 8, !tbaa !8
  %.not34.not = icmp slt i64 %.247, %55
  br i1 %.not34.not, label %.lr.ph49, label %._crit_edge50, !llvm.loop !17

56:                                               ; preds = %.lr.ph49
  %57 = landingpad { ptr, i32 }
          cleanup
  br label %104

._crit_edge50:                                    ; preds = %53, %._crit_edge45
  store i64 %.032.lcssa, ptr %5, align 8, !tbaa !8
  %58 = load i64, ptr %3, align 8, !tbaa !8
  %.not3563 = icmp slt i64 %58, 1
  br i1 %.not3563, label %._crit_edge67, label %.lr.ph66.preheader

.lr.ph66.preheader:                               ; preds = %._crit_edge50
  %59 = insertelement <2 x i64> <i64 poison, i64 0>, i64 %.032.lcssa, i64 0
  br label %.lr.ph66

.lr.ph66:                                         ; preds = %.lr.ph66.preheader, %._crit_edge61
  %.364 = phi i64 [ %94, %._crit_edge61 ], [ 1, %.lr.ph66.preheader ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #9
  store i64 0, ptr %8, align 8, !tbaa !8
  %60 = shl nuw nsw i64 %.364, 1
  %61 = load i64, ptr %2, align 8, !tbaa !8
  %62 = sub nsw i64 %61, %60
  %.not3651 = icmp slt i64 %62, 0
  br i1 %.not3651, label %._crit_edge55, label %.lr.ph54

.lr.ph54:                                         ; preds = %.lr.ph66, %.lr.ph54
  %.02852 = phi i64 [ %65, %.lr.ph54 ], [ 0, %.lr.ph66 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #9
  %63 = getelementptr inbounds i64, ptr %30, i64 %.02852
  %64 = load i64, ptr %63, align 8, !tbaa !8
  %65 = add nuw nsw i64 %.02852, 1
  %66 = getelementptr inbounds i64, ptr %30, i64 %65
  %67 = load i64, ptr %66, align 8, !tbaa !8
  %68 = add nsw i64 %67, %64
  store i64 %68, ptr %9, align 8, !tbaa !8
  %69 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %9)
  %70 = load i64, ptr %69, align 8, !tbaa !8
  store i64 %70, ptr %8, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #9
  %71 = load i64, ptr %2, align 8, !tbaa !8
  %72 = sub nsw i64 %71, %60
  %.not36.not = icmp slt i64 %.02852, %72
  br i1 %.not36.not, label %.lr.ph54, label %._crit_edge55, !llvm.loop !18

._crit_edge55:                                    ; preds = %.lr.ph54, %.lr.ph66
  %73 = phi i64 [ 0, %.lr.ph66 ], [ %70, %.lr.ph54 ]
  %.lcssa38 = phi i64 [ %61, %.lr.ph66 ], [ %71, %.lr.ph54 ]
  %.lcssa = phi i64 [ %62, %.lr.ph66 ], [ %72, %.lr.ph54 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #9
  %74 = icmp sgt i64 %.lcssa38, %.lcssa
  br i1 %74, label %.lr.ph60.preheader, label %._crit_edge61

.lr.ph60.preheader:                               ; preds = %._crit_edge55
  %75 = sub i64 %.lcssa38, %.lcssa
  %min.iters.check = icmp ult i64 %75, 4
  br i1 %min.iters.check, label %.lr.ph60.preheader109, label %vector.ph

vector.ph:                                        ; preds = %.lr.ph60.preheader
  %n.vec = and i64 %75, -4
  %ind.end = sub i64 %.lcssa38, %n.vec
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %vec.phi = phi <2 x i64> [ %59, %vector.ph ], [ %79, %vector.body ]
  %vec.phi89 = phi <2 x i64> [ zeroinitializer, %vector.ph ], [ %80, %vector.body ]
  %offset.idx = sub i64 %.lcssa38, %index
  %76 = getelementptr inbounds i64, ptr %30, i64 %offset.idx
  %77 = getelementptr inbounds i8, ptr %76, i64 -8
  %78 = getelementptr inbounds i8, ptr %76, i64 -24
  %wide.load = load <2 x i64>, ptr %77, align 8, !tbaa !8
  %reverse = shufflevector <2 x i64> %wide.load, <2 x i64> poison, <2 x i32> <i32 1, i32 0>
  %wide.load90 = load <2 x i64>, ptr %78, align 8, !tbaa !8
  %reverse91 = shufflevector <2 x i64> %wide.load90, <2 x i64> poison, <2 x i32> <i32 1, i32 0>
  %79 = sub <2 x i64> %vec.phi, %reverse
  %80 = sub <2 x i64> %vec.phi89, %reverse91
  %index.next = add nuw i64 %index, 4
  %81 = icmp eq i64 %index.next, %n.vec
  br i1 %81, label %middle.block, label %vector.body, !llvm.loop !19

middle.block:                                     ; preds = %vector.body
  %bin.rdx = add <2 x i64> %80, %79
  %82 = call i64 @llvm.vector.reduce.add.v2i64(<2 x i64> %bin.rdx)
  %cmp.n = icmp eq i64 %75, %n.vec
  br i1 %cmp.n, label %._crit_edge61, label %.lr.ph60.preheader109

.lr.ph60.preheader109:                            ; preds = %middle.block, %.lr.ph60.preheader
  %.12958.ph = phi i64 [ %.lcssa38, %.lr.ph60.preheader ], [ %ind.end, %middle.block ]
  %.ph = phi i64 [ %.032.lcssa, %.lr.ph60.preheader ], [ %82, %middle.block ]
  br label %.lr.ph60

.lr.ph60:                                         ; preds = %.lr.ph60.preheader109, %.lr.ph60
  %.12958 = phi i64 [ %87, %.lr.ph60 ], [ %.12958.ph, %.lr.ph60.preheader109 ]
  %83 = phi i64 [ %86, %.lr.ph60 ], [ %.ph, %.lr.ph60.preheader109 ]
  %84 = getelementptr inbounds i64, ptr %30, i64 %.12958
  %85 = load i64, ptr %84, align 8, !tbaa !8
  %86 = sub nsw i64 %83, %85
  %87 = add nsw i64 %.12958, -1
  %88 = icmp sgt i64 %87, %.lcssa
  br i1 %88, label %.lr.ph60, label %._crit_edge61, !llvm.loop !20

._crit_edge61:                                    ; preds = %.lr.ph60, %middle.block, %._crit_edge55
  %89 = phi i64 [ %.032.lcssa, %._crit_edge55 ], [ %82, %middle.block ], [ %86, %.lr.ph60 ]
  %90 = mul nsw i64 %73, %.364
  %91 = add nsw i64 %89, %90
  store i64 %91, ptr %10, align 8, !tbaa !8
  %92 = 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) %10)
  %93 = load i64, ptr %92, align 8, !tbaa !8
  store i64 %93, ptr %5, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #9
  %94 = add nuw i64 %.364, 1
  %exitcond76.not = icmp eq i64 %.364, %58
  br i1 %exitcond76.not, label %._crit_edge67, label %.lr.ph66, !llvm.loop !21

._crit_edge67:                                    ; preds = %._crit_edge61, %._crit_edge50
  %95 = phi i64 [ %.032.lcssa, %._crit_edge50 ], [ %93, %._crit_edge61 ]
  %96 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %95)
          to label %97 unwind label %102

97:                                               ; preds = %._crit_edge67
  %98 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %96, i8 noundef signext 10)
          to label %99 unwind label %102

99:                                               ; preds = %97
  call void @_ZNSt8multisetIxSt4lessIxESaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %7) #9
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %7) #9
  call void @_ZNSt6vectorIxSaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #9
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #9
  call void @llvm.stackrestore.p0(ptr %29)
  %100 = load i64, ptr %4, align 8, !tbaa !8
  %101 = add nsw i64 %100, -1
  store i64 %101, ptr %4, align 8, !tbaa !8
  %.not = icmp eq i64 %100, 0
  br i1 %.not, label %._crit_edge71, label %.lr.ph70, !llvm.loop !22

102:                                              ; preds = %97, %._crit_edge67
  %103 = landingpad { ptr, i32 }
          cleanup
  br label %104

104:                                              ; preds = %102, %56
  %.pn = phi { ptr, i32 } [ %57, %56 ], [ %103, %102 ]
  call void @_ZNSt8multisetIxSt4lessIxESaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %7) #9
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %7) #9
  call void @_ZNSt6vectorIxSaIxEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #9
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #9
  resume { ptr, i32 } %.pn

._crit_edge71:                                    ; preds = %99, %0
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #9
  ret i32 0
}

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

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

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

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #5

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

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

declare i32 @__gxx_personality_v0(...)

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

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

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

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn
declare void @llvm.stackrestore.p0(ptr) #5

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

attributes #0 = { 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 #1 = { 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 #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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress nocallback nofree nosync nounwind willreturn }
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 = { 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 #8 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #9 = { 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, !15}
!14 = !{!"llvm.loop.isvectorized", i32 1}
!15 = !{!"llvm.loop.unroll.runtime.disable"}
!16 = distinct !{!16, !12, !15, !14}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !12}
!19 = distinct !{!19, !12, !14, !15}
!20 = distinct !{!20, !12, !15, !14}
!21 = distinct !{!21, !12}
!22 = distinct !{!22, !12}


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