; LLVM IR from avrtt/finite-element-method :: boundaries.ll (Z9thirdCondi)

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

@nX = external global i32, align 4
@gridX = external global ptr, align 8
@gridY = external global ptr, align 8
@f = external global ptr, align 8
@nY = external global i32, align 4

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z9thirdCondi(i32 noundef %0) #1 {
  %2 = alloca i32, align 4
  %3 = alloca [2 x double], align 16
  %4 = alloca [2 x [2 x double]], align 16
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca double, align 8
  %8 = alloca double, align 8
  %9 = alloca double, align 8
  store i32 %0, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr %3) #4
  call void @llvm.lifetime.start.p0(i64 32, ptr %4) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #4
  store i32 0, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  store i32 0, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #4
  store double 0.000000e+00, ptr %7, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  store double 0.000000e+00, ptr %8, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  store double 0.000000e+00, ptr %9, align 8, !tbaa !9
  %10 = load i32, ptr %2, align 4, !tbaa !5
  switch i32 %10, label %258 [
    i32 0, label %11
    i32 1, label %64
    i32 2, label %131
    i32 3, label %203
  ]

11:                                               ; preds = %1
  store i32 0, ptr %5, align 4, !tbaa !5
  %12 = load i32, ptr @nX, align 4, !tbaa !5
  %13 = sub nsw i32 %12, 1
  store i32 %13, ptr %6, align 4, !tbaa !5
  %14 = load ptr, ptr @gridX, align 8, !tbaa !11
  %15 = load i32, ptr @nX, align 4, !tbaa !5
  %16 = sub nsw i32 %15, 1
  %17 = sext i32 %16 to i64
  %18 = getelementptr inbounds double, ptr %14, i64 %17
  %19 = load double, ptr %18, align 8, !tbaa !9
  %20 = load ptr, ptr @gridX, align 8, !tbaa !11
  %21 = getelementptr inbounds double, ptr %20, i64 0
  %22 = load double, ptr %21, align 8, !tbaa !9
  %23 = fsub double %19, %22
  store double %23, ptr %9, align 8, !tbaa !9
  %24 = load ptr, ptr @gridX, align 8, !tbaa !11
  %25 = getelementptr inbounds double, ptr %24, i64 0
  %26 = load double, ptr %25, align 8, !tbaa !9
  %27 = load ptr, ptr @gridY, align 8, !tbaa !11
  %28 = getelementptr inbounds double, ptr %27, i64 0
  %29 = load double, ptr %28, align 8, !tbaa !9
  %30 = call noundef double @_Z9getLambdadd(double noundef %26, double noundef %29)
  %31 = fneg double %30
  %32 = call noundef double @_Z7getBetav()
  %33 = load ptr, ptr @gridX, align 8, !tbaa !11
  %34 = getelementptr inbounds double, ptr %33, i64 0
  %35 = load double, ptr %34, align 8, !tbaa !9
  %36 = load ptr, ptr @gridY, align 8, !tbaa !11
  %37 = getelementptr inbounds double, ptr %36, i64 0
  %38 = load double, ptr %37, align 8, !tbaa !9
  %39 = call noundef double @_Z13getAnalyticaldd(double noundef %35, double noundef %38)
  %40 = call double @llvm.fmuladd.f64(double %32, double %39, double %31)
  store double %40, ptr %7, align 8, !tbaa !9
  %41 = load ptr, ptr @gridX, align 8, !tbaa !11
  %42 = load i32, ptr @nX, align 4, !tbaa !5
  %43 = sub nsw i32 %42, 1
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds double, ptr %41, i64 %44
  %46 = load double, ptr %45, align 8, !tbaa !9
  %47 = load ptr, ptr @gridY, align 8, !tbaa !11
  %48 = getelementptr inbounds double, ptr %47, i64 0
  %49 = load double, ptr %48, align 8, !tbaa !9
  %50 = call noundef double @_Z9getLambdadd(double noundef %46, double noundef %49)
  %51 = fneg double %50
  %52 = call noundef double @_Z7getBetav()
  %53 = load ptr, ptr @gridX, align 8, !tbaa !11
  %54 = load i32, ptr @nX, align 4, !tbaa !5
  %55 = sub nsw i32 %54, 1
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds double, ptr %53, i64 %56
  %58 = load double, ptr %57, align 8, !tbaa !9
  %59 = load ptr, ptr @gridY, align 8, !tbaa !11
  %60 = getelementptr inbounds double, ptr %59, i64 0
  %61 = load double, ptr %60, align 8, !tbaa !9
  %62 = call noundef double @_Z13getAnalyticaldd(double noundef %58, double noundef %61)
  %63 = call double @llvm.fmuladd.f64(double %52, double %62, double %51)
  store double %63, ptr %8, align 8, !tbaa !9
  br label %258

