; LLVM IR from garethcmurphy/Interstellar-Jet-MHD-Simulation :: src/cooling.ll (Z7coolingPdS_d)

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

@atomic_temp_tab = external dso_local global [50 x double], align 16

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z7coolingPdS_d(ptr noundef %0, ptr noundef %1, double noundef %2) #0 {
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca double, align 8
  %8 = alloca i32, align 4
  %9 = alloca double, align 8
  %10 = alloca double, align 8
  %11 = alloca double, align 8
  %12 = alloca double, align 8
  %13 = alloca double, align 8
  %14 = alloca double, align 8
  %15 = alloca double, align 8
  %16 = alloca double, align 8
  %17 = alloca double, align 8
  %18 = alloca double, align 8
  %19 = alloca double, align 8
  %20 = alloca double, align 8
  %21 = alloca double, align 8
  %22 = alloca double, align 8
  %23 = alloca double, align 8
  %24 = alloca double, align 8
  %25 = alloca double, align 8
  %26 = alloca double, align 8
  %27 = alloca double, align 8
  %28 = alloca double, align 8
  %29 = alloca double, align 8
  %30 = alloca double, align 8
  %31 = alloca double, align 8
  %32 = alloca double, align 8
  %33 = alloca double, align 8
  %34 = alloca double, align 8
  %35 = alloca double, align 8
  %36 = alloca double, align 8
  %37 = alloca double, align 8
  %38 = alloca double, align 8
  %39 = alloca double, align 8
  %40 = alloca double, align 8
  %41 = alloca double, align 8
  %42 = alloca double, align 8
  %43 = alloca double, align 8
  %44 = alloca double, align 8
  %45 = alloca double, align 8
  %46 = alloca double, align 8
  %47 = alloca double, align 8
  %48 = alloca double, align 8
  %49 = alloca i32, align 4
  %50 = alloca i32, align 4
  %51 = alloca double, align 8
  %52 = alloca double, align 8
  %53 = alloca double, align 8
  %54 = alloca double, align 8
  %55 = alloca i32, align 4
  %56 = alloca double, align 8
  %57 = alloca double, align 8
  %58 = alloca double, align 8
  %59 = alloca double, align 8
  %60 = alloca double, align 8
  %61 = alloca double, align 8
  %62 = alloca double, align 8
  %63 = alloca double, align 8
  %64 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store double %2, ptr %7, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  store i32 0, ptr %8, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  store double 0x3FFAAAAAAAAAAAAB, ptr %9, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  %65 = load double, ptr %9, align 8, !tbaa !9
  %66 = fsub double %65, 1.000000e+00
  store double %66, ptr %10, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  %67 = load double, ptr %9, align 8, !tbaa !9
  %68 = fsub double %67, 1.000000e+00
  store double %68, ptr %11, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  %69 = load double, ptr %9, align 8, !tbaa !9
  %70 = fdiv double 1.000000e+00, %69
  store double %70, ptr %12, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #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 8, ptr %17) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %29) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %30) #6
  store double 0x40D7BA17A786C227, ptr %30, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %31) #6
  store double 0x3FFAC30ED88AF10A, ptr %31, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %32) #6
  %71 = load double, ptr %31, align 8, !tbaa !9
  %72 = fdiv double 1.000000e+00, %71
  store double %72, ptr %32, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %33) #6
  store double 0.000000e+00, ptr %33, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %34) #6
  store double 0.000000e+00, ptr %34, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %35) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %36) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %37) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %38) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %39) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %40) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %41) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %42) #6
  store double 0.000000e+00, ptr %42, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %43) #6
  store double 0.000000e+00, ptr %43, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %44) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %45) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %46) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %47) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %48) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %49) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %50) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %51) #6
  store double 1.000000e+00, ptr %51, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %52) #6
  store double 1.000000e+00, ptr %52, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %53) #6
  store double 1.000000e+00, ptr %53, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %54) #6
  store double 1.000000e+00, ptr %54, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %55) #6
  store i32 0, ptr %55, align 4, !tbaa !11
  %73 = load ptr, ptr %5, align 8, !tbaa !5
  %74 = getelementptr inbounds double, ptr %73, i64 0
  %75 = load double, ptr %74, align 8, !tbaa !9
  store double %75, ptr %19, align 8, !tbaa !9
  %76 = load ptr, ptr %5, align 8, !tbaa !5
  %77 = getelementptr inbounds double, ptr %76, i64 1
  %78 = load double, ptr %77, align 8, !tbaa !9
  store double %78, ptr %14, align 8, !tbaa !9
  %79 = load ptr, ptr %5, align 8, !tbaa !5
  %80 = getelementptr inbounds double, ptr %79, i64 2
  %81 = load double, ptr %80, align 8, !tbaa !9
  store double %81, ptr %15, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %56) #6
  %82 = load ptr, ptr %5, align 8, !tbaa !5
  %83 = getelementptr inbounds double, ptr %82, i64 3
  %84 = load double, ptr %83, align 8, !tbaa !9
  store double %84, ptr %56, align 8, !tbaa !9
  %85 = load ptr, ptr %5, align 8, !tbaa !5
  %86 = getelementptr inbounds double, ptr %85, i64 4
  %87 = load double, ptr %86, align 8, !tbaa !9
  store double %87, ptr %16, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %57) #6
  %88 = load ptr, ptr %5, align 8, !tbaa !5
  %89 = getelementptr inbounds double, ptr %88, i64 5
  %90 = load double, ptr %89, align 8, !tbaa !9
  store double %90, ptr %57, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %58) #6
  %91 = load ptr, ptr %5, align 8, !tbaa !5
  %92 = getelementptr inbounds double, ptr %91, i64 6
  %93 = load double, ptr %92, align 8, !tbaa !9
  store double %93, ptr %58, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %59) #6
  %94 = load ptr, ptr %5, align 8, !tbaa !5
  %95 = getelementptr inbounds double, ptr %94, i64 7
  %96 = load double, ptr %95, align 8, !tbaa !9
  store double %96, ptr %59, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %60) #6
  %97 = load double, ptr %57, align 8, !tbaa !9
  %98 = load double, ptr %57, align 8, !tbaa !9
  %99 = load double, ptr %58, align 8, !tbaa !9
  %100 = load double, ptr %58, align 8, !tbaa !9
  %101 = fmul double %99, %100
  %102 = call double @llvm.fmuladd.f64(double %97, double %98, double %101)
  %103 = load double, ptr %59, align 8, !tbaa !9
  %104 = load double, ptr %59, align 8, !tbaa !9
  %105 = call double @llvm.fmuladd.f64(double %103, double %104, double %102)
  store double %105, ptr %60, align 8, !tbaa !9
  %106 = load double, ptr %19, align 8, !tbaa !9
  %107 = fdiv double 1.000000e+00, %106
  store double %107, ptr %13, align 8, !tbaa !9
  %108 = load double, ptr %14, align 8, !tbaa !9
  %109 = load double, ptr %13, align 8, !tbaa !9
  %110 = fmul double %108, %109
  store double %110, ptr %20, align 8, !tbaa !9
  %111 = load double, ptr %15, align 8, !tbaa !9
  %112 = load double, ptr %13, align 8, !tbaa !9
  %113 = fmul double %111, %112
  store double %113, ptr %21, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %61) #6
  %114 = load double, ptr %56, align 8, !tbaa !9
  %115 = load double, ptr %13, align 8, !tbaa !9
  %116 = fmul double %114, %115
  store double %116, ptr %61, align 8, !tbaa !9
  %117 = load double, ptr %20, align 8, !tbaa !9
  %118 = load double, ptr %20, align 8, !tbaa !9
  %119 = fmul double %117, %118
  store double %119, ptr %25, align 8, !tbaa !9
  %120 = load double, ptr %21, align 8, !tbaa !9
  %121 = load double, ptr %21, align 8, !tbaa !9
  %122 = fmul double %120, %121
  store double %122, ptr %26, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %62) #6
  %123 = load double, ptr %61, align 8, !tbaa !9
  %124 = load double, ptr %61, align 8, !tbaa !9
  %125 = fmul double %123, %124
  store double %125, ptr %62, align 8, !tbaa !9
  %126 = load double, ptr %19, align 8, !tbaa !9
  %127 = fmul double 5.000000e-01, %126
  %128 = load double, ptr %25, align 8, !tbaa !9
  %129 = load double, ptr %26, align 8, !tbaa !9
  %130 = fadd double %128, %129
  %131 = load double, ptr %62, align 8, !tbaa !9
  %132 = fadd double %130, %131
  %133 = fmul double %127, %132
  store double %133, ptr %17, align 8, !tbaa !9
  %134 = load double, ptr %16, align 8, !tbaa !9
  %135 = load double, ptr %17, align 8, !tbaa !9
  %136 = fsub double %134, %135
  %137 = load double, ptr %60, align 8, !tbaa !9
  %138 = call double @llvm.fmuladd.f64(double -5.000000e-01, double %137, double %136)
  store double %138, ptr %22, align 8, !tbaa !9
  %139 = load double, ptr %22, align 8, !tbaa !9
  %140 = load double, ptr %10, align 8, !tbaa !9
  %141 = fmul double %139, %140
  store double %141, ptr %22, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %63) #6
  store double 1.000000e-05, ptr %63, align 8, !tbaa !9
  %142 = load double, ptr %22, align 8, !tbaa !9
  %143 = load double, ptr %63, align 8, !tbaa !9
  %144 = fcmp olt double %142, %143
  br i1 %144, label %145, label %146

