; LLVM IR from alexzheng42/sDMD :: src (CG)

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

%struct.CGMatrixStr = type { [5 x double], [32 x %struct.CGBeadStr] }
%struct.CGBeadStr = type { double, double, double, double }

@.str.5 = external hidden unnamed_addr constant [59 x i8], align 1
@datadir = external global [1024 x i8], align 16
@CGMatrix = external global %struct.CGMatrixStr, align 8
@__const.CreateCGPotentialMatrix.sur_type = external hidden unnamed_addr constant [3 x ptr], align 16
@__const.CreateCGPotentialMatrix.gap = external hidden unnamed_addr constant [3 x double], align 16
@.str.19 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [64 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [17 x i8], align 1

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

; Function Attrs: nounwind
declare i32 @sprintf(ptr noundef, ptr noundef, ...) #1

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

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

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) #3

declare noalias ptr @fopen(ptr noundef, ptr noundef) #2

declare i32 @AAModel(ptr noundef) #2

declare i32 @fclose(ptr noundef) #2

; Function Attrs: nounwind uwtable
define dso_local void @CreateCGPotentialMatrix() #4 {
  %1 = alloca [512 x i8], align 16
  %2 = alloca [3 x ptr], align 16
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca double, align 8
  %7 = alloca double, align 8
  %8 = alloca [3 x double], align 16
  %9 = alloca double, align 8
  %10 = alloca [128 x [2 x double]], align 16
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 512, ptr %1) #8
  call void @llvm.lifetime.start.p0(i64 24, ptr %2) #8
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %2, ptr align 16 @__const.CreateCGPotentialMatrix.sur_type, i64 24, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #8
  store i32 3, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #8
  call void @llvm.lifetime.start.p0(i64 24, ptr %8) #8
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %8, ptr align 16 @__const.CreateCGPotentialMatrix.gap, i64 24, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #8
  call void @llvm.lifetime.start.p0(i64 2048, ptr %10) #8
  call void @llvm.memset.p0.i64(ptr align 16 %10, i8 0, i64 2048, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #8
  %16 = getelementptr inbounds [512 x i8], ptr %1, i64 0, i64 0
  %17 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef %16, ptr noundef @.str.19, ptr noundef @datadir) #8
  %18 = getelementptr inbounds [512 x i8], ptr %1, i64 0, i64 0
  %19 = call noalias ptr @fopen(ptr noundef %18, ptr noundef @.str.20)
  store ptr %19, ptr %11, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #8
  store i32 0, ptr %12, align 4, !tbaa !5
  br label %20

20:                                               ; preds = %316, %0
  %21 = load i32, ptr %12, align 4, !tbaa !5
  %22 = load i32, ptr %4, align 4, !tbaa !5
  %23 = icmp slt i32 %21, %22
  br i1 %23, label %25, label %24

24:                                               ; preds = %20
  store i32 2, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #8
  br label %319

25:                                               ; preds = %20
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #8
  store i32 0, ptr %14, align 4, !tbaa !5
  br label %26

26:                                               ; preds = %312, %25
  %27 = load i32, ptr %14, align 4, !tbaa !5
  %28 = icmp slt i32 %27, 32
  br i1 %28, label %30, label %29

29:                                               ; preds = %26
  store i32 5, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #8
  br label %315

30:                                               ; preds = %26
  %31 = load i32, ptr %14, align 4, !tbaa !5
  %32 = sext i32 %31 to i64
  %33 = getelementptr inbounds [32 x %struct.CGBeadStr], ptr getelementptr inbounds (%struct.CGMatrixStr, ptr @CGMatrix, i32 0, i32 1), i64 0, i64 %32
  %34 = getelementptr inbounds %struct.CGBeadStr, ptr %33, i32 0, i32 2
  %35 = load double, ptr %34, align 8, !tbaa !11
  %36 = fcmp ole double %35, 0.000000e+00
  br i1 %36, label %55, label %37

37:                                               ; preds = %30
  %38 = getelementptr inbounds [3 x ptr], ptr %2, i64 0, i64 0
  %39 = load ptr, ptr %38, align 16, !tbaa !9
  %40 = call i32 @AAModel(ptr noundef %39)
  %41 = load i32, ptr %14, align 4, !tbaa !5
  %42 = icmp eq i32 %40, %41
  br i1 %42, label %55, label %43

43:                                               ; preds = %37
  %44 = getelementptr inbounds [3 x ptr], ptr %2, i64 0, i64 1
  %45 = load ptr, ptr %44, align 8, !tbaa !9
  %46 = call i32 @AAModel(ptr noundef %45)
  %47 = load i32, ptr %14, align 4, !tbaa !5
  %48 = icmp eq i32 %46, %47
  br i1 %48, label %55, label %49

49:                                               ; preds = %43
  %50 = getelementptr inbounds [3 x ptr], ptr %2, i64 0, i64 2
  %51 = load ptr, ptr %50, align 16, !tbaa !9
  %52 = call i32 @AAModel(ptr noundef %51)
  %53 = load i32, ptr %14, align 4, !tbaa !5
  %54 = icmp eq i32 %52, %53
  br i1 %54, label %55, label %56

55:                                               ; preds = %49, %43, %37, %30
  br label %312