64:                                               ; preds = %1
  %65 = load i32, ptr @nX, align 4, !tbaa !5
  %66 = sub nsw i32 %65, 1
  store i32 %66, ptr %5, align 4, !tbaa !5
  %67 = load i32, ptr @nX, align 4, !tbaa !5
  %68 = load i32, ptr @nY, align 4, !tbaa !5
  %69 = mul nsw i32 %67, %68
  %70 = sub nsw i32 %69, 1
  store i32 %70, ptr %6, align 4, !tbaa !5
  %71 = load ptr, ptr @gridY, align 8, !tbaa !11
  %72 = load i32, ptr @nY, align 4, !tbaa !5
  %73 = sub nsw i32 %72, 1
  %74 = sext i32 %73 to i64
  %75 = getelementptr inbounds double, ptr %71, i64 %74
  %76 = load double, ptr %75, align 8, !tbaa !9
  %77 = load ptr, ptr @gridY, align 8, !tbaa !11
  %78 = getelementptr inbounds double, ptr %77, i64 0
  %79 = load double, ptr %78, align 8, !tbaa !9
  %80 = fsub double %76, %79
  store double %80, ptr %9, align 8, !tbaa !9
  %81 = load ptr, ptr @gridX, align 8, !tbaa !11
  %82 = load i32, ptr @nX, align 4, !tbaa !5
  %83 = sub nsw i32 %82, 1
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds double, ptr %81, i64 %84
  %86 = load double, ptr %85, align 8, !tbaa !9
  %87 = load ptr, ptr @gridY, align 8, !tbaa !11
  %88 = getelementptr inbounds double, ptr %87, i64 0
  %89 = load double, ptr %88, align 8, !tbaa !9
  %90 = call noundef double @_Z9getLambdadd(double noundef %86, double noundef %89)
  %91 = call noundef double @_Z7getBetav()
  %92 = load ptr, ptr @gridX, align 8, !tbaa !11
  %93 = load i32, ptr @nX, align 4, !tbaa !5
  %94 = sub nsw i32 %93, 1
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds double, ptr %92, i64 %95
  %97 = load double, ptr %96, align 8, !tbaa !9
  %98 = load ptr, ptr @gridY, align 8, !tbaa !11
  %99 = getelementptr inbounds double, ptr %98, i64 0
  %100 = load double, ptr %99, align 8, !tbaa !9
  %101 = call noundef double @_Z13getAnalyticaldd(double noundef %97, double noundef %100)
  %102 = call double @llvm.fmuladd.f64(double %91, double %101, double %90)
  store double %102, ptr %7, align 8, !tbaa !9
  %103 = load ptr, ptr @gridX, align 8, !tbaa !11
  %104 = load i32, ptr @nX, align 4, !tbaa !5
  %105 = sub nsw i32 %104, 1
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds double, ptr %103, i64 %106
  %108 = load double, ptr %107, align 8, !tbaa !9
  %109 = load ptr, ptr @gridY, align 8, !tbaa !11
  %110 = load i32, ptr @nY, align 4, !tbaa !5
  %111 = sub nsw i32 %110, 1
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds double, ptr %109, i64 %112
  %114 = load double, ptr %113, align 8, !tbaa !9
  %115 = call noundef double @_Z9getLambdadd(double noundef %108, double noundef %114)
  %116 = call noundef double @_Z7getBetav()
  %117 = load ptr, ptr @gridX, align 8, !tbaa !11
  %118 = load i32, ptr @nX, align 4, !tbaa !5
  %119 = sub nsw i32 %118, 1
  %120 = sext i32 %119 to i64
  %121 = getelementptr inbounds double, ptr %117, i64 %120
  %122 = load double, ptr %121, align 8, !tbaa !9
  %123 = load ptr, ptr @gridY, align 8, !tbaa !11
  %124 = load i32, ptr @nY, align 4, !tbaa !5
  %125 = sub nsw i32 %124, 1
  %126 = sext i32 %125 to i64
  %127 = getelementptr inbounds double, ptr %123, i64 %126
  %128 = load double, ptr %127, align 8, !tbaa !9
  %129 = call noundef double @_Z13getAnalyticaldd(double noundef %122, double noundef %128)
  %130 = call double @llvm.fmuladd.f64(double %116, double %129, double %115)
  store double %130, ptr %8, align 8, !tbaa !9
  br label %258