145:                                              ; preds = %3
  store i32 0, ptr %4, align 4
  store i32 1, ptr %64, align 4
  br label %261

146:                                              ; preds = %3
  %147 = load double, ptr %9, align 8, !tbaa !9
  store double %147, ptr %23, align 8, !tbaa !9
  %148 = load double, ptr %23, align 8, !tbaa !9
  %149 = load double, ptr %13, align 8, !tbaa !9
  %150 = fmul double %148, %149
  %151 = load double, ptr %22, align 8, !tbaa !9
  %152 = fmul double %150, %151
  store double %152, ptr %23, align 8, !tbaa !9
  %153 = load double, ptr %23, align 8, !tbaa !9
  %154 = call double @sqrt(double noundef %153) #6
  store double %154, ptr %23, align 8, !tbaa !9
  %155 = load double, ptr %32, align 8, !tbaa !9
  %156 = fmul double 2.000000e+00, %155
  %157 = load double, ptr %19, align 8, !tbaa !9
  %158 = fmul double %156, %157
  store double %158, ptr %33, align 8, !tbaa !9
  %159 = load double, ptr %33, align 8, !tbaa !9
  %160 = load double, ptr %33, align 8, !tbaa !9
  %161 = fmul double %159, %160
  store double %161, ptr %36, align 8, !tbaa !9
  %162 = load double, ptr %30, align 8, !tbaa !9
  %163 = load double, ptr %22, align 8, !tbaa !9
  %164 = fmul double %162, %163
  %165 = load double, ptr %33, align 8, !tbaa !9
  %166 = fdiv double %164, %165
  store double %166, ptr %29, align 8, !tbaa !9
  %167 = load double, ptr %30, align 8, !tbaa !9
  %168 = load double, ptr %22, align 8, !tbaa !9
  %169 = fmul double %167, %168
  %170 = load double, ptr %33, align 8, !tbaa !9
  %171 = fdiv double %169, %170
  store double %171, ptr %54, align 8, !tbaa !9
  %172 = load double, ptr %29, align 8, !tbaa !9
  %173 = call double @log10(double noundef %172) #6
  store double %173, ptr %29, align 8, !tbaa !9
  %174 = load double, ptr %7, align 8, !tbaa !9
  %175 = fdiv double %174, 1.000000e+02
  store double %175, ptr %44, align 8, !tbaa !9
  %176 = load double, ptr @atomic_temp_tab, align 16, !tbaa !9
  store double %176, ptr %45, align 8, !tbaa !9
  store double 0.000000e+00, ptr %46, align 8, !tbaa !9
  store double 0.000000e+00, ptr %47, align 8, !tbaa !9
  store i32 1, ptr %49, align 4, !tbaa !11
  %177 = load double, ptr %16, align 8, !tbaa !9
  %178 = load double, ptr %17, align 8, !tbaa !9
  %179 = fsub double %177, %178
  store double %179, ptr %48, align 8, !tbaa !9
  %180 = load double, ptr %16, align 8, !tbaa !9
  %181 = load double, ptr %17, align 8, !tbaa !9
  %182 = fsub double %180, %181
  store double %182, ptr %16, align 8, !tbaa !9
  %183 = load double, ptr %29, align 8, !tbaa !9
  %184 = load double, ptr %45, align 8, !tbaa !9
  %185 = fcmp ole double %183, %184
  br i1 %185, label %186, label %187