56:                                               ; preds = %49
  %57 = load i32, ptr %12, align 4, !tbaa !5
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds [3 x ptr], ptr %2, i64 0, i64 %58
  %60 = load ptr, ptr %59, align 8, !tbaa !9
  %61 = call i32 @AAModel(ptr noundef %60)
  %62 = sext i32 %61 to i64
  %63 = getelementptr inbounds [32 x %struct.CGBeadStr], ptr getelementptr inbounds (%struct.CGMatrixStr, ptr @CGMatrix, i32 0, i32 1), i64 0, i64 %62
  %64 = load i32, ptr %14, align 4, !tbaa !5
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds [32 x %struct.CGBeadStr], ptr getelementptr inbounds (%struct.CGMatrixStr, ptr @CGMatrix, i32 0, i32 1), i64 0, i64 %65
  %67 = call double @FindMaxPotDis(ptr noundef byval(%struct.CGBeadStr) align 8 %63, ptr noundef byval(%struct.CGBeadStr) align 8 %66, double noundef 8.000000e-01)
  store double %67, ptr %7, align 8, !tbaa !14
  %68 = load i32, ptr %12, align 4, !tbaa !5
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds [3 x ptr], ptr %2, i64 0, i64 %69
  %71 = load ptr, ptr %70, align 8, !tbaa !9
  %72 = call i32 @AAModel(ptr noundef %71)
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds [32 x %struct.CGBeadStr], ptr getelementptr inbounds (%struct.CGMatrixStr, ptr @CGMatrix, i32 0, i32 1), i64 0, i64 %73
  %75 = load i32, ptr %14, align 4, !tbaa !5
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds [32 x %struct.CGBeadStr], ptr getelementptr inbounds (%struct.CGMatrixStr, ptr @CGMatrix, i32 0, i32 1), i64 0, i64 %76
  %78 = call double @FindMinPotDis(ptr noundef byval(%struct.CGBeadStr) align 8 %74, ptr noundef byval(%struct.CGBeadStr) align 8 %77, i32 noundef 0)
  store double %78, ptr %6, align 8, !tbaa !14
  %79 = load ptr, ptr %11, align 8, !tbaa !9
  %80 = load i32, ptr %12, align 4, !tbaa !5
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds [3 x ptr], ptr %2, i64 0, i64 %81
  %83 = load ptr, ptr %82, align 8, !tbaa !9
  %84 = load i32, ptr %14, align 4, !tbaa !5
  %85 = call ptr @GetAAName(i32 noundef %84)
  %86 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %79, ptr noundef @.str.21, ptr noundef %83, ptr noundef %85) #8
  %87 = load ptr, ptr %11, align 8, !tbaa !9
  %88 = load double, ptr %7, align 8, !tbaa !14
  %89 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %87, ptr noundef @.str.22, double noundef %88) #8
  store i32 0, ptr %3, align 4, !tbaa !5
  store i32 1, ptr %5, align 4, !tbaa !5
  %90 = load double, ptr %7, align 8, !tbaa !14
  %91 = getelementptr inbounds [3 x double], ptr %8, i64 0, i64 2
  %92 = load double, ptr %91, align 16, !tbaa !14
  %93 = fadd double %90, %92
  store double %93, ptr %9, align 8, !tbaa !14
  %94 = load double, ptr %9, align 8, !tbaa !14
  %95 = load i32, ptr %3, align 4, !tbaa !5
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds [128 x [2 x double]], ptr %10, i64 0, i64 %96
  %98 = getelementptr inbounds [2 x double], ptr %97, i64 0, i64 0
  store double %94, ptr %98, align 16, !tbaa !14
  %99 = load i32, ptr %12, align 4, !tbaa !5
  %100 = sext i32 %99 to i64
  %101 = getelementptr inbounds [3 x ptr], ptr %2, i64 0, i64 %100
  %102 = load ptr, ptr %101, align 8, !tbaa !9
  %103 = call i32 @AAModel(ptr noundef %102)
  %104 = sext i32 %103 to i64
  %105 = getelementptr inbounds [32 x %struct.CGBeadStr], ptr getelementptr inbounds (%struct.CGMatrixStr, ptr @CGMatrix, i32 0, i32 1), i64 0, i64 %104
  %106 = load i32, ptr %14, align 4, !tbaa !5
  %107 = sext i32 %106 to i64
  %108 = getelementptr inbounds [32 x %struct.CGBeadStr], ptr getelementptr inbounds (%struct.CGMatrixStr, ptr @CGMatrix, i32 0, i32 1), i64 0, i64 %107
  %109 = load double, ptr %9, align 8, !tbaa !14
  %110 = call double @CalculateSurPoten(ptr noundef byval(%struct.CGBeadStr) align 8 %105, ptr noundef byval(%struct.CGBeadStr) align 8 %108, double noundef %109)
  %111 = load i32, ptr %3, align 4, !tbaa !5
  %112 = add nsw i32 %111, 1
  store i32 %112, ptr %3, align 4, !tbaa !5
  %113 = sext i32 %111 to i64
  %114 = getelementptr inbounds [128 x [2 x double]], ptr %10, i64 0, i64 %113
  %115 = getelementptr inbounds [2 x double], ptr %114, i64 0, i64 1
  store double %110, ptr %115, align 8, !tbaa !14
  br label %116

116:                                              ; preds = %261, %56
  %117 = load double, ptr %9, align 8, !tbaa !14
  %118 = fcmp ole double %117, 1.000000e+01
  br i1 %118, label %119, label %262

119:                                              ; preds = %116
  %120 = getelementptr inbounds [3 x double], ptr %8, i64 0, i64 2
  %121 = load double, ptr %120, align 16, !tbaa !14
  %122 = load double, ptr %9, align 8, !tbaa !14
  %123 = fadd double %122, %121
  store double %123, ptr %9, align 8, !tbaa !14
  %124 = load i32, ptr %3, align 4, !tbaa !5
  %125 = icmp eq i32 %124, 128
  br i1 %125, label %126, label %128

