; LLVM IR from tangjz/acm-icpc :: spoj/DIVCNT1.ll (Z5solvey)

; 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::stack" = type { %"class.std::deque" }
%"class.std::deque" = type { %"class.std::_Deque_base" }
%"class.std::_Deque_base" = type { %"struct.std::_Deque_base<std::pair<unsigned int, unsigned int>, std::allocator<std::pair<unsigned int, unsigned int>>>::_Deque_impl" }
%"struct.std::_Deque_base<std::pair<unsigned int, unsigned int>, std::allocator<std::pair<unsigned int, unsigned int>>>::_Deque_impl" = type { %"struct.std::_Deque_base<std::pair<unsigned int, unsigned int>, std::allocator<std::pair<unsigned int, unsigned int>>>::_Deque_impl_data" }
%"struct.std::_Deque_base<std::pair<unsigned int, unsigned int>, std::allocator<std::pair<unsigned int, unsigned int>>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator", %"struct.std::_Deque_iterator" }
%"struct.std::_Deque_iterator" = type { ptr, ptr, ptr, ptr }
%"struct.std::pair" = type { i32, i32 }
%"struct.std::pair.0" = type { i32, i32 }

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z5iSqrty(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 speculatable willreturn memory(none)
declare double @llvm.floor.f64(double) #2

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

; Function Attrs: mustprogress uwtable
define dso_local noundef { i64, i64 } @_Z5solvey(i64 noundef %0) #3 personality ptr @__gxx_personality_v0 {
  %2 = alloca i128, align 16
  %3 = alloca i64, align 8
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i64, align 8
  %7 = alloca i32, align 4
  %8 = alloca %"class.std::stack", align 8
  %9 = alloca %"struct.std::pair", align 4
  %10 = alloca %"struct.std::pair.0", align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  %15 = alloca %"struct.std::pair", align 4
  %16 = alloca %"struct.std::pair.0", align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i128, align 16
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  %24 = alloca i32, align 4
  %25 = alloca i32, align 4
  %26 = alloca i32, align 4
  %27 = alloca %"struct.std::pair", align 4
  %28 = alloca i64, align 8
  store i64 %0, ptr %3, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  %29 = load i64, ptr %3, align 8, !tbaa !5
  %30 = call noundef i32 @_Z5iSqrty(i64 noundef %29)
  store i32 %30, ptr %4, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  %31 = load i64, ptr %3, align 8, !tbaa !5
  %32 = uitofp i64 %31 to double
  %33 = call double @pow(double noundef %32, double noundef 3.500000e-01) #6
  %34 = call double @llvm.floor.f64(double %33)
  %35 = fptoui double %34 to i32
  store i32 %35, ptr %5, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #6
  %36 = load i64, ptr %3, align 8, !tbaa !5
  %37 = load i32, ptr %4, align 4, !tbaa !9
  %38 = zext i32 %37 to i64
  %39 = udiv i64 %36, %38
  store i64 %39, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  %40 = load i64, ptr %3, align 8, !tbaa !5
  %41 = load i64, ptr %6, align 8, !tbaa !5
  %42 = udiv i64 %40, %41
  %43 = add i64 %42, 1
  %44 = trunc i64 %43 to i32
  store i32 %44, ptr %7, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 80, ptr %8) #6
  call void @_ZNSt5stackISt4pairIjjESt5dequeIS1_SaIS1_EEEC2IS4_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %8)
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  store i32 1, ptr %11, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  store i32 0, ptr %12, align 4, !tbaa !9
  %45 = invoke i64 @_ZSt9make_pairIiiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS1_INS2_IT0_E4typeEE6__typeEEOS3_OS8_(ptr noundef nonnull align 4 dereferenceable(4) %11, ptr noundef nonnull align 4 dereferenceable(4) %12)
          to label %46 unwind label %101

46:                                               ; preds = %1
  store i64 %45, ptr %10, align 4
  invoke void @_ZNSt4pairIjjEC2IiiTnNSt9enable_ifIXaaclsr6_PCCFPIT_T0_EE22_MoveConstructiblePairIS3_S4_EEclsr6_PCCFPIS3_S4_EE30_ImplicitlyMoveConvertiblePairIS3_S4_EEEbE4typeELb1EEEOS_IS3_S4_E(ptr noundef nonnull align 4 dereferenceable(8) %9, ptr noundef nonnull align 4 dereferenceable(8) %10)
          to label %47 unwind label %101

47:                                               ; preds = %46
  invoke void @_ZNSt5stackISt4pairIjjESt5dequeIS1_SaIS1_EEE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(80) %8, ptr noundef nonnull align 4 dereferenceable(8) %9)
          to label %48 unwind label %101

48:                                               ; preds = %47
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #6
  store i32 1, ptr %17, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #6
  store i32 1, ptr %18, align 4, !tbaa !9
  %49 = invoke i64 @_ZSt9make_pairIiiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS1_INS2_IT0_E4typeEE6__typeEEOS3_OS8_(ptr noundef nonnull align 4 dereferenceable(4) %17, ptr noundef nonnull align 4 dereferenceable(4) %18)
          to label %50 unwind label %105