131:                                              ; preds = %1
  %132 = load i32, ptr @nX, align 4, !tbaa !5
  %133 = load i32, ptr @nY, align 4, !tbaa !5
  %134 = sub nsw i32 %133, 1
  %135 = mul nsw i32 %132, %134
  store i32 %135, ptr %5, align 4, !tbaa !5
  %136 = load i32, ptr @nX, align 4, !tbaa !5
  %137 = load i32, ptr @nY, align 4, !tbaa !5
  %138 = sub nsw i32 %137, 1
  %139 = mul nsw i32 %136, %138
  %140 = load i32, ptr @nX, align 4, !tbaa !5
  %141 = add nsw i32 %139, %140
  %142 = sub nsw i32 %141, 1
  store i32 %142, ptr %6, align 4, !tbaa !5
  %143 = load ptr, ptr @gridX, align 8, !tbaa !11
  %144 = load i32, ptr @nX, align 4, !tbaa !5
  %145 = sub nsw i32 %144, 1
  %146 = sext i32 %145 to i64
  %147 = getelementptr inbounds double, ptr %143, i64 %146
  %148 = load double, ptr %147, align 8, !tbaa !9
  %149 = load ptr, ptr @gridX, align 8, !tbaa !11
  %150 = getelementptr inbounds double, ptr %149, i64 0
  %151 = load double, ptr %150, align 8, !tbaa !9
  %152 = fsub double %148, %151
  store double %152, ptr %9, align 8, !tbaa !9
  %153 = load ptr, ptr @gridX, align 8, !tbaa !11
  %154 = getelementptr inbounds double, ptr %153, i64 0
  %155 = load double, ptr %154, align 8, !tbaa !9
  %156 = load ptr, ptr @gridY, align 8, !tbaa !11
  %157 = load i32, ptr @nY, align 4, !tbaa !5
  %158 = sub nsw i32 %157, 1
  %159 = sext i32 %158 to i64
  %160 = getelementptr inbounds double, ptr %156, i64 %159
  %161 = load double, ptr %160, align 8, !tbaa !9
  %162 = call noundef double @_Z9getLambdadd(double noundef %155, double noundef %161)
  %163 = call noundef double @_Z7getBetav()
  %164 = load ptr, ptr @gridX, align 8, !tbaa !11
  %165 = getelementptr inbounds double, ptr %164, i64 0
  %166 = load double, ptr %165, align 8, !tbaa !9
  %167 = load ptr, ptr @gridY, align 8, !tbaa !11
  %168 = load i32, ptr @nY, align 4, !tbaa !5
  %169 = sub nsw i32 %168, 1
  %170 = sext i32 %169 to i64
  %171 = getelementptr inbounds double, ptr %167, i64 %170
  %172 = load double, ptr %171, align 8, !tbaa !9
  %173 = call noundef double @_Z13getAnalyticaldd(double noundef %166, double noundef %172)
  %174 = call double @llvm.fmuladd.f64(double %163, double %173, double %162)
  store double %174, ptr %7, align 8, !tbaa !9
  %175 = load ptr, ptr @gridX, align 8, !tbaa !11
  %176 = load i32, ptr @nX, align 4, !tbaa !5
  %177 = sub nsw i32 %176, 1
  %178 = sext i32 %177 to i64
  %179 = getelementptr inbounds double, ptr %175, i64 %178
  %180 = load double, ptr %179, align 8, !tbaa !9
  %181 = load ptr, ptr @gridY, align 8, !tbaa !11
  %182 = load i32, ptr @nY, align 4, !tbaa !5
  %183 = sub nsw i32 %182, 1
  %184 = sext i32 %183 to i64
  %185 = getelementptr inbounds double, ptr %181, i64 %184
  %186 = load double, ptr %185, align 8, !tbaa !9
  %187 = call noundef double @_Z9getLambdadd(double noundef %180, double noundef %186)
  %188 = call noundef double @_Z7getBetav()
  %189 = load ptr, ptr @gridX, align 8, !tbaa !11
  %190 = load i32, ptr @nX, align 4, !tbaa !5
  %191 = sub nsw i32 %190, 1
  %192 = sext i32 %191 to i64
  %193 = getelementptr inbounds double, ptr %189, i64 %192
  %194 = load double, ptr %193, align 8, !tbaa !9
  %195 = load ptr, ptr @gridY, align 8, !tbaa !11
  %196 = load i32, ptr @nY, align 4, !tbaa !5
  %197 = sub nsw i32 %196, 1
  %198 = sext i32 %197 to i64
  %199 = getelementptr inbounds double, ptr %195, i64 %198
  %200 = load double, ptr %199, align 8, !tbaa !9
  %201 = call noundef double @_Z13getAnalyticaldd(double noundef %194, double noundef %200)
  %202 = call double @llvm.fmuladd.f64(double %188, double %201, double %187)
  store double %202, ptr %8, align 8, !tbaa !9
  br label %258

203:                                              ; preds = %1
  store i32 0, ptr %5, align 4, !tbaa !5
  %204 = load i32, ptr @nX, align 4, !tbaa !5
  %205 = load i32, ptr @nY, align 4, !tbaa !5
  %206 = sub nsw i32 %205, 1
  %207 = mul nsw i32 %204, %206
  store i32 %207, ptr %6, align 4, !tbaa !5
  %208 = load ptr, ptr @gridY, align 8, !tbaa !11
  %209 = load i32, ptr @nY, align 4, !tbaa !5
  %210 = sub nsw i32 %209, 1
  %211 = sext i32 %210 to i64
  %212 = getelementptr inbounds double, ptr %208, i64 %211
  %213 = load double, ptr %212, align 8, !tbaa !9
  %214 = load ptr, ptr @gridY, align 8, !tbaa !11
  %215 = getelementptr inbounds double, ptr %214, i64 0
  %216 = load double, ptr %215, align 8, !tbaa !9
  %217 = fsub double %213, %216
  store double %217, ptr %9, align 8, !tbaa !9
  %218 = load ptr, ptr @gridX, align 8, !tbaa !11
  %219 = getelementptr inbounds double, ptr %218, i64 0
  %220 = load double, ptr %219, align 8, !tbaa !9
  %221 = load ptr, ptr @gridY, align 8, !tbaa !11
  %222 = getelementptr inbounds double, ptr %221, i64 0
  %223 = load double, ptr %222, align 8, !tbaa !9
  %224 = call noundef double @_Z9getLambdadd(double noundef %220, double noundef %223)
  %225 = fneg double %224
  %226 = call noundef double @_Z7getBetav()
  %227 = load ptr, ptr @gridX, align 8, !tbaa !11
  %228 = getelementptr inbounds double, ptr %227, i64 0
  %229 = load double, ptr %228, align 8, !tbaa !9
  %230 = load ptr, ptr @gridY, align 8, !tbaa !11
  %231 = getelementptr inbounds double, ptr %230, i64 0
  %232 = load double, ptr %231, align 8, !tbaa !9
  %233 = call noundef double @_Z13getAnalyticaldd(double noundef %229, double noundef %232)
  %234 = call double @llvm.fmuladd.f64(double %226, double %233, double %225)
  store double %234, ptr %7, align 8, !tbaa !9
  %235 = load ptr, ptr @gridX, align 8, !tbaa !11
  %236 = getelementptr inbounds double, ptr %235, i64 0
  %237 = load double, ptr %236, align 8, !tbaa !9
  %238 = load ptr, ptr @gridY, align 8, !tbaa !11
  %239 = load i32, ptr @nY, align 4, !tbaa !5
  %240 = sub nsw i32 %239, 1
  %241 = sext i32 %240 to i64
  %242 = getelementptr inbounds double, ptr %238, i64 %241
  %243 = load double, ptr %242, align 8, !tbaa !9
  %244 = call noundef double @_Z9getLambdadd(double noundef %237, double noundef %243)
  %245 = fneg double %244
  %246 = call noundef double @_Z7getBetav()
  %247 = load ptr, ptr @gridX, align 8, !tbaa !11
  %248 = getelementptr inbounds double, ptr %247, i64 0
  %249 = load double, ptr %248, align 8, !tbaa !9
  %250 = load ptr, ptr @gridY, align 8, !tbaa !11
  %251 = load i32, ptr @nY, align 4, !tbaa !5
  %252 = sub nsw i32 %251, 1
  %253 = sext i32 %252 to i64
  %254 = getelementptr inbounds double, ptr %250, i64 %253
  %255 = load double, ptr %254, align 8, !tbaa !9
  %256 = call noundef double @_Z13getAnalyticaldd(double noundef %249, double noundef %255)
  %257 = call double @llvm.fmuladd.f64(double %246, double %256, double %245)
  store double %257, ptr %8, align 8, !tbaa !9
  br label %258

