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

; 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.ConstraintStr = type { i32, double, ptr, double, ptr }
%struct.StepPotenStr = type { double, double, double, ptr }

@datadir = external global [1024 x i8], align 16
@.str.94 = external hidden unnamed_addr constant [2 x i8], align 1
@Methodtype = external global [20 x i8], align 16
@.str.107 = external hidden unnamed_addr constant [41 x i8], align 1
@.str.110 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.123 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.178 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.179 = external hidden unnamed_addr constant [46 x i8], align 1
@.str.180 = external hidden unnamed_addr constant [82 x i8], align 1
@potentialPairCollision = external global [33 x [33 x %struct.ConstraintStr]], align 16
@.str.181 = external hidden unnamed_addr constant [9 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: 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) #1

; Function Attrs: nounwind allocsize(0,1)
declare noalias ptr @calloc(i64 noundef, i64 noundef) #2

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

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

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

; Function Attrs: nounwind willreturn memory(read)
declare i32 @strncmp(ptr noundef, ptr noundef, i64 noundef) #6

; Function Attrs: nounwind uwtable
define dso_local void @CreatePotentialMatrix() #7 {
  %1 = alloca [2 x i32], align 4
  %2 = alloca [2 x [10 x i8]], align 16
  %3 = alloca [1024 x i8], align 16
  %4 = alloca [2 x double], align 16
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %1) #8
  call void @llvm.lifetime.start.p0(i64 20, ptr %2) #8
  call void @llvm.lifetime.start.p0(i64 1024, ptr %3) #8
  call void @llvm.lifetime.start.p0(i64 16, ptr %4) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #8
  store ptr null, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #8
  %12 = call i32 @strncmp(ptr noundef @Methodtype, ptr noundef @.str.178, i64 noundef 1) #9
  %13 = icmp eq i32 %12, 0
  br i1 %13, label %14, label %189

14:                                               ; preds = %0
  %15 = getelementptr inbounds [1024 x i8], ptr %3, i64 0, i64 0
  %16 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef %15, ptr noundef @.str.179, ptr noundef @datadir) #8
  %17 = getelementptr inbounds [1024 x i8], ptr %3, i64 0, i64 0
  %18 = call noalias ptr @fopen(ptr noundef %17, ptr noundef @.str.94)
  store ptr %18, ptr %6, align 8, !tbaa !5
  %19 = load ptr, ptr %6, align 8, !tbaa !5
  %20 = icmp eq ptr %19, null
  br i1 %20, label %21, label %24

21:                                               ; preds = %14
  %22 = call i32 (ptr, ...) @printf(ptr noundef @.str.180, ptr noundef @datadir)
  %23 = call i32 (ptr, ...) @printf(ptr noundef @.str.107)
  call void @exit(i32 noundef 1) #10
  unreachable

24:                                               ; preds = %14
  br label %25

25:                                               ; preds = %159, %35, %24
  %26 = getelementptr inbounds [1024 x i8], ptr %3, i64 0, i64 0
  %27 = load ptr, ptr %6, align 8, !tbaa !5
  %28 = call ptr @fgets(ptr noundef %26, i32 noundef 1024, ptr noundef %27)
  %29 = icmp ne ptr %28, null
  br i1 %29, label %30, label %186

30:                                               ; preds = %25
  %31 = getelementptr inbounds [1024 x i8], ptr %3, i64 0, i64 0
  %32 = load i8, ptr %31, align 16, !tbaa !9
  %33 = sext i8 %32 to i32
  %34 = icmp eq i32 %33, 35
  br i1 %34, label %35, label %36

35:                                               ; preds = %30
  br label %25, !llvm.loop !10