186:                                              ; preds = %146
  store double 0.000000e+00, ptr %34, align 8, !tbaa !9
  br label %189

187:                                              ; preds = %146
  %188 = load double, ptr %29, align 8, !tbaa !9
  call void @_Z7tabfinddPdS_(double noundef %188, ptr noundef %34, ptr noundef @atomic_temp_tab)
  br label %189

189:                                              ; preds = %187, %186
  %190 = load double, ptr %36, align 8, !tbaa !9
  %191 = load double, ptr %34, align 8, !tbaa !9
  %192 = fmul double %190, %191
  store double %192, ptr %35, align 8, !tbaa !9
  %193 = load ptr, ptr %6, align 8, !tbaa !5
  store double 0.000000e+00, ptr %193, align 8, !tbaa !9
  %194 = load double, ptr %11, align 8, !tbaa !9
  store double %194, ptr %41, align 8, !tbaa !9
  store i32 0, ptr %50, align 4, !tbaa !11
  store double 0.000000e+00, ptr %37, align 8, !tbaa !9
  br label %195

195:                                              ; preds = %250, %189
  %196 = load double, ptr %46, align 8, !tbaa !9
  %197 = load double, ptr %7, align 8, !tbaa !9
  %198 = fcmp olt double %196, %197
  br i1 %198, label %199, label %203

