; LLVM IR from tangjz/acm-icpc :: lydsy (4117)

; 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::priority_queue" = type <{ %"class.std::vector", [8 x i8] }>
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::pair<double, long long>, std::allocator<std::pair<double, long long>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<double, long long>, std::allocator<std::pair<double, long long>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<double, long long>, std::allocator<std::pair<double, long long>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<double, long long>, std::allocator<std::pair<double, long long>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.std::pair" = type { double, i64 }

@n = external dso_local global i32, align 4
@fact = external dso_local global [21 x i64], align 16
@p = external dso_local global [4 x [21 x double]], align 16
@ans = external dso_local global double, align 8
@Q = external dso_local global %"class.std::priority_queue", align 8
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [6 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca double, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca %"struct.std::pair", align 8
  %11 = alloca double, align 8
  %12 = alloca i64, align 8
  %13 = alloca %"struct.std::pair", align 8
  %14 = alloca %"struct.std::pair", align 8
  %15 = alloca %"struct.std::pair", align 8
  %16 = alloca i64, align 8
  %17 = alloca %"struct.std::pair", align 8
  %18 = alloca double, align 8
  %19 = alloca i64, align 8
  %20 = alloca %"struct.std::pair", align 8
  %21 = alloca double, align 8
  %22 = alloca i64, align 8
  %23 = alloca %"struct.std::pair", align 8
  store i32 0, ptr %1, align 4
  store i64 1, ptr @fact, align 16, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #7
  store i32 1, ptr %2, align 4, !tbaa !9
  br label %24

24:                                               ; preds = %40, %0
  %25 = load i32, ptr %2, align 4, !tbaa !9
  %26 = icmp slt i32 %25, 21
  br i1 %26, label %28, label %27

27:                                               ; preds = %24
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #7
  br label %43

28:                                               ; preds = %24
  %29 = load i32, ptr %2, align 4, !tbaa !9
  %30 = sub nsw i32 %29, 1
  %31 = sext i32 %30 to i64
  %32 = getelementptr inbounds [21 x i64], ptr @fact, i64 0, i64 %31
  %33 = load i64, ptr %32, align 8, !tbaa !5
  %34 = load i32, ptr %2, align 4, !tbaa !9
  %35 = sext i32 %34 to i64
  %36 = mul nsw i64 %33, %35
  %37 = load i32, ptr %2, align 4, !tbaa !9
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds [21 x i64], ptr @fact, i64 0, i64 %38
  store i64 %36, ptr %39, align 8, !tbaa !5
  br label %40

40:                                               ; preds = %28
  %41 = load i32, ptr %2, align 4, !tbaa !9
  %42 = add nsw i32 %41, 1
  store i32 %42, ptr %2, align 4, !tbaa !9
  br label %24, !llvm.loop !11

43:                                               ; preds = %27
  br label %44

44:                                               ; preds = %270, %43
  %45 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n)
  %46 = icmp eq i32 %45, 1
  br i1 %46, label %47, label %273

47:                                               ; preds = %44
  store double 0.000000e+00, ptr @ans, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #7
  store i32 0, ptr %3, align 4, !tbaa !9
  br label %48

48:                                               ; preds = %84, %47
  %49 = load i32, ptr %3, align 4, !tbaa !9
  %50 = icmp slt i32 %49, 4
  br i1 %50, label %52, label %51

51:                                               ; preds = %48
  store i32 7, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #7
  br label %87

52:                                               ; preds = %48
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #7
  %53 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %5)
  %54 = load i32, ptr %3, align 4, !tbaa !9
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds [4 x [21 x double]], ptr @p, i64 0, i64 %55
  %57 = getelementptr inbounds [21 x double], ptr %56, i64 0, i64 0
  store double 1.000000e+00, ptr %57, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  store i32 1, ptr %6, align 4, !tbaa !9
  br label %58

58:                                               ; preds = %80, %52
  %59 = load i32, ptr %6, align 4, !tbaa !9
  %60 = load i32, ptr @n, align 4, !tbaa !9
  %61 = icmp sle i32 %59, %60
  br i1 %61, label %63, label %62

62:                                               ; preds = %58
  store i32 10, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  br label %83

63:                                               ; preds = %58
  %64 = load i32, ptr %3, align 4, !tbaa !9
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds [4 x [21 x double]], ptr @p, i64 0, i64 %65
  %67 = load i32, ptr %6, align 4, !tbaa !9
  %68 = sub nsw i32 %67, 1
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds [21 x double], ptr %66, i64 0, i64 %69
  %71 = load double, ptr %70, align 8, !tbaa !13
  %72 = load double, ptr %5, align 8, !tbaa !13
  %73 = fmul double %71, %72
  %74 = load i32, ptr %3, align 4, !tbaa !9
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds [4 x [21 x double]], ptr @p, i64 0, i64 %75
  %77 = load i32, ptr %6, align 4, !tbaa !9
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds [21 x double], ptr %76, i64 0, i64 %78
  store double %73, ptr %79, align 8, !tbaa !13
  br label %80

80:                                               ; preds = %63
  %81 = load i32, ptr %6, align 4, !tbaa !9
  %82 = add nsw i32 %81, 1
  store i32 %82, ptr %6, align 4, !tbaa !9
  br label %58, !llvm.loop !15

83:                                               ; preds = %62
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #7
  br label %84

84:                                               ; preds = %83
  %85 = load i32, ptr %3, align 4, !tbaa !9
  %86 = add nsw i32 %85, 1
  store i32 %86, ptr %3, align 4, !tbaa !9
  br label %48, !llvm.loop !16

87:                                               ; preds = %51
  br label %88

88:                                               ; preds = %91, %87
  %89 = call noundef zeroext i1 @_ZNKSt14priority_queueISt4pairIdxESt6vectorIS1_SaIS1_EESt7greaterIS1_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25) @Q)
  %90 = xor i1 %89, true
  br i1 %90, label %91, label %92

91:                                               ; preds = %88
  call void @_ZNSt14priority_queueISt4pairIdxESt6vectorIS1_SaIS1_EESt7greaterIS1_EE3popEv(ptr noundef nonnull align 8 dereferenceable(25) @Q)
  br label %88, !llvm.loop !17

92:                                               ; preds = %88
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #7
  store i32 0, ptr %7, align 4, !tbaa !9
  br label %93

93:                                               ; preds = %182, %92
  %94 = load i32, ptr %7, align 4, !tbaa !9
  %95 = load i32, ptr @n, align 4, !tbaa !9
  %96 = icmp sle i32 %94, %95
  br i1 %96, label %98, label %97

97:                                               ; preds = %93
  store i32 15, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  br label %185

98:                                               ; preds = %93
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #7
  %99 = load i32, ptr %7, align 4, !tbaa !9
  store i32 %99, ptr %8, align 4, !tbaa !9
  br label %100

100:                                              ; preds = %178, %98
  %101 = load i32, ptr %8, align 4, !tbaa !9
  %102 = load i32, ptr @n, align 4, !tbaa !9
  %103 = icmp sle i32 %101, %102
  br i1 %103, label %105, label %104

104:                                              ; preds = %100
  store i32 18, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  br label %181

105:                                              ; preds = %100
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #7
  %106 = load i32, ptr %8, align 4, !tbaa !9
  store i32 %106, ptr %9, align 4, !tbaa !9
  br label %107

107:                                              ; preds = %174, %105
  %108 = load i32, ptr %9, align 4, !tbaa !9
  %109 = load i32, ptr @n, align 4, !tbaa !9
  %110 = icmp sle i32 %108, %109
  br i1 %110, label %112, label %111

111:                                              ; preds = %107
  store i32 21, ptr %4, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  br label %177