50:                                               ; preds = %48
  store i64 %49, ptr %16, align 4
  invoke void @_ZNSt4pairIjjEC2IiiTnNSt9enable_ifIXaaclsr6_PCCFPIT_T0_EE22_MoveConstructiblePairIS3_S4_EEclsr6_PCCFPIS3_S4_EE30_ImplicitlyMoveConvertiblePairIS3_S4_EEEbE4typeELb1EEEOS_IS3_S4_E(ptr noundef nonnull align 4 dereferenceable(8) %15, ptr noundef nonnull align 4 dereferenceable(8) %16)
          to label %51 unwind label %105

51:                                               ; preds = %50
  invoke void @_ZNSt5stackISt4pairIjjESt5dequeIS1_SaIS1_EEE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(80) %8, ptr noundef nonnull align 4 dereferenceable(8) %15)
          to label %52 unwind label %105

52:                                               ; preds = %51
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr %19) #6
  store i128 0, ptr %19, align 16, !tbaa !11
  br label %53

53:                                               ; preds = %218, %52
  br label %54

54:                                               ; preds = %53
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #6
  %55 = invoke noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt5stackISt4pairIjjESt5dequeIS1_SaIS1_EEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %8)
          to label %56 unwind label %109

56:                                               ; preds = %54
  %57 = getelementptr inbounds %"struct.std::pair", ptr %55, i32 0, i32 0
  %58 = load i32, ptr %57, align 4, !tbaa !13
  store i32 %58, ptr %20, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #6
  %59 = invoke noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt5stackISt4pairIjjESt5dequeIS1_SaIS1_EEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %8)
          to label %60 unwind label %113

60:                                               ; preds = %56
  %61 = getelementptr inbounds %"struct.std::pair", ptr %59, i32 0, i32 1
  %62 = load i32, ptr %61, align 4, !tbaa !15
  store i32 %62, ptr %21, align 4, !tbaa !9
  invoke void @_ZNSt5stackISt4pairIjjESt5dequeIS1_SaIS1_EEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %8)
          to label %63 unwind label %113

63:                                               ; preds = %60
  br label %64

64:                                               ; preds = %93, %63
  %65 = load i64, ptr %6, align 8, !tbaa !5
  %66 = load i32, ptr %20, align 4, !tbaa !9
  %67 = zext i32 %66 to i64
  %68 = add i64 %65, %67
  %69 = load i32, ptr %7, align 4, !tbaa !9
  %70 = load i32, ptr %21, align 4, !tbaa !9
  %71 = sub i32 %69, %70
  %72 = zext i32 %71 to i64
  %73 = mul i64 %68, %72
  %74 = load i64, ptr %3, align 8, !tbaa !5
  %75 = icmp ugt i64 %73, %74
  br i1 %75, label %76, label %117

76:                                               ; preds = %64
  %77 = load i64, ptr %6, align 8, !tbaa !5
  %78 = load i32, ptr %21, align 4, !tbaa !9
  %79 = zext i32 %78 to i64
  %80 = mul i64 %77, %79
  %81 = load i32, ptr %21, align 4, !tbaa !9
  %82 = zext i32 %81 to i64
  %83 = add i64 %82, 1
  %84 = load i32, ptr %20, align 4, !tbaa !9
  %85 = sub i32 %84, 1
  %86 = zext i32 %85 to i64
  %87 = mul i64 %83, %86
  %88 = lshr i64 %87, 1
  %89 = add i64 %80, %88
  %90 = zext i64 %89 to i128
  %91 = load i128, ptr %19, align 16, !tbaa !11
  %92 = add i128 %91, %90
  store i128 %92, ptr %19, align 16, !tbaa !11
  br label %93

93:                                               ; preds = %76
  %94 = load i32, ptr %20, align 4, !tbaa !9
  %95 = zext i32 %94 to i64
  %96 = load i64, ptr %6, align 8, !tbaa !5
  %97 = add i64 %96, %95
  store i64 %97, ptr %6, align 8, !tbaa !5
  %98 = load i32, ptr %21, align 4, !tbaa !9
  %99 = load i32, ptr %7, align 4, !tbaa !9
  %100 = sub i32 %99, %98
  store i32 %100, ptr %7, align 4, !tbaa !9
  br label %64, !llvm.loop !16

101:                                              ; preds = %47, %46, %1
  %102 = landingpad { ptr, i32 }
          cleanup
  %103 = extractvalue { ptr, i32 } %102, 0
  store ptr %103, ptr %13, align 8
  %104 = extractvalue { ptr, i32 } %102, 1
  store i32 %104, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  br label %246

105:                                              ; preds = %51, %50, %48
  %106 = landingpad { ptr, i32 }
          cleanup
  %107 = extractvalue { ptr, i32 } %106, 0
  store ptr %107, ptr %13, align 8
  %108 = extractvalue { ptr, i32 } %106, 1
  store i32 %108, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  br label %246