199:                                              ; preds = %195
  %200 = load double, ptr %29, align 8, !tbaa !9
  %201 = load double, ptr %45, align 8, !tbaa !9
  %202 = fcmp ogt double %200, %201
  br label %203

203:                                              ; preds = %199, %195
  %204 = phi i1 [ false, %195 ], [ %202, %199 ]
  br i1 %204, label %205, label %251

205:                                              ; preds = %203
  %206 = load double, ptr %7, align 8, !tbaa !9
  %207 = load double, ptr %46, align 8, !tbaa !9
  %208 = fsub double %206, %207
  store double %208, ptr %38, align 8, !tbaa !9
  %209 = load double, ptr %16, align 8, !tbaa !9
  %210 = fmul double 5.000000e-02, %209
  %211 = load double, ptr %35, align 8, !tbaa !9
  %212 = call noundef double @_ZSt3absd(double noundef %211)
  %213 = fdiv double %210, %212
  store double %213, ptr %39, align 8, !tbaa !9
  %214 = load double, ptr %38, align 8, !tbaa !9
  %215 = load double, ptr %39, align 8, !tbaa !9
  %216 = fcmp olt double %214, %215
  br i1 %216, label %217, label %219

217:                                              ; preds = %205
  %218 = load double, ptr %38, align 8, !tbaa !9
  br label %221

219:                                              ; preds = %205
  %220 = load double, ptr %39, align 8, !tbaa !9
  br label %221

221:                                              ; preds = %219, %217
  %222 = phi double [ %218, %217 ], [ %220, %219 ]
  store double %222, ptr %40, align 8, !tbaa !9
  %223 = load double, ptr %35, align 8, !tbaa !9
  %224 = load double, ptr %40, align 8, !tbaa !9
  %225 = fmul double %223, %224
  store double %225, ptr %47, align 8, !tbaa !9
  %226 = load double, ptr %16, align 8, !tbaa !9
  %227 = load double, ptr %47, align 8, !tbaa !9
  %228 = fsub double %226, %227
  store double %228, ptr %16, align 8, !tbaa !9
  %229 = load double, ptr %16, align 8, !tbaa !9
  %230 = load double, ptr %41, align 8, !tbaa !9
  %231 = fdiv double %229, %230
  store double %231, ptr %18, align 8, !tbaa !9
  %232 = load double, ptr %29, align 8, !tbaa !9
  %233 = load double, ptr %45, align 8, !tbaa !9
  %234 = fcmp ole double %232, %233
  br i1 %234, label %235, label %236