112:                                              ; preds = %107
  call void @llvm.lifetime.start.p0(i64 16, ptr %10) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #7
  %113 = load i32, ptr %7, align 4, !tbaa !9
  %114 = sext i32 %113 to i64
  %115 = getelementptr inbounds [21 x double], ptr @p, i64 0, i64 %114
  %116 = load double, ptr %115, align 8, !tbaa !13
  %117 = load i32, ptr %8, align 4, !tbaa !9
  %118 = load i32, ptr %7, align 4, !tbaa !9
  %119 = sub nsw i32 %117, %118
  %120 = sext i32 %119 to i64
  %121 = getelementptr inbounds [21 x double], ptr getelementptr inbounds ([4 x [21 x double]], ptr @p, i64 0, i64 1), i64 0, i64 %120
  %122 = load double, ptr %121, align 8, !tbaa !13
  %123 = fmul double %116, %122
  %124 = load i32, ptr %9, align 4, !tbaa !9
  %125 = load i32, ptr %8, align 4, !tbaa !9
  %126 = sub nsw i32 %124, %125
  %127 = sext i32 %126 to i64
  %128 = getelementptr inbounds [21 x double], ptr getelementptr inbounds ([4 x [21 x double]], ptr @p, i64 0, i64 2), i64 0, i64 %127
  %129 = load double, ptr %128, align 8, !tbaa !13
  %130 = fmul double %123, %129
  %131 = load i32, ptr @n, align 4, !tbaa !9
  %132 = load i32, ptr %9, align 4, !tbaa !9
  %133 = sub nsw i32 %131, %132
  %134 = sext i32 %133 to i64
  %135 = getelementptr inbounds [21 x double], ptr getelementptr inbounds ([4 x [21 x double]], ptr @p, i64 0, i64 3), i64 0, i64 %134
  %136 = load double, ptr %135, align 8, !tbaa !13
  %137 = fmul double %130, %136
  store double %137, ptr %11, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #7
  %138 = load i32, ptr @n, align 4, !tbaa !9
  %139 = sext i32 %138 to i64
  %140 = getelementptr inbounds [21 x i64], ptr @fact, i64 0, i64 %139
  %141 = load i64, ptr %140, align 8, !tbaa !5
  %142 = sub nsw i64 0, %141
  %143 = load i32, ptr %7, align 4, !tbaa !9
  %144 = sext i32 %143 to i64
  %145 = getelementptr inbounds [21 x i64], ptr @fact, i64 0, i64 %144
  %146 = load i64, ptr %145, align 8, !tbaa !5
  %147 = sdiv i64 %142, %146
  %148 = load i32, ptr %8, align 4, !tbaa !9
  %149 = load i32, ptr %7, align 4, !tbaa !9
  %150 = sub nsw i32 %148, %149
  %151 = sext i32 %150 to i64
  %152 = getelementptr inbounds [21 x i64], ptr @fact, i64 0, i64 %151
  %153 = load i64, ptr %152, align 8, !tbaa !5
  %154 = sdiv i64 %147, %153
  %155 = load i32, ptr %9, align 4, !tbaa !9
  %156 = load i32, ptr %8, align 4, !tbaa !9
  %157 = sub nsw i32 %155, %156
  %158 = sext i32 %157 to i64
  %159 = getelementptr inbounds [21 x i64], ptr @fact, i64 0, i64 %158
  %160 = load i64, ptr %159, align 8, !tbaa !5
  %161 = sdiv i64 %154, %160
  %162 = load i32, ptr @n, align 4, !tbaa !9
  %163 = load i32, ptr %9, align 4, !tbaa !9
  %164 = sub nsw i32 %162, %163
  %165 = sext i32 %164 to i64
  %166 = getelementptr inbounds [21 x i64], ptr @fact, i64 0, i64 %165
  %167 = load i64, ptr %166, align 8, !tbaa !5
  %168 = sdiv i64 %161, %167
  store i64 %168, ptr %12, align 8, !tbaa !5
  %169 = call { double, i64 } @_ZSt9make_pairIdxESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS1_INS2_IT0_E4typeEE6__typeEEOS3_OS8_(ptr noundef nonnull align 8 dereferenceable(8) %11, ptr noundef nonnull align 8 dereferenceable(8) %12)
  %170 = getelementptr inbounds { double, i64 }, ptr %10, i32 0, i32 0
  %171 = extractvalue { double, i64 } %169, 0
  store double %171, ptr %170, align 8
  %172 = getelementptr inbounds { double, i64 }, ptr %10, i32 0, i32 1
  %173 = extractvalue { double, i64 } %169, 1
  store i64 %173, ptr %172, align 8
  call void @_ZNSt14priority_queueISt4pairIdxESt6vectorIS1_SaIS1_EESt7greaterIS1_EE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(25) @Q, ptr noundef nonnull align 8 dereferenceable(16) %10)
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %10) #7
  br label %174

174:                                              ; preds = %112
  %175 = load i32, ptr %9, align 4, !tbaa !9
  %176 = add nsw i32 %175, 1
  store i32 %176, ptr %9, align 4, !tbaa !9
  br label %107, !llvm.loop !18

177:                                              ; preds = %111
  br label %178

178:                                              ; preds = %177
  %179 = load i32, ptr %8, align 4, !tbaa !9
  %180 = add nsw i32 %179, 1
  store i32 %180, ptr %8, align 4, !tbaa !9
  br label %100, !llvm.loop !19

181:                                              ; preds = %104
  br label %182

182:                                              ; preds = %181
  %183 = load i32, ptr %7, align 4, !tbaa !9
  %184 = add nsw i32 %183, 1
  store i32 %184, ptr %7, align 4, !tbaa !9
  br label %93, !llvm.loop !20

185:                                              ; preds = %97
  br label %186

186:                                              ; preds = %269, %185
  %187 = call noundef zeroext i1 @_ZNKSt14priority_queueISt4pairIdxESt6vectorIS1_SaIS1_EESt7greaterIS1_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25) @Q)
  %188 = xor i1 %187, true
  br i1 %188, label %189, label %270

189:                                              ; preds = %186
  call void @llvm.lifetime.start.p0(i64 16, ptr %13) #7
  %190 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNKSt14priority_queueISt4pairIdxESt6vectorIS1_SaIS1_EESt7greaterIS1_EE3topEv(ptr noundef nonnull align 8 dereferenceable(25) @Q)
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %13, ptr align 8 %190, i64 16, i1 false)
  call void @llvm.lifetime.start.p0(i64 16, ptr %14) #7
  call void @_ZNSt4pairIdxEC2IdxTnNSt9enable_ifIXsr6__and_ISt37__is_implicitly_default_constructibleIT_ES3_IT0_EEE5valueEbE4typeELb1EEEv(ptr noundef nonnull align 8 dereferenceable(16) %14)
  call void @_ZNSt14priority_queueISt4pairIdxESt6vectorIS1_SaIS1_EESt7greaterIS1_EE3popEv(ptr noundef nonnull align 8 dereferenceable(25) @Q)
  %191 = getelementptr inbounds %"struct.std::pair", ptr %13, i32 0, i32 1
  %192 = load i64, ptr %191, align 8, !tbaa !21
  %193 = sub nsw i64 0, %192
  %194 = icmp sgt i64 %193, 1
  br i1 %194, label %195, label %231

195:                                              ; preds = %189
  %196 = getelementptr inbounds %"struct.std::pair", ptr %13, i32 0, i32 1
  %197 = load i64, ptr %196, align 8, !tbaa !21
  %198 = sub nsw i64 0, %197
  %199 = and i64 %198, 1
  %200 = icmp ne i64 %199, 0
  br i1 %200, label %201, label %211

