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

; 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.FlowStr = type { i32, %struct.ConstVStr, %struct.ForceStr, %struct.ChargeStr }
%struct.ConstVStr = type { [4 x double] }
%struct.ForceStr = type { [4 x double], ptr, ptr }
%struct.ChargeStr = type { i32, i32, ptr, ptr, ptr, ptr }
%struct.AtomStr = type { ptr, ptr }
%struct.DynamicStr = type { [4 x i32], [4 x double], [4 x double], %struct.HBStr, %struct.HBNeighborStr, %struct.InteractionEventStr }
%struct.HBStr = type { i32, i32, i8, i32 }
%struct.HBNeighborStr = type { [5 x i32], i32, i32 }
%struct.InteractionEventStr = type { i32, i64, i64, double, double, i32, i32 }
%struct.PropertyStr = type { [8 x i8], [2 x [16 x i8]], [8 x i8], i32, i32, i32, double, double, [3 x double], %struct.AtomSeqStr, ptr, ptr }
%struct.AtomSeqStr = type { i32, i32, i32 }
%struct.PepStr = type { i32, i32, i32, i32, double }

@atomnum = external global i32, align 4
@atom = external global ptr, align 8
@protein = external global ptr, align 8
@flow = external global %struct.FlowStr, align 8
@numofprotein = external global i32, align 4
@.str.27 = external hidden unnamed_addr constant [44 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 nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

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

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

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(none)
declare i64 @llvm.expect.i64(i64, i64) #3

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

; Function Attrs: nounwind uwtable
declare dso_local void @CalCOMV(i32 noundef, ptr noundef) #5

; Function Attrs: nounwind uwtable
define dso_local double @CalKinetE() #5 {
  %1 = alloca [4 x double], align 16
  %2 = alloca double, align 8
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca [4 x double], align 16
  %7 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 32, ptr %1) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #6
  store double 0.000000e+00, ptr %2, align 8, !tbaa !5
  %8 = load i32, ptr @flow, align 8, !tbaa !9
  %9 = icmp slt i32 %8, 2
  br i1 %9, label %10, label %86

10:                                               ; preds = %0
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  store i32 1, ptr %3, align 4, !tbaa !16
  br label %11

11:                                               ; preds = %82, %10
  %12 = load i32, ptr %3, align 4, !tbaa !16
  %13 = load i32, ptr @atomnum, align 4, !tbaa !16
  %14 = icmp sle i32 %12, %13
  br i1 %14, label %16, label %15

15:                                               ; preds = %11
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  br label %85