235:                                              ; preds = %221
  store double 0.000000e+00, ptr %35, align 8, !tbaa !9
  br label %241

236:                                              ; preds = %221
  %237 = load double, ptr %29, align 8, !tbaa !9
  call void @_Z7tabfinddPdS_(double noundef %237, ptr noundef %34, ptr noundef @atomic_temp_tab)
  %238 = load double, ptr %36, align 8, !tbaa !9
  %239 = load double, ptr %34, align 8, !tbaa !9
  %240 = fmul double %238, %239
  store double %240, ptr %35, align 8, !tbaa !9
  br label %241

241:                                              ; preds = %236, %235
  %242 = load i32, ptr %50, align 4, !tbaa !11
  %243 = add nsw i32 %242, 1
  store i32 %243, ptr %50, align 4, !tbaa !11
  %244 = load double, ptr %46, align 8, !tbaa !9
  %245 = load double, ptr %40, align 8, !tbaa !9
  %246 = fadd double %244, %245
  store double %246, ptr %46, align 8, !tbaa !9
  %247 = load i32, ptr %49, align 4, !tbaa !11
  %248 = icmp eq i32 %247, 0
  br i1 %248, label %249, label %250

249:                                              ; preds = %241
  store i32 0, ptr %49, align 4, !tbaa !11
  br label %250

250:                                              ; preds = %249, %241
  br label %195, !llvm.loop !13

251:                                              ; preds = %203
  %252 = load i32, ptr %50, align 4, !tbaa !11
  %253 = icmp sgt i32 %252, 0
  br i1 %253, label %254, label %260

254:                                              ; preds = %251
  %255 = load double, ptr %16, align 8, !tbaa !9
  %256 = load double, ptr %48, align 8, !tbaa !9
  %257 = fsub double %255, %256
  store double %257, ptr %37, align 8, !tbaa !9
  %258 = load double, ptr %37, align 8, !tbaa !9
  %259 = load ptr, ptr %6, align 8, !tbaa !5
  store double %258, ptr %259, align 8, !tbaa !9
  br label %260

260:                                              ; preds = %254, %251
  store i32 0, ptr %4, align 4
  store i32 1, ptr %64, align 4
  br label %261

261:                                              ; preds = %260, %145
  call void @llvm.lifetime.end.p0(i64 8, ptr %63) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %62) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %61) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %60) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %59) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %58) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %57) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %56) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %55) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %54) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %53) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %52) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %51) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %50) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %49) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %48) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %47) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %46) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %45) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %44) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %43) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %42) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %41) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %40) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %39) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %38) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %37) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %36) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %35) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %34) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %33) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %32) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %31) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 8, 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.end.p0(i64 8, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 8, 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.end.p0(i64 4, ptr %8) #6
  %262 = load i32, ptr %4, align 4
  ret i32 %262
}

; 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.fmuladd.f64(double, double, double) #2

; Function Attrs: nounwind
declare double @sqrt(double noundef) #3

; Function Attrs: nounwind
declare double @log10(double noundef) #3

declare void @_Z7tabfinddPdS_(double noundef, ptr noundef, ptr noundef) #4

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZSt3absd(double noundef) #5

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

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


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