201:                                              ; preds = %195
  call void @llvm.lifetime.start.p0(i64 16, ptr %15) #7
  %202 = getelementptr inbounds %"struct.std::pair", ptr %13, i32 0, i32 0
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #7
  store i64 -1, ptr %16, align 8, !tbaa !5
  %203 = call { double, i64 } @_ZSt9make_pairIRdxESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 8 dereferenceable(8) %202, ptr noundef nonnull align 8 dereferenceable(8) %16)
  %204 = getelementptr inbounds { double, i64 }, ptr %15, i32 0, i32 0
  %205 = extractvalue { double, i64 } %203, 0
  store double %205, ptr %204, align 8
  %206 = getelementptr inbounds { double, i64 }, ptr %15, i32 0, i32 1
  %207 = extractvalue { double, i64 } %203, 1
  store i64 %207, ptr %206, align 8
  call void @_ZNSt14priority_queueISt4pairIdxESt6vectorIS1_SaIS1_EESt7greaterIS1_EE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(25) @Q, ptr noundef nonnull align 8 dereferenceable(16) %15)
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %15) #7
  %208 = getelementptr inbounds %"struct.std::pair", ptr %13, i32 0, i32 1
  %209 = load i64, ptr %208, align 8, !tbaa !21
  %210 = add nsw i64 %209, 1
  store i64 %210, ptr %208, align 8, !tbaa !21
  br label %211

211:                                              ; preds = %201, %195
  %212 = getelementptr inbounds %"struct.std::pair", ptr %13, i32 0, i32 0
  %213 = load double, ptr %212, align 8, !tbaa !23
  %214 = getelementptr inbounds %"struct.std::pair", ptr %13, i32 0, i32 1
  %215 = load i64, ptr %214, align 8, !tbaa !21
  %216 = sub nsw i64 0, %215
  %217 = sitofp i64 %216 to double
  %218 = load double, ptr @ans, align 8, !tbaa !13
  %219 = call double @llvm.fmuladd.f64(double %213, double %217, double %218)
  store double %219, ptr @ans, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 16, ptr %17) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #7
  %220 = getelementptr inbounds %"struct.std::pair", ptr %13, i32 0, i32 0
  %221 = load double, ptr %220, align 8, !tbaa !23
  %222 = fmul double %221, 2.000000e+00
  store double %222, ptr %18, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #7
  %223 = getelementptr inbounds %"struct.std::pair", ptr %13, i32 0, i32 1
  %224 = load i64, ptr %223, align 8, !tbaa !21
  %225 = ashr i64 %224, 1
  store i64 %225, ptr %19, align 8, !tbaa !5
  %226 = call { double, i64 } @_ZSt9make_pairIdxESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS1_INS2_IT0_E4typeEE6__typeEEOS3_OS8_(ptr noundef nonnull align 8 dereferenceable(8) %18, ptr noundef nonnull align 8 dereferenceable(8) %19)
  %227 = getelementptr inbounds { double, i64 }, ptr %17, i32 0, i32 0
  %228 = extractvalue { double, i64 } %226, 0
  store double %228, ptr %227, align 8
  %229 = getelementptr inbounds { double, i64 }, ptr %17, i32 0, i32 1
  %230 = extractvalue { double, i64 } %226, 1
  store i64 %230, ptr %229, align 8
  call void @_ZNSt14priority_queueISt4pairIdxESt6vectorIS1_SaIS1_EESt7greaterIS1_EE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(25) @Q, ptr noundef nonnull align 8 dereferenceable(16) %17)
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %17) #7
  br label %269

231:                                              ; preds = %189
  %232 = call noundef zeroext i1 @_ZNKSt14priority_queueISt4pairIdxESt6vectorIS1_SaIS1_EESt7greaterIS1_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25) @Q)
  br i1 %232, label %268, label %233

233:                                              ; preds = %231
  %234 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNKSt14priority_queueISt4pairIdxESt6vectorIS1_SaIS1_EESt7greaterIS1_EE3topEv(ptr noundef nonnull align 8 dereferenceable(25) @Q)
  %235 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt4pairIdxEaSERKS0_(ptr noundef nonnull align 8 dereferenceable(16) %14, ptr noundef nonnull align 8 dereferenceable(16) %234)
  call void @_ZNSt14priority_queueISt4pairIdxESt6vectorIS1_SaIS1_EESt7greaterIS1_EE3popEv(ptr noundef nonnull align 8 dereferenceable(25) @Q)
  %236 = getelementptr inbounds %"struct.std::pair", ptr %13, i32 0, i32 0
  %237 = load double, ptr %236, align 8, !tbaa !23
  %238 = getelementptr inbounds %"struct.std::pair", ptr %14, i32 0, i32 0
  %239 = load double, ptr %238, align 8, !tbaa !23
  %240 = fadd double %237, %239
  %241 = load double, ptr @ans, align 8, !tbaa !13
  %242 = fadd double %241, %240
  store double %242, ptr @ans, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 16, ptr %20) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #7
  %243 = getelementptr inbounds %"struct.std::pair", ptr %13, i32 0, i32 0
  %244 = load double, ptr %243, align 8, !tbaa !23
  %245 = getelementptr inbounds %"struct.std::pair", ptr %14, i32 0, i32 0
  %246 = load double, ptr %245, align 8, !tbaa !23
  %247 = fadd double %244, %246
  store double %247, ptr %21, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #7
  store i64 -1, ptr %22, align 8, !tbaa !5
  %248 = call { double, i64 } @_ZSt9make_pairIdxESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS1_INS2_IT0_E4typeEE6__typeEEOS3_OS8_(ptr noundef nonnull align 8 dereferenceable(8) %21, ptr noundef nonnull align 8 dereferenceable(8) %22)
  %249 = getelementptr inbounds { double, i64 }, ptr %20, i32 0, i32 0
  %250 = extractvalue { double, i64 } %248, 0
  store double %250, ptr %249, align 8
  %251 = getelementptr inbounds { double, i64 }, ptr %20, i32 0, i32 1
  %252 = extractvalue { double, i64 } %248, 1
  store i64 %252, ptr %251, align 8
  call void @_ZNSt14priority_queueISt4pairIdxESt6vectorIS1_SaIS1_EESt7greaterIS1_EE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(25) @Q, ptr noundef nonnull align 8 dereferenceable(16) %20)
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %20) #7
  %253 = getelementptr inbounds %"struct.std::pair", ptr %14, i32 0, i32 1
  %254 = load i64, ptr %253, align 8, !tbaa !21
  %255 = sub nsw i64 0, %254
  %256 = icmp sgt i64 %255, 1
  br i1 %256, label %257, label %267

257:                                              ; preds = %233
  call void @llvm.lifetime.start.p0(i64 16, ptr %23) #7
  %258 = getelementptr inbounds %"struct.std::pair", ptr %14, i32 0, i32 0
  %259 = getelementptr inbounds %"struct.std::pair", ptr %14, i32 0, i32 1
  %260 = load i64, ptr %259, align 8, !tbaa !21
  %261 = add nsw i64 %260, 1
  store i64 %261, ptr %259, align 8, !tbaa !21
  %262 = call { double, i64 } @_ZSt9make_pairIRdRxESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 8 dereferenceable(8) %258, ptr noundef nonnull align 8 dereferenceable(8) %259)
  %263 = getelementptr inbounds { double, i64 }, ptr %23, i32 0, i32 0
  %264 = extractvalue { double, i64 } %262, 0
  store double %264, ptr %263, align 8
  %265 = getelementptr inbounds { double, i64 }, ptr %23, i32 0, i32 1
  %266 = extractvalue { double, i64 } %262, 1
  store i64 %266, ptr %265, align 8
  call void @_ZNSt14priority_queueISt4pairIdxESt6vectorIS1_SaIS1_EESt7greaterIS1_EE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(25) @Q, ptr noundef nonnull align 8 dereferenceable(16) %23)
  call void @llvm.lifetime.end.p0(i64 16, ptr %23) #7
  br label %267

267:                                              ; preds = %257, %233
  br label %268

268:                                              ; preds = %267, %231
  br label %269

269:                                              ; preds = %268, %211
  call void @llvm.lifetime.end.p0(i64 16, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %13) #7
  br label %186, !llvm.loop !24

270:                                              ; preds = %186
  %271 = load double, ptr @ans, align 8, !tbaa !13
  %272 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, double noundef %271)
  br label %44, !llvm.loop !25

273:                                              ; preds = %44
  ret i32 0
}

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

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