258:                                              ; preds = %203, %131, %64, %11, %1
  %259 = call noundef double @_Z7getBetav()
  %260 = load double, ptr %9, align 8, !tbaa !9
  %261 = fdiv double %260, 6.000000e+00
  %262 = fmul double %259, %261
  %263 = load double, ptr %7, align 8, !tbaa !9
  %264 = load double, ptr %8, align 8, !tbaa !9
  %265 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %263, double %264)
  %266 = fmul double %262, %265
  %267 = getelementptr inbounds [2 x double], ptr %3, i64 0, i64 0
  store double %266, ptr %267, align 16, !tbaa !9
  %268 = call noundef double @_Z7getBetav()
  %269 = load double, ptr %9, align 8, !tbaa !9
  %270 = fdiv double %269, 6.000000e+00
  %271 = fmul double %268, %270
  %272 = load double, ptr %7, align 8, !tbaa !9
  %273 = load double, ptr %8, align 8, !tbaa !9
  %274 = call double @llvm.fmuladd.f64(double 2.000000e+00, double %273, double %272)
  %275 = fmul double %271, %274
  %276 = getelementptr inbounds [2 x double], ptr %3, i64 0, i64 1
  store double %275, ptr %276, align 8, !tbaa !9
  %277 = getelementptr inbounds [2 x double], ptr %3, i64 0, i64 0
  %278 = load double, ptr %277, align 16, !tbaa !9
  %279 = load ptr, ptr @f, align 8, !tbaa !11
  %280 = load i32, ptr %5, align 4, !tbaa !5
  %281 = sext i32 %280 to i64
  %282 = getelementptr inbounds double, ptr %279, i64 %281
  %283 = load double, ptr %282, align 8, !tbaa !9
  %284 = fadd double %283, %278
  store double %284, ptr %282, align 8, !tbaa !9
  %285 = getelementptr inbounds [2 x double], ptr %3, i64 0, i64 1
  %286 = load double, ptr %285, align 8, !tbaa !9
  %287 = load ptr, ptr @f, align 8, !tbaa !11
  %288 = load i32, ptr %6, align 4, !tbaa !5
  %289 = sext i32 %288 to i64
  %290 = getelementptr inbounds double, ptr %287, i64 %289
  %291 = load double, ptr %290, align 8, !tbaa !9
  %292 = fadd double %291, %286
  store double %292, ptr %290, align 8, !tbaa !9
  %293 = call noundef double @_Z7getBetav()
  %294 = load double, ptr %9, align 8, !tbaa !9
  %295 = fmul double %293, %294
  %296 = fdiv double %295, 3.000000e+00
  %297 = getelementptr inbounds [2 x [2 x double]], ptr %4, i64 0, i64 0
  %298 = getelementptr inbounds [2 x double], ptr %297, i64 0, i64 0
  store double %296, ptr %298, align 16, !tbaa !9
  %299 = call noundef double @_Z7getBetav()
  %300 = load double, ptr %9, align 8, !tbaa !9
  %301 = fmul double %299, %300
  %302 = fdiv double %301, 6.000000e+00
  %303 = getelementptr inbounds [2 x [2 x double]], ptr %4, i64 0, i64 0
  %304 = getelementptr inbounds [2 x double], ptr %303, i64 0, i64 1
  store double %302, ptr %304, align 8, !tbaa !9
  %305 = call noundef double @_Z7getBetav()
  %306 = load double, ptr %9, align 8, !tbaa !9
  %307 = fmul double %305, %306
  %308 = fdiv double %307, 6.000000e+00
  %309 = getelementptr inbounds [2 x [2 x double]], ptr %4, i64 0, i64 1
  %310 = getelementptr inbounds [2 x double], ptr %309, i64 0, i64 0
  store double %308, ptr %310, align 16, !tbaa !9
  %311 = call noundef double @_Z7getBetav()
  %312 = load double, ptr %9, align 8, !tbaa !9
  %313 = fmul double %311, %312
  %314 = fdiv double %313, 3.000000e+00
  %315 = getelementptr inbounds [2 x [2 x double]], ptr %4, i64 0, i64 1
  %316 = getelementptr inbounds [2 x double], ptr %315, i64 0, i64 1
  store double %314, ptr %316, align 8, !tbaa !9
  %317 = getelementptr inbounds [2 x [2 x double]], ptr %4, i64 0, i64 0
  %318 = getelementptr inbounds [2 x double], ptr %317, i64 0, i64 0
  %319 = load double, ptr %318, align 16, !tbaa !9
  %320 = load i32, ptr %5, align 4, !tbaa !5
  %321 = load i32, ptr %5, align 4, !tbaa !5
  call void @_Z9addGlobaldii(double noundef %319, i32 noundef %320, i32 noundef %321)
  %322 = getelementptr inbounds [2 x [2 x double]], ptr %4, i64 0, i64 0
  %323 = getelementptr inbounds [2 x double], ptr %322, i64 0, i64 1
  %324 = load double, ptr %323, align 8, !tbaa !9
  %325 = load i32, ptr %5, align 4, !tbaa !5
  %326 = load i32, ptr %6, align 4, !tbaa !5
  call void @_Z9addGlobaldii(double noundef %324, i32 noundef %325, i32 noundef %326)
  %327 = getelementptr inbounds [2 x [2 x double]], ptr %4, i64 0, i64 1
  %328 = getelementptr inbounds [2 x double], ptr %327, i64 0, i64 0
  %329 = load double, ptr %328, align 16, !tbaa !9
  %330 = load i32, ptr %6, align 4, !tbaa !5
  %331 = load i32, ptr %5, align 4, !tbaa !5
  call void @_Z9addGlobaldii(double noundef %329, i32 noundef %330, i32 noundef %331)
  %332 = getelementptr inbounds [2 x [2 x double]], ptr %4, i64 0, i64 1
  %333 = getelementptr inbounds [2 x double], ptr %332, i64 0, i64 1
  %334 = load double, ptr %333, align 8, !tbaa !9
  %335 = load i32, ptr %6, align 4, !tbaa !5
  %336 = load i32, ptr %6, align 4, !tbaa !5
  call void @_Z9addGlobaldii(double noundef %334, i32 noundef %335, i32 noundef %336)
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %4) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr %3) #4
  ret void
}

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