16:                                               ; preds = %11
  %17 = load ptr, ptr @atom, align 8, !tbaa !17
  %18 = load i32, ptr %3, align 4, !tbaa !16
  %19 = sext i32 %18 to i64
  %20 = getelementptr inbounds %struct.AtomStr, ptr %17, i64 %19
  %21 = getelementptr inbounds %struct.AtomStr, ptr %20, i32 0, i32 1
  %22 = load ptr, ptr %21, align 8, !tbaa !18
  %23 = getelementptr inbounds %struct.DynamicStr, ptr %22, i32 0, i32 2
  %24 = getelementptr inbounds [4 x double], ptr %23, i64 0, i64 1
  %25 = load double, ptr %24, align 8, !tbaa !5
  %26 = load double, ptr getelementptr inbounds ([4 x double], ptr getelementptr inbounds (%struct.FlowStr, ptr @flow, i32 0, i32 1), i64 0, i64 1), align 8, !tbaa !5
  %27 = fsub double %25, %26
  %28 = getelementptr inbounds [4 x double], ptr %1, i64 0, i64 1
  store double %27, ptr %28, align 8, !tbaa !5
  %29 = load ptr, ptr @atom, align 8, !tbaa !17
  %30 = load i32, ptr %3, align 4, !tbaa !16
  %31 = sext i32 %30 to i64
  %32 = getelementptr inbounds %struct.AtomStr, ptr %29, i64 %31
  %33 = getelementptr inbounds %struct.AtomStr, ptr %32, i32 0, i32 1
  %34 = load ptr, ptr %33, align 8, !tbaa !18
  %35 = getelementptr inbounds %struct.DynamicStr, ptr %34, i32 0, i32 2
  %36 = getelementptr inbounds [4 x double], ptr %35, i64 0, i64 2
  %37 = load double, ptr %36, align 8, !tbaa !5
  %38 = load double, ptr getelementptr inbounds ([4 x double], ptr getelementptr inbounds (%struct.FlowStr, ptr @flow, i32 0, i32 1), i64 0, i64 2), align 8, !tbaa !5
  %39 = fsub double %37, %38
  %40 = getelementptr inbounds [4 x double], ptr %1, i64 0, i64 2
  store double %39, ptr %40, align 16, !tbaa !5
  %41 = load ptr, ptr @atom, align 8, !tbaa !17
  %42 = load i32, ptr %3, align 4, !tbaa !16
  %43 = sext i32 %42 to i64
  %44 = getelementptr inbounds %struct.AtomStr, ptr %41, i64 %43
  %45 = getelementptr inbounds %struct.AtomStr, ptr %44, i32 0, i32 1
  %46 = load ptr, ptr %45, align 8, !tbaa !18
  %47 = getelementptr inbounds %struct.DynamicStr, ptr %46, i32 0, i32 2
  %48 = getelementptr inbounds [4 x double], ptr %47, i64 0, i64 3
  %49 = load double, ptr %48, align 8, !tbaa !5
  %50 = load double, ptr getelementptr inbounds ([4 x double], ptr getelementptr inbounds (%struct.FlowStr, ptr @flow, i32 0, i32 1), i64 0, i64 3), align 8, !tbaa !5
  %51 = fsub double %49, %50
  %52 = getelementptr inbounds [4 x double], ptr %1, i64 0, i64 3
  store double %51, ptr %52, align 8, !tbaa !5
  %53 = getelementptr inbounds [4 x double], ptr %1, i64 0, i64 1
  %54 = load double, ptr %53, align 8, !tbaa !5
  %55 = getelementptr inbounds [4 x double], ptr %1, i64 0, i64 1
  %56 = load double, ptr %55, align 8, !tbaa !5
  %57 = getelementptr inbounds [4 x double], ptr %1, i64 0, i64 2
  %58 = load double, ptr %57, align 16, !tbaa !5
  %59 = getelementptr inbounds [4 x double], ptr %1, i64 0, i64 2
  %60 = load double, ptr %59, align 16, !tbaa !5
  %61 = fmul double %58, %60
  %62 = call double @llvm.fmuladd.f64(double %54, double %56, double %61)
  %63 = getelementptr inbounds [4 x double], ptr %1, i64 0, i64 3
  %64 = load double, ptr %63, align 8, !tbaa !5
  %65 = getelementptr inbounds [4 x double], ptr %1, i64 0, i64 3
  %66 = load double, ptr %65, align 8, !tbaa !5
  %67 = call double @llvm.fmuladd.f64(double %64, double %66, double %62)
  %68 = getelementptr inbounds [4 x double], ptr %1, i64 0, i64 0
  store double %67, ptr %68, align 16, !tbaa !5
  %69 = load ptr, ptr @atom, align 8, !tbaa !17
  %70 = load i32, ptr %3, align 4, !tbaa !16
  %71 = sext i32 %70 to i64
  %72 = getelementptr inbounds %struct.AtomStr, ptr %69, i64 %71
  %73 = getelementptr inbounds %struct.AtomStr, ptr %72, i32 0, i32 0
  %74 = load ptr, ptr %73, align 8, !tbaa !20
  %75 = getelementptr inbounds %struct.PropertyStr, ptr %74, i32 0, i32 7
  %76 = load double, ptr %75, align 8, !tbaa !21
  %77 = fmul double 5.000000e-01, %76
  %78 = getelementptr inbounds [4 x double], ptr %1, i64 0, i64 0
  %79 = load double, ptr %78, align 16, !tbaa !5
  %80 = load double, ptr %2, align 8, !tbaa !5
  %81 = call double @llvm.fmuladd.f64(double %77, double %79, double %80)
  store double %81, ptr %2, align 8, !tbaa !5
  br label %82

82:                                               ; preds = %16
  %83 = load i32, ptr %3, align 4, !tbaa !16
  %84 = add nsw i32 %83, 1
  store i32 %84, ptr %3, align 4, !tbaa !16
  br label %11, !llvm.loop !24

85:                                               ; preds = %15
  br label %188

86:                                               ; preds = %0
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  store i32 1, ptr %4, align 4, !tbaa !16
  br label %87