declare i32 @__isoc99_scanf(ptr noundef, ...) #2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt14priority_queueISt4pairIdxESt6vectorIS1_SaIS1_EESt7greaterIS1_EE3popEv(ptr noundef nonnull align 8 dereferenceable(25)) #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt14priority_queueISt4pairIdxESt6vectorIS1_SaIS1_EESt7greaterIS1_EE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(25), ptr noundef nonnull align 8 dereferenceable(16)) #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local { double, i64 } @_ZSt9make_pairIdxESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS1_INS2_IT0_E4typeEE6__typeEEOS3_OS8_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #4

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local { double, i64 } @_ZSt9make_pairIRdxESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #4

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #6

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

; Function Attrs: mustprogress uwtable
declare dso_local { double, i64 } @_ZSt9make_pairIRdRxESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #4

declare i32 @printf(ptr noundef, ...) #2

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"long long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!14, !14, i64 0}
!14 = !{!"double", !7, i64 0}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !12}
!19 = distinct !{!19, !12}
!20 = distinct !{!20, !12}
!21 = !{!22, !6, i64 8}
!22 = !{!"_ZTSSt4pairIdxE", !14, i64 0, !6, i64 8}
!23 = !{!22, !14, i64 0}
!24 = distinct !{!24, !12}
!25 = distinct !{!25, !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::priority_queue" = type <{ %"class.std::vector", [8 x i8] }>
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::pair<double, long long>, std::allocator<std::pair<double, long long>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<double, long long>, std::allocator<std::pair<double, long long>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<double, long long>, std::allocator<std::pair<double, long long>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<double, long long>, std::allocator<std::pair<double, long long>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.std::pair" = type { double, i64 }

@n = external dso_local global i32, align 4
@fact = external dso_local local_unnamed_addr global [21 x i64], align 16
@p = external dso_local local_unnamed_addr global [4 x [21 x double]], align 16
@ans = external dso_local local_unnamed_addr global double, align 8
@Q = external dso_local global %"class.std::priority_queue", align 8
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [6 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
.preheader48:
  %0 = alloca double, align 8
  %1 = alloca %"struct.std::pair", align 8
  %2 = alloca double, align 8
  %3 = alloca i64, align 8
  %4 = alloca %"struct.std::pair", align 8
  %5 = alloca %"struct.std::pair", align 8
  %6 = alloca %"struct.std::pair", align 8
  %7 = alloca i64, align 8
  %8 = alloca %"struct.std::pair", align 8
  %9 = alloca double, align 8
  %10 = alloca i64, align 8
  %11 = alloca %"struct.std::pair", align 8
  %12 = alloca double, align 8
  %13 = alloca i64, align 8
  %14 = alloca %"struct.std::pair", align 8
  store i64 1, ptr @fact, align 16, !tbaa !5
  store i64 1, ptr getelementptr inbounds (i8, ptr @fact, i64 8), align 8, !tbaa !5
  store i64 2, ptr getelementptr inbounds (i8, ptr @fact, i64 16), align 16, !tbaa !5
  store i64 6, ptr getelementptr inbounds (i8, ptr @fact, i64 24), align 8, !tbaa !5
  store i64 24, ptr getelementptr inbounds (i8, ptr @fact, i64 32), align 16, !tbaa !5
  store i64 120, ptr getelementptr inbounds (i8, ptr @fact, i64 40), align 8, !tbaa !5
  store i64 720, ptr getelementptr inbounds (i8, ptr @fact, i64 48), align 16, !tbaa !5
  store i64 5040, ptr getelementptr inbounds (i8, ptr @fact, i64 56), align 8, !tbaa !5
  store i64 40320, ptr getelementptr inbounds (i8, ptr @fact, i64 64), align 16, !tbaa !5
  store i64 362880, ptr getelementptr inbounds (i8, ptr @fact, i64 72), align 8, !tbaa !5
  store i64 3628800, ptr getelementptr inbounds (i8, ptr @fact, i64 80), align 16, !tbaa !5
  store i64 39916800, ptr getelementptr inbounds (i8, ptr @fact, i64 88), align 8, !tbaa !5
  store i64 479001600, ptr getelementptr inbounds (i8, ptr @fact, i64 96), align 16, !tbaa !5
  store i64 6227020800, ptr getelementptr inbounds (i8, ptr @fact, i64 104), align 8, !tbaa !5
  store i64 87178291200, ptr getelementptr inbounds (i8, ptr @fact, i64 112), align 16, !tbaa !5
  store i64 1307674368000, ptr getelementptr inbounds (i8, ptr @fact, i64 120), align 8, !tbaa !5
  store i64 20922789888000, ptr getelementptr inbounds (i8, ptr @fact, i64 128), align 16, !tbaa !5
  store i64 355687428096000, ptr getelementptr inbounds (i8, ptr @fact, i64 136), align 8, !tbaa !5
  store i64 6402373705728000, ptr getelementptr inbounds (i8, ptr @fact, i64 144), align 16, !tbaa !5
  store i64 121645100408832000, ptr getelementptr inbounds (i8, ptr @fact, i64 152), align 8, !tbaa !5
  store i64 2432902008176640000, ptr getelementptr inbounds (i8, ptr @fact, i64 160), align 16, !tbaa !5
  %15 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n)
  %16 = icmp eq i32 %15, 1
  br i1 %16, label %.lr.ph65, label %._crit_edge66

.lr.ph65:                                         ; preds = %.preheader48
  %17 = getelementptr inbounds i8, ptr %1, i64 8
  %18 = getelementptr inbounds i8, ptr %4, i64 8
  %19 = getelementptr inbounds i8, ptr %11, i64 8
  %20 = getelementptr inbounds i8, ptr %5, i64 8
  %21 = getelementptr inbounds i8, ptr %14, i64 8
  %22 = getelementptr inbounds i8, ptr %6, i64 8
  %23 = getelementptr inbounds i8, ptr %8, i64 8
  br label %24

24:                                               ; preds = %.lr.ph65, %._crit_edge64
  store double 0.000000e+00, ptr @ans, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %0) #7
  %25 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %0)
  store double 1.000000e+00, ptr @p, align 16, !tbaa !9
  %26 = load i32, ptr @n, align 4, !tbaa !11
  %.not4350 = icmp slt i32 %26, 1
  br i1 %.not4350, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %24
  %27 = load double, ptr %0, align 8, !tbaa !9
  %28 = zext nneg i32 %26 to i64
  %xtraiter = and i64 %28, 3
  %29 = icmp ult i32 %26, 4
  br i1 %29, label %._crit_edge.loopexit.unr-lcssa, label %.lr.ph.new

.lr.ph.new:                                       ; preds = %.lr.ph
  %unroll_iter = and i64 %28, 2147483644
  br label %88

._crit_edge.loopexit.unr-lcssa:                   ; preds = %88, %.lr.ph
  %.unr = phi double [ 1.000000e+00, %.lr.ph ], [ %96, %88 ]
  %indvars.iv.unr = phi i64 [ 1, %.lr.ph ], [ %indvars.iv.next.394, %88 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge, label %.epil.preheader

.epil.preheader:                                  ; preds = %._crit_edge.loopexit.unr-lcssa, %.epil.preheader
  %30 = phi double [ %31, %.epil.preheader ], [ %.unr, %._crit_edge.loopexit.unr-lcssa ]
  %indvars.iv.epil = phi i64 [ %indvars.iv.next.epil, %.epil.preheader ], [ %indvars.iv.unr, %._crit_edge.loopexit.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.epil.preheader ], [ 0, %._crit_edge.loopexit.unr-lcssa ]
  %31 = fmul double %30, %27
  %32 = getelementptr inbounds [4 x [21 x double]], ptr @p, i64 0, i64 0, i64 %indvars.iv.epil
  store double %31, ptr %32, align 8, !tbaa !9
  %indvars.iv.next.epil = add nuw nsw i64 %indvars.iv.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
  br i1 %epil.iter.cmp.not, label %._crit_edge, label %.epil.preheader, !llvm.loop !13

._crit_edge:                                      ; preds = %._crit_edge.loopexit.unr-lcssa, %.epil.preheader, %24
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %0) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %0) #7
  %33 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %0)
  store double 1.000000e+00, ptr getelementptr inbounds (i8, ptr @p, i64 168), align 8, !tbaa !9
  %34 = load i32, ptr @n, align 4, !tbaa !11
  %.not4350.1 = icmp slt i32 %34, 1
  br i1 %.not4350.1, label %._crit_edge.1, label %.lr.ph.1