109:                                              ; preds = %54
  %110 = landingpad { ptr, i32 }
          cleanup
  %111 = extractvalue { ptr, i32 } %110, 0
  store ptr %111, ptr %13, align 8
  %112 = extractvalue { ptr, i32 } %110, 1
  store i32 %112, ptr %14, align 4
  br label %221

113:                                              ; preds = %60, %56
  %114 = landingpad { ptr, i32 }
          cleanup
  %115 = extractvalue { ptr, i32 } %114, 0
  store ptr %115, ptr %13, align 8
  %116 = extractvalue { ptr, i32 } %114, 1
  store i32 %116, ptr %14, align 4
  br label %220

117:                                              ; preds = %64
  %118 = load i32, ptr %7, align 4, !tbaa !9
  %119 = load i32, ptr %5, align 4, !tbaa !9
  %120 = icmp ule i32 %118, %119
  br i1 %120, label %121, label %122

121:                                              ; preds = %117
  store i32 3, ptr %22, align 4
  br label %216

122:                                              ; preds = %117
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #6
  %123 = load i32, ptr %20, align 4, !tbaa !9
  store i32 %123, ptr %23, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #6
  %124 = load i32, ptr %21, align 4, !tbaa !9
  store i32 %124, ptr %24, align 4, !tbaa !9
  br label %125

125:                                              ; preds = %154, %122
  br label %126

126:                                              ; preds = %125
  %127 = invoke noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt5stackISt4pairIjjESt5dequeIS1_SaIS1_EEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %8)
          to label %128 unwind label %147

128:                                              ; preds = %126
  %129 = getelementptr inbounds %"struct.std::pair", ptr %127, i32 0, i32 0
  %130 = load i32, ptr %129, align 4, !tbaa !13
  store i32 %130, ptr %20, align 4, !tbaa !9
  %131 = invoke noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt5stackISt4pairIjjESt5dequeIS1_SaIS1_EEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %8)
          to label %132 unwind label %147

132:                                              ; preds = %128
  %133 = getelementptr inbounds %"struct.std::pair", ptr %131, i32 0, i32 1
  %134 = load i32, ptr %133, align 4, !tbaa !15
  store i32 %134, ptr %21, align 4, !tbaa !9
  %135 = load i64, ptr %6, align 8, !tbaa !5
  %136 = load i32, ptr %20, align 4, !tbaa !9
  %137 = zext i32 %136 to i64
  %138 = add i64 %135, %137
  %139 = load i32, ptr %7, align 4, !tbaa !9
  %140 = load i32, ptr %21, align 4, !tbaa !9
  %141 = sub i32 %139, %140
  %142 = zext i32 %141 to i64
  %143 = mul i64 %138, %142
  %144 = load i64, ptr %3, align 8, !tbaa !5
  %145 = icmp ugt i64 %143, %144
  br i1 %145, label %146, label %151

146:                                              ; preds = %132
  br label %155

147:                                              ; preds = %151, %128, %126
  %148 = landingpad { ptr, i32 }
          cleanup
  %149 = extractvalue { ptr, i32 } %148, 0
  store ptr %149, ptr %13, align 8
  %150 = extractvalue { ptr, i32 } %148, 1
  store i32 %150, ptr %14, align 4
  br label %219

151:                                              ; preds = %132
  %152 = load i32, ptr %20, align 4, !tbaa !9
  store i32 %152, ptr %23, align 4, !tbaa !9
  %153 = load i32, ptr %21, align 4, !tbaa !9
  store i32 %153, ptr %24, align 4, !tbaa !9
  invoke void @_ZNSt5stackISt4pairIjjESt5dequeIS1_SaIS1_EEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %8)
          to label %154 unwind label %147

154:                                              ; preds = %151
  br label %125, !llvm.loop !18

155:                                              ; preds = %146
  br label %156

156:                                              ; preds = %214, %155
  br label %157

157:                                              ; preds = %156
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #6
  %158 = load i32, ptr %20, align 4, !tbaa !9
  %159 = load i32, ptr %23, align 4, !tbaa !9
  %160 = add i32 %158, %159
  store i32 %160, ptr %25, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #6
  %161 = load i32, ptr %21, align 4, !tbaa !9
  %162 = load i32, ptr %24, align 4, !tbaa !9
  %163 = add i32 %161, %162
  store i32 %163, ptr %26, align 4, !tbaa !9
  %164 = load i64, ptr %6, align 8, !tbaa !5
  %165 = load i32, ptr %25, align 4, !tbaa !9
  %166 = zext i32 %165 to i64
  %167 = add i64 %164, %166
  %168 = load i32, ptr %7, align 4, !tbaa !9
  %169 = load i32, ptr %26, align 4, !tbaa !9
  %170 = sub i32 %168, %169
  %171 = zext i32 %170 to i64
  %172 = mul i64 %167, %171
  %173 = load i64, ptr %3, align 8, !tbaa !5
  %174 = icmp ugt i64 %172, %173
  br i1 %174, label %175, label %185