87:                                               ; preds = %184, %86
  %88 = load i32, ptr %4, align 4, !tbaa !16
  %89 = load i32, ptr @numofprotein, align 4, !tbaa !16
  %90 = icmp sle i32 %88, %89
  br i1 %90, label %92, label %91

91:                                               ; preds = %87
  store i32 5, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  br label %187

92:                                               ; preds = %87
  call void @llvm.lifetime.start.p0(i64 32, ptr %6) #6
  call void @llvm.memset.p0.i64(ptr align 16 %6, i8 0, i64 32, i1 false)
  %93 = load i32, ptr %4, align 4, !tbaa !16
  %94 = getelementptr inbounds [4 x double], ptr %6, i64 0, i64 0
  call void @CalCOMV(i32 noundef %93, ptr noundef %94)
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  %95 = load ptr, ptr @protein, align 8, !tbaa !17
  %96 = load i32, ptr %4, align 4, !tbaa !16
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds %struct.PepStr, ptr %95, i64 %97
  %99 = getelementptr inbounds %struct.PepStr, ptr %98, i32 0, i32 0
  %100 = load i32, ptr %99, align 8, !tbaa !26
  store i32 %100, ptr %7, align 4, !tbaa !16
  br label %101

101:                                              ; preds = %180, %92
  %102 = load i32, ptr %7, align 4, !tbaa !16
  %103 = load ptr, ptr @protein, align 8, !tbaa !17
  %104 = load i32, ptr %4, align 4, !tbaa !16
  %105 = sext i32 %104 to i64
  %106 = getelementptr inbounds %struct.PepStr, ptr %103, i64 %105
  %107 = getelementptr inbounds %struct.PepStr, ptr %106, i32 0, i32 1
  %108 = load i32, ptr %107, align 4, !tbaa !28
  %109 = icmp sle i32 %102, %108
  br i1 %109, label %111, label %110

110:                                              ; preds = %101
  store i32 8, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  br label %183