.lr.ph.1:                                         ; preds = %._crit_edge
  %35 = load double, ptr %0, align 8, !tbaa !9
  %36 = zext nneg i32 %34 to i64
  %xtraiter96 = and i64 %36, 3
  %37 = icmp ult i32 %34, 4
  br i1 %37, label %._crit_edge.1.loopexit.unr-lcssa, label %.lr.ph.1.new

.lr.ph.1.new:                                     ; preds = %.lr.ph.1
  %unroll_iter100 = and i64 %36, 2147483644
  br label %38

38:                                               ; preds = %38, %.lr.ph.1.new
  %39 = phi double [ 1.000000e+00, %.lr.ph.1.new ], [ %46, %38 ]
  %indvars.iv.1 = phi i64 [ 1, %.lr.ph.1.new ], [ %indvars.iv.next.1.3, %38 ]
  %niter101 = phi i64 [ 0, %.lr.ph.1.new ], [ %niter101.next.3, %38 ]
  %40 = fmul double %39, %35
  %41 = getelementptr inbounds [4 x [21 x double]], ptr @p, i64 0, i64 1, i64 %indvars.iv.1
  store double %40, ptr %41, align 8, !tbaa !9
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv.1, 1
  %42 = fmul double %40, %35
  %43 = getelementptr inbounds [4 x [21 x double]], ptr @p, i64 0, i64 1, i64 %indvars.iv.next.1
  store double %42, ptr %43, align 8, !tbaa !9
  %indvars.iv.next.1.1 = add nuw nsw i64 %indvars.iv.1, 2
  %44 = fmul double %42, %35
  %45 = getelementptr inbounds [4 x [21 x double]], ptr @p, i64 0, i64 1, i64 %indvars.iv.next.1.1
  store double %44, ptr %45, align 8, !tbaa !9
  %indvars.iv.next.1.2 = add nuw nsw i64 %indvars.iv.1, 3
  %46 = fmul double %44, %35
  %47 = getelementptr inbounds [4 x [21 x double]], ptr @p, i64 0, i64 1, i64 %indvars.iv.next.1.2
  store double %46, ptr %47, align 8, !tbaa !9
  %indvars.iv.next.1.3 = add nuw nsw i64 %indvars.iv.1, 4
  %niter101.next.3 = add i64 %niter101, 4
  %niter101.ncmp.3 = icmp eq i64 %niter101.next.3, %unroll_iter100
  br i1 %niter101.ncmp.3, label %._crit_edge.1.loopexit.unr-lcssa, label %38, !llvm.loop !15

._crit_edge.1.loopexit.unr-lcssa:                 ; preds = %38, %.lr.ph.1
  %.unr98 = phi double [ 1.000000e+00, %.lr.ph.1 ], [ %46, %38 ]
  %indvars.iv.1.unr = phi i64 [ 1, %.lr.ph.1 ], [ %indvars.iv.next.1.3, %38 ]
  %lcmp.mod99.not = icmp eq i64 %xtraiter96, 0
  br i1 %lcmp.mod99.not, label %._crit_edge.1, label %.epil.preheader95

.epil.preheader95:                                ; preds = %._crit_edge.1.loopexit.unr-lcssa, %.epil.preheader95
  %48 = phi double [ %49, %.epil.preheader95 ], [ %.unr98, %._crit_edge.1.loopexit.unr-lcssa ]
  %indvars.iv.1.epil = phi i64 [ %indvars.iv.next.1.epil, %.epil.preheader95 ], [ %indvars.iv.1.unr, %._crit_edge.1.loopexit.unr-lcssa ]
  %epil.iter97 = phi i64 [ %epil.iter97.next, %.epil.preheader95 ], [ 0, %._crit_edge.1.loopexit.unr-lcssa ]
  %49 = fmul double %48, %35
  %50 = getelementptr inbounds [4 x [21 x double]], ptr @p, i64 0, i64 1, i64 %indvars.iv.1.epil
  store double %49, ptr %50, align 8, !tbaa !9
  %indvars.iv.next.1.epil = add nuw nsw i64 %indvars.iv.1.epil, 1
  %epil.iter97.next = add i64 %epil.iter97, 1
  %epil.iter97.cmp.not = icmp eq i64 %epil.iter97.next, %xtraiter96
  br i1 %epil.iter97.cmp.not, label %._crit_edge.1, label %.epil.preheader95, !llvm.loop !17

._crit_edge.1:                                    ; preds = %._crit_edge.1.loopexit.unr-lcssa, %.epil.preheader95, %._crit_edge
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %0) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %0) #7
  %51 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %0)
  store double 1.000000e+00, ptr getelementptr inbounds (i8, ptr @p, i64 336), align 16, !tbaa !9
  %52 = load i32, ptr @n, align 4, !tbaa !11
  %.not4350.2 = icmp slt i32 %52, 1
  br i1 %.not4350.2, label %._crit_edge.2, label %.lr.ph.2

.lr.ph.2:                                         ; preds = %._crit_edge.1
  %53 = load double, ptr %0, align 8, !tbaa !9
  %54 = zext nneg i32 %52 to i64
  %xtraiter103 = and i64 %54, 3
  %55 = icmp ult i32 %52, 4
  br i1 %55, label %._crit_edge.2.loopexit.unr-lcssa, label %.lr.ph.2.new

.lr.ph.2.new:                                     ; preds = %.lr.ph.2
  %unroll_iter107 = and i64 %54, 2147483644
  br label %56

56:                                               ; preds = %56, %.lr.ph.2.new
  %57 = phi double [ 1.000000e+00, %.lr.ph.2.new ], [ %64, %56 ]
  %indvars.iv.2 = phi i64 [ 1, %.lr.ph.2.new ], [ %indvars.iv.next.2.3, %56 ]
  %niter108 = phi i64 [ 0, %.lr.ph.2.new ], [ %niter108.next.3, %56 ]
  %58 = fmul double %57, %53
  %59 = getelementptr inbounds [4 x [21 x double]], ptr @p, i64 0, i64 2, i64 %indvars.iv.2
  store double %58, ptr %59, align 8, !tbaa !9
  %indvars.iv.next.2 = add nuw nsw i64 %indvars.iv.2, 1
  %60 = fmul double %58, %53
  %61 = getelementptr inbounds [4 x [21 x double]], ptr @p, i64 0, i64 2, i64 %indvars.iv.next.2
  store double %60, ptr %61, align 8, !tbaa !9
  %indvars.iv.next.2.1 = add nuw nsw i64 %indvars.iv.2, 2
  %62 = fmul double %60, %53
  %63 = getelementptr inbounds [4 x [21 x double]], ptr @p, i64 0, i64 2, i64 %indvars.iv.next.2.1
  store double %62, ptr %63, align 8, !tbaa !9
  %indvars.iv.next.2.2 = add nuw nsw i64 %indvars.iv.2, 3
  %64 = fmul double %62, %53
  %65 = getelementptr inbounds [4 x [21 x double]], ptr @p, i64 0, i64 2, i64 %indvars.iv.next.2.2
  store double %64, ptr %65, align 8, !tbaa !9
  %indvars.iv.next.2.3 = add nuw nsw i64 %indvars.iv.2, 4
  %niter108.next.3 = add i64 %niter108, 4
  %niter108.ncmp.3 = icmp eq i64 %niter108.next.3, %unroll_iter107
  br i1 %niter108.ncmp.3, label %._crit_edge.2.loopexit.unr-lcssa, label %56, !llvm.loop !15