126:                                              ; preds = %119
  %127 = call i32 (ptr, ...) @printf(ptr noundef @.str.23, ptr noundef @.str.5, i32 noundef 224)
  call void @exit(i32 noundef 1) #9
  unreachable

128:                                              ; preds = %119
  %129 = load double, ptr %9, align 8, !tbaa !14
  %130 = load i32, ptr %3, align 4, !tbaa !5
  %131 = sext i32 %130 to i64
  %132 = getelementptr inbounds [128 x [2 x double]], ptr %10, i64 0, i64 %131
  %133 = getelementptr inbounds [2 x double], ptr %132, i64 0, i64 0
  store double %129, ptr %133, align 16, !tbaa !14
  %134 = load i32, ptr %12, align 4, !tbaa !5
  %135 = sext i32 %134 to i64
  %136 = getelementptr inbounds [3 x ptr], ptr %2, i64 0, i64 %135
  %137 = load ptr, ptr %136, align 8, !tbaa !9
  %138 = call i32 @AAModel(ptr noundef %137)
  %139 = sext i32 %138 to i64
  %140 = getelementptr inbounds [32 x %struct.CGBeadStr], ptr getelementptr inbounds (%struct.CGMatrixStr, ptr @CGMatrix, i32 0, i32 1), i64 0, i64 %139
  %141 = load i32, ptr %14, align 4, !tbaa !5
  %142 = sext i32 %141 to i64
  %143 = getelementptr inbounds [32 x %struct.CGBeadStr], ptr getelementptr inbounds (%struct.CGMatrixStr, ptr @CGMatrix, i32 0, i32 1), i64 0, i64 %142
  %144 = load double, ptr %9, align 8, !tbaa !14
  %145 = call double @CalculateSurPoten(ptr noundef byval(%struct.CGBeadStr) align 8 %140, ptr noundef byval(%struct.CGBeadStr) align 8 %143, double noundef %144)
  %146 = load i32, ptr %3, align 4, !tbaa !5
  %147 = sext i32 %146 to i64
  %148 = getelementptr inbounds [128 x [2 x double]], ptr %10, i64 0, i64 %147
  %149 = getelementptr inbounds [2 x double], ptr %148, i64 0, i64 1
  store double %145, ptr %149, align 8, !tbaa !14
  %150 = load i32, ptr %5, align 4, !tbaa !5
  %151 = icmp ne i32 %150, 0
  br i1 %151, label %152, label %224

152:                                              ; preds = %128
  %153 = load i32, ptr %3, align 4, !tbaa !5
  %154 = sext i32 %153 to i64
  %155 = getelementptr inbounds [128 x [2 x double]], ptr %10, i64 0, i64 %154
  %156 = getelementptr inbounds [2 x double], ptr %155, i64 0, i64 0
  %157 = load double, ptr %156, align 16, !tbaa !14
  %158 = load double, ptr %6, align 8, !tbaa !14
  %159 = fsub double %157, %158
  %160 = call double @llvm.fabs.f64(double %159)
  %161 = getelementptr inbounds [3 x double], ptr %8, i64 0, i64 2
  %162 = load double, ptr %161, align 16, !tbaa !14
  %163 = fcmp olt double %160, %162
  br i1 %163, label %164, label %224

164:                                              ; preds = %152
  %165 = load double, ptr %6, align 8, !tbaa !14
  %166 = load i32, ptr %3, align 4, !tbaa !5
  %167 = sext i32 %166 to i64
  %168 = getelementptr inbounds [128 x [2 x double]], ptr %10, i64 0, i64 %167
  %169 = getelementptr inbounds [2 x double], ptr %168, i64 0, i64 0
  store double %165, ptr %169, align 16, !tbaa !14
  %170 = load i32, ptr %12, align 4, !tbaa !5
  %171 = sext i32 %170 to i64
  %172 = getelementptr inbounds [3 x ptr], ptr %2, i64 0, i64 %171
  %173 = load ptr, ptr %172, align 8, !tbaa !9
  %174 = call i32 @AAModel(ptr noundef %173)
  %175 = sext i32 %174 to i64
  %176 = getelementptr inbounds [32 x %struct.CGBeadStr], ptr getelementptr inbounds (%struct.CGMatrixStr, ptr @CGMatrix, i32 0, i32 1), i64 0, i64 %175
  %177 = load i32, ptr %14, align 4, !tbaa !5
  %178 = sext i32 %177 to i64
  %179 = getelementptr inbounds [32 x %struct.CGBeadStr], ptr getelementptr inbounds (%struct.CGMatrixStr, ptr @CGMatrix, i32 0, i32 1), i64 0, i64 %178
  %180 = load double, ptr %6, align 8, !tbaa !14
  %181 = call double @CalculateSurPoten(ptr noundef byval(%struct.CGBeadStr) align 8 %176, ptr noundef byval(%struct.CGBeadStr) align 8 %179, double noundef %180)
  %182 = load i32, ptr %3, align 4, !tbaa !5
  %183 = sext i32 %182 to i64
  %184 = getelementptr inbounds [128 x [2 x double]], ptr %10, i64 0, i64 %183
  %185 = getelementptr inbounds [2 x double], ptr %184, i64 0, i64 1
  store double %181, ptr %185, align 8, !tbaa !14
  %186 = load i32, ptr %3, align 4, !tbaa !5
  %187 = sext i32 %186 to i64
  %188 = getelementptr inbounds [128 x [2 x double]], ptr %10, i64 0, i64 %187
  %189 = getelementptr inbounds [2 x double], ptr %188, i64 0, i64 0
  %190 = load double, ptr %189, align 16, !tbaa !14
  %191 = load i32, ptr %3, align 4, !tbaa !5
  %192 = sub nsw i32 %191, 1
  %193 = sext i32 %192 to i64
  %194 = getelementptr inbounds [128 x [2 x double]], ptr %10, i64 0, i64 %193
  %195 = getelementptr inbounds [2 x double], ptr %194, i64 0, i64 0
  %196 = load double, ptr %195, align 16, !tbaa !14
  %197 = fsub double %190, %196
  %198 = getelementptr inbounds [3 x double], ptr %8, i64 0, i64 1
  %199 = load double, ptr %198, align 8, !tbaa !14
  %200 = fmul double %199, 1.000000e-01
  %201 = fcmp ogt double %197, %200
  br i1 %201, label %220, label %202