36:                                               ; preds = %30
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #8
  store i32 0, ptr %8, align 4, !tbaa !12
  %37 = getelementptr inbounds [1024 x i8], ptr %3, i64 0, i64 0
  %38 = getelementptr inbounds [2 x [10 x i8]], ptr %2, i64 0, i64 0
  %39 = getelementptr inbounds [10 x i8], ptr %38, i64 0, i64 0
  %40 = getelementptr inbounds [2 x [10 x i8]], ptr %2, i64 0, i64 1
  %41 = getelementptr inbounds [10 x i8], ptr %40, i64 0, i64 0
  %42 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef %37, ptr noundef @.str.110, ptr noundef %39, ptr noundef %41, ptr noundef %7) #8
  %43 = load i32, ptr %7, align 4, !tbaa !12
  %44 = load i32, ptr %8, align 4, !tbaa !12
  %45 = add nsw i32 %44, %43
  store i32 %45, ptr %8, align 4, !tbaa !12
  %46 = getelementptr inbounds [2 x [10 x i8]], ptr %2, i64 0, i64 0
  %47 = getelementptr inbounds [10 x i8], ptr %46, i64 0, i64 0
  %48 = call i32 @AtomModel(ptr noundef %47)
  %49 = getelementptr inbounds [2 x i32], ptr %1, i64 0, i64 0
  store i32 %48, ptr %49, align 4, !tbaa !12
  %50 = getelementptr inbounds [2 x [10 x i8]], ptr %2, i64 0, i64 1
  %51 = getelementptr inbounds [10 x i8], ptr %50, i64 0, i64 0
  %52 = call i32 @AtomModel(ptr noundef %51)
  %53 = getelementptr inbounds [2 x i32], ptr %1, i64 0, i64 1
  store i32 %52, ptr %53, align 4, !tbaa !12
  %54 = getelementptr inbounds [2 x i32], ptr %1, i64 0, i64 0
  %55 = load i32, ptr %54, align 4, !tbaa !12
  %56 = getelementptr inbounds [2 x i32], ptr %1, i64 0, i64 1
  %57 = load i32, ptr %56, align 4, !tbaa !12
  %58 = icmp sgt i32 %55, %57
  br i1 %58, label %59, label %67

59:                                               ; preds = %36
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #8
  %60 = getelementptr inbounds [2 x i32], ptr %1, i64 0, i64 0
  %61 = load i32, ptr %60, align 4, !tbaa !12
  store i32 %61, ptr %9, align 4, !tbaa !12
  %62 = getelementptr inbounds [2 x i32], ptr %1, i64 0, i64 1
  %63 = load i32, ptr %62, align 4, !tbaa !12
  %64 = getelementptr inbounds [2 x i32], ptr %1, i64 0, i64 0
  store i32 %63, ptr %64, align 4, !tbaa !12
  %65 = load i32, ptr %9, align 4, !tbaa !12
  %66 = getelementptr inbounds [2 x i32], ptr %1, i64 0, i64 1
  store i32 %65, ptr %66, align 4, !tbaa !12
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #8
  br label %67

67:                                               ; preds = %59, %36
  %68 = getelementptr inbounds [1024 x i8], ptr %3, i64 0, i64 0
  %69 = load i32, ptr %8, align 4, !tbaa !12
  %70 = sext i32 %69 to i64
  %71 = getelementptr inbounds i8, ptr %68, i64 %70
  %72 = getelementptr inbounds [2 x i32], ptr %1, i64 0, i64 0
  %73 = load i32, ptr %72, align 4, !tbaa !12
  %74 = sext i32 %73 to i64
  %75 = getelementptr inbounds [33 x [33 x %struct.ConstraintStr]], ptr @potentialPairCollision, i64 0, i64 %74
  %76 = getelementptr inbounds [2 x i32], ptr %1, i64 0, i64 1
  %77 = load i32, ptr %76, align 4, !tbaa !12
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds [33 x %struct.ConstraintStr], ptr %75, i64 0, i64 %78
  %80 = getelementptr inbounds %struct.ConstraintStr, ptr %79, i32 0, i32 1
  %81 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef %71, ptr noundef @.str.123, ptr noundef %80, ptr noundef %7) #8
  %82 = load i32, ptr %7, align 4, !tbaa !12
  %83 = load i32, ptr %8, align 4, !tbaa !12
  %84 = add nsw i32 %83, %82
  store i32 %84, ptr %8, align 4, !tbaa !12
  %85 = getelementptr inbounds [2 x i32], ptr %1, i64 0, i64 0
  %86 = load i32, ptr %85, align 4, !tbaa !12
  %87 = sext i32 %86 to i64
  %88 = getelementptr inbounds [33 x [33 x %struct.ConstraintStr]], ptr @potentialPairCollision, i64 0, i64 %87
  %89 = getelementptr inbounds [2 x i32], ptr %1, i64 0, i64 1
  %90 = load i32, ptr %89, align 4, !tbaa !12
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds [33 x %struct.ConstraintStr], ptr %88, i64 0, i64 %91
  %93 = getelementptr inbounds %struct.ConstraintStr, ptr %92, i32 0, i32 1
  %94 = load double, ptr %93, align 8, !tbaa !14
  %95 = getelementptr inbounds [2 x i32], ptr %1, i64 0, i64 0
  %96 = load i32, ptr %95, align 4, !tbaa !12
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds [33 x [33 x %struct.ConstraintStr]], ptr @potentialPairCollision, i64 0, i64 %97
  %99 = getelementptr inbounds [2 x i32], ptr %1, i64 0, i64 1
  %100 = load i32, ptr %99, align 4, !tbaa !12
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds [33 x %struct.ConstraintStr], ptr %98, i64 0, i64 %101
  %103 = getelementptr inbounds %struct.ConstraintStr, ptr %102, i32 0, i32 1
  %104 = load double, ptr %103, align 8, !tbaa !14
  %105 = fmul double %104, %94
  store double %105, ptr %103, align 8, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #8
  store i32 1, ptr %10, align 4, !tbaa !12
  br label %106