declare noundef double @_Z13getAnalyticaldd(double noundef, double noundef) #2

declare noundef double @_Z9getLambdadd(double noundef, double noundef) #2

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

declare noundef double @_Z7getBetav() #2

declare void @_Z9addGlobaldii(double noundef, i32 noundef, i32 noundef) #2

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

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

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


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

@nX = external local_unnamed_addr global i32, align 4
@gridX = external local_unnamed_addr global ptr, align 8
@gridY = external local_unnamed_addr global ptr, align 8
@f = external local_unnamed_addr global ptr, align 8
@nY = external local_unnamed_addr global i32, align 4

; Function Attrs: mustprogress uwtable
define dso_local void @_Z9thirdCondi(i32 noundef %0) local_unnamed_addr #0 {
  switch i32 %0, label %219 [
    i32 0, label %2
    i32 1, label %47
    i32 2, label %109
    i32 3, label %172
  ]

2:                                                ; preds = %1
  %3 = load i32, ptr @nX, align 4, !tbaa !5
  %4 = add nsw i32 %3, -1
  %5 = load ptr, ptr @gridX, align 8, !tbaa !9
  %6 = sext i32 %4 to i64
  %7 = getelementptr inbounds double, ptr %5, i64 %6
  %8 = load double, ptr %7, align 8, !tbaa !11
  %9 = load double, ptr %5, align 8, !tbaa !11
  %10 = fsub double %8, %9
  %11 = load ptr, ptr @gridY, align 8, !tbaa !9
  %12 = load double, ptr %11, align 8, !tbaa !11
  %13 = tail call noundef double @_Z9getLambdadd(double noundef %9, double noundef %12)
  %14 = tail call noundef double @_Z7getBetav()
  %15 = load ptr, ptr @gridX, align 8, !tbaa !9
  %16 = load double, ptr %15, align 8, !tbaa !11
  %17 = load ptr, ptr @gridY, align 8, !tbaa !9
  %18 = load double, ptr %17, align 8, !tbaa !11
  %19 = tail call noundef double @_Z13getAnalyticaldd(double noundef %16, double noundef %18)
  %20 = load ptr, ptr @gridX, align 8, !tbaa !9
  %21 = load i32, ptr @nX, align 4, !tbaa !5
  %22 = sext i32 %21 to i64
  %23 = getelementptr double, ptr %20, i64 %22
  %24 = getelementptr i8, ptr %23, i64 -8
  %25 = load double, ptr %24, align 8, !tbaa !11
  %26 = load ptr, ptr @gridY, align 8, !tbaa !9
  %27 = load double, ptr %26, align 8, !tbaa !11
  %28 = tail call noundef double @_Z9getLambdadd(double noundef %25, double noundef %27)
  %29 = insertelement <2 x double> poison, double %13, i64 0
  %30 = insertelement <2 x double> %29, double %28, i64 1
  %31 = fneg <2 x double> %30
  %32 = tail call noundef double @_Z7getBetav()
  %33 = load ptr, ptr @gridX, align 8, !tbaa !9
  %34 = load i32, ptr @nX, align 4, !tbaa !5
  %35 = sext i32 %34 to i64
  %36 = getelementptr double, ptr %33, i64 %35
  %37 = getelementptr i8, ptr %36, i64 -8
  %38 = load double, ptr %37, align 8, !tbaa !11
  %39 = load ptr, ptr @gridY, align 8, !tbaa !9
  %40 = load double, ptr %39, align 8, !tbaa !11
  %41 = tail call noundef double @_Z13getAnalyticaldd(double noundef %38, double noundef %40)
  %42 = insertelement <2 x double> poison, double %14, i64 0
  %43 = insertelement <2 x double> %42, double %32, i64 1
  %44 = insertelement <2 x double> poison, double %19, i64 0
  %45 = insertelement <2 x double> %44, double %41, i64 1
  %46 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %43, <2 x double> %45, <2 x double> %31)
  br label %219