@atomic_temp_tab = external dso_local global [50 x double], align 16

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_Z7coolingPdS_d(ptr nocapture noundef readonly %0, ptr nocapture noundef writeonly %1, double noundef %2) local_unnamed_addr #0 {
  %4 = alloca double, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #6
  store double 0.000000e+00, ptr %4, align 8, !tbaa !5
  %5 = load double, ptr %0, align 8, !tbaa !5
  %6 = getelementptr inbounds i8, ptr %0, i64 8
  %7 = load double, ptr %6, align 8, !tbaa !5
  %8 = getelementptr inbounds i8, ptr %0, i64 16
  %9 = load double, ptr %8, align 8, !tbaa !5
  %10 = getelementptr inbounds i8, ptr %0, i64 24
  %11 = load double, ptr %10, align 8, !tbaa !5
  %12 = getelementptr inbounds i8, ptr %0, i64 32
  %13 = load double, ptr %12, align 8, !tbaa !5
  %14 = getelementptr inbounds i8, ptr %0, i64 40
  %15 = load double, ptr %14, align 8, !tbaa !5
  %16 = getelementptr inbounds i8, ptr %0, i64 48
  %17 = load double, ptr %16, align 8, !tbaa !5
  %18 = getelementptr inbounds i8, ptr %0, i64 56
  %19 = load double, ptr %18, align 8, !tbaa !5
  %20 = fmul double %17, %17
  %21 = tail call double @llvm.fmuladd.f64(double %15, double %15, double %20)
  %22 = tail call double @llvm.fmuladd.f64(double %19, double %19, double %21)
  %23 = fdiv double 1.000000e+00, %5
  %24 = fmul double %23, %9
  %25 = fmul double %24, %24
  %26 = insertelement <2 x double> poison, double %7, i64 0
  %27 = insertelement <2 x double> %26, double %11, i64 1
  %28 = insertelement <2 x double> poison, double %23, i64 0
  %29 = shufflevector <2 x double> %28, <2 x double> poison, <2 x i32> zeroinitializer
  %30 = fmul <2 x double> %27, %29
  %31 = fmul <2 x double> %30, %30
  %32 = fmul double %5, 5.000000e-01
  %33 = extractelement <2 x double> %31, i64 0
  %34 = fadd double %33, %25
  %35 = extractelement <2 x double> %31, i64 1
  %36 = fadd double %34, %35
  %37 = fmul double %32, %36
  %38 = fsub double %13, %37
  %39 = tail call double @llvm.fmuladd.f64(double %22, double -5.000000e-01, double %38)
  %40 = fmul double %39, 0x3FE5555555555556
  %41 = fcmp olt double %40, 1.000000e-05
  br i1 %41, label %._crit_edge.thread, label %42

42:                                               ; preds = %3
  %43 = fmul double %23, 0x3FFAAAAAAAAAAAAB
  %44 = fmul double %43, %40
  %45 = fcmp olt double %44, 0.000000e+00
  br i1 %45, label %cdce.call, label %cdce.end, !prof !9

cdce.call:                                        ; preds = %42
  %46 = tail call double @sqrt(double noundef %44) #6
  br label %cdce.end

cdce.end:                                         ; preds = %42, %cdce.call
  %47 = fmul double %5, 0x3FF321B365A6CD2E
  %48 = fmul double %47, %47
  %49 = fmul double %40, 0x40D7BA17A786C227
  %50 = fdiv double %49, %47
  %51 = tail call double @log10(double noundef %50) #6
  %52 = load double, ptr @atomic_temp_tab, align 16, !tbaa !5
  %53 = fcmp ugt double %51, %52
  br i1 %53, label %.thread, label %54

54:                                               ; preds = %cdce.end
  store double 0.000000e+00, ptr %1, align 8, !tbaa !5
  %55 = fcmp ogt double %51, %52
  %.fr = freeze i1 %55
  %56 = fcmp ogt double %2, 0.000000e+00
  %57 = and i1 %.fr, %56
  br i1 %57, label %.lr.ph.split.us.split.preheader, label %._crit_edge.thread

.thread:                                          ; preds = %cdce.end
  call void @_Z7tabfinddPdS_(double noundef %51, ptr noundef nonnull %4, ptr noundef nonnull @atomic_temp_tab)
  %.pre = load double, ptr %4, align 8, !tbaa !5
  store double 0.000000e+00, ptr %1, align 8, !tbaa !5
  %58 = fcmp ogt double %51, %52
  %.fr127 = freeze i1 %58
  %59 = fcmp ogt double %2, 0.000000e+00
  %60 = and i1 %.fr127, %59
  br i1 %60, label %.lr.ph.split.split, label %._crit_edge.thread

.lr.ph.split.us.split.preheader:                  ; preds = %54
  %61 = fmul double %48, 0.000000e+00
  %62 = fmul double %38, 5.000000e-02
  %63 = tail call noundef double @_ZSt3absd(double noundef %61)
  %64 = fdiv double %62, %63
  %65 = fcmp ogt double %64, %2
  %66 = select i1 %65, double %2, double %64
  %67 = fmul double %61, %66
  %68 = fsub double %38, %67
  %69 = fcmp olt double %66, %2
  br i1 %69, label %.lr.ph.split.us.split.peel.next, label %._crit_edge.thread129