106:                                              ; preds = %158, %67
  %107 = getelementptr inbounds [1024 x i8], ptr %3, i64 0, i64 0
  %108 = load i32, ptr %8, align 4, !tbaa !12
  %109 = sext i32 %108 to i64
  %110 = getelementptr inbounds i8, ptr %107, i64 %109
  %111 = getelementptr inbounds [2 x double], ptr %4, i64 0, i64 0
  %112 = getelementptr inbounds [2 x double], ptr %4, i64 0, i64 1
  %113 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef %110, ptr noundef @.str.181, ptr noundef %111, ptr noundef %112, ptr noundef %7) #8
  %114 = icmp ne i32 %113, -1
  br i1 %114, label %115, label %159

115:                                              ; preds = %106
  %116 = load i32, ptr %7, align 4, !tbaa !12
  %117 = load i32, ptr %8, align 4, !tbaa !12
  %118 = add nsw i32 %117, %116
  store i32 %118, ptr %8, align 4, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #8
  %119 = call noalias ptr @calloc(i64 noundef 1, i64 noundef 32) #11
  store ptr %119, ptr %11, align 8, !tbaa !5
  %120 = getelementptr inbounds [2 x double], ptr %4, i64 0, i64 0
  %121 = load double, ptr %120, align 16, !tbaa !17
  %122 = load ptr, ptr %11, align 8, !tbaa !5
  %123 = getelementptr inbounds %struct.StepPotenStr, ptr %122, i32 0, i32 0
  store double %121, ptr %123, align 8, !tbaa !18
  %124 = load ptr, ptr %11, align 8, !tbaa !5
  %125 = getelementptr inbounds %struct.StepPotenStr, ptr %124, i32 0, i32 0
  %126 = load double, ptr %125, align 8, !tbaa !18
  %127 = load ptr, ptr %11, align 8, !tbaa !5
  %128 = getelementptr inbounds %struct.StepPotenStr, ptr %127, i32 0, i32 0
  %129 = load double, ptr %128, align 8, !tbaa !18
  %130 = fmul double %129, %126
  store double %130, ptr %128, align 8, !tbaa !18
  %131 = getelementptr inbounds [2 x double], ptr %4, i64 0, i64 1
  %132 = load double, ptr %131, align 8, !tbaa !17
  %133 = load ptr, ptr %11, align 8, !tbaa !5
  %134 = getelementptr inbounds %struct.StepPotenStr, ptr %133, i32 0, i32 1
  store double %132, ptr %134, align 8, !tbaa !20
  %135 = load i32, ptr %10, align 4, !tbaa !12
  %136 = icmp eq i32 %135, 1
  br i1 %136, label %137, label %151

137:                                              ; preds = %115
  %138 = load ptr, ptr %11, align 8, !tbaa !5
  %139 = getelementptr inbounds [2 x i32], ptr %1, i64 0, i64 0
  %140 = load i32, ptr %139, align 4, !tbaa !12
  %141 = sext i32 %140 to i64
  %142 = getelementptr inbounds [33 x [33 x %struct.ConstraintStr]], ptr @potentialPairCollision, i64 0, i64 %141
  %143 = getelementptr inbounds [2 x i32], ptr %1, i64 0, i64 1
  %144 = load i32, ptr %143, align 4, !tbaa !12
  %145 = sext i32 %144 to i64
  %146 = getelementptr inbounds [33 x %struct.ConstraintStr], ptr %142, i64 0, i64 %145
  %147 = getelementptr inbounds %struct.ConstraintStr, ptr %146, i32 0, i32 2
  store ptr %138, ptr %147, align 8, !tbaa !21
  %148 = load ptr, ptr %11, align 8, !tbaa !5
  store ptr %148, ptr %5, align 8, !tbaa !5
  %149 = load i32, ptr %10, align 4, !tbaa !12
  %150 = add nsw i32 %149, 1
  store i32 %150, ptr %10, align 4, !tbaa !12
  br label %158

151:                                              ; preds = %115
  %152 = load ptr, ptr %11, align 8, !tbaa !5
  %153 = load ptr, ptr %5, align 8, !tbaa !5
  %154 = getelementptr inbounds %struct.StepPotenStr, ptr %153, i32 0, i32 3
  store ptr %152, ptr %154, align 8, !tbaa !22
  %155 = load ptr, ptr %5, align 8, !tbaa !5
  %156 = getelementptr inbounds %struct.StepPotenStr, ptr %155, i32 0, i32 3
  %157 = load ptr, ptr %156, align 8, !tbaa !22
  store ptr %157, ptr %5, align 8, !tbaa !5
  br label %158

158:                                              ; preds = %151, %137
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #8
  br label %106, !llvm.loop !23

159:                                              ; preds = %106
  %160 = getelementptr inbounds [2 x i32], ptr %1, i64 0, i64 0
  %161 = load i32, ptr %160, align 4, !tbaa !12
  %162 = sext i32 %161 to i64
  %163 = getelementptr inbounds [33 x [33 x %struct.ConstraintStr]], ptr @potentialPairCollision, i64 0, i64 %162
  %164 = getelementptr inbounds [2 x i32], ptr %1, i64 0, i64 1
  %165 = load i32, ptr %164, align 4, !tbaa !12
  %166 = sext i32 %165 to i64
  %167 = getelementptr inbounds [33 x %struct.ConstraintStr], ptr %163, i64 0, i64 %166
  %168 = getelementptr inbounds %struct.ConstraintStr, ptr %167, i32 0, i32 2
  %169 = load ptr, ptr %168, align 8, !tbaa !21
  call void @CalAccumulatedPoten(ptr noundef %169)
  %170 = getelementptr inbounds [2 x i32], ptr %1, i64 0, i64 1
  %171 = load i32, ptr %170, align 4, !tbaa !12
  %172 = sext i32 %171 to i64
  %173 = getelementptr inbounds [33 x [33 x %struct.ConstraintStr]], ptr @potentialPairCollision, i64 0, i64 %172
  %174 = getelementptr inbounds [2 x i32], ptr %1, i64 0, i64 0
  %175 = load i32, ptr %174, align 4, !tbaa !12
  %176 = sext i32 %175 to i64
  %177 = getelementptr inbounds [33 x %struct.ConstraintStr], ptr %173, i64 0, i64 %176
  %178 = getelementptr inbounds [2 x i32], ptr %1, i64 0, i64 0
  %179 = load i32, ptr %178, align 4, !tbaa !12
  %180 = sext i32 %179 to i64
  %181 = getelementptr inbounds [33 x [33 x %struct.ConstraintStr]], ptr @potentialPairCollision, i64 0, i64 %180
  %182 = getelementptr inbounds [2 x i32], ptr %1, i64 0, i64 1
  %183 = load i32, ptr %182, align 4, !tbaa !12
  %184 = sext i32 %183 to i64
  %185 = getelementptr inbounds [33 x %struct.ConstraintStr], ptr %181, i64 0, i64 %184
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %177, ptr align 8 %185, i64 40, i1 false), !tbaa.struct !24
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #8
  br label %25, !llvm.loop !10