175:                                              ; preds = %157
  %176 = load i32, ptr %25, align 4, !tbaa !9
  store i32 %176, ptr %20, align 4, !tbaa !9
  %177 = load i32, ptr %26, align 4, !tbaa !9
  store i32 %177, ptr %21, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #6
  %178 = invoke i64 @_ZSt9make_pairIRjS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %20, ptr noundef nonnull align 4 dereferenceable(4) %21)
          to label %179 unwind label %181

179:                                              ; preds = %175
  store i64 %178, ptr %27, align 4
  invoke void @_ZNSt5stackISt4pairIjjESt5dequeIS1_SaIS1_EEE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(80) %8, ptr noundef nonnull align 4 dereferenceable(8) %27)
          to label %180 unwind label %181

180:                                              ; preds = %179
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #6
  br label %211

181:                                              ; preds = %179, %175
  %182 = landingpad { ptr, i32 }
          cleanup
  %183 = extractvalue { ptr, i32 } %182, 0
  store ptr %183, ptr %13, align 8
  %184 = extractvalue { ptr, i32 } %182, 1
  store i32 %184, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #6
  br label %219

185:                                              ; preds = %157
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #6
  %186 = load i64, ptr %6, align 8, !tbaa !5
  %187 = load i32, ptr %25, align 4, !tbaa !9
  %188 = zext i32 %187 to i64
  %189 = add i64 %186, %188
  store i64 %189, ptr %28, align 8, !tbaa !5
  %190 = load i64, ptr %28, align 8, !tbaa !5
  %191 = zext i64 %190 to i128
  %192 = load i64, ptr %28, align 8, !tbaa !5
  %193 = load i32, ptr %21, align 4, !tbaa !9
  %194 = zext i32 %193 to i64
  %195 = mul i64 %192, %194
  %196 = zext i64 %195 to i128
  %197 = mul i128 %191, %196
  %198 = load i64, ptr %3, align 8, !tbaa !5
  %199 = zext i64 %198 to i128
  %200 = load i32, ptr %20, align 4, !tbaa !9
  %201 = zext i32 %200 to i128
  %202 = mul i128 %199, %201
  %203 = icmp uge i128 %197, %202
  br i1 %203, label %204, label %205

204:                                              ; preds = %185
  store i32 10, ptr %22, align 4
  br label %208

205:                                              ; preds = %185
  %206 = load i32, ptr %25, align 4, !tbaa !9
  store i32 %206, ptr %23, align 4, !tbaa !9
  %207 = load i32, ptr %26, align 4, !tbaa !9
  store i32 %207, ptr %24, align 4, !tbaa !9
  store i32 0, ptr %22, align 4
  br label %208

208:                                              ; preds = %205, %204
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #6
  %209 = load i32, ptr %22, align 4
  switch i32 %209, label %212 [
    i32 0, label %210
  ]

210:                                              ; preds = %208
  br label %211

211:                                              ; preds = %210, %180
  store i32 0, ptr %22, align 4
  br label %212

212:                                              ; preds = %211, %208
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #6
  %213 = load i32, ptr %22, align 4
  switch i32 %213, label %252 [
    i32 0, label %214
    i32 10, label %215
  ]

214:                                              ; preds = %212
  br label %156, !llvm.loop !19

215:                                              ; preds = %212
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #6
  store i32 0, ptr %22, align 4
  br label %216

216:                                              ; preds = %215, %121
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #6
  %217 = load i32, ptr %22, align 4
  switch i32 %217, label %252 [
    i32 0, label %218
    i32 3, label %222
  ]

218:                                              ; preds = %216
  br label %53, !llvm.loop !20

219:                                              ; preds = %181, %147
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #6
  br label %220

220:                                              ; preds = %219, %113
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #6
  br label %221

221:                                              ; preds = %220, %109
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %19) #6
  br label %246

222:                                              ; preds = %216
  br label %223

223:                                              ; preds = %227, %222
  %224 = load i32, ptr %7, align 4, !tbaa !9
  %225 = add i32 %224, -1
  store i32 %225, ptr %7, align 4, !tbaa !9
  %226 = icmp ne i32 %225, 0
  br i1 %226, label %227, label %235

227:                                              ; preds = %223
  %228 = load i64, ptr %3, align 8, !tbaa !5
  %229 = load i32, ptr %7, align 4, !tbaa !9
  %230 = zext i32 %229 to i64
  %231 = udiv i64 %228, %230
  %232 = zext i64 %231 to i128
  %233 = load i128, ptr %19, align 16, !tbaa !11
  %234 = add i128 %233, %232
  store i128 %234, ptr %19, align 16, !tbaa !11
  br label %223, !llvm.loop !21