202:                                              ; preds = %164
  %203 = load i32, ptr %3, align 4, !tbaa !5
  %204 = sext i32 %203 to i64
  %205 = getelementptr inbounds [128 x [2 x double]], ptr %10, i64 0, i64 %204
  %206 = getelementptr inbounds [2 x double], ptr %205, i64 0, i64 1
  %207 = load double, ptr %206, align 8, !tbaa !14
  %208 = load i32, ptr %3, align 4, !tbaa !5
  %209 = sub nsw i32 %208, 1
  %210 = sext i32 %209 to i64
  %211 = getelementptr inbounds [128 x [2 x double]], ptr %10, i64 0, i64 %210
  %212 = getelementptr inbounds [2 x double], ptr %211, i64 0, i64 1
  %213 = load double, ptr %212, align 8, !tbaa !14
  %214 = fsub double %207, %213
  %215 = call double @llvm.fabs.f64(double %214)
  %216 = getelementptr inbounds [3 x double], ptr %8, i64 0, i64 0
  %217 = load double, ptr %216, align 16, !tbaa !14
  %218 = fmul double %217, 1.000000e-01
  %219 = fcmp ogt double %215, %218
  br i1 %219, label %220, label %223

220:                                              ; preds = %202, %164
  %221 = load i32, ptr %3, align 4, !tbaa !5
  %222 = add nsw i32 %221, 1
  store i32 %222, ptr %3, align 4, !tbaa !5
  br label %223

223:                                              ; preds = %220, %202
  store i32 0, ptr %5, align 4, !tbaa !5
  br label %261

224:                                              ; preds = %152, %128
  %225 = load i32, ptr %3, align 4, !tbaa !5
  %226 = sext i32 %225 to i64
  %227 = getelementptr inbounds [128 x [2 x double]], ptr %10, i64 0, i64 %226
  %228 = getelementptr inbounds [2 x double], ptr %227, i64 0, i64 0
  %229 = load double, ptr %228, align 16, !tbaa !14
  %230 = load i32, ptr %3, align 4, !tbaa !5
  %231 = sub nsw i32 %230, 1
  %232 = sext i32 %231 to i64
  %233 = getelementptr inbounds [128 x [2 x double]], ptr %10, i64 0, i64 %232
  %234 = getelementptr inbounds [2 x double], ptr %233, i64 0, i64 0
  %235 = load double, ptr %234, align 16, !tbaa !14
  %236 = fsub double %229, %235
  %237 = getelementptr inbounds [3 x double], ptr %8, i64 0, i64 1
  %238 = load double, ptr %237, align 8, !tbaa !14
  %239 = fcmp ogt double %236, %238
  br i1 %239, label %257, label %240

240:                                              ; preds = %224
  %241 = load i32, ptr %3, align 4, !tbaa !5
  %242 = sext i32 %241 to i64
  %243 = getelementptr inbounds [128 x [2 x double]], ptr %10, i64 0, i64 %242
  %244 = getelementptr inbounds [2 x double], ptr %243, i64 0, i64 1
  %245 = load double, ptr %244, align 8, !tbaa !14
  %246 = load i32, ptr %3, align 4, !tbaa !5
  %247 = sub nsw i32 %246, 1
  %248 = sext i32 %247 to i64
  %249 = getelementptr inbounds [128 x [2 x double]], ptr %10, i64 0, i64 %248
  %250 = getelementptr inbounds [2 x double], ptr %249, i64 0, i64 1
  %251 = load double, ptr %250, align 8, !tbaa !14
  %252 = fsub double %245, %251
  %253 = call double @llvm.fabs.f64(double %252)
  %254 = getelementptr inbounds [3 x double], ptr %8, i64 0, i64 0
  %255 = load double, ptr %254, align 16, !tbaa !14
  %256 = fcmp ogt double %253, %255
  br i1 %256, label %257, label %260

257:                                              ; preds = %240, %224
  %258 = load i32, ptr %3, align 4, !tbaa !5
  %259 = add nsw i32 %258, 1
  store i32 %259, ptr %3, align 4, !tbaa !5
  br label %260

260:                                              ; preds = %257, %240
  br label %261

261:                                              ; preds = %260, %223
  br label %116, !llvm.loop !15

262:                                              ; preds = %116
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #8
  %263 = load i32, ptr %3, align 4, !tbaa !5
  store i32 %263, ptr %15, align 4, !tbaa !5
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %264

264:                                              ; preds = %269, %262
  %265 = load i32, ptr %3, align 4, !tbaa !5
  %266 = add nsw i32 %265, 1
  store i32 %266, ptr %3, align 4, !tbaa !5
  %267 = load i32, ptr %15, align 4, !tbaa !5
  %268 = icmp slt i32 %266, %267
  br i1 %268, label %269, label %297