186:                                              ; preds = %25
  %187 = load ptr, ptr %6, align 8, !tbaa !5
  %188 = call i32 @fclose(ptr noundef %187)
  br label %189

189:                                              ; preds = %186, %0
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %4) #8
  call void @llvm.lifetime.end.p0(i64 1024, ptr %3) #8
  call void @llvm.lifetime.end.p0(i64 20, ptr %2) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %1) #8
  ret void
}

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

declare i32 @fclose(ptr noundef) #3

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

declare ptr @fgets(ptr noundef, i32 noundef, ptr noundef) #3

; Function Attrs: nounwind
declare i32 @__isoc99_sscanf(ptr noundef, ptr noundef, ...) #4

declare i32 @AtomModel(ptr noundef) #3

declare void @CalAccumulatedPoten(ptr noundef) #3

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nounwind allocsize(0,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 #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 "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 = { 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 #6 = { nounwind willreturn memory(read) "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 #7 = { 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 #8 = { nounwind }
attributes #9 = { nounwind willreturn memory(read) }
attributes #10 = { noreturn nounwind }
attributes #11 = { nounwind allocsize(0,1) }

!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/C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = !{!13, !13, i64 0}
!13 = !{!"int", !7, i64 0}
!14 = !{!15, !16, i64 8}
!15 = !{!"ConstraintStr", !13, i64 0, !16, i64 8, !6, i64 16, !16, i64 24, !6, i64 32}
!16 = !{!"double", !7, i64 0}
!17 = !{!16, !16, i64 0}
!18 = !{!19, !16, i64 0}
!19 = !{!"StepPotenStr", !16, i64 0, !16, i64 8, !16, i64 16, !6, i64 24}
!20 = !{!19, !16, i64 8}
!21 = !{!15, !6, i64 16}
!22 = !{!19, !6, i64 24}
!23 = distinct !{!23, !11}
!24 = !{i64 0, i64 4, !12, i64 8, i64 8, !17, i64 16, i64 8, !5, i64 24, i64 8, !17, i64 32, i64 8, !5}


; 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.ConstraintStr = type { i32, double, ptr, double, ptr }

@datadir = external global [1024 x i8], align 16
@.str.94 = external hidden unnamed_addr constant [2 x i8], align 1
@Methodtype = external local_unnamed_addr global [20 x i8], align 16
@.str.107 = external hidden unnamed_addr constant [41 x i8], align 1
@.str.110 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.123 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.178 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.179 = external hidden unnamed_addr constant [46 x i8], align 1
@.str.180 = external hidden unnamed_addr constant [82 x i8], align 1
@potentialPairCollision = external global [33 x [33 x %struct.ConstraintStr]], align 16
@.str.181 = external hidden unnamed_addr constant [9 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: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #1

; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @calloc(i64 noundef, i64 noundef) local_unnamed_addr #2

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

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

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

; Function Attrs: nounwind uwtable
define dso_local void @CreatePotentialMatrix() local_unnamed_addr #5 {
  %1 = alloca [2 x [10 x i8]], align 16
  %2 = alloca [1024 x i8], align 16
  %3 = alloca [2 x double], align 16
  %4 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %1) #8
  call void @llvm.lifetime.start.p0(i64 1024, ptr nonnull %2) #8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %3) #8
  %lhsc = load i8, ptr @Methodtype, align 16
  %rhsc = load i8, ptr @.str.178, align 1
  %5 = icmp eq i8 %lhsc, %rhsc
  br i1 %5, label %6, label %66

6:                                                ; preds = %0
  %7 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %2, ptr noundef nonnull dereferenceable(1) @.str.179, ptr noundef nonnull @datadir) #8
  %8 = call noalias ptr @fopen(ptr noundef nonnull %2, ptr noundef nonnull @.str.94)
  %9 = icmp eq ptr %8, null
  br i1 %9, label %12, label %.preheader