._crit_edge.2.loopexit.unr-lcssa:                 ; preds = %56, %.lr.ph.2
  %.unr105 = phi double [ 1.000000e+00, %.lr.ph.2 ], [ %64, %56 ]
  %indvars.iv.2.unr = phi i64 [ 1, %.lr.ph.2 ], [ %indvars.iv.next.2.3, %56 ]
  %lcmp.mod106.not = icmp eq i64 %xtraiter103, 0
  br i1 %lcmp.mod106.not, label %._crit_edge.2, label %.epil.preheader102

.epil.preheader102:                               ; preds = %._crit_edge.2.loopexit.unr-lcssa, %.epil.preheader102
  %66 = phi double [ %67, %.epil.preheader102 ], [ %.unr105, %._crit_edge.2.loopexit.unr-lcssa ]
  %indvars.iv.2.epil = phi i64 [ %indvars.iv.next.2.epil, %.epil.preheader102 ], [ %indvars.iv.2.unr, %._crit_edge.2.loopexit.unr-lcssa ]
  %epil.iter104 = phi i64 [ %epil.iter104.next, %.epil.preheader102 ], [ 0, %._crit_edge.2.loopexit.unr-lcssa ]
  %67 = fmul double %66, %53
  %68 = getelementptr inbounds [4 x [21 x double]], ptr @p, i64 0, i64 2, i64 %indvars.iv.2.epil
  store double %67, ptr %68, align 8, !tbaa !9
  %indvars.iv.next.2.epil = add nuw nsw i64 %indvars.iv.2.epil, 1
  %epil.iter104.next = add i64 %epil.iter104, 1
  %epil.iter104.cmp.not = icmp eq i64 %epil.iter104.next, %xtraiter103
  br i1 %epil.iter104.cmp.not, label %._crit_edge.2, label %.epil.preheader102, !llvm.loop !18

._crit_edge.2:                                    ; preds = %._crit_edge.2.loopexit.unr-lcssa, %.epil.preheader102, %._crit_edge.1
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %0) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %0) #7
  %69 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %0)
  store double 1.000000e+00, ptr getelementptr inbounds (i8, ptr @p, i64 504), align 8, !tbaa !9
  %70 = load i32, ptr @n, align 4, !tbaa !11
  %.not4350.3 = icmp slt i32 %70, 1
  br i1 %.not4350.3, label %._crit_edge.3, label %.lr.ph.3

.lr.ph.3:                                         ; preds = %._crit_edge.2
  %71 = load double, ptr %0, align 8, !tbaa !9
  %72 = zext nneg i32 %70 to i64
  %xtraiter110 = and i64 %72, 3
  %73 = icmp ult i32 %70, 4
  br i1 %73, label %._crit_edge.3.loopexit.unr-lcssa, label %.lr.ph.3.new

.lr.ph.3.new:                                     ; preds = %.lr.ph.3
  %unroll_iter114 = and i64 %72, 2147483644
  br label %74

74:                                               ; preds = %74, %.lr.ph.3.new
  %75 = phi double [ 1.000000e+00, %.lr.ph.3.new ], [ %82, %74 ]
  %indvars.iv.3 = phi i64 [ 1, %.lr.ph.3.new ], [ %indvars.iv.next.3.3, %74 ]
  %niter115 = phi i64 [ 0, %.lr.ph.3.new ], [ %niter115.next.3, %74 ]
  %76 = fmul double %75, %71
  %77 = getelementptr inbounds [4 x [21 x double]], ptr @p, i64 0, i64 3, i64 %indvars.iv.3
  store double %76, ptr %77, align 8, !tbaa !9
  %indvars.iv.next.3 = add nuw nsw i64 %indvars.iv.3, 1
  %78 = fmul double %76, %71
  %79 = getelementptr inbounds [4 x [21 x double]], ptr @p, i64 0, i64 3, i64 %indvars.iv.next.3
  store double %78, ptr %79, align 8, !tbaa !9
  %indvars.iv.next.3.1 = add nuw nsw i64 %indvars.iv.3, 2
  %80 = fmul double %78, %71
  %81 = getelementptr inbounds [4 x [21 x double]], ptr @p, i64 0, i64 3, i64 %indvars.iv.next.3.1
  store double %80, ptr %81, align 8, !tbaa !9
  %indvars.iv.next.3.2 = add nuw nsw i64 %indvars.iv.3, 3
  %82 = fmul double %80, %71
  %83 = getelementptr inbounds [4 x [21 x double]], ptr @p, i64 0, i64 3, i64 %indvars.iv.next.3.2
  store double %82, ptr %83, align 8, !tbaa !9
  %indvars.iv.next.3.3 = add nuw nsw i64 %indvars.iv.3, 4
  %niter115.next.3 = add i64 %niter115, 4
  %niter115.ncmp.3 = icmp eq i64 %niter115.next.3, %unroll_iter114
  br i1 %niter115.ncmp.3, label %._crit_edge.3.loopexit.unr-lcssa, label %74, !llvm.loop !15

._crit_edge.3.loopexit.unr-lcssa:                 ; preds = %74, %.lr.ph.3
  %.unr112 = phi double [ 1.000000e+00, %.lr.ph.3 ], [ %82, %74 ]
  %indvars.iv.3.unr = phi i64 [ 1, %.lr.ph.3 ], [ %indvars.iv.next.3.3, %74 ]
  %lcmp.mod113.not = icmp eq i64 %xtraiter110, 0
  br i1 %lcmp.mod113.not, label %._crit_edge.3, label %.epil.preheader109

.epil.preheader109:                               ; preds = %._crit_edge.3.loopexit.unr-lcssa, %.epil.preheader109
  %84 = phi double [ %85, %.epil.preheader109 ], [ %.unr112, %._crit_edge.3.loopexit.unr-lcssa ]
  %indvars.iv.3.epil = phi i64 [ %indvars.iv.next.3.epil, %.epil.preheader109 ], [ %indvars.iv.3.unr, %._crit_edge.3.loopexit.unr-lcssa ]
  %epil.iter111 = phi i64 [ %epil.iter111.next, %.epil.preheader109 ], [ 0, %._crit_edge.3.loopexit.unr-lcssa ]
  %85 = fmul double %84, %71
  %86 = getelementptr inbounds [4 x [21 x double]], ptr @p, i64 0, i64 3, i64 %indvars.iv.3.epil
  store double %85, ptr %86, align 8, !tbaa !9
  %indvars.iv.next.3.epil = add nuw nsw i64 %indvars.iv.3.epil, 1
  %epil.iter111.next = add i64 %epil.iter111, 1
  %epil.iter111.cmp.not = icmp eq i64 %epil.iter111.next, %xtraiter110
  br i1 %epil.iter111.cmp.not, label %._crit_edge.3, label %.epil.preheader109, !llvm.loop !19

._crit_edge.3:                                    ; preds = %._crit_edge.3.loopexit.unr-lcssa, %.epil.preheader109, %._crit_edge.2
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %0) #7
  %87 = call noundef zeroext i1 @_ZNKSt14priority_queueISt4pairIdxESt6vectorIS1_SaIS1_EESt7greaterIS1_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25) @Q)
  br i1 %87, label %.preheader46, label %.lr.ph53

88:                                               ; preds = %88, %.lr.ph.new
  %89 = phi double [ 1.000000e+00, %.lr.ph.new ], [ %96, %88 ]
  %indvars.iv = phi i64 [ 1, %.lr.ph.new ], [ %indvars.iv.next.394, %88 ]
  %niter = phi i64 [ 0, %.lr.ph.new ], [ %niter.next.3, %88 ]
  %90 = fmul double %89, %27
  %91 = getelementptr inbounds [4 x [21 x double]], ptr @p, i64 0, i64 0, i64 %indvars.iv
  store double %90, ptr %91, align 8, !tbaa !9
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %92 = fmul double %90, %27
  %93 = getelementptr inbounds [4 x [21 x double]], ptr @p, i64 0, i64 0, i64 %indvars.iv.next
  store double %92, ptr %93, align 8, !tbaa !9
  %indvars.iv.next.190 = add nuw nsw i64 %indvars.iv, 2
  %94 = fmul double %92, %27
  %95 = getelementptr inbounds [4 x [21 x double]], ptr @p, i64 0, i64 0, i64 %indvars.iv.next.190
  store double %94, ptr %95, align 8, !tbaa !9
  %indvars.iv.next.292 = add nuw nsw i64 %indvars.iv, 3
  %96 = fmul double %94, %27
  %97 = getelementptr inbounds [4 x [21 x double]], ptr @p, i64 0, i64 0, i64 %indvars.iv.next.292
  store double %96, ptr %97, align 8, !tbaa !9
  %indvars.iv.next.394 = add nuw nsw i64 %indvars.iv, 4
  %niter.next.3 = add i64 %niter, 4
  %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3, label %._crit_edge.loopexit.unr-lcssa, label %88, !llvm.loop !15