.lr.ph.split.us.split.peel.next:                  ; preds = %.lr.ph.split.us.split.preheader
  %70 = fadd double %66, 0.000000e+00
  br label %.lr.ph.split.us.split

.lr.ph.split.us.split:                            ; preds = %.lr.ph.split.us.split.peel.next, %.lr.ph.split.us.split
  %.0100110.us = phi double [ %78, %.lr.ph.split.us.split ], [ %68, %.lr.ph.split.us.split.peel.next ]
  %.0102108.us = phi double [ %79, %.lr.ph.split.us.split ], [ %70, %.lr.ph.split.us.split.peel.next ]
  %71 = fsub double %2, %.0102108.us
  %72 = fmul double %.0100110.us, 5.000000e-02
  %73 = tail call noundef double @_ZSt3absd(double noundef 0.000000e+00)
  %74 = fdiv double %72, %73
  %75 = fcmp olt double %71, %74
  %76 = select i1 %75, double %71, double %74
  %77 = fmul double %76, 0.000000e+00
  %78 = fsub double %.0100110.us, %77
  %79 = fadd double %.0102108.us, %76
  %80 = fcmp olt double %79, %2
  br i1 %80, label %.lr.ph.split.us.split, label %._crit_edge, !llvm.loop !10

.lr.ph.split.split:                               ; preds = %.thread, %.lr.ph.split.split
  %.0100110 = phi double [ %88, %.lr.ph.split.split ], [ %38, %.thread ]
  %.pn = phi double [ %89, %.lr.ph.split.split ], [ %.pre, %.thread ]
  %.0102108 = phi double [ %90, %.lr.ph.split.split ], [ 0.000000e+00, %.thread ]
  %.0101109 = fmul double %48, %.pn
  %81 = fsub double %2, %.0102108
  %82 = fmul double %.0100110, 5.000000e-02
  %83 = call noundef double @_ZSt3absd(double noundef %.0101109)
  %84 = fdiv double %82, %83
  %85 = fcmp olt double %81, %84
  %86 = select i1 %85, double %81, double %84
  %87 = fmul double %.0101109, %86
  %88 = fsub double %.0100110, %87
  call void @_Z7tabfinddPdS_(double noundef %51, ptr noundef nonnull %4, ptr noundef nonnull @atomic_temp_tab)
  %89 = load double, ptr %4, align 8, !tbaa !5
  %90 = fadd double %.0102108, %86
  %91 = fcmp olt double %90, %2
  br i1 %91, label %.lr.ph.split.split, label %._crit_edge, !llvm.loop !13

._crit_edge:                                      ; preds = %.lr.ph.split.us.split, %.lr.ph.split.split
  %92 = phi i1 [ %60, %.lr.ph.split.split ], [ true, %.lr.ph.split.us.split ]
  %.0100.lcssa = phi double [ %88, %.lr.ph.split.split ], [ %78, %.lr.ph.split.us.split ]
  br i1 %92, label %._crit_edge.thread129, label %._crit_edge.thread

._crit_edge.thread129:                            ; preds = %.lr.ph.split.us.split.preheader, %._crit_edge
  %.0100.lcssa131 = phi double [ %.0100.lcssa, %._crit_edge ], [ %68, %.lr.ph.split.us.split.preheader ]
  %93 = fsub double %.0100.lcssa131, %38
  store double %93, ptr %1, align 8, !tbaa !5
  br label %._crit_edge.thread

._crit_edge.thread:                               ; preds = %.thread, %54, %._crit_edge, %._crit_edge.thread129, %3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #6
  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 speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #2

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @sqrt(double noundef) local_unnamed_addr #3

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @log10(double noundef) local_unnamed_addr #3

declare void @_Z7tabfinddPdS_(double noundef, ptr noundef, ptr noundef) local_unnamed_addr #4

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZSt3absd(double noundef) local_unnamed_addr #5

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

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


; Effective O3 passes: CorrelatedValuePropagationPass,DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LibCallsShrinkWrapPass,LoopFullUnrollPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SCCPPass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass