; 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 }
%struct.AAStr = type { [5 x i8], i32, i32, i32, i32, double }
%struct.AtomStr = type { ptr, ptr }
%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.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 }

@totalAminoAcids = external global i32, align 4
@aminoacid = external global ptr, align 8
@atom = external global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@CGMatrix = external global %struct.CGMatrixStr, align 8
@.str.20 = external hidden unnamed_addr constant [2 x i8], align 1
@savedir = external global [1024 x i8], align 16
@.str.27 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [2 x i8], align 1
@__const.PrintPotCur_Pep.sur_type = external hidden unnamed_addr constant [3 x ptr], align 16
@.str.29 = external hidden unnamed_addr constant [14 x i8], align 1

; Function Attrs: nounwind willreturn memory(read)
declare i32 @strcmp(ptr noundef, ptr noundef) #0

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

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

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

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

declare i32 @AAModel(ptr noundef) #3

declare i32 @fclose(ptr noundef) #3

; 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) #4

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

; 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) #5

; Function Attrs: nounwind uwtable
define dso_local void @PrintPotCur_Pep() #5 {
  %1 = alloca ptr, align 8
  %2 = alloca [128 x i8], align 16
  %3 = alloca [3 x ptr], align 16
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca double, align 8
  %7 = alloca double, align 8
  %8 = alloca double, align 8
  %9 = alloca double, align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %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 8, ptr %1) #6
  call void @llvm.lifetime.start.p0(i64 128, ptr %2) #6
  call void @llvm.lifetime.start.p0(i64 24, ptr %3) #6
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %3, ptr align 16 @__const.PrintPotCur_Pep.sur_type, i64 24, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  store i32 3, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  store i32 2, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  store double 1.000000e-01, ptr %8, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  store double 0.000000e+00, ptr %9, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  store i32 0, ptr %10, align 4, !tbaa !5
  br label %16

16:                                               ; preds = %131, %0
  %17 = load i32, ptr %10, align 4, !tbaa !5
  %18 = load i32, ptr %4, align 4, !tbaa !5
  %19 = icmp slt i32 %17, %18
  br i1 %19, label %21, label %20

20:                                               ; preds = %16
  store i32 2, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  br label %134

21:                                               ; preds = %16
  %22 = getelementptr inbounds [128 x i8], ptr %2, i64 0, i64 0
  %23 = load i32, ptr %10, align 4, !tbaa !5
  %24 = sext i32 %23 to i64
  %25 = getelementptr inbounds [3 x ptr], ptr %3, i64 0, i64 %24
  %26 = load ptr, ptr %25, align 8, !tbaa !11
  %27 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef %22, ptr noundef @.str.29, ptr noundef @savedir, ptr noundef %26) #6
  %28 = getelementptr inbounds [128 x i8], ptr %2, i64 0, i64 0
  %29 = call noalias ptr @fopen(ptr noundef %28, ptr noundef @.str.20)
  store ptr %29, ptr %1, align 8, !tbaa !11
  store double 2.000000e+00, ptr %6, align 8, !tbaa !9
  %30 = load i32, ptr %5, align 4, !tbaa !5
  %31 = call double @FindMinDisDimen(i32 noundef %30)
  store double %31, ptr %7, align 8, !tbaa !9
  br label %32

32:                                               ; preds = %122, %21
  %33 = load double, ptr %6, align 8, !tbaa !9
  %34 = fcmp olt double %33, 1.000000e+01
  br i1 %34, label %35, label %126

35:                                               ; preds = %32
  store double 0.000000e+00, ptr %9, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  store i32 1, ptr %12, align 4, !tbaa !5
  br label %36

36:                                               ; preds = %111, %35
  %37 = load i32, ptr %12, align 4, !tbaa !5
  %38 = load i32, ptr @totalAminoAcids, align 4, !tbaa !5
  %39 = icmp sle i32 %37, %38
  br i1 %39, label %41, label %40

40:                                               ; preds = %36
  store i32 7, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  br label %114

41:                                               ; preds = %36
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  %42 = load ptr, ptr @aminoacid, align 8, !tbaa !11
  %43 = load i32, ptr %12, align 4, !tbaa !5
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds %struct.AAStr, ptr %42, i64 %44
  %46 = getelementptr inbounds %struct.AAStr, ptr %45, i32 0, i32 2
  %47 = load i32, ptr %46, align 4, !tbaa !13
  store i32 %47, ptr %13, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  %48 = load ptr, ptr @aminoacid, align 8, !tbaa !11
  %49 = load i32, ptr %12, align 4, !tbaa !5
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds %struct.AAStr, ptr %48, i64 %50
  %52 = getelementptr inbounds %struct.AAStr, ptr %51, i32 0, i32 3
  %53 = load i32, ptr %52, align 8, !tbaa !15
  store i32 %53, ptr %14, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  %54 = load i32, ptr %13, align 4, !tbaa !5
  store i32 %54, ptr %15, align 4, !tbaa !5
  br label %55