269:                                              ; preds = %264
  %270 = load ptr, ptr %11, align 8, !tbaa !9
  %271 = load i32, ptr %3, align 4, !tbaa !5
  %272 = sub nsw i32 %271, 1
  %273 = sext i32 %272 to i64
  %274 = getelementptr inbounds [128 x [2 x double]], ptr %10, i64 0, i64 %273
  %275 = getelementptr inbounds [2 x double], ptr %274, i64 0, i64 0
  %276 = load double, ptr %275, align 16, !tbaa !14
  %277 = load i32, ptr %3, align 4, !tbaa !5
  %278 = sext i32 %277 to i64
  %279 = getelementptr inbounds [128 x [2 x double]], ptr %10, i64 0, i64 %278
  %280 = getelementptr inbounds [2 x double], ptr %279, i64 0, i64 0
  %281 = load double, ptr %280, align 16, !tbaa !14
  %282 = fadd double %276, %281
  %283 = fmul double %282, 5.000000e-01
  %284 = load i32, ptr %3, align 4, !tbaa !5
  %285 = sub nsw i32 %284, 1
  %286 = sext i32 %285 to i64
  %287 = getelementptr inbounds [128 x [2 x double]], ptr %10, i64 0, i64 %286
  %288 = getelementptr inbounds [2 x double], ptr %287, i64 0, i64 1
  %289 = load double, ptr %288, align 8, !tbaa !14
  %290 = load i32, ptr %3, align 4, !tbaa !5
  %291 = sext i32 %290 to i64
  %292 = getelementptr inbounds [128 x [2 x double]], ptr %10, i64 0, i64 %291
  %293 = getelementptr inbounds [2 x double], ptr %292, i64 0, i64 1
  %294 = load double, ptr %293, align 8, !tbaa !14
  %295 = fsub double %289, %294
  %296 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %270, ptr noundef @.str.24, double noundef %283, double noundef %295) #8
  br label %264, !llvm.loop !17

297:                                              ; preds = %264
  %298 = load ptr, ptr %11, align 8, !tbaa !9
  %299 = load i32, ptr %3, align 4, !tbaa !5
  %300 = sub nsw i32 %299, 1
  %301 = sext i32 %300 to i64
  %302 = getelementptr inbounds [128 x [2 x double]], ptr %10, i64 0, i64 %301
  %303 = getelementptr inbounds [2 x double], ptr %302, i64 0, i64 0
  %304 = load double, ptr %303, align 16, !tbaa !14
  %305 = load i32, ptr %3, align 4, !tbaa !5
  %306 = sub nsw i32 %305, 1
  %307 = sext i32 %306 to i64
  %308 = getelementptr inbounds [128 x [2 x double]], ptr %10, i64 0, i64 %307
  %309 = getelementptr inbounds [2 x double], ptr %308, i64 0, i64 1
  %310 = load double, ptr %309, align 8, !tbaa !14
  %311 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %298, ptr noundef @.str.25, double noundef %304, double noundef %310) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #8
  br label %312

312:                                              ; preds = %297, %55
  %313 = load i32, ptr %14, align 4, !tbaa !5
  %314 = add nsw i32 %313, 1
  store i32 %314, ptr %14, align 4, !tbaa !5
  br label %26, !llvm.loop !18

315:                                              ; preds = %29
  br label %316

316:                                              ; preds = %315
  %317 = load i32, ptr %12, align 4, !tbaa !5
  %318 = add nsw i32 %317, 1
  store i32 %318, ptr %12, align 4, !tbaa !5
  br label %20, !llvm.loop !19

319:                                              ; preds = %24
  %320 = load ptr, ptr %11, align 8, !tbaa !9
  %321 = call i32 @fclose(ptr noundef %320)
  store i32 1, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #8
  call void @llvm.lifetime.end.p0(i64 2048, ptr %10) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %8) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %2) #8
  call void @llvm.lifetime.end.p0(i64 512, ptr %1) #8
  ret void
}

; 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: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #6

; Function Attrs: nounwind uwtable
declare dso_local double @FindMaxPotDis(ptr noundef byval(%struct.CGBeadStr) align 8, ptr noundef byval(%struct.CGBeadStr) align 8, double noundef) #4

; Function Attrs: nounwind uwtable
declare dso_local double @FindMinPotDis(ptr noundef byval(%struct.CGBeadStr) align 8, ptr noundef byval(%struct.CGBeadStr) align 8, i32 noundef) #4

; Function Attrs: nounwind
declare i32 @fprintf(ptr noundef, ptr noundef, ...) #1

; Function Attrs: nounwind uwtable
declare dso_local ptr @GetAAName(i32 noundef) #4