235:                                              ; preds = %223
  %236 = load i128, ptr %19, align 16, !tbaa !11
  %237 = shl i128 %236, 1
  %238 = load i32, ptr %4, align 4, !tbaa !9
  %239 = zext i32 %238 to i64
  %240 = load i32, ptr %4, align 4, !tbaa !9
  %241 = zext i32 %240 to i64
  %242 = mul i64 %239, %241
  %243 = zext i64 %242 to i128
  %244 = sub i128 %237, %243
  store i128 %244, ptr %2, align 16
  store i32 1, ptr %22, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %19) #6
  call void @_ZNSt5stackISt4pairIjjESt5dequeIS1_SaIS1_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %8) #6
  call void @llvm.lifetime.end.p0(i64 80, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  %245 = load { i64, i64 }, ptr %2, align 16
  ret { i64, i64 } %245

246:                                              ; preds = %221, %105, %101
  call void @_ZNSt5stackISt4pairIjjESt5dequeIS1_SaIS1_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %8) #6
  call void @llvm.lifetime.end.p0(i64 80, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  br label %247

247:                                              ; preds = %246
  %248 = load ptr, ptr %13, align 8
  %249 = load i32, ptr %14, align 4
  %250 = insertvalue { ptr, i32 } poison, ptr %248, 0
  %251 = insertvalue { ptr, i32 } %250, i32 %249, 1
  resume { ptr, i32 } %251

252:                                              ; preds = %216, %212
  unreachable
}

; Function Attrs: nounwind
declare double @pow(double noundef, double noundef) #4

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt5stackISt4pairIjjESt5dequeIS1_SaIS1_EEEC2IS4_vEEv(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt5stackISt4pairIjjESt5dequeIS1_SaIS1_EEE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(80), ptr noundef nonnull align 4 dereferenceable(8)) #3 align 2

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

declare i32 @__gxx_personality_v0(...)

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

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZNSt5stackISt4pairIjjESt5dequeIS1_SaIS1_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #5 align 2

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

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

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


; 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::stack" = type { %"class.std::deque" }
%"class.std::deque" = type { %"class.std::_Deque_base" }
%"class.std::_Deque_base" = type { %"struct.std::_Deque_base<std::pair<unsigned int, unsigned int>, std::allocator<std::pair<unsigned int, unsigned int>>>::_Deque_impl" }
%"struct.std::_Deque_base<std::pair<unsigned int, unsigned int>, std::allocator<std::pair<unsigned int, unsigned int>>>::_Deque_impl" = type { %"struct.std::_Deque_base<std::pair<unsigned int, unsigned int>, std::allocator<std::pair<unsigned int, unsigned int>>>::_Deque_impl_data" }
%"struct.std::_Deque_base<std::pair<unsigned int, unsigned int>, std::allocator<std::pair<unsigned int, unsigned int>>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator", %"struct.std::_Deque_iterator" }
%"struct.std::_Deque_iterator" = type { ptr, ptr, ptr, ptr }
%"struct.std::pair" = type { i32, i32 }
%"struct.std::pair.0" = type { i32, i32 }

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z5iSqrty(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 speculatable willreturn memory(none)
declare double @llvm.floor.f64(double) #2

; 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 uwtable
define dso_local noundef { i64, i64 } @_Z5solvey(i64 noundef %0) local_unnamed_addr #3 personality ptr @__gxx_personality_v0 {
  %2 = alloca %"class.std::stack", align 8
  %3 = alloca %"struct.std::pair", align 4
  %4 = alloca %"struct.std::pair.0", align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca %"struct.std::pair", align 4
  %8 = alloca %"struct.std::pair.0", align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca %"struct.std::pair", align 8
  %14 = tail call noundef i32 @_Z5iSqrty(i64 noundef %0)
  %15 = uitofp i64 %0 to double
  %16 = tail call double @pow(double noundef %15, double noundef 3.500000e-01) #6
  %17 = tail call double @llvm.floor.f64(double %16)
  %18 = fptoui double %17 to i32
  %19 = zext i32 %14 to i64
  %20 = udiv i64 %0, %19
  %21 = udiv i64 %0, %20
  %22 = trunc i64 %21 to i32
  %23 = add i32 %22, 1
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %2) #6
  call void @_ZNSt5stackISt4pairIjjESt5dequeIS1_SaIS1_EEEC2IS4_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %2)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #6
  store i32 1, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #6
  store i32 0, ptr %6, align 4, !tbaa !5
  %24 = invoke i64 @_ZSt9make_pairIiiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS1_INS2_IT0_E4typeEE6__typeEEOS3_OS8_(ptr noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull align 4 dereferenceable(4) %6)
          to label %25 unwind label %62

25:                                               ; preds = %1
  store i64 %24, ptr %4, align 8
  call void @_ZNSt4pairIjjEC2IiiTnNSt9enable_ifIXaaclsr6_PCCFPIT_T0_EE22_MoveConstructiblePairIS3_S4_EEclsr6_PCCFPIS3_S4_EE30_ImplicitlyMoveConvertiblePairIS3_S4_EEEbE4typeELb1EEEOS_IS3_S4_E(ptr noundef nonnull align 4 dereferenceable(8) %3, ptr noundef nonnull align 4 dereferenceable(8) %4)
  invoke void @_ZNSt5stackISt4pairIjjESt5dequeIS1_SaIS1_EEE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(80) %2, ptr noundef nonnull align 4 dereferenceable(8) %3)
          to label %26 unwind label %62