.preheader46:                                     ; preds = %.lr.ph53, %._crit_edge.3
  %98 = load i32, ptr @n, align 4, !tbaa !11
  %.not61 = icmp slt i32 %98, 0
  br i1 %.not61, label %.preheader45, label %.preheader44

.lr.ph53:                                         ; preds = %._crit_edge.3, %.lr.ph53
  call void @_ZNSt14priority_queueISt4pairIdxESt6vectorIS1_SaIS1_EESt7greaterIS1_EE3popEv(ptr noundef nonnull align 8 dereferenceable(25) @Q)
  %99 = call noundef zeroext i1 @_ZNKSt14priority_queueISt4pairIdxESt6vectorIS1_SaIS1_EESt7greaterIS1_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25) @Q)
  br i1 %99, label %.preheader46, label %.lr.ph53, !llvm.loop !20

.preheader45:                                     ; preds = %._crit_edge60, %.preheader46
  %100 = call noundef zeroext i1 @_ZNKSt14priority_queueISt4pairIdxESt6vectorIS1_SaIS1_EESt7greaterIS1_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25) @Q)
  br i1 %100, label %._crit_edge64, label %.lr.ph63

.preheader44:                                     ; preds = %.preheader46, %._crit_edge60
  %101 = phi i32 [ %111, %._crit_edge60 ], [ %98, %.preheader46 ]
  %indvars.iv73 = phi i64 [ %indvars.iv.next74, %._crit_edge60 ], [ 0, %.preheader46 ]
  %102 = sext i32 %101 to i64
  %.not4158 = icmp sgt i64 %indvars.iv73, %102
  br i1 %.not4158, label %._crit_edge60, label %.preheader.lr.ph

.preheader.lr.ph:                                 ; preds = %.preheader44
  %103 = getelementptr inbounds [21 x double], ptr @p, i64 0, i64 %indvars.iv73
  %104 = getelementptr inbounds [21 x i64], ptr @fact, i64 0, i64 %indvars.iv73
  br label %.preheader

.preheader:                                       ; preds = %.preheader.lr.ph, %._crit_edge57
  %105 = phi i32 [ %101, %.preheader.lr.ph ], [ %112, %._crit_edge57 ]
  %106 = phi i32 [ %101, %.preheader.lr.ph ], [ %113, %._crit_edge57 ]
  %indvars.iv75 = phi i64 [ %indvars.iv73, %.preheader.lr.ph ], [ %indvars.iv.next76, %._crit_edge57 ]
  %107 = sext i32 %106 to i64
  %.not4254 = icmp sgt i64 %indvars.iv75, %107
  br i1 %.not4254, label %._crit_edge57, label %.lr.ph56

.lr.ph56:                                         ; preds = %.preheader
  %108 = sub nuw nsw i64 %indvars.iv75, %indvars.iv73
  %109 = getelementptr inbounds [21 x double], ptr getelementptr inbounds (i8, ptr @p, i64 168), i64 0, i64 %108
  %110 = getelementptr inbounds [21 x i64], ptr @fact, i64 0, i64 %108
  br label %114

._crit_edge60.loopexit:                           ; preds = %._crit_edge57
  %.pre = sext i32 %112 to i64
  br label %._crit_edge60

._crit_edge60:                                    ; preds = %._crit_edge60.loopexit, %.preheader44
  %.pre-phi = phi i64 [ %.pre, %._crit_edge60.loopexit ], [ %102, %.preheader44 ]
  %111 = phi i32 [ %112, %._crit_edge60.loopexit ], [ %101, %.preheader44 ]
  %indvars.iv.next74 = add nuw nsw i64 %indvars.iv73, 1
  %.not.not = icmp slt i64 %indvars.iv73, %.pre-phi
  br i1 %.not.not, label %.preheader44, label %.preheader45, !llvm.loop !21

._crit_edge57:                                    ; preds = %114, %.preheader
  %.pre-phi82 = phi i64 [ %107, %.preheader ], [ %145, %114 ]
  %112 = phi i32 [ %105, %.preheader ], [ %144, %114 ]
  %113 = phi i32 [ %106, %.preheader ], [ %144, %114 ]
  %indvars.iv.next76 = add nuw nsw i64 %indvars.iv75, 1
  %.not41.not = icmp slt i64 %indvars.iv75, %.pre-phi82
  br i1 %.not41.not, label %.preheader, label %._crit_edge60.loopexit, !llvm.loop !22

114:                                              ; preds = %.lr.ph56, %114
  %indvars.iv77 = phi i64 [ %indvars.iv75, %.lr.ph56 ], [ %indvars.iv.next78, %114 ]
  %115 = phi i32 [ %106, %.lr.ph56 ], [ %144, %114 ]
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %1) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #7
  %116 = load double, ptr %103, align 8, !tbaa !9
  %117 = load double, ptr %109, align 8, !tbaa !9
  %118 = fmul double %116, %117
  %119 = sub nuw nsw i64 %indvars.iv77, %indvars.iv75
  %120 = getelementptr inbounds [21 x double], ptr getelementptr inbounds (i8, ptr @p, i64 336), i64 0, i64 %119
  %121 = load double, ptr %120, align 8, !tbaa !9
  %122 = fmul double %118, %121
  %123 = sext i32 %115 to i64
  %124 = sub nsw i64 %123, %indvars.iv77
  %125 = getelementptr inbounds [21 x double], ptr getelementptr inbounds (i8, ptr @p, i64 504), i64 0, i64 %124
  %126 = load double, ptr %125, align 8, !tbaa !9
  %127 = fmul double %122, %126
  store double %127, ptr %2, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #7
  %128 = getelementptr inbounds [21 x i64], ptr @fact, i64 0, i64 %123
  %129 = load i64, ptr %128, align 8, !tbaa !5
  %130 = load i64, ptr %104, align 8, !tbaa !5
  %131 = sdiv i64 %129, %130
  %132 = load i64, ptr %110, align 8, !tbaa !5
  %133 = sdiv i64 %131, %132
  %134 = getelementptr inbounds [21 x i64], ptr @fact, i64 0, i64 %119
  %135 = load i64, ptr %134, align 8, !tbaa !5
  %136 = sdiv i64 %133, %135
  %137 = getelementptr inbounds [21 x i64], ptr @fact, i64 0, i64 %124
  %138 = load i64, ptr %137, align 8, !tbaa !5
  %139 = sdiv i64 %136, %138
  %140 = sub nsw i64 0, %139
  store i64 %140, ptr %3, align 8, !tbaa !5
  %141 = call { double, i64 } @_ZSt9make_pairIdxESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS1_INS2_IT0_E4typeEE6__typeEEOS3_OS8_(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 8 dereferenceable(8) %3)
  %142 = extractvalue { double, i64 } %141, 0
  store double %142, ptr %1, align 8
  %143 = extractvalue { double, i64 } %141, 1
  store i64 %143, ptr %17, align 8
  call void @_ZNSt14priority_queueISt4pairIdxESt6vectorIS1_SaIS1_EESt7greaterIS1_EE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(25) @Q, ptr noundef nonnull align 8 dereferenceable(16) %1)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %1) #7
  %indvars.iv.next78 = add nuw nsw i64 %indvars.iv77, 1
  %144 = load i32, ptr @n, align 4, !tbaa !11
  %145 = sext i32 %144 to i64
  %.not42.not = icmp slt i64 %indvars.iv77, %145
  br i1 %.not42.not, label %114, label %._crit_edge57, !llvm.loop !23