55:                                               ; preds = %107, %41
  %56 = load i32, ptr %15, align 4, !tbaa !5
  %57 = load i32, ptr %14, align 4, !tbaa !5
  %58 = icmp sle i32 %56, %57
  br i1 %58, label %60, label %59

59:                                               ; preds = %55
  store i32 10, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  br label %110

60:                                               ; preds = %55
  %61 = load ptr, ptr @atom, align 8, !tbaa !11
  %62 = load i32, ptr %15, align 4, !tbaa !5
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds %struct.AtomStr, ptr %61, i64 %63
  %65 = getelementptr inbounds %struct.AtomStr, ptr %64, i32 0, i32 0
  %66 = load ptr, ptr %65, align 8, !tbaa !16
  %67 = getelementptr inbounds %struct.PropertyStr, ptr %66, i32 0, i32 1
  %68 = getelementptr inbounds [2 x [16 x i8]], ptr %67, i64 0, i64 0
  %69 = getelementptr inbounds [16 x i8], ptr %68, i64 0, i64 0
  %70 = call i32 @strcmp(ptr noundef %69, ptr noundef @.str.2) #7
  %71 = icmp eq i32 %70, 0
  br i1 %71, label %72, label %106

72:                                               ; preds = %60
  %73 = load i32, ptr %10, align 4, !tbaa !5
  %74 = sext i32 %73 to i64
  %75 = getelementptr inbounds [3 x ptr], ptr %3, i64 0, i64 %74
  %76 = load ptr, ptr %75, align 8, !tbaa !11
  %77 = call i32 @AAModel(ptr noundef %76)
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds [32 x %struct.CGBeadStr], ptr getelementptr inbounds (%struct.CGMatrixStr, ptr @CGMatrix, i32 0, i32 1), i64 0, i64 %78
  %80 = load ptr, ptr @aminoacid, align 8, !tbaa !11
  %81 = load i32, ptr %12, align 4, !tbaa !5
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds %struct.AAStr, ptr %80, i64 %82
  %84 = getelementptr inbounds %struct.AAStr, ptr %83, i32 0, i32 1
  %85 = load i32, ptr %84, align 8, !tbaa !18
  %86 = sext i32 %85 to i64
  %87 = getelementptr inbounds [32 x %struct.CGBeadStr], ptr getelementptr inbounds (%struct.CGMatrixStr, ptr @CGMatrix, i32 0, i32 1), i64 0, i64 %86
  %88 = load double, ptr %6, align 8, !tbaa !9
  %89 = load ptr, ptr @atom, align 8, !tbaa !11
  %90 = load i32, ptr %15, align 4, !tbaa !5
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds %struct.AtomStr, ptr %89, i64 %91
  %93 = getelementptr inbounds %struct.AtomStr, ptr %92, i32 0, i32 1
  %94 = load ptr, ptr %93, align 8, !tbaa !19
  %95 = getelementptr inbounds %struct.DynamicStr, ptr %94, i32 0, i32 1
  %96 = load i32, ptr %5, align 4, !tbaa !5
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds [4 x double], ptr %95, i64 0, i64 %97
  %99 = load double, ptr %98, align 8, !tbaa !9
  %100 = fadd double %88, %99
  %101 = load double, ptr %7, align 8, !tbaa !9
  %102 = fsub double %100, %101
  %103 = call double @CalculateSurPoten(ptr noundef byval(%struct.CGBeadStr) align 8 %79, ptr noundef byval(%struct.CGBeadStr) align 8 %87, double noundef %102)
  %104 = load double, ptr %9, align 8, !tbaa !9
  %105 = fadd double %104, %103
  store double %105, ptr %9, align 8, !tbaa !9
  br label %106

106:                                              ; preds = %72, %60
  br label %107

107:                                              ; preds = %106
  %108 = load i32, ptr %15, align 4, !tbaa !5
  %109 = add nsw i32 %108, 1
  store i32 %109, ptr %15, align 4, !tbaa !5
  br label %55, !llvm.loop !20

110:                                              ; preds = %59
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  br label %111