111:                                              ; preds = %101
  %112 = load ptr, ptr @atom, align 8, !tbaa !17
  %113 = load i32, ptr %7, align 4, !tbaa !16
  %114 = sext i32 %113 to i64
  %115 = getelementptr inbounds %struct.AtomStr, ptr %112, i64 %114
  %116 = getelementptr inbounds %struct.AtomStr, ptr %115, i32 0, i32 1
  %117 = load ptr, ptr %116, align 8, !tbaa !18
  %118 = getelementptr inbounds %struct.DynamicStr, ptr %117, i32 0, i32 2
  %119 = getelementptr inbounds [4 x double], ptr %118, i64 0, i64 1
  %120 = load double, ptr %119, align 8, !tbaa !5
  %121 = getelementptr inbounds [4 x double], ptr %6, i64 0, i64 1
  %122 = load double, ptr %121, align 8, !tbaa !5
  %123 = fsub double %120, %122
  %124 = getelementptr inbounds [4 x double], ptr %1, i64 0, i64 1
  store double %123, ptr %124, align 8, !tbaa !5
  %125 = load ptr, ptr @atom, align 8, !tbaa !17
  %126 = load i32, ptr %7, align 4, !tbaa !16
  %127 = sext i32 %126 to i64
  %128 = getelementptr inbounds %struct.AtomStr, ptr %125, i64 %127
  %129 = getelementptr inbounds %struct.AtomStr, ptr %128, i32 0, i32 1
  %130 = load ptr, ptr %129, align 8, !tbaa !18
  %131 = getelementptr inbounds %struct.DynamicStr, ptr %130, i32 0, i32 2
  %132 = getelementptr inbounds [4 x double], ptr %131, i64 0, i64 2
  %133 = load double, ptr %132, align 8, !tbaa !5
  %134 = getelementptr inbounds [4 x double], ptr %6, i64 0, i64 2
  %135 = load double, ptr %134, align 16, !tbaa !5
  %136 = fsub double %133, %135
  %137 = getelementptr inbounds [4 x double], ptr %1, i64 0, i64 2
  store double %136, ptr %137, align 16, !tbaa !5
  %138 = load ptr, ptr @atom, align 8, !tbaa !17
  %139 = load i32, ptr %7, align 4, !tbaa !16
  %140 = sext i32 %139 to i64
  %141 = getelementptr inbounds %struct.AtomStr, ptr %138, i64 %140
  %142 = getelementptr inbounds %struct.AtomStr, ptr %141, i32 0, i32 1
  %143 = load ptr, ptr %142, align 8, !tbaa !18
  %144 = getelementptr inbounds %struct.DynamicStr, ptr %143, i32 0, i32 2
  %145 = getelementptr inbounds [4 x double], ptr %144, i64 0, i64 3
  %146 = load double, ptr %145, align 8, !tbaa !5
  %147 = getelementptr inbounds [4 x double], ptr %6, i64 0, i64 3
  %148 = load double, ptr %147, align 8, !tbaa !5
  %149 = fsub double %146, %148
  %150 = getelementptr inbounds [4 x double], ptr %1, i64 0, i64 3
  store double %149, ptr %150, align 8, !tbaa !5
  %151 = getelementptr inbounds [4 x double], ptr %1, i64 0, i64 1
  %152 = load double, ptr %151, align 8, !tbaa !5
  %153 = getelementptr inbounds [4 x double], ptr %1, i64 0, i64 1
  %154 = load double, ptr %153, align 8, !tbaa !5
  %155 = getelementptr inbounds [4 x double], ptr %1, i64 0, i64 2
  %156 = load double, ptr %155, align 16, !tbaa !5
  %157 = getelementptr inbounds [4 x double], ptr %1, i64 0, i64 2
  %158 = load double, ptr %157, align 16, !tbaa !5
  %159 = fmul double %156, %158
  %160 = call double @llvm.fmuladd.f64(double %152, double %154, double %159)
  %161 = getelementptr inbounds [4 x double], ptr %1, i64 0, i64 3
  %162 = load double, ptr %161, align 8, !tbaa !5
  %163 = getelementptr inbounds [4 x double], ptr %1, i64 0, i64 3
  %164 = load double, ptr %163, align 8, !tbaa !5
  %165 = call double @llvm.fmuladd.f64(double %162, double %164, double %160)
  %166 = getelementptr inbounds [4 x double], ptr %1, i64 0, i64 0
  store double %165, ptr %166, align 16, !tbaa !5
  %167 = load ptr, ptr @atom, align 8, !tbaa !17
  %168 = load i32, ptr %7, align 4, !tbaa !16
  %169 = sext i32 %168 to i64
  %170 = getelementptr inbounds %struct.AtomStr, ptr %167, i64 %169
  %171 = getelementptr inbounds %struct.AtomStr, ptr %170, i32 0, i32 0
  %172 = load ptr, ptr %171, align 8, !tbaa !20
  %173 = getelementptr inbounds %struct.PropertyStr, ptr %172, i32 0, i32 7
  %174 = load double, ptr %173, align 8, !tbaa !21
  %175 = fmul double 5.000000e-01, %174
  %176 = getelementptr inbounds [4 x double], ptr %1, i64 0, i64 0
  %177 = load double, ptr %176, align 16, !tbaa !5
  %178 = load double, ptr %2, align 8, !tbaa !5
  %179 = call double @llvm.fmuladd.f64(double %175, double %177, double %178)
  store double %179, ptr %2, align 8, !tbaa !5
  br label %180

180:                                              ; preds = %111
  %181 = load i32, ptr %7, align 4, !tbaa !16
  %182 = add nsw i32 %181, 1
  store i32 %182, ptr %7, align 4, !tbaa !16
  br label %101, !llvm.loop !29

183:                                              ; preds = %110
  call void @llvm.lifetime.end.p0(i64 32, ptr %6) #6
  br label %184

184:                                              ; preds = %183
  %185 = load i32, ptr %4, align 4, !tbaa !16
  %186 = add nsw i32 %185, 1
  store i32 %186, ptr %4, align 4, !tbaa !16
  br label %87, !llvm.loop !30

187:                                              ; preds = %91
  br label %188

188:                                              ; preds = %187, %85
  %189 = load double, ptr %2, align 8, !tbaa !5
  %190 = call i1 @llvm.is.fpclass.f64(double %189, i32 3)
  %191 = xor i1 %190, true
  %192 = xor i1 %191, true
  %193 = zext i1 %192 to i32
  %194 = sext i32 %193 to i64
  %195 = call i64 @llvm.expect.i64(i64 %194, i64 0)
  %196 = icmp ne i64 %195, 0
  br i1 %196, label %197, label %199