; Function Attrs: nounwind uwtable
declare dso_local double @CalculateSurPoten(ptr noundef byval(%struct.CGBeadStr) align 8, ptr noundef byval(%struct.CGBeadStr) align 8, double noundef) #4

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 = { noreturn 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 = { 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 #5 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #6 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #7 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #8 = { nounwind }
attributes #9 = { noreturn 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/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !13, i64 16}
!12 = !{!"CGBeadStr", !13, i64 0, !13, i64 8, !13, i64 16, !13, i64 24}
!13 = !{!"double", !7, i64 0}
!14 = !{!13, !13, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = distinct !{!17, !16}
!18 = distinct !{!18, !16}
!19 = distinct !{!19, !16}


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

%struct.CGMatrixStr = type { [5 x double], [32 x %struct.CGBeadStr] }
%struct.CGBeadStr = type { double, double, double, double }

@.str.5 = external hidden unnamed_addr constant [59 x i8], align 1
@datadir = external global [1024 x i8], align 16
@CGMatrix = external global %struct.CGMatrixStr, align 8
@__const.CreateCGPotentialMatrix.sur_type = external hidden unnamed_addr constant [3 x ptr], align 16
@__const.CreateCGPotentialMatrix.gap = external hidden unnamed_addr constant [3 x double], align 16
@.str.19 = external hidden unnamed_addr constant [31 x i8], align 1
@.str.20 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.21 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.22 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.23 = external hidden unnamed_addr constant [64 x i8], align 1
@.str.24 = external hidden unnamed_addr constant [17 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [17 x i8], align 1

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

; Function Attrs: nofree nounwind
declare noundef i32 @sprintf(ptr noalias nocapture noundef writeonly, ptr nocapture noundef readonly, ...) local_unnamed_addr #1

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

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

; Function Attrs: noreturn nounwind
declare void @exit(i32 noundef) local_unnamed_addr #2

; Function Attrs: nofree nounwind
declare noalias noundef ptr @fopen(ptr nocapture noundef readonly, ptr nocapture noundef readonly) local_unnamed_addr #1

declare i32 @AAModel(ptr noundef) local_unnamed_addr #3

; Function Attrs: nofree nounwind
declare noundef i32 @fclose(ptr nocapture noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local void @CreateCGPotentialMatrix() local_unnamed_addr #4 {
  %1 = alloca [512 x i8], align 16
  %2 = alloca [128 x [2 x double]], align 16
  call void @llvm.lifetime.start.p0(i64 512, ptr nonnull %1) #7
  %.sroa.0.0.copyload = load double, ptr @__const.CreateCGPotentialMatrix.gap, align 16
  %.sroa.5.0.copyload = load double, ptr getelementptr inbounds (i8, ptr @__const.CreateCGPotentialMatrix.gap, i64 8), align 8
  %.sroa.7.0.copyload = load double, ptr getelementptr inbounds (i8, ptr @__const.CreateCGPotentialMatrix.gap, i64 16), align 16
  call void @llvm.lifetime.start.p0(i64 2048, ptr nonnull %2) #7
  %3 = getelementptr inbounds i8, ptr %2, i64 16
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(2048) %3, i8 0, i64 2032, i1 false)
  %4 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %1, ptr noundef nonnull dereferenceable(1) @.str.19, ptr noundef nonnull @datadir) #7
  %5 = call noalias ptr @fopen(ptr noundef nonnull %1, ptr noundef nonnull @.str.20)
  %6 = load ptr, ptr @__const.CreateCGPotentialMatrix.sur_type, align 16
  %7 = load ptr, ptr getelementptr inbounds (i8, ptr @__const.CreateCGPotentialMatrix.sur_type, i64 8), align 8
  %8 = load ptr, ptr getelementptr inbounds (i8, ptr @__const.CreateCGPotentialMatrix.sur_type, i64 16), align 16
  %9 = getelementptr inbounds i8, ptr %2, i64 8
  %10 = fmul double %.sroa.5.0.copyload, 1.000000e-01
  %11 = fmul double %.sroa.0.0.copyload, 1.000000e-01
  br label %.preheader74

.preheader74:                                     ; preds = %0, %15
  %indvars.iv93 = phi i64 [ 0, %0 ], [ %indvars.iv.next94, %15 ]
  %12 = getelementptr inbounds [3 x ptr], ptr @__const.CreateCGPotentialMatrix.sur_type, i64 0, i64 %indvars.iv93
  br label %16

13:                                               ; preds = %15
  %14 = tail call i32 @fclose(ptr noundef %5)
  call void @llvm.lifetime.end.p0(i64 2048, ptr nonnull %2) #7
  call void @llvm.lifetime.end.p0(i64 512, ptr nonnull %1) #7
  ret void

15:                                               ; preds = %125
  %indvars.iv.next94 = add nuw nsw i64 %indvars.iv93, 1
  %exitcond96.not = icmp eq i64 %indvars.iv.next94, 3
  br i1 %exitcond96.not, label %13, label %.preheader74, !llvm.loop !5

16:                                               ; preds = %.preheader74, %125
  %indvars.iv89 = phi i64 [ 0, %.preheader74 ], [ %indvars.iv.next90, %125 ]
  %17 = getelementptr inbounds [32 x %struct.CGBeadStr], ptr getelementptr inbounds (i8, ptr @CGMatrix, i64 40), i64 0, i64 %indvars.iv89
  %18 = getelementptr inbounds i8, ptr %17, i64 16
  %19 = load double, ptr %18, align 8, !tbaa !7
  %20 = fcmp ugt double %19, 0.000000e+00
  br i1 %20, label %21, label %125

21:                                               ; preds = %16
  %22 = tail call i32 @AAModel(ptr noundef %6) #7
  %23 = zext i32 %22 to i64
  %24 = icmp eq i64 %indvars.iv89, %23
  br i1 %24, label %125, label %25

25:                                               ; preds = %21
  %26 = tail call i32 @AAModel(ptr noundef %7) #7
  %27 = zext i32 %26 to i64
  %28 = icmp eq i64 %indvars.iv89, %27
  br i1 %28, label %125, label %29

29:                                               ; preds = %25
  %30 = tail call i32 @AAModel(ptr noundef %8) #7
  %31 = zext i32 %30 to i64
  %32 = icmp eq i64 %indvars.iv89, %31
  br i1 %32, label %125, label %33

33:                                               ; preds = %29
  %34 = load ptr, ptr %12, align 8, !tbaa !12
  %35 = tail call i32 @AAModel(ptr noundef %34) #7
  %36 = sext i32 %35 to i64
  %37 = getelementptr inbounds [32 x %struct.CGBeadStr], ptr getelementptr inbounds (i8, ptr @CGMatrix, i64 40), i64 0, i64 %36
  %38 = tail call double @FindMaxPotDis(ptr noundef nonnull byval(%struct.CGBeadStr) align 8 %37, ptr noundef nonnull byval(%struct.CGBeadStr) align 8 %17, double noundef 8.000000e-01)
  %39 = tail call i32 @AAModel(ptr noundef %34) #7
  %40 = sext i32 %39 to i64
  %41 = getelementptr inbounds [32 x %struct.CGBeadStr], ptr getelementptr inbounds (i8, ptr @CGMatrix, i64 40), i64 0, i64 %40
  %42 = tail call double @FindMinPotDis(ptr noundef nonnull byval(%struct.CGBeadStr) align 8 %41, ptr noundef nonnull byval(%struct.CGBeadStr) align 8 %17, i32 noundef 0)
  %43 = trunc nuw nsw i64 %indvars.iv89 to i32
  %44 = tail call ptr @GetAAName(i32 noundef %43)
  %45 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %5, ptr noundef nonnull @.str.21, ptr noundef %34, ptr noundef %44) #7
  %46 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %5, ptr noundef nonnull @.str.22, double noundef %38) #7
  %47 = fadd double %.sroa.7.0.copyload, %38
  store double %47, ptr %2, align 16, !tbaa !14
  %48 = tail call i32 @AAModel(ptr noundef %34) #7
  %49 = sext i32 %48 to i64
  %50 = getelementptr inbounds [32 x %struct.CGBeadStr], ptr getelementptr inbounds (i8, ptr @CGMatrix, i64 40), i64 0, i64 %49
  %51 = tail call double @CalculateSurPoten(ptr noundef nonnull byval(%struct.CGBeadStr) align 8 %50, ptr noundef nonnull byval(%struct.CGBeadStr) align 8 %17, double noundef %47)
  store double %51, ptr %9, align 8, !tbaa !14
  %52 = fcmp ugt double %47, 1.000000e+01
  br i1 %52, label %._crit_edge, label %.lr.ph

.preheader:                                       ; preds = %105
  %53 = icmp sgt i32 %.2, 1
  br i1 %53, label %.lr.ph80.preheader, label %._crit_edge

.lr.ph80.preheader:                               ; preds = %.preheader
  %54 = add nsw i32 %.2, -1
  %wide.trip.count = zext nneg i32 %54 to i64
  br label %.lr.ph80

.lr.ph:                                           ; preds = %33, %105
  %.078 = phi i32 [ %.2, %105 ], [ 1, %33 ]
  %.07077 = phi i32 [ %.171, %105 ], [ 1, %33 ]
  %.07276 = phi double [ %55, %105 ], [ %47, %33 ]
  %55 = fadd double %.sroa.7.0.copyload, %.07276
  %56 = icmp eq i32 %.078, 128
  br i1 %56, label %57, label %59

57:                                               ; preds = %.lr.ph
  %58 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.23, ptr noundef nonnull @.str.5, i32 noundef 224)
  tail call void @exit(i32 noundef 1) #8
  unreachable