111:                                              ; preds = %110
  %112 = load i32, ptr %12, align 4, !tbaa !5
  %113 = add nsw i32 %112, 1
  store i32 %113, ptr %12, align 4, !tbaa !5
  br label %36, !llvm.loop !22

114:                                              ; preds = %40
  %115 = load double, ptr %9, align 8, !tbaa !9
  %116 = fcmp olt double %115, 8.000000e-01
  br i1 %116, label %117, label %122

117:                                              ; preds = %114
  %118 = load ptr, ptr %1, align 8, !tbaa !11
  %119 = load double, ptr %6, align 8, !tbaa !9
  %120 = load double, ptr %9, align 8, !tbaa !9
  %121 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %118, ptr noundef @.str.27, double noundef %119, double noundef %120) #6
  br label %122

122:                                              ; preds = %117, %114
  %123 = load double, ptr %8, align 8, !tbaa !9
  %124 = load double, ptr %6, align 8, !tbaa !9
  %125 = fadd double %124, %123
  store double %125, ptr %6, align 8, !tbaa !9
  br label %32, !llvm.loop !23

126:                                              ; preds = %32
  %127 = load ptr, ptr %1, align 8, !tbaa !11
  %128 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %127, ptr noundef @.str.28) #6
  %129 = load ptr, ptr %1, align 8, !tbaa !11
  %130 = call i32 @fclose(ptr noundef %129)
  br label %131

131:                                              ; preds = %126
  %132 = load i32, ptr %10, align 4, !tbaa !5
  %133 = add nsw i32 %132, 1
  store i32 %133, ptr %10, align 4, !tbaa !5
  br label %16, !llvm.loop !24

134:                                              ; preds = %20
  store i32 1, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %3) #6
  call void @llvm.lifetime.end.p0(i64 128, ptr %2) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %1) #6
  ret void
}

; Function Attrs: nounwind uwtable
declare dso_local double @FindMinDisDimen(i32 noundef) #5

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

!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 = !{!"double", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"any pointer", !7, i64 0}
!13 = !{!14, !6, i64 12}
!14 = !{!"AAStr", !7, i64 0, !6, i64 8, !6, i64 12, !6, i64 16, !6, i64 20, !10, i64 24}
!15 = !{!14, !6, i64 16}
!16 = !{!17, !12, i64 0}
!17 = !{!"AtomStr", !12, i64 0, !12, i64 8}
!18 = !{!14, !6, i64 8}
!19 = !{!17, !12, i64 8}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.mustprogress"}
!22 = distinct !{!22, !21}
!23 = distinct !{!23, !21}
!24 = distinct !{!24, !21}


; 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 }
%struct.AAStr = type { [5 x i8], i32, i32, i32, i32, double }
%struct.AtomStr = type { ptr, ptr }

@totalAminoAcids = external local_unnamed_addr global i32, align 4
@aminoacid = external local_unnamed_addr global ptr, align 8
@atom = external local_unnamed_addr global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@CGMatrix = external global %struct.CGMatrixStr, align 8
@.str.20 = external hidden unnamed_addr constant [2 x i8], align 1
@savedir = external global [1024 x i8], align 16
@.str.27 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [2 x i8], align 1
@__const.PrintPotCur_Pep.sur_type = external hidden unnamed_addr constant [3 x ptr], align 16
@.str.29 = external hidden unnamed_addr constant [14 x i8], align 1

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #0

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

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

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

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

declare i32 @AAModel(ptr noundef) local_unnamed_addr #3

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

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

; 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: nounwind uwtable
define dso_local void @PrintPotCur_Pep() local_unnamed_addr #4 {
  %1 = alloca [128 x i8], align 16
  call void @llvm.lifetime.start.p0(i64 128, ptr nonnull %1) #5
  %2 = load ptr, ptr @__const.PrintPotCur_Pep.sur_type, align 16, !tbaa !5
  %3 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %1, ptr noundef nonnull dereferenceable(1) @.str.29, ptr noundef nonnull @savedir, ptr noundef %2) #5
  %4 = call noalias ptr @fopen(ptr noundef nonnull %1, ptr noundef nonnull @.str.20)
  %5 = tail call double @FindMinDisDimen(i32 noundef 2)
  %.pre53 = load i32, ptr @totalAminoAcids, align 4, !tbaa !9
  br label %.preheader

.preheader:                                       ; preds = %0, %46
  %6 = phi i32 [ %.pre53, %0 ], [ %47, %46 ]
  %.02943 = phi double [ 2.000000e+00, %0 ], [ %48, %46 ]
  %.not37 = icmp slt i32 %6, 1
  br i1 %.not37, label %._crit_edge41.thread, label %.lr.ph40