26:                                               ; preds = %25
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #6
  store i32 1, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %10) #6
  store i32 1, ptr %10, align 4, !tbaa !5
  %27 = invoke i64 @_ZSt9make_pairIiiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS1_INS2_IT0_E4typeEE6__typeEEOS3_OS8_(ptr noundef nonnull align 4 dereferenceable(4) %9, ptr noundef nonnull align 4 dereferenceable(4) %10)
          to label %28 unwind label %64

28:                                               ; preds = %26
  store i64 %27, ptr %8, align 8
  call void @_ZNSt4pairIjjEC2IiiTnNSt9enable_ifIXaaclsr6_PCCFPIT_T0_EE22_MoveConstructiblePairIS3_S4_EEclsr6_PCCFPIS3_S4_EE30_ImplicitlyMoveConvertiblePairIS3_S4_EEEbE4typeELb1EEEOS_IS3_S4_E(ptr noundef nonnull align 4 dereferenceable(8) %7, ptr noundef nonnull align 4 dereferenceable(8) %8)
  invoke void @_ZNSt5stackISt4pairIjjESt5dequeIS1_SaIS1_EEE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(80) %2, ptr noundef nonnull align 4 dereferenceable(8) %7)
          to label %.split unwind label %64

.split:                                           ; preds = %28
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #6
  %29 = zext i64 %0 to i128
  br label %30

30:                                               ; preds = %116, %.split
  %.059 = phi i128 [ 0, %.split ], [ %.160.lcssa, %116 ]
  %.045 = phi i32 [ %23, %.split ], [ %.146.lcssa, %116 ]
  %.0 = phi i64 [ %20, %.split ], [ %.1.lcssa, %116 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %11) #6
  %31 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt5stackISt4pairIjjESt5dequeIS1_SaIS1_EEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %2)
  %32 = load i32, ptr %31, align 4, !tbaa !9
  store i32 %32, ptr %11, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %12) #6
  %33 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt5stackISt4pairIjjESt5dequeIS1_SaIS1_EEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %2)
  %34 = getelementptr inbounds i8, ptr %33, i64 4
  %35 = load i32, ptr %34, align 4, !tbaa !11
  store i32 %35, ptr %12, align 4, !tbaa !5
  call void @_ZNSt5stackISt4pairIjjESt5dequeIS1_SaIS1_EEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %2)
  %36 = load i32, ptr %11, align 4, !tbaa !5
  %37 = zext i32 %36 to i64
  %38 = load i32, ptr %12, align 4, !tbaa !5
  %39 = add i64 %.0, %37
  %40 = sub i32 %.045, %38
  %41 = zext i32 %40 to i64
  %42 = mul i64 %39, %41
  %43 = icmp ugt i64 %42, %0
  br i1 %43, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %30
  %44 = zext i32 %38 to i64
  %45 = add nuw nsw i64 %44, 1
  %46 = add i32 %36, -1
  %47 = zext i32 %46 to i64
  %48 = mul nuw i64 %45, %47
  %49 = lshr i64 %48, 1
  br label %50

50:                                               ; preds = %.lr.ph, %50
  %51 = phi i32 [ %40, %.lr.ph ], [ %58, %50 ]
  %52 = phi i64 [ %39, %.lr.ph ], [ %57, %50 ]
  %.180 = phi i64 [ %.0, %.lr.ph ], [ %52, %50 ]
  %.16079 = phi i128 [ %.059, %.lr.ph ], [ %56, %50 ]
  %53 = mul i64 %.180, %44
  %54 = add i64 %49, %53
  %55 = zext i64 %54 to i128
  %56 = add i128 %.16079, %55
  %57 = add i64 %52, %37
  %58 = sub i32 %51, %38
  %59 = zext i32 %58 to i64
  %60 = mul i64 %57, %59
  %61 = icmp ugt i64 %60, %0
  br i1 %61, label %50, label %._crit_edge, !llvm.loop !12

62:                                               ; preds = %25, %1
  %63 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #6
  br label %134

64:                                               ; preds = %28, %26
  %65 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #6
  br label %134

._crit_edge:                                      ; preds = %50, %30
  %.160.lcssa = phi i128 [ %.059, %30 ], [ %56, %50 ]
  %.146.lcssa = phi i32 [ %.045, %30 ], [ %51, %50 ]
  %.1.lcssa = phi i64 [ %.0, %30 ], [ %52, %50 ]
  %.not = icmp ugt i32 %.146.lcssa, %18
  br i1 %.not, label %.preheader71, label %.critedge