59:                                               ; preds = %.lr.ph
  %60 = sext i32 %.078 to i64
  %61 = getelementptr inbounds [128 x [2 x double]], ptr %2, i64 0, i64 %60
  store double %55, ptr %61, align 16, !tbaa !14
  %62 = tail call i32 @AAModel(ptr noundef %34) #7
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds [32 x %struct.CGBeadStr], ptr getelementptr inbounds (i8, ptr @CGMatrix, i64 40), i64 0, i64 %63
  %65 = tail call double @CalculateSurPoten(ptr noundef nonnull byval(%struct.CGBeadStr) align 8 %64, ptr noundef nonnull byval(%struct.CGBeadStr) align 8 %17, double noundef %55)
  %66 = getelementptr inbounds i8, ptr %61, i64 8
  store double %65, ptr %66, align 8, !tbaa !14
  %.not = icmp eq i32 %.07077, 0
  br i1 %.not, label %90, label %67

67:                                               ; preds = %59
  %68 = fsub double %55, %42
  %69 = tail call double @llvm.fabs.f64(double %68)
  %70 = fcmp olt double %69, %.sroa.7.0.copyload
  br i1 %70, label %71, label %90

71:                                               ; preds = %67
  store double %42, ptr %61, align 16, !tbaa !14
  %72 = tail call i32 @AAModel(ptr noundef %34) #7
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds [32 x %struct.CGBeadStr], ptr getelementptr inbounds (i8, ptr @CGMatrix, i64 40), i64 0, i64 %73
  %75 = tail call double @CalculateSurPoten(ptr noundef nonnull byval(%struct.CGBeadStr) align 8 %74, ptr noundef nonnull byval(%struct.CGBeadStr) align 8 %17, double noundef %42)
  store double %75, ptr %66, align 8, !tbaa !14
  %76 = add nsw i32 %.078, -1
  %77 = sext i32 %76 to i64
  %78 = getelementptr inbounds [128 x [2 x double]], ptr %2, i64 0, i64 %77
  %79 = load double, ptr %78, align 16, !tbaa !14
  %80 = fsub double %42, %79
  %81 = fcmp ogt double %80, %10
  br i1 %81, label %88, label %82

82:                                               ; preds = %71
  %83 = getelementptr inbounds i8, ptr %78, i64 8
  %84 = load double, ptr %83, align 8, !tbaa !14
  %85 = fsub double %75, %84
  %86 = tail call double @llvm.fabs.f64(double %85)
  %87 = fcmp ogt double %86, %11
  br i1 %87, label %88, label %105