._crit_edge41:                                    ; preds = %._crit_edge
  %7 = fcmp olt double %.1.lcssa, 8.000000e-01
  br i1 %7, label %._crit_edge41.thread, label %46

.lr.ph40:                                         ; preds = %.preheader, %._crit_edge
  %8 = phi i32 [ %17, %._crit_edge ], [ %6, %.preheader ]
  %indvars.iv46 = phi i64 [ %indvars.iv.next47, %._crit_edge ], [ 1, %.preheader ]
  %.03039 = phi double [ %.1.lcssa, %._crit_edge ], [ 0.000000e+00, %.preheader ]
  %9 = load ptr, ptr @aminoacid, align 8, !tbaa !5
  %10 = getelementptr inbounds %struct.AAStr, ptr %9, i64 %indvars.iv46
  %11 = getelementptr inbounds i8, ptr %10, i64 12
  %12 = load i32, ptr %11, align 4, !tbaa !11
  %13 = getelementptr inbounds i8, ptr %10, i64 16
  %14 = load i32, ptr %13, align 8, !tbaa !14
  %.not3334 = icmp sgt i32 %12, %14
  br i1 %.not3334, label %._crit_edge, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %.lr.ph40
  %15 = sext i32 %12 to i64
  %16 = add i32 %14, 1
  %.pre55 = load ptr, ptr @atom, align 8, !tbaa !5
  br label %.lr.ph

._crit_edge.loopexit:                             ; preds = %43
  %.pre56 = load i32, ptr @totalAminoAcids, align 4, !tbaa !9
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %.lr.ph40
  %17 = phi i32 [ %8, %.lr.ph40 ], [ %.pre56, %._crit_edge.loopexit ]
  %.1.lcssa = phi double [ %.03039, %.lr.ph40 ], [ %.2, %._crit_edge.loopexit ]
  %indvars.iv.next47 = add nuw nsw i64 %indvars.iv46, 1
  %18 = sext i32 %17 to i64
  %.not.not = icmp slt i64 %indvars.iv46, %18
  br i1 %.not.not, label %.lr.ph40, label %._crit_edge41, !llvm.loop !15

.lr.ph:                                           ; preds = %.lr.ph.preheader, %43
  %19 = phi ptr [ %.pre55, %.lr.ph.preheader ], [ %44, %43 ]
  %indvars.iv = phi i64 [ %15, %.lr.ph.preheader ], [ %indvars.iv.next, %43 ]
  %.135 = phi double [ %.03039, %.lr.ph.preheader ], [ %.2, %43 ]
  %20 = getelementptr inbounds %struct.AtomStr, ptr %19, i64 %indvars.iv
  %21 = load ptr, ptr %20, align 8, !tbaa !17
  %22 = getelementptr inbounds i8, ptr %21, i64 8
  %23 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %22, ptr noundef nonnull dereferenceable(1) @.str.2) #6
  %24 = icmp eq i32 %23, 0
  br i1 %24, label %25, label %43

25:                                               ; preds = %.lr.ph
  %26 = tail call i32 @AAModel(ptr noundef %2) #5
  %27 = sext i32 %26 to i64
  %28 = getelementptr inbounds [32 x %struct.CGBeadStr], ptr getelementptr inbounds (i8, ptr @CGMatrix, i64 40), i64 0, i64 %27
  %29 = load ptr, ptr @aminoacid, align 8, !tbaa !5
  %30 = getelementptr inbounds %struct.AAStr, ptr %29, i64 %indvars.iv46, i32 1
  %31 = load i32, ptr %30, align 8, !tbaa !19
  %32 = sext i32 %31 to i64
  %33 = getelementptr inbounds [32 x %struct.CGBeadStr], ptr getelementptr inbounds (i8, ptr @CGMatrix, i64 40), i64 0, i64 %32
  %34 = load ptr, ptr @atom, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct.AtomStr, ptr %34, i64 %indvars.iv, i32 1
  %36 = load ptr, ptr %35, align 8, !tbaa !20
  %37 = getelementptr inbounds i8, ptr %36, i64 32
  %38 = load double, ptr %37, align 8, !tbaa !21
  %39 = fadd double %.02943, %38
  %40 = fsub double %39, %5
  %41 = tail call double @CalculateSurPoten(ptr noundef nonnull byval(%struct.CGBeadStr) align 8 %28, ptr noundef nonnull byval(%struct.CGBeadStr) align 8 %33, double noundef %40)
  %42 = fadd double %.135, %41
  %.pre54 = load ptr, ptr @atom, align 8, !tbaa !5
  br label %43