.preheader71:                                     ; preds = %._crit_edge
  %66 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt5stackISt4pairIjjESt5dequeIS1_SaIS1_EEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %2)
  %67 = load i32, ptr %66, align 4, !tbaa !9
  store i32 %67, ptr %11, align 4, !tbaa !5
  %68 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt5stackISt4pairIjjESt5dequeIS1_SaIS1_EEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %2)
  %69 = getelementptr inbounds i8, ptr %68, i64 4
  %70 = load i32, ptr %69, align 4, !tbaa !11
  store i32 %70, ptr %12, align 4, !tbaa !5
  %71 = load i32, ptr %11, align 4, !tbaa !5
  %72 = zext i32 %71 to i64
  %73 = add i64 %.1.lcssa, %72
  %74 = sub i32 %.146.lcssa, %70
  %75 = zext i32 %74 to i64
  %76 = mul i64 %73, %75
  %77 = icmp ugt i64 %76, %0
  br i1 %77, label %.preheader70.preheader, label %.lr.ph85

.lr.ph85:                                         ; preds = %.preheader71, %.lr.ph85
  %78 = phi i32 [ %85, %.lr.ph85 ], [ %71, %.preheader71 ]
  %79 = phi i32 [ %84, %.lr.ph85 ], [ %70, %.preheader71 ]
  call void @_ZNSt5stackISt4pairIjjESt5dequeIS1_SaIS1_EEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %2)
  %80 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt5stackISt4pairIjjESt5dequeIS1_SaIS1_EEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %2)
  %81 = load i32, ptr %80, align 4, !tbaa !9
  store i32 %81, ptr %11, align 4, !tbaa !5
  %82 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt5stackISt4pairIjjESt5dequeIS1_SaIS1_EEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %2)
  %83 = getelementptr inbounds i8, ptr %82, i64 4
  %84 = load i32, ptr %83, align 4, !tbaa !11
  store i32 %84, ptr %12, align 4, !tbaa !5
  %85 = load i32, ptr %11, align 4, !tbaa !5
  %86 = zext i32 %85 to i64
  %87 = add i64 %.1.lcssa, %86
  %88 = sub i32 %.146.lcssa, %84
  %89 = zext i32 %88 to i64
  %90 = mul i64 %87, %89
  %91 = icmp ugt i64 %90, %0
  br i1 %91, label %.preheader70.preheader, label %.lr.ph85, !llvm.loop !14

.preheader70.preheader:                           ; preds = %.lr.ph85, %.preheader71
  %.152.ph = phi i32 [ %36, %.preheader71 ], [ %78, %.lr.ph85 ]
  %.149.ph = phi i32 [ %38, %.preheader71 ], [ %79, %.lr.ph85 ]
  br label %.preheader70.outer

.preheader70.outer:                               ; preds = %.preheader70.preheader, %108
  %.152.ph118 = phi i32 [ %.152.ph, %.preheader70.preheader ], [ %93, %108 ]
  %.149.ph119 = phi i32 [ %.149.ph, %.preheader70.preheader ], [ %95, %108 ]
  br label %.preheader70

.preheader70:                                     ; preds = %.preheader70.outer, %105
  %92 = load i32, ptr %11, align 4, !tbaa !5
  %93 = add i32 %92, %.152.ph118
  %94 = load i32, ptr %12, align 4, !tbaa !5
  %95 = add i32 %94, %.149.ph119
  %96 = zext i32 %93 to i64
  %97 = add i64 %.1.lcssa, %96
  %98 = sub i32 %.146.lcssa, %95
  %99 = zext i32 %98 to i64
  %100 = mul i64 %97, %99
  %101 = icmp ugt i64 %100, %0
  br i1 %101, label %102, label %108

102:                                              ; preds = %.preheader70
  store i32 %93, ptr %11, align 4, !tbaa !5
  store i32 %95, ptr %12, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %13) #6
  %103 = invoke i64 @_ZSt9make_pairIRjS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %11, ptr noundef nonnull align 4 dereferenceable(4) %12)
          to label %104 unwind label %106

104:                                              ; preds = %102
  store i64 %103, ptr %13, align 8
  invoke void @_ZNSt5stackISt4pairIjjESt5dequeIS1_SaIS1_EEE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(80) %2, ptr noundef nonnull align 4 dereferenceable(8) %13)
          to label %105 unwind label %106

105:                                              ; preds = %104
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #6
  br label %.preheader70

106:                                              ; preds = %104, %102
  %107 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %12) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #6
  br label %134

108:                                              ; preds = %.preheader70
  %109 = zext i64 %97 to i128
  %110 = zext i32 %94 to i64
  %111 = mul i64 %97, %110
  %112 = zext i64 %111 to i128
  %113 = mul nuw i128 %112, %109
  %114 = zext i32 %92 to i128
  %115 = mul nuw nsw i128 %114, %29
  %.not65 = icmp ult i128 %113, %115
  br i1 %.not65, label %.preheader70.outer, label %116

116:                                              ; preds = %108
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %12) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #6
  br label %30