47:                                               ; preds = %1
  %48 = load i32, ptr @nX, align 4, !tbaa !5
  %49 = add nsw i32 %48, -1
  %50 = load i32, ptr @nY, align 4, !tbaa !5
  %51 = mul nsw i32 %50, %48
  %52 = add nsw i32 %51, -1
  %53 = load ptr, ptr @gridY, align 8, !tbaa !9
  %54 = sext i32 %50 to i64
  %55 = getelementptr double, ptr %53, i64 %54
  %56 = getelementptr i8, ptr %55, i64 -8
  %57 = load double, ptr %56, align 8, !tbaa !11
  %58 = load double, ptr %53, align 8, !tbaa !11
  %59 = fsub double %57, %58
  %60 = load ptr, ptr @gridX, align 8, !tbaa !9
  %61 = sext i32 %49 to i64
  %62 = getelementptr inbounds double, ptr %60, i64 %61
  %63 = load double, ptr %62, align 8, !tbaa !11
  %64 = tail call noundef double @_Z9getLambdadd(double noundef %63, double noundef %58)
  %65 = tail call noundef double @_Z7getBetav()
  %66 = load ptr, ptr @gridX, align 8, !tbaa !9
  %67 = load i32, ptr @nX, align 4, !tbaa !5
  %68 = sext i32 %67 to i64
  %69 = getelementptr double, ptr %66, i64 %68
  %70 = getelementptr i8, ptr %69, i64 -8
  %71 = load double, ptr %70, align 8, !tbaa !11
  %72 = load ptr, ptr @gridY, align 8, !tbaa !9
  %73 = load double, ptr %72, align 8, !tbaa !11
  %74 = tail call noundef double @_Z13getAnalyticaldd(double noundef %71, double noundef %73)
  %75 = load ptr, ptr @gridX, align 8, !tbaa !9
  %76 = load i32, ptr @nX, align 4, !tbaa !5
  %77 = sext i32 %76 to i64
  %78 = getelementptr double, ptr %75, i64 %77
  %79 = getelementptr i8, ptr %78, i64 -8
  %80 = load double, ptr %79, align 8, !tbaa !11
  %81 = load ptr, ptr @gridY, align 8, !tbaa !9
  %82 = load i32, ptr @nY, align 4, !tbaa !5
  %83 = sext i32 %82 to i64
  %84 = getelementptr double, ptr %81, i64 %83
  %85 = getelementptr i8, ptr %84, i64 -8
  %86 = load double, ptr %85, align 8, !tbaa !11
  %87 = tail call noundef double @_Z9getLambdadd(double noundef %80, double noundef %86)
  %88 = tail call noundef double @_Z7getBetav()
  %89 = load ptr, ptr @gridX, align 8, !tbaa !9
  %90 = load i32, ptr @nX, align 4, !tbaa !5
  %91 = sext i32 %90 to i64
  %92 = getelementptr double, ptr %89, i64 %91
  %93 = getelementptr i8, ptr %92, i64 -8
  %94 = load double, ptr %93, align 8, !tbaa !11
  %95 = load ptr, ptr @gridY, align 8, !tbaa !9
  %96 = load i32, ptr @nY, align 4, !tbaa !5
  %97 = sext i32 %96 to i64
  %98 = getelementptr double, ptr %95, i64 %97
  %99 = getelementptr i8, ptr %98, i64 -8
  %100 = load double, ptr %99, align 8, !tbaa !11
  %101 = tail call noundef double @_Z13getAnalyticaldd(double noundef %94, double noundef %100)
  %102 = insertelement <2 x double> poison, double %65, i64 0
  %103 = insertelement <2 x double> %102, double %88, i64 1
  %104 = insertelement <2 x double> poison, double %74, i64 0
  %105 = insertelement <2 x double> %104, double %101, i64 1
  %106 = insertelement <2 x double> poison, double %64, i64 0
  %107 = insertelement <2 x double> %106, double %87, i64 1
  %108 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %103, <2 x double> %105, <2 x double> %107)
  br label %219