.lr.ph63:                                         ; preds = %.preheader45, %189
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #7
  %146 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNKSt14priority_queueISt4pairIdxESt6vectorIS1_SaIS1_EESt7greaterIS1_EE3topEv(ptr noundef nonnull align 8 dereferenceable(25) @Q)
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %4, ptr noundef nonnull align 8 dereferenceable(16) %146, i64 16, i1 false)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #7
  call void @_ZNSt4pairIdxEC2IdxTnNSt9enable_ifIXsr6__and_ISt37__is_implicitly_default_constructibleIT_ES3_IT0_EEE5valueEbE4typeELb1EEEv(ptr noundef nonnull align 8 dereferenceable(16) %5)
  call void @_ZNSt14priority_queueISt4pairIdxESt6vectorIS1_SaIS1_EESt7greaterIS1_EE3popEv(ptr noundef nonnull align 8 dereferenceable(25) @Q)
  %147 = load i64, ptr %18, align 8, !tbaa !24
  %148 = icmp slt i64 %147, -1
  br i1 %148, label %149, label %169

149:                                              ; preds = %.lr.ph63
  %150 = and i64 %147, 1
  %.not40 = icmp eq i64 %150, 0
  br i1 %.not40, label %157, label %151

151:                                              ; preds = %149
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #7
  store i64 -1, ptr %7, align 8, !tbaa !5
  %152 = call { double, i64 } @_ZSt9make_pairIRdxESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %7)
  %153 = extractvalue { double, i64 } %152, 0
  store double %153, ptr %6, align 8
  %154 = extractvalue { double, i64 } %152, 1
  store i64 %154, ptr %22, align 8
  call void @_ZNSt14priority_queueISt4pairIdxESt6vectorIS1_SaIS1_EESt7greaterIS1_EE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(25) @Q, ptr noundef nonnull align 8 dereferenceable(16) %6)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #7
  %155 = load i64, ptr %18, align 8, !tbaa !24
  %156 = add nsw i64 %155, 1
  store i64 %156, ptr %18, align 8, !tbaa !24
  br label %157

157:                                              ; preds = %151, %149
  %158 = phi i64 [ %156, %151 ], [ %147, %149 ]
  %159 = load double, ptr %4, align 8, !tbaa !26
  %160 = sub nsw i64 0, %158
  %161 = sitofp i64 %160 to double
  %162 = load double, ptr @ans, align 8, !tbaa !9
  %163 = call double @llvm.fmuladd.f64(double %159, double %161, double %162)
  store double %163, ptr @ans, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %8) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #7
  %164 = fmul double %159, 2.000000e+00
  store double %164, ptr %9, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #7
  %165 = ashr i64 %158, 1
  store i64 %165, ptr %10, align 8, !tbaa !5
  %166 = call { double, i64 } @_ZSt9make_pairIdxESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS1_INS2_IT0_E4typeEE6__typeEEOS3_OS8_(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 8 dereferenceable(8) %10)
  %167 = extractvalue { double, i64 } %166, 0
  store double %167, ptr %8, align 8
  %168 = extractvalue { double, i64 } %166, 1
  store i64 %168, ptr %23, align 8
  call void @_ZNSt14priority_queueISt4pairIdxESt6vectorIS1_SaIS1_EESt7greaterIS1_EE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(25) @Q, ptr noundef nonnull align 8 dereferenceable(16) %8)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %8) #7
  br label %189

169:                                              ; preds = %.lr.ph63
  %170 = call noundef zeroext i1 @_ZNKSt14priority_queueISt4pairIdxESt6vectorIS1_SaIS1_EESt7greaterIS1_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25) @Q)
  br i1 %170, label %189, label %171

171:                                              ; preds = %169
  %172 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNKSt14priority_queueISt4pairIdxESt6vectorIS1_SaIS1_EESt7greaterIS1_EE3topEv(ptr noundef nonnull align 8 dereferenceable(25) @Q)
  %173 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt4pairIdxEaSERKS0_(ptr noundef nonnull align 8 dereferenceable(16) %5, ptr noundef nonnull align 8 dereferenceable(16) %172)
  call void @_ZNSt14priority_queueISt4pairIdxESt6vectorIS1_SaIS1_EESt7greaterIS1_EE3popEv(ptr noundef nonnull align 8 dereferenceable(25) @Q)
  %174 = load double, ptr %4, align 8, !tbaa !26
  %175 = load double, ptr %5, align 8, !tbaa !26
  %176 = fadd double %174, %175
  %177 = load double, ptr @ans, align 8, !tbaa !9
  %178 = fadd double %177, %176
  store double %178, ptr @ans, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %11) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #7
  store double %176, ptr %12, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %13) #7
  store i64 -1, ptr %13, align 8, !tbaa !5
  %179 = call { double, i64 } @_ZSt9make_pairIdxESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS1_INS2_IT0_E4typeEE6__typeEEOS3_OS8_(ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef nonnull align 8 dereferenceable(8) %13)
  %180 = extractvalue { double, i64 } %179, 0
  store double %180, ptr %11, align 8
  %181 = extractvalue { double, i64 } %179, 1
  store i64 %181, ptr %19, align 8
  call void @_ZNSt14priority_queueISt4pairIdxESt6vectorIS1_SaIS1_EESt7greaterIS1_EE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(25) @Q, ptr noundef nonnull align 8 dereferenceable(16) %11)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %11) #7
  %182 = load i64, ptr %20, align 8, !tbaa !24
  %183 = icmp slt i64 %182, -1
  br i1 %183, label %184, label %189

184:                                              ; preds = %171
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %14) #7
  %185 = add nuw nsw i64 %182, 1
  store i64 %185, ptr %20, align 8, !tbaa !24
  %186 = call { double, i64 } @_ZSt9make_pairIRdRxESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %20)
  %187 = extractvalue { double, i64 } %186, 0
  store double %187, ptr %14, align 8
  %188 = extractvalue { double, i64 } %186, 1
  store i64 %188, ptr %21, align 8
  call void @_ZNSt14priority_queueISt4pairIdxESt6vectorIS1_SaIS1_EESt7greaterIS1_EE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(25) @Q, ptr noundef nonnull align 8 dereferenceable(16) %14)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %14) #7
  br label %189

189:                                              ; preds = %169, %184, %171, %157
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #7
  %190 = call noundef zeroext i1 @_ZNKSt14priority_queueISt4pairIdxESt6vectorIS1_SaIS1_EESt7greaterIS1_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(25) @Q)
  br i1 %190, label %._crit_edge64, label %.lr.ph63, !llvm.loop !27

._crit_edge64:                                    ; preds = %189, %.preheader45
  %191 = load double, ptr @ans, align 8, !tbaa !9
  %192 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, double noundef %191)
  %193 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n)
  %194 = icmp eq i32 %193, 1
  br i1 %194, label %24, label %._crit_edge66, !llvm.loop !28

._crit_edge66:                                    ; preds = %._crit_edge64, %.preheader48
  ret i32 0
}

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

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

; Function Attrs: nofree nounwind
declare noundef i32 @__isoc99_scanf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt14priority_queueISt4pairIdxESt6vectorIS1_SaIS1_EESt7greaterIS1_EE3popEv(ptr noundef nonnull align 8 dereferenceable(25)) local_unnamed_addr #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt14priority_queueISt4pairIdxESt6vectorIS1_SaIS1_EESt7greaterIS1_EE4pushEOS1_(ptr noundef nonnull align 8 dereferenceable(25), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local { double, i64 } @_ZSt9make_pairIdxESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS1_INS2_IT0_E4typeEE6__typeEEOS3_OS8_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #4

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local { double, i64 } @_ZSt9make_pairIRdxESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #4

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #6

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

; Function Attrs: mustprogress uwtable
declare dso_local { double, i64 } @_ZSt9make_pairIRdRxESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #4

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2

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

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

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


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