43:                                               ; preds = %.lr.ph, %25
  %44 = phi ptr [ %.pre54, %25 ], [ %19, %.lr.ph ]
  %.2 = phi double [ %42, %25 ], [ %.135, %.lr.ph ]
  %indvars.iv.next = add nsw i64 %indvars.iv, 1
  %lftr.wideiv = trunc i64 %indvars.iv.next to i32
  %exitcond.not = icmp eq i32 %16, %lftr.wideiv
  br i1 %exitcond.not, label %._crit_edge.loopexit, label %.lr.ph, !llvm.loop !22

._crit_edge41.thread:                             ; preds = %.preheader, %._crit_edge41
  %.030.lcssa68 = phi double [ %.1.lcssa, %._crit_edge41 ], [ 0.000000e+00, %.preheader ]
  %45 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %4, ptr noundef nonnull @.str.27, double noundef %.02943, double noundef %.030.lcssa68) #5
  %.pre = load i32, ptr @totalAminoAcids, align 4, !tbaa !9
  br label %46

46:                                               ; preds = %._crit_edge41.thread, %._crit_edge41
  %47 = phi i32 [ %.pre, %._crit_edge41.thread ], [ %17, %._crit_edge41 ]
  %48 = fadd double %.02943, 1.000000e-01
  %49 = fcmp olt double %48, 1.000000e+01
  br i1 %49, label %.preheader, label %50, !llvm.loop !23

50:                                               ; preds = %46
  %51 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %4, ptr noundef nonnull @.str.28) #5
  %52 = tail call i32 @fclose(ptr noundef %4)
  %53 = load ptr, ptr getelementptr inbounds (i8, ptr @__const.PrintPotCur_Pep.sur_type, i64 8), align 8, !tbaa !5
  %54 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %1, ptr noundef nonnull dereferenceable(1) @.str.29, ptr noundef nonnull @savedir, ptr noundef %53) #5
  %55 = call noalias ptr @fopen(ptr noundef nonnull %1, ptr noundef nonnull @.str.20)
  %56 = tail call double @FindMinDisDimen(i32 noundef 2)
  %.pre58 = load i32, ptr @totalAminoAcids, align 4, !tbaa !9
  br label %.preheader.1

.preheader.1:                                     ; preds = %97, %50
  %57 = phi i32 [ %.pre58, %50 ], [ %98, %97 ]
  %.02943.1 = phi double [ 2.000000e+00, %50 ], [ %99, %97 ]
  %.not37.1 = icmp slt i32 %57, 1
  br i1 %.not37.1, label %._crit_edge41.1.thread, label %.lr.ph40.1

.lr.ph40.1:                                       ; preds = %.preheader.1, %._crit_edge.1
  %58 = phi i32 [ %93, %._crit_edge.1 ], [ %57, %.preheader.1 ]
  %indvars.iv46.1 = phi i64 [ %indvars.iv.next47.1, %._crit_edge.1 ], [ 1, %.preheader.1 ]
  %.03039.1 = phi double [ %.1.lcssa.1, %._crit_edge.1 ], [ 0.000000e+00, %.preheader.1 ]
  %59 = load ptr, ptr @aminoacid, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct.AAStr, ptr %59, i64 %indvars.iv46.1
  %61 = getelementptr inbounds i8, ptr %60, i64 12
  %62 = load i32, ptr %61, align 4, !tbaa !11
  %63 = getelementptr inbounds i8, ptr %60, i64 16
  %64 = load i32, ptr %63, align 8, !tbaa !14
  %.not3334.1 = icmp sgt i32 %62, %64
  br i1 %.not3334.1, label %._crit_edge.1, label %.lr.ph.preheader.1

.lr.ph.preheader.1:                               ; preds = %.lr.ph40.1
  %65 = sext i32 %62 to i64
  %66 = add i32 %64, 1
  %.pre60 = load ptr, ptr @atom, align 8, !tbaa !5
  br label %.lr.ph.1

.lr.ph.1:                                         ; preds = %91, %.lr.ph.preheader.1
  %67 = phi ptr [ %.pre60, %.lr.ph.preheader.1 ], [ %92, %91 ]
  %indvars.iv.1 = phi i64 [ %65, %.lr.ph.preheader.1 ], [ %indvars.iv.next.1, %91 ]
  %.135.1 = phi double [ %.03039.1, %.lr.ph.preheader.1 ], [ %.2.1, %91 ]
  %68 = getelementptr inbounds %struct.AtomStr, ptr %67, i64 %indvars.iv.1
  %69 = load ptr, ptr %68, align 8, !tbaa !17
  %70 = getelementptr inbounds i8, ptr %69, i64 8
  %71 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %70, ptr noundef nonnull dereferenceable(1) @.str.2) #6
  %72 = icmp eq i32 %71, 0
  br i1 %72, label %73, label %91