109:                                              ; preds = %1
  %110 = load i32, ptr @nX, align 4, !tbaa !5
  %111 = load i32, ptr @nY, align 4, !tbaa !5
  %112 = add nsw i32 %111, -1
  %113 = mul nsw i32 %112, %110
  %114 = mul i32 %111, %110
  %115 = add nsw i32 %114, -1
  %116 = load ptr, ptr @gridX, align 8, !tbaa !9
  %117 = sext i32 %110 to i64
  %118 = getelementptr double, ptr %116, i64 %117
  %119 = getelementptr i8, ptr %118, i64 -8
  %120 = load double, ptr %119, align 8, !tbaa !11
  %121 = load double, ptr %116, align 8, !tbaa !11
  %122 = fsub double %120, %121
  %123 = load ptr, ptr @gridY, align 8, !tbaa !9
  %124 = sext i32 %112 to i64
  %125 = getelementptr inbounds double, ptr %123, i64 %124
  %126 = load double, ptr %125, align 8, !tbaa !11
  %127 = tail call noundef double @_Z9getLambdadd(double noundef %121, double noundef %126)
  %128 = tail call noundef double @_Z7getBetav()
  %129 = load ptr, ptr @gridX, align 8, !tbaa !9
  %130 = load double, ptr %129, align 8, !tbaa !11
  %131 = load ptr, ptr @gridY, align 8, !tbaa !9
  %132 = load i32, ptr @nY, align 4, !tbaa !5
  %133 = sext i32 %132 to i64
  %134 = getelementptr double, ptr %131, i64 %133
  %135 = getelementptr i8, ptr %134, i64 -8
  %136 = load double, ptr %135, align 8, !tbaa !11
  %137 = tail call noundef double @_Z13getAnalyticaldd(double noundef %130, double noundef %136)
  %138 = load ptr, ptr @gridX, align 8, !tbaa !9
  %139 = load i32, ptr @nX, align 4, !tbaa !5
  %140 = sext i32 %139 to i64
  %141 = getelementptr double, ptr %138, i64 %140
  %142 = getelementptr i8, ptr %141, i64 -8
  %143 = load double, ptr %142, align 8, !tbaa !11
  %144 = load ptr, ptr @gridY, align 8, !tbaa !9
  %145 = load i32, ptr @nY, align 4, !tbaa !5
  %146 = sext i32 %145 to i64
  %147 = getelementptr double, ptr %144, i64 %146
  %148 = getelementptr i8, ptr %147, i64 -8
  %149 = load double, ptr %148, align 8, !tbaa !11
  %150 = tail call noundef double @_Z9getLambdadd(double noundef %143, double noundef %149)
  %151 = tail call noundef double @_Z7getBetav()
  %152 = load ptr, ptr @gridX, align 8, !tbaa !9
  %153 = load i32, ptr @nX, align 4, !tbaa !5
  %154 = sext i32 %153 to i64
  %155 = getelementptr double, ptr %152, i64 %154
  %156 = getelementptr i8, ptr %155, i64 -8
  %157 = load double, ptr %156, align 8, !tbaa !11
  %158 = load ptr, ptr @gridY, align 8, !tbaa !9
  %159 = load i32, ptr @nY, align 4, !tbaa !5
  %160 = sext i32 %159 to i64
  %161 = getelementptr double, ptr %158, i64 %160
  %162 = getelementptr i8, ptr %161, i64 -8
  %163 = load double, ptr %162, align 8, !tbaa !11
  %164 = tail call noundef double @_Z13getAnalyticaldd(double noundef %157, double noundef %163)
  %165 = insertelement <2 x double> poison, double %128, i64 0
  %166 = insertelement <2 x double> %165, double %151, i64 1
  %167 = insertelement <2 x double> poison, double %137, i64 0
  %168 = insertelement <2 x double> %167, double %164, i64 1
  %169 = insertelement <2 x double> poison, double %127, i64 0
  %170 = insertelement <2 x double> %169, double %150, i64 1
  %171 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %166, <2 x double> %168, <2 x double> %170)
  br label %219