88:                                               ; preds = %82, %71
  %89 = add nsw i32 %.078, 1
  br label %105

90:                                               ; preds = %67, %59
  %91 = add nsw i32 %.078, -1
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds [128 x [2 x double]], ptr %2, i64 0, i64 %92
  %94 = load double, ptr %93, align 16, !tbaa !14
  %95 = fsub double %55, %94
  %96 = fcmp ogt double %95, %.sroa.5.0.copyload
  br i1 %96, label %103, label %97

97:                                               ; preds = %90
  %98 = getelementptr inbounds i8, ptr %93, i64 8
  %99 = load double, ptr %98, align 8, !tbaa !14
  %100 = fsub double %65, %99
  %101 = tail call double @llvm.fabs.f64(double %100)
  %102 = fcmp ogt double %101, %.sroa.0.0.copyload
  br i1 %102, label %103, label %105

103:                                              ; preds = %97, %90
  %104 = add nsw i32 %.078, 1
  br label %105

105:                                              ; preds = %82, %88, %97, %103
  %.171 = phi i32 [ %.07077, %103 ], [ %.07077, %97 ], [ 0, %88 ], [ 0, %82 ]
  %.2 = phi i32 [ %104, %103 ], [ %.078, %97 ], [ %89, %88 ], [ %.078, %82 ]
  %106 = fcmp ugt double %55, 1.000000e+01
  br i1 %106, label %.preheader, label %.lr.ph, !llvm.loop !15

.lr.ph80:                                         ; preds = %.lr.ph80.preheader, %.lr.ph80
  %indvars.iv84 = phi i64 [ 0, %.lr.ph80.preheader ], [ %indvars.iv.next85, %.lr.ph80 ]
  %indvars.iv = phi i64 [ 1, %.lr.ph80.preheader ], [ %indvars.iv.next, %.lr.ph80 ]
  %107 = getelementptr inbounds [128 x [2 x double]], ptr %2, i64 0, i64 %indvars.iv84
  %108 = load double, ptr %107, align 16, !tbaa !14
  %109 = getelementptr inbounds [128 x [2 x double]], ptr %2, i64 0, i64 %indvars.iv
  %110 = load double, ptr %109, align 16, !tbaa !14
  %111 = fadd double %108, %110
  %112 = fmul double %111, 5.000000e-01
  %113 = getelementptr inbounds i8, ptr %107, i64 8
  %114 = load double, ptr %113, align 8, !tbaa !14
  %115 = getelementptr inbounds i8, ptr %109, i64 8
  %116 = load double, ptr %115, align 8, !tbaa !14
  %117 = fsub double %114, %116
  %118 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %5, ptr noundef nonnull @.str.24, double noundef %112, double noundef %117) #7
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %indvars.iv.next85 = add nuw nsw i64 %indvars.iv84, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next85, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph80, !llvm.loop !16

._crit_edge:                                      ; preds = %.lr.ph80, %33, %.preheader
  %.3.lcssa = phi i64 [ 0, %.preheader ], [ 0, %33 ], [ %indvars.iv, %.lr.ph80 ]
  %119 = and i64 %.3.lcssa, 4294967295
  %120 = getelementptr inbounds [128 x [2 x double]], ptr %2, i64 0, i64 %119
  %121 = load double, ptr %120, align 16, !tbaa !14
  %122 = getelementptr inbounds i8, ptr %120, i64 8
  %123 = load double, ptr %122, align 8, !tbaa !14
  %124 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %5, ptr noundef nonnull @.str.25, double noundef %121, double noundef %123) #7
  br label %125

125:                                              ; preds = %16, %21, %25, %29, %._crit_edge
  %indvars.iv.next90 = add nuw nsw i64 %indvars.iv89, 1
  %exitcond92.not = icmp eq i64 %indvars.iv.next90, 32
  br i1 %exitcond92.not, label %15, label %16, !llvm.loop !17
}

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

; Function Attrs: nounwind uwtable
declare dso_local double @FindMaxPotDis(ptr noundef byval(%struct.CGBeadStr) align 8, ptr noundef byval(%struct.CGBeadStr) align 8, double noundef) local_unnamed_addr #4

; Function Attrs: nounwind uwtable
declare dso_local double @FindMinPotDis(ptr noundef byval(%struct.CGBeadStr) align 8, ptr noundef byval(%struct.CGBeadStr) align 8, i32 noundef) local_unnamed_addr #4

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

; Function Attrs: nounwind uwtable
declare dso_local ptr @GetAAName(i32 noundef) local_unnamed_addr #4

; Function Attrs: nounwind uwtable
declare dso_local double @CalculateSurPoten(ptr noundef byval(%struct.CGBeadStr) align 8, ptr noundef byval(%struct.CGBeadStr) align 8, double noundef) local_unnamed_addr #4

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { noreturn 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 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind 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: write) }
attributes #6 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #7 = { nounwind }
attributes #8 = { noreturn 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 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}
!7 = !{!8, !9, i64 16}
!8 = !{!"CGBeadStr", !9, i64 0, !9, i64 8, !9, i64 16, !9, i64 24}
!9 = !{!"double", !10, i64 0}
!10 = !{!"omnipotent char", !11, i64 0}
!11 = !{!"Simple C/C++ TBAA"}
!12 = !{!13, !13, i64 0}
!13 = !{!"any pointer", !10, i64 0}
!14 = !{!9, !9, i64 0}
!15 = distinct !{!15, !6}
!16 = distinct !{!16, !6}
!17 = distinct !{!17, !6}


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