73:                                               ; preds = %.lr.ph.1
  %74 = tail call i32 @AAModel(ptr noundef %53) #5
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds [32 x %struct.CGBeadStr], ptr getelementptr inbounds (i8, ptr @CGMatrix, i64 40), i64 0, i64 %75
  %77 = load ptr, ptr @aminoacid, align 8, !tbaa !5
  %78 = getelementptr inbounds %struct.AAStr, ptr %77, i64 %indvars.iv46.1, i32 1
  %79 = load i32, ptr %78, align 8, !tbaa !19
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds [32 x %struct.CGBeadStr], ptr getelementptr inbounds (i8, ptr @CGMatrix, i64 40), i64 0, i64 %80
  %82 = load ptr, ptr @atom, align 8, !tbaa !5
  %83 = getelementptr inbounds %struct.AtomStr, ptr %82, i64 %indvars.iv.1, i32 1
  %84 = load ptr, ptr %83, align 8, !tbaa !20
  %85 = getelementptr inbounds i8, ptr %84, i64 32
  %86 = load double, ptr %85, align 8, !tbaa !21
  %87 = fadd double %.02943.1, %86
  %88 = fsub double %87, %56
  %89 = tail call double @CalculateSurPoten(ptr noundef nonnull byval(%struct.CGBeadStr) align 8 %76, ptr noundef nonnull byval(%struct.CGBeadStr) align 8 %81, double noundef %88)
  %90 = fadd double %.135.1, %89
  %.pre59 = load ptr, ptr @atom, align 8, !tbaa !5
  br label %91

91:                                               ; preds = %73, %.lr.ph.1
  %92 = phi ptr [ %.pre59, %73 ], [ %67, %.lr.ph.1 ]
  %.2.1 = phi double [ %90, %73 ], [ %.135.1, %.lr.ph.1 ]
  %indvars.iv.next.1 = add nsw i64 %indvars.iv.1, 1
  %lftr.wideiv.1 = trunc i64 %indvars.iv.next.1 to i32
  %exitcond.1.not = icmp eq i32 %66, %lftr.wideiv.1
  br i1 %exitcond.1.not, label %._crit_edge.loopexit.1, label %.lr.ph.1, !llvm.loop !22

._crit_edge.loopexit.1:                           ; preds = %91
  %.pre61 = load i32, ptr @totalAminoAcids, align 4, !tbaa !9
  br label %._crit_edge.1

._crit_edge.1:                                    ; preds = %._crit_edge.loopexit.1, %.lr.ph40.1
  %93 = phi i32 [ %58, %.lr.ph40.1 ], [ %.pre61, %._crit_edge.loopexit.1 ]
  %.1.lcssa.1 = phi double [ %.03039.1, %.lr.ph40.1 ], [ %.2.1, %._crit_edge.loopexit.1 ]
  %indvars.iv.next47.1 = add nuw nsw i64 %indvars.iv46.1, 1
  %94 = sext i32 %93 to i64
  %.not.not.1 = icmp slt i64 %indvars.iv46.1, %94
  br i1 %.not.not.1, label %.lr.ph40.1, label %._crit_edge41.1, !llvm.loop !15

._crit_edge41.1:                                  ; preds = %._crit_edge.1
  %95 = fcmp olt double %.1.lcssa.1, 8.000000e-01
  br i1 %95, label %._crit_edge41.1.thread, label %97

._crit_edge41.1.thread:                           ; preds = %.preheader.1, %._crit_edge41.1
  %.030.lcssa.170 = phi double [ %.1.lcssa.1, %._crit_edge41.1 ], [ 0.000000e+00, %.preheader.1 ]
  %96 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %55, ptr noundef nonnull @.str.27, double noundef %.02943.1, double noundef %.030.lcssa.170) #5
  %.pre57 = load i32, ptr @totalAminoAcids, align 4, !tbaa !9
  br label %97

97:                                               ; preds = %._crit_edge41.1.thread, %._crit_edge41.1
  %98 = phi i32 [ %.pre57, %._crit_edge41.1.thread ], [ %93, %._crit_edge41.1 ]
  %99 = fadd double %.02943.1, 1.000000e-01
  %100 = fcmp olt double %99, 1.000000e+01
  br i1 %100, label %.preheader.1, label %101, !llvm.loop !23