197:                                              ; preds = %188
  %198 = call i32 (ptr, ...) @printf(ptr noundef @.str.27)
  br label %199

199:                                              ; preds = %197, %188
  %200 = load double, ptr %2, align 8, !tbaa !5
  store i32 1, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr %1) #6
  ret double %200
}

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i1 @llvm.is.fpclass.f64(double, i32 immarg) #1

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 willreturn memory(none) }
attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"double", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !11, i64 0}
!10 = !{!"FlowStr", !11, i64 0, !12, i64 8, !13, i64 40, !15, i64 88}
!11 = !{!"int", !7, i64 0}
!12 = !{!"ConstVStr", !7, i64 0}
!13 = !{!"ForceStr", !7, i64 0, !14, i64 32, !14, i64 40}
!14 = !{!"any pointer", !7, i64 0}
!15 = !{!"ChargeStr", !11, i64 0, !11, i64 4, !14, i64 8, !14, i64 16, !14, i64 24, !14, i64 32}
!16 = !{!11, !11, i64 0}
!17 = !{!14, !14, i64 0}
!18 = !{!19, !14, i64 8}
!19 = !{!"AtomStr", !14, i64 0, !14, i64 8}
!20 = !{!19, !14, i64 0}
!21 = !{!22, !6, i64 72}
!22 = !{!"PropertyStr", !7, i64 0, !7, i64 8, !7, i64 40, !11, i64 48, !11, i64 52, !11, i64 56, !6, i64 64, !6, i64 72, !7, i64 80, !23, i64 104, !14, i64 120, !14, i64 128}
!23 = !{!"AtomSeqStr", !11, i64 0, !11, i64 4, !11, i64 8}
!24 = distinct !{!24, !25}
!25 = !{!"llvm.loop.mustprogress"}
!26 = !{!27, !11, i64 0}
!27 = !{!"PepStr", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !6, i64 16}
!28 = !{!27, !11, i64 4}
!29 = distinct !{!29, !25}
!30 = distinct !{!30, !25}


; 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.FlowStr = type { i32, %struct.ConstVStr, %struct.ForceStr, %struct.ChargeStr }
%struct.ConstVStr = type { [4 x double] }
%struct.ForceStr = type { [4 x double], ptr, ptr }
%struct.ChargeStr = type { i32, i32, ptr, ptr, ptr, ptr }
%struct.AtomStr = type { ptr, ptr }
%struct.PepStr = type { i32, i32, i32, i32, double }