.preheader:                                       ; preds = %6
  %10 = getelementptr inbounds i8, ptr %1, i64 10
  %11 = getelementptr inbounds i8, ptr %3, i64 8
  br label %.outer

12:                                               ; preds = %6
  %13 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.180, ptr noundef nonnull @datadir)
  %14 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.107)
  tail call void @exit(i32 noundef 1) #9
  unreachable

.outer:                                           ; preds = %.outer.backedge, %.preheader
  %15 = call ptr @fgets(ptr noundef nonnull %2, i32 noundef 1024, ptr noundef nonnull %8)
  %.not = icmp eq ptr %15, null
  br i1 %.not, label %64, label %16

16:                                               ; preds = %.outer
  %17 = load i8, ptr %2, align 16, !tbaa !5
  %18 = icmp eq i8 %17, 35
  br i1 %18, label %.outer.backedge, label %19

.outer.backedge:                                  ; preds = %16, %._crit_edge
  br label %.outer, !llvm.loop !8

19:                                               ; preds = %16
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #8
  %20 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef nonnull %2, ptr noundef nonnull @.str.110, ptr noundef nonnull %1, ptr noundef nonnull %10, ptr noundef nonnull %4) #8
  %21 = load i32, ptr %4, align 4, !tbaa !10
  %22 = call i32 @AtomModel(ptr noundef nonnull %1) #8
  %23 = call i32 @AtomModel(ptr noundef nonnull %10) #8
  %spec.select = call i32 @llvm.smin.i32(i32 %22, i32 %23)
  %spec.select43 = call i32 @llvm.smax.i32(i32 %22, i32 %23)
  %24 = sext i32 %21 to i64
  %25 = getelementptr inbounds i8, ptr %2, i64 %24
  %26 = sext i32 %spec.select to i64
  %27 = sext i32 %spec.select43 to i64
  %28 = getelementptr inbounds [33 x [33 x %struct.ConstraintStr]], ptr @potentialPairCollision, i64 0, i64 %26, i64 %27
  %29 = getelementptr inbounds i8, ptr %28, i64 8
  %30 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef nonnull %25, ptr noundef nonnull @.str.123, ptr noundef nonnull %29, ptr noundef nonnull %4) #8
  %31 = load i32, ptr %4, align 4, !tbaa !10
  %32 = add nsw i32 %31, %21
  %33 = load double, ptr %29, align 8, !tbaa !12
  %34 = fmul double %33, %33
  store double %34, ptr %29, align 8, !tbaa !12
  %35 = sext i32 %32 to i64
  %36 = getelementptr inbounds i8, ptr %2, i64 %35
  %37 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef nonnull %36, ptr noundef nonnull @.str.181, ptr noundef nonnull %3, ptr noundef nonnull %11, ptr noundef nonnull %4) #8
  %.not4244 = icmp eq i32 %37, -1
  br i1 %.not4244, label %._crit_edge, label %38

38:                                               ; preds = %19
  %39 = load i32, ptr %4, align 4, !tbaa !10
  %40 = add nsw i32 %39, %32
  %41 = call noalias dereferenceable_or_null(32) ptr @calloc(i64 noundef 1, i64 noundef 32) #10
  %42 = load double, ptr %3, align 16, !tbaa !16
  %43 = fmul double %42, %42
  store double %43, ptr %41, align 8, !tbaa !17
  %44 = load double, ptr %11, align 8, !tbaa !16
  %45 = getelementptr inbounds i8, ptr %41, i64 8
  store double %44, ptr %45, align 8, !tbaa !19
  %46 = getelementptr inbounds i8, ptr %28, i64 16
  store ptr %41, ptr %46, align 8, !tbaa !20
  %47 = sext i32 %40 to i64
  %48 = getelementptr inbounds i8, ptr %2, i64 %47
  %49 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef nonnull %48, ptr noundef nonnull @.str.181, ptr noundef nonnull %3, ptr noundef nonnull %11, ptr noundef nonnull %4) #8
  %.not42.peel = icmp eq i32 %49, -1
  br i1 %.not42.peel, label %._crit_edge, label %.peel.next