101:                                              ; preds = %97
  %102 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %55, ptr noundef nonnull @.str.28) #5
  %103 = tail call i32 @fclose(ptr noundef %55)
  %104 = load ptr, ptr getelementptr inbounds (i8, ptr @__const.PrintPotCur_Pep.sur_type, i64 16), align 16, !tbaa !5
  %105 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %1, ptr noundef nonnull dereferenceable(1) @.str.29, ptr noundef nonnull @savedir, ptr noundef %104) #5
  %106 = call noalias ptr @fopen(ptr noundef nonnull %1, ptr noundef nonnull @.str.20)
  %107 = tail call double @FindMinDisDimen(i32 noundef 2)
  %.pre63 = load i32, ptr @totalAminoAcids, align 4, !tbaa !9
  br label %.preheader.2

.preheader.2:                                     ; preds = %148, %101
  %108 = phi i32 [ %.pre63, %101 ], [ %149, %148 ]
  %.02943.2 = phi double [ 2.000000e+00, %101 ], [ %150, %148 ]
  %.not37.2 = icmp slt i32 %108, 1
  br i1 %.not37.2, label %._crit_edge41.2.thread, label %.lr.ph40.2

.lr.ph40.2:                                       ; preds = %.preheader.2, %._crit_edge.2
  %109 = phi i32 [ %144, %._crit_edge.2 ], [ %108, %.preheader.2 ]
  %indvars.iv46.2 = phi i64 [ %indvars.iv.next47.2, %._crit_edge.2 ], [ 1, %.preheader.2 ]
  %.03039.2 = phi double [ %.1.lcssa.2, %._crit_edge.2 ], [ 0.000000e+00, %.preheader.2 ]
  %110 = load ptr, ptr @aminoacid, align 8, !tbaa !5
  %111 = getelementptr inbounds %struct.AAStr, ptr %110, i64 %indvars.iv46.2
  %112 = getelementptr inbounds i8, ptr %111, i64 12
  %113 = load i32, ptr %112, align 4, !tbaa !11
  %114 = getelementptr inbounds i8, ptr %111, i64 16
  %115 = load i32, ptr %114, align 8, !tbaa !14
  %.not3334.2 = icmp sgt i32 %113, %115
  br i1 %.not3334.2, label %._crit_edge.2, label %.lr.ph.preheader.2

.lr.ph.preheader.2:                               ; preds = %.lr.ph40.2
  %116 = sext i32 %113 to i64
  %117 = add i32 %115, 1
  %.pre65 = load ptr, ptr @atom, align 8, !tbaa !5
  br label %.lr.ph.2

.lr.ph.2:                                         ; preds = %142, %.lr.ph.preheader.2
  %118 = phi ptr [ %.pre65, %.lr.ph.preheader.2 ], [ %143, %142 ]
  %indvars.iv.2 = phi i64 [ %116, %.lr.ph.preheader.2 ], [ %indvars.iv.next.2, %142 ]
  %.135.2 = phi double [ %.03039.2, %.lr.ph.preheader.2 ], [ %.2.2, %142 ]
  %119 = getelementptr inbounds %struct.AtomStr, ptr %118, i64 %indvars.iv.2
  %120 = load ptr, ptr %119, align 8, !tbaa !17
  %121 = getelementptr inbounds i8, ptr %120, i64 8
  %122 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %121, ptr noundef nonnull dereferenceable(1) @.str.2) #6
  %123 = icmp eq i32 %122, 0
  br i1 %123, label %124, label %142

124:                                              ; preds = %.lr.ph.2
  %125 = tail call i32 @AAModel(ptr noundef %104) #5
  %126 = sext i32 %125 to i64
  %127 = getelementptr inbounds [32 x %struct.CGBeadStr], ptr getelementptr inbounds (i8, ptr @CGMatrix, i64 40), i64 0, i64 %126
  %128 = load ptr, ptr @aminoacid, align 8, !tbaa !5
  %129 = getelementptr inbounds %struct.AAStr, ptr %128, i64 %indvars.iv46.2, i32 1
  %130 = load i32, ptr %129, align 8, !tbaa !19
  %131 = sext i32 %130 to i64
  %132 = getelementptr inbounds [32 x %struct.CGBeadStr], ptr getelementptr inbounds (i8, ptr @CGMatrix, i64 40), i64 0, i64 %131
  %133 = load ptr, ptr @atom, align 8, !tbaa !5
  %134 = getelementptr inbounds %struct.AtomStr, ptr %133, i64 %indvars.iv.2, i32 1
  %135 = load ptr, ptr %134, align 8, !tbaa !20
  %136 = getelementptr inbounds i8, ptr %135, i64 32
  %137 = load double, ptr %136, align 8, !tbaa !21
  %138 = fadd double %.02943.2, %137
  %139 = fsub double %138, %107
  %140 = tail call double @CalculateSurPoten(ptr noundef nonnull byval(%struct.CGBeadStr) align 8 %127, ptr noundef nonnull byval(%struct.CGBeadStr) align 8 %132, double noundef %139)
  %141 = fadd double %.135.2, %140
  %.pre64 = load ptr, ptr @atom, align 8, !tbaa !5
  br label %142