172:                                              ; preds = %1
  %173 = load i32, ptr @nX, align 4, !tbaa !5
  %174 = load i32, ptr @nY, align 4, !tbaa !5
  %175 = add nsw i32 %174, -1
  %176 = mul nsw i32 %175, %173
  %177 = load ptr, ptr @gridY, align 8, !tbaa !9
  %178 = sext i32 %175 to i64
  %179 = getelementptr inbounds double, ptr %177, i64 %178
  %180 = load double, ptr %179, align 8, !tbaa !11
  %181 = load double, ptr %177, align 8, !tbaa !11
  %182 = fsub double %180, %181
  %183 = load ptr, ptr @gridX, align 8, !tbaa !9
  %184 = load double, ptr %183, align 8, !tbaa !11
  %185 = tail call noundef double @_Z9getLambdadd(double noundef %184, double noundef %181)
  %186 = tail call noundef double @_Z7getBetav()
  %187 = load ptr, ptr @gridX, align 8, !tbaa !9
  %188 = load double, ptr %187, align 8, !tbaa !11
  %189 = load ptr, ptr @gridY, align 8, !tbaa !9
  %190 = load double, ptr %189, align 8, !tbaa !11
  %191 = tail call noundef double @_Z13getAnalyticaldd(double noundef %188, double noundef %190)
  %192 = load ptr, ptr @gridX, align 8, !tbaa !9
  %193 = load double, ptr %192, align 8, !tbaa !11
  %194 = load ptr, ptr @gridY, align 8, !tbaa !9
  %195 = load i32, ptr @nY, align 4, !tbaa !5
  %196 = sext i32 %195 to i64
  %197 = getelementptr double, ptr %194, i64 %196
  %198 = getelementptr i8, ptr %197, i64 -8
  %199 = load double, ptr %198, align 8, !tbaa !11
  %200 = tail call noundef double @_Z9getLambdadd(double noundef %193, double noundef %199)
  %201 = insertelement <2 x double> poison, double %185, i64 0
  %202 = insertelement <2 x double> %201, double %200, i64 1
  %203 = fneg <2 x double> %202
  %204 = tail call noundef double @_Z7getBetav()
  %205 = load ptr, ptr @gridX, align 8, !tbaa !9
  %206 = load double, ptr %205, align 8, !tbaa !11
  %207 = load ptr, ptr @gridY, align 8, !tbaa !9
  %208 = load i32, ptr @nY, align 4, !tbaa !5
  %209 = sext i32 %208 to i64
  %210 = getelementptr double, ptr %207, i64 %209
  %211 = getelementptr i8, ptr %210, i64 -8
  %212 = load double, ptr %211, align 8, !tbaa !11
  %213 = tail call noundef double @_Z13getAnalyticaldd(double noundef %206, double noundef %212)
  %214 = insertelement <2 x double> poison, double %186, i64 0
  %215 = insertelement <2 x double> %214, double %204, i64 1
  %216 = insertelement <2 x double> poison, double %191, i64 0
  %217 = insertelement <2 x double> %216, double %213, i64 1
  %218 = tail call <2 x double> @llvm.fmuladd.v2f64(<2 x double> %215, <2 x double> %217, <2 x double> %203)
  br label %219

219:                                              ; preds = %172, %109, %47, %2, %1
  %.025 = phi i32 [ 0, %1 ], [ 0, %172 ], [ %113, %109 ], [ %49, %47 ], [ 0, %2 ]
  %.024 = phi i32 [ 0, %1 ], [ %176, %172 ], [ %115, %109 ], [ %52, %47 ], [ %4, %2 ]
  %.0 = phi double [ 0.000000e+00, %1 ], [ %182, %172 ], [ %122, %109 ], [ %59, %47 ], [ %10, %2 ]
  %220 = phi <2 x double> [ zeroinitializer, %1 ], [ %218, %172 ], [ %171, %109 ], [ %108, %47 ], [ %46, %2 ]
  %221 = tail call noundef double @_Z7getBetav()
  %222 = fdiv double %.0, 6.000000e+00
  %223 = fmul double %221, %222
  %224 = extractelement <2 x double> %220, i64 0
  %225 = extractelement <2 x double> %220, i64 1
  %226 = tail call double @llvm.fmuladd.f64(double %224, double 2.000000e+00, double %225)
  %227 = fmul double %226, %223
  %228 = tail call noundef double @_Z7getBetav()
  %229 = fmul double %222, %228
  %230 = tail call double @llvm.fmuladd.f64(double %225, double 2.000000e+00, double %224)
  %231 = fmul double %230, %229
  %232 = load ptr, ptr @f, align 8, !tbaa !9
  %233 = sext i32 %.025 to i64
  %234 = getelementptr inbounds double, ptr %232, i64 %233
  %235 = load double, ptr %234, align 8, !tbaa !11
  %236 = fadd double %227, %235
  store double %236, ptr %234, align 8, !tbaa !11
  %237 = sext i32 %.024 to i64
  %238 = getelementptr inbounds double, ptr %232, i64 %237
  %239 = load double, ptr %238, align 8, !tbaa !11
  %240 = fadd double %231, %239
  store double %240, ptr %238, align 8, !tbaa !11
  %241 = tail call noundef double @_Z7getBetav()
  %242 = fmul double %.0, %241
  %243 = fdiv double %242, 3.000000e+00
  %244 = tail call noundef double @_Z7getBetav()
  %245 = fmul double %.0, %244
  %246 = fdiv double %245, 6.000000e+00
  %247 = tail call noundef double @_Z7getBetav()
  %248 = fmul double %.0, %247
  %249 = fdiv double %248, 6.000000e+00
  %250 = tail call noundef double @_Z7getBetav()
  %251 = fmul double %.0, %250
  %252 = fdiv double %251, 3.000000e+00
  tail call void @_Z9addGlobaldii(double noundef %243, i32 noundef %.025, i32 noundef %.025)
  tail call void @_Z9addGlobaldii(double noundef %246, i32 noundef %.025, i32 noundef %.024)
  tail call void @_Z9addGlobaldii(double noundef %249, i32 noundef %.024, i32 noundef %.025)
  tail call void @_Z9addGlobaldii(double noundef %252, i32 noundef %.024, i32 noundef %.024)
  ret void
}

declare noundef double @_Z13getAnalyticaldd(double noundef, double noundef) local_unnamed_addr #1

declare noundef double @_Z9getLambdadd(double noundef, double noundef) local_unnamed_addr #1

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

declare noundef double @_Z7getBetav() local_unnamed_addr #1

declare void @_Z9addGlobaldii(double noundef, i32 noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <2 x double> @llvm.fmuladd.v2f64(<2 x double>, <2 x double>, <2 x double>) #3

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

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

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


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,ReassociatePass,SLPVectorizerPass,SROAPass,TailCallElimPass