.critedge:                                        ; preds = %._crit_edge
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %12) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #6
  %117 = add i32 %.146.lcssa, -1
  %.not6788 = icmp eq i32 %117, 0
  br i1 %.not6788, label %._crit_edge91, label %.lr.ph90.preheader

.lr.ph90.preheader:                               ; preds = %.critedge
  %118 = zext i32 %117 to i64
  %xtraiter = and i32 %117, 1
  %lcmp.mod.not = icmp eq i32 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.lr.ph90.prol.loopexit, label %.lr.ph90.prol

.lr.ph90.prol:                                    ; preds = %.lr.ph90.preheader
  %119 = udiv i64 %0, %118
  %120 = zext i64 %119 to i128
  %121 = add i128 %.160.lcssa, %120
  %indvars.iv.next.prol = add nsw i64 %118, -1
  br label %.lr.ph90.prol.loopexit

.lr.ph90.prol.loopexit:                           ; preds = %.lr.ph90.prol, %.lr.ph90.preheader
  %.lcssa.unr = phi i128 [ poison, %.lr.ph90.preheader ], [ %121, %.lr.ph90.prol ]
  %indvars.iv.unr = phi i64 [ %118, %.lr.ph90.preheader ], [ %indvars.iv.next.prol, %.lr.ph90.prol ]
  %.26189.unr = phi i128 [ %.160.lcssa, %.lr.ph90.preheader ], [ %121, %.lr.ph90.prol ]
  %122 = icmp eq i32 %.146.lcssa, 2
  br i1 %122, label %._crit_edge91, label %.lr.ph90

.lr.ph90:                                         ; preds = %.lr.ph90.prol.loopexit, %.lr.ph90
  %indvars.iv = phi i64 [ %indvars.iv.next.1, %.lr.ph90 ], [ %indvars.iv.unr, %.lr.ph90.prol.loopexit ]
  %.26189 = phi i128 [ %128, %.lr.ph90 ], [ %.26189.unr, %.lr.ph90.prol.loopexit ]
  %123 = udiv i64 %0, %indvars.iv
  %124 = zext i64 %123 to i128
  %125 = add i128 %.26189, %124
  %indvars.iv.next = add nsw i64 %indvars.iv, -1
  %126 = udiv i64 %0, %indvars.iv.next
  %127 = zext i64 %126 to i128
  %128 = add i128 %125, %127
  %indvars.iv.next.1 = add nsw i64 %indvars.iv, -2
  %129 = and i64 %indvars.iv.next.1, 4294967295
  %.not67.1 = icmp eq i64 %129, 0
  br i1 %.not67.1, label %._crit_edge91, label %.lr.ph90, !llvm.loop !15

._crit_edge91:                                    ; preds = %.lr.ph90.prol.loopexit, %.lr.ph90, %.critedge
  %.261.lcssa = phi i128 [ %.160.lcssa, %.critedge ], [ %.lcssa.unr, %.lr.ph90.prol.loopexit ], [ %128, %.lr.ph90 ]
  %130 = shl i128 %.261.lcssa, 1
  %131 = mul nuw i64 %19, %19
  %132 = zext i64 %131 to i128
  %133 = sub i128 %130, %132
  %.sroa.0.0.extract.trunc = trunc i128 %133 to i64
  %.sroa.2.0.extract.shift = lshr i128 %133, 64
  %.sroa.2.0.extract.trunc = trunc nuw i128 %.sroa.2.0.extract.shift to i64
  call void @_ZNSt5stackISt4pairIjjESt5dequeIS1_SaIS1_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %2) #6
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %2) #6
  %.fca.0.insert = insertvalue { i64, i64 } poison, i64 %.sroa.0.0.extract.trunc, 0
  %.fca.1.insert = insertvalue { i64, i64 } %.fca.0.insert, i64 %.sroa.2.0.extract.trunc, 1
  ret { i64, i64 } %.fca.1.insert

134:                                              ; preds = %106, %64, %62
  %.pn = phi { ptr, i32 } [ %107, %106 ], [ %65, %64 ], [ %63, %62 ]
  call void @_ZNSt5stackISt4pairIjjESt5dequeIS1_SaIS1_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %2) #6
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %2) #6
  resume { ptr, i32 } %.pn
}

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @pow(double noundef, double noundef) local_unnamed_addr #4

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt5stackISt4pairIjjESt5dequeIS1_SaIS1_EEEC2IS4_vEEv(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt5stackISt4pairIjjESt5dequeIS1_SaIS1_EEE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(80), ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #3 align 2

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

declare i32 @__gxx_personality_v0(...)

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

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZNSt5stackISt4pairIjjESt5dequeIS1_SaIS1_EEED2Ev(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #5 align 2

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !6, i64 0}
!10 = !{!"_ZTSSt4pairIjjE", !6, i64 0, !6, i64 4}
!11 = !{!10, !6, i64 4}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = distinct !{!14, !13}
!15 = distinct !{!15, !13}


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