142:                                              ; preds = %124, %.lr.ph.2
  %143 = phi ptr [ %.pre64, %124 ], [ %118, %.lr.ph.2 ]
  %.2.2 = phi double [ %141, %124 ], [ %.135.2, %.lr.ph.2 ]
  %indvars.iv.next.2 = add nsw i64 %indvars.iv.2, 1
  %lftr.wideiv.2 = trunc i64 %indvars.iv.next.2 to i32
  %exitcond.2.not = icmp eq i32 %117, %lftr.wideiv.2
  br i1 %exitcond.2.not, label %._crit_edge.loopexit.2, label %.lr.ph.2, !llvm.loop !22

._crit_edge.loopexit.2:                           ; preds = %142
  %.pre66 = load i32, ptr @totalAminoAcids, align 4, !tbaa !9
  br label %._crit_edge.2

._crit_edge.2:                                    ; preds = %._crit_edge.loopexit.2, %.lr.ph40.2
  %144 = phi i32 [ %109, %.lr.ph40.2 ], [ %.pre66, %._crit_edge.loopexit.2 ]
  %.1.lcssa.2 = phi double [ %.03039.2, %.lr.ph40.2 ], [ %.2.2, %._crit_edge.loopexit.2 ]
  %indvars.iv.next47.2 = add nuw nsw i64 %indvars.iv46.2, 1
  %145 = sext i32 %144 to i64
  %.not.not.2 = icmp slt i64 %indvars.iv46.2, %145
  br i1 %.not.not.2, label %.lr.ph40.2, label %._crit_edge41.2, !llvm.loop !15

._crit_edge41.2:                                  ; preds = %._crit_edge.2
  %146 = fcmp olt double %.1.lcssa.2, 8.000000e-01
  br i1 %146, label %._crit_edge41.2.thread, label %148

._crit_edge41.2.thread:                           ; preds = %.preheader.2, %._crit_edge41.2
  %.030.lcssa.272 = phi double [ %.1.lcssa.2, %._crit_edge41.2 ], [ 0.000000e+00, %.preheader.2 ]
  %147 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %106, ptr noundef nonnull @.str.27, double noundef %.02943.2, double noundef %.030.lcssa.272) #5
  %.pre62 = load i32, ptr @totalAminoAcids, align 4, !tbaa !9
  br label %148

148:                                              ; preds = %._crit_edge41.2.thread, %._crit_edge41.2
  %149 = phi i32 [ %.pre62, %._crit_edge41.2.thread ], [ %144, %._crit_edge41.2 ]
  %150 = fadd double %.02943.2, 1.000000e-01
  %151 = fcmp olt double %150, 1.000000e+01
  br i1 %151, label %.preheader.2, label %152, !llvm.loop !23

152:                                              ; preds = %148
  %153 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %106, ptr noundef nonnull @.str.28) #5
  %154 = tail call i32 @fclose(ptr noundef %106)
  call void @llvm.lifetime.end.p0(i64 128, ptr nonnull %1) #5
  ret void
}

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

attributes #0 = { mustprogress nofree nounwind willreturn memory(argmem: 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { "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 = { nounwind }
attributes #6 = { nounwind willreturn memory(read) }

!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 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !10, i64 12}
!12 = !{!"AAStr", !7, i64 0, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !13, i64 24}
!13 = !{!"double", !7, i64 0}
!14 = !{!12, !10, i64 16}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = !{!18, !6, i64 0}
!18 = !{!"AtomStr", !6, i64 0, !6, i64 8}
!19 = !{!12, !10, i64 8}
!20 = !{!18, !6, i64 8}
!21 = !{!13, !13, i64 0}
!22 = distinct !{!22, !16}
!23 = distinct !{!23, !16}


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