.peel.next:                                       ; preds = %38, %.peel.next
  %.03546 = phi i32 [ %51, %.peel.next ], [ %40, %38 ]
  %.13745 = phi ptr [ %52, %.peel.next ], [ %41, %38 ]
  %50 = load i32, ptr %4, align 4, !tbaa !10
  %51 = add nsw i32 %50, %.03546
  %52 = call noalias dereferenceable_or_null(32) ptr @calloc(i64 noundef 1, i64 noundef 32) #10
  %53 = load double, ptr %3, align 16, !tbaa !16
  %54 = fmul double %53, %53
  store double %54, ptr %52, align 8, !tbaa !17
  %55 = load double, ptr %11, align 8, !tbaa !16
  %56 = getelementptr inbounds i8, ptr %52, i64 8
  store double %55, ptr %56, align 8, !tbaa !19
  %57 = getelementptr inbounds i8, ptr %.13745, i64 24
  store ptr %52, ptr %57, align 8, !tbaa !21
  %58 = sext i32 %51 to i64
  %59 = getelementptr inbounds i8, ptr %2, i64 %58
  %60 = call i32 (ptr, ptr, ...) @__isoc99_sscanf(ptr noundef nonnull %59, ptr noundef nonnull @.str.181, ptr noundef nonnull %3, ptr noundef nonnull %11, ptr noundef nonnull %4) #8
  %.not42 = icmp eq i32 %60, -1
  br i1 %.not42, label %._crit_edge, label %.peel.next, !llvm.loop !22

._crit_edge:                                      ; preds = %.peel.next, %38, %19
  %61 = getelementptr inbounds i8, ptr %28, i64 16
  %62 = load ptr, ptr %61, align 8, !tbaa !20
  call void @CalAccumulatedPoten(ptr noundef %62) #8
  %63 = getelementptr inbounds [33 x [33 x %struct.ConstraintStr]], ptr @potentialPairCollision, i64 0, i64 %27, i64 %26
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(40) %63, ptr noundef nonnull align 8 dereferenceable(40) %28, i64 40, i1 false), !tbaa.struct !24
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #8
  br label %.outer.backedge

64:                                               ; preds = %.outer
  %65 = call i32 @fclose(ptr noundef nonnull %8)
  br label %66

66:                                               ; preds = %64, %0
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #8
  call void @llvm.lifetime.end.p0(i64 1024, ptr nonnull %2) #8
  call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %1) #8
  ret void
}

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

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

; 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 ptr @fgets(ptr noundef, i32 noundef, ptr nocapture noundef) local_unnamed_addr #3

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

declare i32 @AtomModel(ptr noundef) local_unnamed_addr #6

declare void @CalAccumulatedPoten(ptr noundef) local_unnamed_addr #6

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #7

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smax.i32(i32, i32) #7

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "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 = { 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 #4 = { 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 #5 = { 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 = { "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 #7 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #8 = { nounwind }
attributes #9 = { noreturn nounwind }
attributes #10 = { nounwind allocsize(0,1) }

!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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C/C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}
!10 = !{!11, !11, i64 0}
!11 = !{!"int", !6, i64 0}
!12 = !{!13, !14, i64 8}
!13 = !{!"ConstraintStr", !11, i64 0, !14, i64 8, !15, i64 16, !14, i64 24, !15, i64 32}
!14 = !{!"double", !6, i64 0}
!15 = !{!"any pointer", !6, i64 0}
!16 = !{!14, !14, i64 0}
!17 = !{!18, !14, i64 0}
!18 = !{!"StepPotenStr", !14, i64 0, !14, i64 8, !14, i64 16, !15, i64 24}
!19 = !{!18, !14, i64 8}
!20 = !{!13, !15, i64 16}
!21 = !{!18, !15, i64 24}
!22 = distinct !{!22, !9, !23}
!23 = !{!"llvm.loop.peeled.count", i32 1}
!24 = !{i64 0, i64 4, !10, i64 8, i64 8, !16, i64 16, i64 8, !25, i64 24, i64 8, !16, i64 32, i64 8, !25}
!25 = !{!15, !15, i64 0}


; Effective O3 passes: BDCEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LCSSAPass,LICMPass,LoopFullUnrollPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SCCPPass,SROAPass,SimplifyCFGPass,TailCallElimPass