@atomnum = external local_unnamed_addr global i32, align 4
@atom = external local_unnamed_addr global ptr, align 8
@protein = external local_unnamed_addr global ptr, align 8
@flow = external local_unnamed_addr global %struct.FlowStr, align 8
@numofprotein = external local_unnamed_addr global i32, align 4
@.str.27 = external hidden unnamed_addr constant [44 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 nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

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

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

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

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

; Function Attrs: nounwind uwtable
define dso_local double @CalKinetE() local_unnamed_addr #4 {
  %1 = alloca [4 x double], align 16
  %2 = load i32, ptr @flow, align 8, !tbaa !5
  %3 = icmp slt i32 %2, 2
  br i1 %3, label %.preheader, label %.preheader35

.preheader35:                                     ; preds = %0
  %4 = load i32, ptr @numofprotein, align 4, !tbaa !14
  %.not40 = icmp slt i32 %4, 1
  br i1 %.not40, label %.loopexit.thread, label %.lr.ph43

.lr.ph43:                                         ; preds = %.preheader35
  %5 = getelementptr inbounds i8, ptr %1, i64 8
  %6 = getelementptr inbounds i8, ptr %1, i64 16
  %7 = getelementptr inbounds i8, ptr %1, i64 24
  br label %35

.preheader:                                       ; preds = %0
  %8 = load i32, ptr @atomnum, align 4, !tbaa !14
  %.not3445 = icmp slt i32 %8, 1
  br i1 %.not3445, label %.loopexit.thread, label %.lr.ph48

.lr.ph48:                                         ; preds = %.preheader
  %9 = load ptr, ptr @atom, align 8, !tbaa !15
  %10 = load double, ptr getelementptr inbounds (i8, ptr @flow, i64 16), align 8, !tbaa !16
  %11 = load double, ptr getelementptr inbounds (i8, ptr @flow, i64 24), align 8, !tbaa !16
  %12 = load double, ptr getelementptr inbounds (i8, ptr @flow, i64 32), align 8, !tbaa !16
  %13 = add nuw i32 %8, 1
  %wide.trip.count = zext i32 %13 to i64
  br label %14

14:                                               ; preds = %.lr.ph48, %14
  %indvars.iv56 = phi i64 [ 1, %.lr.ph48 ], [ %indvars.iv.next57, %14 ]
  %.03246 = phi double [ 0.000000e+00, %.lr.ph48 ], [ %34, %14 ]
  %15 = getelementptr inbounds %struct.AtomStr, ptr %9, i64 %indvars.iv56
  %16 = getelementptr inbounds i8, ptr %15, i64 8
  %17 = load ptr, ptr %16, align 8, !tbaa !18
  %18 = getelementptr inbounds i8, ptr %17, i64 56
  %19 = load double, ptr %18, align 8, !tbaa !16
  %20 = fsub double %19, %10
  %21 = getelementptr inbounds i8, ptr %17, i64 64
  %22 = load double, ptr %21, align 8, !tbaa !16
  %23 = fsub double %22, %11
  %24 = getelementptr inbounds i8, ptr %17, i64 72
  %25 = load double, ptr %24, align 8, !tbaa !16
  %26 = fsub double %25, %12
  %27 = fmul double %23, %23
  %28 = tail call double @llvm.fmuladd.f64(double %20, double %20, double %27)
  %29 = tail call double @llvm.fmuladd.f64(double %26, double %26, double %28)
  %30 = load ptr, ptr %15, align 8, !tbaa !20
  %31 = getelementptr inbounds i8, ptr %30, i64 72
  %32 = load double, ptr %31, align 8, !tbaa !21
  %33 = fmul double %32, 5.000000e-01
  %34 = tail call double @llvm.fmuladd.f64(double %33, double %29, double %.03246)
  %indvars.iv.next57 = add nuw nsw i64 %indvars.iv56, 1
  %exitcond59.not = icmp eq i64 %indvars.iv.next57, %wide.trip.count
  br i1 %exitcond59.not, label %.loopexit, label %14, !llvm.loop !24

35:                                               ; preds = %.lr.ph43, %._crit_edge
  %indvars.iv53 = phi i64 [ 1, %.lr.ph43 ], [ %indvars.iv.next54, %._crit_edge ]
  %.141 = phi double [ 0.000000e+00, %.lr.ph43 ], [ %.2.lcssa, %._crit_edge ]
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %1) #5
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(32) %1, i8 0, i64 32, i1 false)
  %36 = trunc nuw nsw i64 %indvars.iv53 to i32
  call void @CalCOMV(i32 noundef %36, ptr noundef nonnull %1)
  %37 = load ptr, ptr @protein, align 8, !tbaa !15
  %38 = getelementptr inbounds %struct.PepStr, ptr %37, i64 %indvars.iv53
  %39 = load i32, ptr %38, align 8, !tbaa !26
  %40 = getelementptr inbounds %struct.PepStr, ptr %37, i64 %indvars.iv53, i32 1
  %41 = load i32, ptr %40, align 4, !tbaa !28
  %.not3337 = icmp sgt i32 %39, %41
  br i1 %.not3337, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %35
  %42 = load ptr, ptr @atom, align 8, !tbaa !15
  %43 = load double, ptr %5, align 8, !tbaa !16
  %44 = load double, ptr %6, align 16, !tbaa !16
  %45 = load double, ptr %7, align 8, !tbaa !16
  %46 = sext i32 %39 to i64
  %47 = add i32 %41, 1
  br label %50

._crit_edge:                                      ; preds = %50, %35
  %.2.lcssa = phi double [ %.141, %35 ], [ %70, %50 ]
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %1) #5
  %indvars.iv.next54 = add nuw nsw i64 %indvars.iv53, 1
  %48 = load i32, ptr @numofprotein, align 4, !tbaa !14
  %49 = sext i32 %48 to i64
  %.not.not = icmp slt i64 %indvars.iv53, %49
  br i1 %.not.not, label %35, label %.loopexit, !llvm.loop !29

50:                                               ; preds = %.lr.ph, %50
  %indvars.iv = phi i64 [ %46, %.lr.ph ], [ %indvars.iv.next, %50 ]
  %.238 = phi double [ %.141, %.lr.ph ], [ %70, %50 ]
  %51 = getelementptr inbounds %struct.AtomStr, ptr %42, i64 %indvars.iv
  %52 = getelementptr inbounds i8, ptr %51, i64 8
  %53 = load ptr, ptr %52, align 8, !tbaa !18
  %54 = getelementptr inbounds i8, ptr %53, i64 56
  %55 = load double, ptr %54, align 8, !tbaa !16
  %56 = fsub double %55, %43
  %57 = getelementptr inbounds i8, ptr %53, i64 64
  %58 = load double, ptr %57, align 8, !tbaa !16
  %59 = fsub double %58, %44
  %60 = getelementptr inbounds i8, ptr %53, i64 72
  %61 = load double, ptr %60, align 8, !tbaa !16
  %62 = fsub double %61, %45
  %63 = fmul double %59, %59
  %64 = call double @llvm.fmuladd.f64(double %56, double %56, double %63)
  %65 = call double @llvm.fmuladd.f64(double %62, double %62, double %64)
  %66 = load ptr, ptr %51, align 8, !tbaa !20
  %67 = getelementptr inbounds i8, ptr %66, i64 72
  %68 = load double, ptr %67, align 8, !tbaa !21
  %69 = fmul double %68, 5.000000e-01
  %70 = call double @llvm.fmuladd.f64(double %69, double %65, double %.238)
  %indvars.iv.next = add nsw i64 %indvars.iv, 1
  %lftr.wideiv = trunc i64 %indvars.iv.next to i32
  %exitcond.not = icmp eq i32 %47, %lftr.wideiv
  br i1 %exitcond.not, label %._crit_edge, label %50, !llvm.loop !30

.loopexit:                                        ; preds = %._crit_edge, %14
  %.3 = phi double [ %34, %14 ], [ %.2.lcssa, %._crit_edge ]
  %71 = fcmp uno double %.3, 0.000000e+00
  br i1 %71, label %72, label %.loopexit.thread, !prof !31

72:                                               ; preds = %.loopexit
  %73 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.27)
  br label %.loopexit.thread

.loopexit.thread:                                 ; preds = %.preheader35, %.preheader, %72, %.loopexit
  %.361 = phi double [ %.3, %72 ], [ %.3, %.loopexit ], [ 0.000000e+00, %.preheader ], [ 0.000000e+00, %.preheader35 ]
  ret double %.361
}

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #2 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
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 = { 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, !7, i64 0}
!6 = !{!"FlowStr", !7, i64 0, !10, i64 8, !11, i64 40, !13, i64 88}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"ConstVStr", !8, i64 0}
!11 = !{!"ForceStr", !8, i64 0, !12, i64 32, !12, i64 40}
!12 = !{!"any pointer", !8, i64 0}
!13 = !{!"ChargeStr", !7, i64 0, !7, i64 4, !12, i64 8, !12, i64 16, !12, i64 24, !12, i64 32}
!14 = !{!7, !7, i64 0}
!15 = !{!12, !12, i64 0}
!16 = !{!17, !17, i64 0}
!17 = !{!"double", !8, i64 0}
!18 = !{!19, !12, i64 8}
!19 = !{!"AtomStr", !12, i64 0, !12, i64 8}
!20 = !{!19, !12, i64 0}
!21 = !{!22, !17, i64 72}
!22 = !{!"PropertyStr", !8, i64 0, !8, i64 8, !8, i64 40, !7, i64 48, !7, i64 52, !7, i64 56, !17, i64 64, !17, i64 72, !8, i64 80, !23, i64 104, !12, i64 120, !12, i64 128}
!23 = !{!"AtomSeqStr", !7, i64 0, !7, i64 4, !7, i64 8}
!24 = distinct !{!24, !25}
!25 = !{!"llvm.loop.mustprogress"}
!26 = !{!27, !7, i64 0}
!27 = !{!"PepStr", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !17, i64 16}
!28 = !{!27, !7, i64 4}
!29 = distinct !{!29, !25}
!30 = distinct !{!30, !25}
!31 = !{!"branch_weights", !"expected", i32 1717128, i32 2145766520}


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