; LLVM IR from alexzheng42/sDMD :: analysis (RMSD)

; 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.FileListStr = type { i32, [128 x [64 x i8]] }
%struct.FileStr = type { i32, [256 x i8] }
%struct.SectionStr = type { i64, double, double, double, double, [20 x i8], %struct.WallStr, %struct.DynamicWallStr, %struct.ObstructionStr, %struct.TunnelStr, %struct.FlowStr }
%struct.WallStr = type { [20 x i8], [20 x i8], %struct.AtomStr }
%struct.AtomStr = type { ptr, ptr }
%struct.DynamicWallStr = type { [16 x i8], i32, i32, double, double, double, double, [4 x double] }
%struct.ObstructionStr = type { i32, i32, ptr, ptr, ptr }
%struct.TunnelStr = type { i32, double, double, double, %struct.AtomStr }
%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 }

@.str = external hidden unnamed_addr constant [19 x i8], align 1
@stdout = external global ptr, align 8
@RMSDFile = external global %struct.FileListStr, align 4
@.str.1 = external hidden unnamed_addr constant [132 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [66 x i8], align 1
@nRow = external hidden global i32, align 4
@refCoor = external hidden global ptr, align 8
@.str.3 = external hidden unnamed_addr constant [5 x i8], align 1
@path = external global [1024 x i8], align 16
@files = external global ptr, align 8
@.str.4 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [116 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [79 x i8], align 1
@fileList = external global ptr, align 8
@sectInfo = external global ptr, align 8
@.str.11 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [9 x i8], align 1
@curCoor = external hidden global ptr, align 8
@.str.13 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [7 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local void @RMSDInfo(i32 noundef %0) #0 {
  %2 = alloca i32, align 4
  %3 = alloca i64, align 8
  %4 = alloca i64, align 8
  %5 = alloca [1024 x i8], align 16
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  store i32 %0, ptr %2, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #5
  store i64 0, ptr %3, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #5
  call void @llvm.lifetime.start.p0(i64 1024, ptr %5) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  %13 = call i32 (ptr, ...) @printf(ptr noundef @.str)
  %14 = load ptr, ptr @stdout, align 8, !tbaa !11
  %15 = call i32 @fflush(ptr noundef %14)
  call void @InitializeVariables()
  %16 = load i32, ptr @RMSDFile, align 4, !tbaa !13
  %17 = icmp eq i32 %16, 0
  br i1 %17, label %18, label %20

18:                                               ; preds = %1
  %19 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, ptr noundef @.str.2, i32 noundef 80)
  call void @exit(i32 noundef 1) #6
  unreachable

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

21:                                               ; preds = %37, %20
  %22 = load i32, ptr %9, align 4, !tbaa !5
  %23 = load i32, ptr @RMSDFile, align 4, !tbaa !13
  %24 = icmp slt i32 %22, %23
  br i1 %24, label %26, label %25

25:                                               ; preds = %21
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  br label %40

26:                                               ; preds = %21
  %27 = load i32, ptr %9, align 4, !tbaa !5
  %28 = sext i32 %27 to i64
  %29 = getelementptr inbounds [128 x [64 x i8]], ptr getelementptr inbounds (%struct.FileListStr, ptr @RMSDFile, i32 0, i32 1), i64 0, i64 %28
  %30 = getelementptr inbounds [64 x i8], ptr %29, i64 0, i64 0
  %31 = load i32, ptr @nRow, align 4, !tbaa !5
  %32 = load ptr, ptr @refCoor, align 8, !tbaa !11
  %33 = load i32, ptr %9, align 4, !tbaa !5
  %34 = sext i32 %33 to i64
  %35 = getelementptr inbounds ptr, ptr %32, i64 %34
  %36 = load ptr, ptr %35, align 8, !tbaa !11
  call void @ReadRef(ptr noundef %30, i32 noundef 3, i32 noundef %31, ptr noundef %36)
  br label %37

37:                                               ; preds = %26
  %38 = load i32, ptr %9, align 4, !tbaa !5
  %39 = add nsw i32 %38, 1
  store i32 %39, ptr %9, align 4, !tbaa !5
  br label %21, !llvm.loop !15

40:                                               ; preds = %25
  %41 = getelementptr inbounds [1024 x i8], ptr %5, i64 0, i64 0
  %42 = load ptr, ptr @files, align 8, !tbaa !11
  %43 = getelementptr inbounds ptr, ptr %42, i64 14
  %44 = load ptr, ptr %43, align 8, !tbaa !11
  %45 = load i32, ptr %2, align 4, !tbaa !5
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds %struct.FileStr, ptr %44, i64 %46
  %48 = getelementptr inbounds %struct.FileStr, ptr %47, i32 0, i32 1
  %49 = getelementptr inbounds [256 x i8], ptr %48, i64 0, i64 0
  %50 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef %41, ptr noundef @.str.3, ptr noundef @path, ptr noundef %49) #5
  %51 = getelementptr inbounds [1024 x i8], ptr %5, i64 0, i64 0
  %52 = call noalias ptr @fopen(ptr noundef %51, ptr noundef @.str.4)
  store ptr %52, ptr %8, align 8, !tbaa !11
  %53 = load ptr, ptr %8, align 8, !tbaa !11
  %54 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %53, ptr noundef @.str.5, ptr noundef @.str.6) #5
  %55 = load ptr, ptr %8, align 8, !tbaa !11
  %56 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %55, ptr noundef @.str.5, ptr noundef @.str.7) #5
  %57 = getelementptr inbounds [1024 x i8], ptr %5, i64 0, i64 0
  %58 = load ptr, ptr @files, align 8, !tbaa !11
  %59 = getelementptr inbounds ptr, ptr %58, i64 8
  %60 = load ptr, ptr %59, align 8, !tbaa !11
  %61 = load i32, ptr %2, align 4, !tbaa !5
  %62 = sext i32 %61 to i64
  %63 = getelementptr inbounds %struct.FileStr, ptr %60, i64 %62
  %64 = getelementptr inbounds %struct.FileStr, ptr %63, i32 0, i32 1
  %65 = getelementptr inbounds [256 x i8], ptr %64, i64 0, i64 0
  %66 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef %57, ptr noundef @.str.3, ptr noundef @path, ptr noundef %65) #5
  %67 = getelementptr inbounds [1024 x i8], ptr %5, i64 0, i64 0
  %68 = call noalias ptr @fopen(ptr noundef %67, ptr noundef @.str.8)
  store ptr %68, ptr %7, align 8, !tbaa !11
  %69 = load ptr, ptr %7, align 8, !tbaa !11
  %70 = icmp eq ptr %69, null
  br i1 %70, label %71, label %82

71:                                               ; preds = %40
  %72 = load ptr, ptr @files, align 8, !tbaa !11
  %73 = getelementptr inbounds ptr, ptr %72, i64 8
  %74 = load ptr, ptr %73, align 8, !tbaa !11
  %75 = load i32, ptr %2, align 4, !tbaa !5
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds %struct.FileStr, ptr %74, i64 %76
  %78 = getelementptr inbounds %struct.FileStr, ptr %77, i32 0, i32 1
  %79 = getelementptr inbounds [256 x i8], ptr %78, i64 0, i64 0
  %80 = call i32 (ptr, ...) @printf(ptr noundef @.str.9, ptr noundef %79, ptr noundef @path, ptr noundef @.str.2, i32 noundef 98)
  %81 = call i32 (ptr, ...) @printf(ptr noundef @.str.10)
  call void @exit(i32 noundef 1) #6
  unreachable

82:                                               ; preds = %40
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  store i32 0, ptr %10, align 4, !tbaa !5
  br label %83

83:                                               ; preds = %181, %82
  %84 = load i32, ptr %10, align 4, !tbaa !5
  %85 = load ptr, ptr @fileList, align 8, !tbaa !11
  %86 = load i32, ptr %2, align 4, !tbaa !5
  %87 = sext i32 %86 to i64
  %88 = getelementptr inbounds %struct.FileListStr, ptr %85, i64 %87
  %89 = getelementptr inbounds %struct.FileListStr, ptr %88, i32 0, i32 0
  %90 = load i32, ptr %89, align 4, !tbaa !13
  %91 = icmp slt i32 %84, %90
  br i1 %91, label %93, label %92

92:                                               ; preds = %83
  store i32 5, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  br label %184

93:                                               ; preds = %83
  %94 = load ptr, ptr @sectInfo, align 8, !tbaa !11
  %95 = load i32, ptr %10, align 4, !tbaa !5
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds %struct.SectionStr, ptr %94, i64 %96
  %98 = getelementptr inbounds %struct.SectionStr, ptr %97, i32 0, i32 0
  %99 = load i64, ptr %98, align 8, !tbaa !17
  %100 = sitofp i64 %99 to double
  %101 = load ptr, ptr @sectInfo, align 8, !tbaa !11
  %102 = load i32, ptr %10, align 4, !tbaa !5
  %103 = sext i32 %102 to i64
  %104 = getelementptr inbounds %struct.SectionStr, ptr %101, i64 %103
  %105 = getelementptr inbounds %struct.SectionStr, ptr %104, i32 0, i32 1
  %106 = load double, ptr %105, align 8, !tbaa !29
  %107 = fadd double %100, %106
  %108 = load ptr, ptr @sectInfo, align 8, !tbaa !11
  %109 = load i32, ptr %10, align 4, !tbaa !5
  %110 = sext i32 %109 to i64
  %111 = getelementptr inbounds %struct.SectionStr, ptr %108, i64 %110
  %112 = getelementptr inbounds %struct.SectionStr, ptr %111, i32 0, i32 4
  %113 = load double, ptr %112, align 8, !tbaa !30
  %114 = fdiv double %107, %113
  %115 = fadd double %114, 1.000000e+00
  %116 = fptosi double %115 to i64
  store i64 %116, ptr %4, align 8, !tbaa !9
  %117 = load ptr, ptr @sectInfo, align 8, !tbaa !11
  %118 = load i32, ptr %10, align 4, !tbaa !5
  %119 = sext i32 %118 to i64
  %120 = getelementptr inbounds %struct.SectionStr, ptr %117, i64 %119
  %121 = getelementptr inbounds %struct.SectionStr, ptr %120, i32 0, i32 1
  %122 = load double, ptr %121, align 8, !tbaa !29
  %123 = load ptr, ptr @sectInfo, align 8, !tbaa !11
  %124 = load i32, ptr %10, align 4, !tbaa !5
  %125 = sext i32 %124 to i64
  %126 = getelementptr inbounds %struct.SectionStr, ptr %123, i64 %125
  %127 = getelementptr inbounds %struct.SectionStr, ptr %126, i32 0, i32 4
  %128 = load double, ptr %127, align 8, !tbaa !30
  %129 = fdiv double %122, %128
  %130 = fptosi double %129 to i64
  store i64 %130, ptr %3, align 8, !tbaa !9
  br label %131

131:                                              ; preds = %177, %93
  %132 = load i64, ptr %3, align 8, !tbaa !9
  %133 = load i64, ptr %4, align 8, !tbaa !9
  %134 = icmp slt i64 %132, %133
  br i1 %134, label %135, label %180

135:                                              ; preds = %131
  %136 = load ptr, ptr %7, align 8, !tbaa !11
  %137 = call i32 @ReadGro(ptr noundef %136)
  %138 = icmp ne i32 %137, 0
  br i1 %138, label %139, label %140

139:                                              ; preds = %135
  br label %180

140:                                              ; preds = %135
  %141 = load i64, ptr %3, align 8, !tbaa !9
  call void @PrintProcess(i64 noundef %141)
  %142 = load ptr, ptr @sectInfo, align 8, !tbaa !11
  %143 = load i32, ptr %10, align 4, !tbaa !5
  %144 = sext i32 %143 to i64
  %145 = getelementptr inbounds %struct.SectionStr, ptr %142, i64 %144
  store ptr %145, ptr %6, align 8, !tbaa !11
  %146 = load ptr, ptr %8, align 8, !tbaa !11
  %147 = load i64, ptr %3, align 8, !tbaa !9
  %148 = sitofp i64 %147 to double
  %149 = load ptr, ptr %6, align 8, !tbaa !11
  %150 = getelementptr inbounds %struct.SectionStr, ptr %149, i32 0, i32 4
  %151 = load double, ptr %150, align 8, !tbaa !30
  %152 = fmul double %148, %151
  %153 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %146, ptr noundef @.str.11, double noundef %152) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  store i32 0, ptr %12, align 4, !tbaa !5
  br label %154

154:                                              ; preds = %171, %140
  %155 = load i32, ptr %12, align 4, !tbaa !5
  %156 = load i32, ptr @RMSDFile, align 4, !tbaa !13
  %157 = icmp slt i32 %155, %156
  br i1 %157, label %159, label %158

158:                                              ; preds = %154
  store i32 11, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  br label %174

159:                                              ; preds = %154
  %160 = load ptr, ptr %8, align 8, !tbaa !11
  %161 = load i32, ptr @nRow, align 4, !tbaa !5
  %162 = load ptr, ptr @refCoor, align 8, !tbaa !11
  %163 = load i32, ptr %12, align 4, !tbaa !5
  %164 = sext i32 %163 to i64
  %165 = getelementptr inbounds ptr, ptr %162, i64 %164
  %166 = load ptr, ptr %165, align 8, !tbaa !11
  %167 = load ptr, ptr @curCoor, align 8, !tbaa !11
  %168 = call double @CalRMSD(i32 noundef 3, i32 noundef %161, ptr noundef %166, ptr noundef %167)
  %169 = fdiv double %168, 1.000000e+01
  %170 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %160, ptr noundef @.str.12, double noundef %169) #5
  br label %171

171:                                              ; preds = %159
  %172 = load i32, ptr %12, align 4, !tbaa !5
  %173 = add nsw i32 %172, 1
  store i32 %173, ptr %12, align 4, !tbaa !5
  br label %154, !llvm.loop !31

174:                                              ; preds = %158
  %175 = load ptr, ptr %8, align 8, !tbaa !11
  %176 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %175, ptr noundef @.str.13) #5
  br label %177

177:                                              ; preds = %174
  %178 = load i64, ptr %3, align 8, !tbaa !9
  %179 = add nsw i64 %178, 1
  store i64 %179, ptr %3, align 8, !tbaa !9
  br label %131, !llvm.loop !32

180:                                              ; preds = %139, %131
  br label %181

181:                                              ; preds = %180
  %182 = load i32, ptr %10, align 4, !tbaa !5
  %183 = add nsw i32 %182, 1
  store i32 %183, ptr %10, align 4, !tbaa !5
  br label %83, !llvm.loop !33

184:                                              ; preds = %92
  %185 = load ptr, ptr %7, align 8, !tbaa !11
  %186 = call i32 @fclose(ptr noundef %185)
  %187 = load ptr, ptr %8, align 8, !tbaa !11
  %188 = call i32 @fclose(ptr noundef %187)
  call void @FreeVar()
  %189 = call i32 (ptr, ...) @printf(ptr noundef @.str.14)
  %190 = load ptr, ptr @stdout, align 8, !tbaa !11
  %191 = call i32 @fflush(ptr noundef %190)
  store i32 1, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 1024, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #5
  ret void
}

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

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

declare i32 @fflush(ptr noundef) #2

; Function Attrs: nounwind uwtable
declare hidden void @InitializeVariables() #0

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

; Function Attrs: nounwind uwtable
declare hidden void @ReadRef(ptr noundef, i32 noundef, i32 noundef, ptr noundef) #0

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

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

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

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

declare i32 @ReadGro(ptr noundef) #2

declare void @PrintProcess(i64 noundef) #2

; Function Attrs: nounwind uwtable
declare hidden double @CalRMSD(i32 noundef, i32 noundef, ptr noundef, ptr noundef) #0

declare i32 @fclose(ptr noundef) #2

; Function Attrs: nounwind uwtable
declare hidden void @FreeVar() #0

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

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

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


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

%struct.FileListStr = type { i32, [128 x [64 x i8]] }
%struct.FileStr = type { i32, [256 x i8] }
%struct.SectionStr = type { i64, double, double, double, double, [20 x i8], %struct.WallStr, %struct.DynamicWallStr, %struct.ObstructionStr, %struct.TunnelStr, %struct.FlowStr }
%struct.WallStr = type { [20 x i8], [20 x i8], %struct.AtomStr }
%struct.AtomStr = type { ptr, ptr }
%struct.DynamicWallStr = type { [16 x i8], i32, i32, double, double, double, double, [4 x double] }
%struct.ObstructionStr = type { i32, i32, ptr, ptr, ptr }
%struct.TunnelStr = type { i32, double, double, double, %struct.AtomStr }
%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 }

@.str = external hidden unnamed_addr constant [19 x i8], align 1
@stdout = external local_unnamed_addr global ptr, align 8
@RMSDFile = external global %struct.FileListStr, align 4
@.str.1 = external hidden unnamed_addr constant [132 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [66 x i8], align 1
@nRow = external hidden local_unnamed_addr global i32, align 4
@refCoor = external hidden local_unnamed_addr global ptr, align 8
@.str.3 = external hidden unnamed_addr constant [5 x i8], align 1
@path = external global [1024 x i8], align 16
@files = external local_unnamed_addr global ptr, align 8
@.str.4 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [22 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [30 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [116 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [79 x i8], align 1
@fileList = external local_unnamed_addr global ptr, align 8
@sectInfo = external local_unnamed_addr global ptr, align 8
@.str.11 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [9 x i8], align 1
@curCoor = external hidden local_unnamed_addr global ptr, align 8
@.str.13 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [7 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local void @RMSDInfo(i32 noundef %0) local_unnamed_addr #0 {
  %2 = alloca [1024 x i8], align 16
  call void @llvm.lifetime.start.p0(i64 1024, ptr nonnull %2) #5
  %3 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str)
  %4 = load ptr, ptr @stdout, align 8, !tbaa !5
  %5 = tail call i32 @fflush(ptr noundef %4)
  tail call void @InitializeVariables()
  %6 = load i32, ptr @RMSDFile, align 4, !tbaa !9
  %7 = icmp eq i32 %6, 0
  br i1 %7, label %9, label %.preheader37

.preheader37:                                     ; preds = %1
  %8 = icmp sgt i32 %6, 0
  br i1 %8, label %.lr.ph, label %._crit_edge

9:                                                ; preds = %1
  %10 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, ptr noundef nonnull @.str.2, i32 noundef 80)
  tail call void @exit(i32 noundef 1) #6
  unreachable

._crit_edge:                                      ; preds = %.lr.ph, %.preheader37
  %11 = load ptr, ptr @files, align 8, !tbaa !5
  %12 = getelementptr inbounds i8, ptr %11, i64 112
  %13 = load ptr, ptr %12, align 8, !tbaa !5
  %14 = sext i32 %0 to i64
  %15 = getelementptr inbounds %struct.FileStr, ptr %13, i64 %14, i32 1
  %16 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %2, ptr noundef nonnull dereferenceable(1) @.str.3, ptr noundef nonnull @path, ptr noundef nonnull %15) #5
  %17 = call noalias ptr @fopen(ptr noundef nonnull %2, ptr noundef nonnull @.str.4)
  %18 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %17, ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.6) #5
  %19 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %17, ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.7) #5
  %20 = load ptr, ptr @files, align 8, !tbaa !5
  %21 = getelementptr inbounds i8, ptr %20, i64 64
  %22 = load ptr, ptr %21, align 8, !tbaa !5
  %23 = getelementptr inbounds %struct.FileStr, ptr %22, i64 %14, i32 1
  %24 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %2, ptr noundef nonnull dereferenceable(1) @.str.3, ptr noundef nonnull @path, ptr noundef nonnull %23) #5
  %25 = call noalias ptr @fopen(ptr noundef nonnull %2, ptr noundef nonnull @.str.8)
  %26 = icmp eq ptr %25, null
  br i1 %26, label %39, label %.preheader

.preheader:                                       ; preds = %._crit_edge
  %27 = load ptr, ptr @fileList, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct.FileListStr, ptr %27, i64 %14
  %29 = load i32, ptr %28, align 4, !tbaa !9
  %30 = icmp sgt i32 %29, 0
  br i1 %30, label %.lr.ph49, label %._crit_edge50

.lr.ph:                                           ; preds = %.preheader37, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %.preheader37 ]
  %31 = getelementptr inbounds [128 x [64 x i8]], ptr getelementptr inbounds (i8, ptr @RMSDFile, i64 4), i64 0, i64 %indvars.iv
  %32 = load i32, ptr @nRow, align 4, !tbaa !12
  %33 = load ptr, ptr @refCoor, align 8, !tbaa !5
  %34 = getelementptr inbounds ptr, ptr %33, i64 %indvars.iv
  %35 = load ptr, ptr %34, align 8, !tbaa !5
  tail call void @ReadRef(ptr noundef nonnull %31, i32 noundef 3, i32 noundef %32, ptr noundef %35)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %36 = load i32, ptr @RMSDFile, align 4, !tbaa !9
  %37 = sext i32 %36 to i64
  %38 = icmp slt i64 %indvars.iv.next, %37
  br i1 %38, label %.lr.ph, label %._crit_edge, !llvm.loop !13

39:                                               ; preds = %._crit_edge
  %40 = load ptr, ptr @files, align 8, !tbaa !5
  %41 = getelementptr inbounds i8, ptr %40, i64 64
  %42 = load ptr, ptr %41, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct.FileStr, ptr %42, i64 %14, i32 1
  %44 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.9, ptr noundef nonnull %43, ptr noundef nonnull @path, ptr noundef nonnull @.str.2, i32 noundef 98)
  %45 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.10)
  tail call void @exit(i32 noundef 1) #6
  unreachable

._crit_edge50:                                    ; preds = %._crit_edge46, %.preheader
  %46 = tail call i32 @fclose(ptr noundef nonnull %25)
  %47 = tail call i32 @fclose(ptr noundef %17)
  tail call void @FreeVar()
  %48 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.14)
  %49 = load ptr, ptr @stdout, align 8, !tbaa !5
  %50 = tail call i32 @fflush(ptr noundef %49)
  call void @llvm.lifetime.end.p0(i64 1024, ptr nonnull %2) #5
  ret void

.lr.ph49:                                         ; preds = %.preheader, %._crit_edge46
  %51 = phi ptr [ %90, %._crit_edge46 ], [ %27, %.preheader ]
  %indvars.iv55 = phi i64 [ %indvars.iv.next56, %._crit_edge46 ], [ 0, %.preheader ]
  %52 = load ptr, ptr @sectInfo, align 8, !tbaa !5
  %53 = getelementptr inbounds %struct.SectionStr, ptr %52, i64 %indvars.iv55
  %54 = load i64, ptr %53, align 8, !tbaa !15
  %55 = sitofp i64 %54 to double
  %56 = getelementptr inbounds i8, ptr %53, i64 8
  %57 = load double, ptr %56, align 8, !tbaa !28
  %58 = fadd double %57, %55
  %59 = getelementptr inbounds i8, ptr %53, i64 32
  %60 = load double, ptr %59, align 8, !tbaa !29
  %61 = fdiv double %58, %60
  %62 = fadd double %61, 1.000000e+00
  %63 = fptosi double %62 to i64
  %64 = fdiv double %57, %60
  %65 = fptosi double %64 to i64
  %66 = icmp slt i64 %65, %63
  br i1 %66, label %.lr.ph45, label %._crit_edge46

.lr.ph45:                                         ; preds = %.lr.ph49, %._crit_edge42
  %.03543 = phi i64 [ %78, %._crit_edge42 ], [ %65, %.lr.ph49 ]
  %67 = tail call i32 @ReadGro(ptr noundef nonnull %25) #5
  %.not = icmp eq i32 %67, 0
  br i1 %.not, label %68, label %._crit_edge46.loopexit

68:                                               ; preds = %.lr.ph45
  tail call void @PrintProcess(i64 noundef %.03543) #5
  %69 = load ptr, ptr @sectInfo, align 8, !tbaa !5
  %70 = sitofp i64 %.03543 to double
  %71 = getelementptr inbounds %struct.SectionStr, ptr %69, i64 %indvars.iv55, i32 4
  %72 = load double, ptr %71, align 8, !tbaa !29
  %73 = fmul double %72, %70
  %74 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %17, ptr noundef nonnull @.str.11, double noundef %73) #5
  %75 = load i32, ptr @RMSDFile, align 4, !tbaa !9
  %76 = icmp sgt i32 %75, 0
  br i1 %76, label %.lr.ph41, label %._crit_edge42

._crit_edge42:                                    ; preds = %.lr.ph41, %68
  %77 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %17, ptr noundef nonnull @.str.13) #5
  %78 = add i64 %.03543, 1
  %exitcond.not = icmp eq i64 %78, %63
  br i1 %exitcond.not, label %._crit_edge46.loopexit, label %.lr.ph45, !llvm.loop !30

.lr.ph41:                                         ; preds = %68, %.lr.ph41
  %indvars.iv52 = phi i64 [ %indvars.iv.next53, %.lr.ph41 ], [ 0, %68 ]
  %79 = load i32, ptr @nRow, align 4, !tbaa !12
  %80 = load ptr, ptr @refCoor, align 8, !tbaa !5
  %81 = getelementptr inbounds ptr, ptr %80, i64 %indvars.iv52
  %82 = load ptr, ptr %81, align 8, !tbaa !5
  %83 = load ptr, ptr @curCoor, align 8, !tbaa !5
  %84 = tail call double @CalRMSD(i32 noundef 3, i32 noundef %79, ptr noundef %82, ptr noundef %83)
  %85 = fdiv double %84, 1.000000e+01
  %86 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %17, ptr noundef nonnull @.str.12, double noundef %85) #5
  %indvars.iv.next53 = add nuw nsw i64 %indvars.iv52, 1
  %87 = load i32, ptr @RMSDFile, align 4, !tbaa !9
  %88 = sext i32 %87 to i64
  %89 = icmp slt i64 %indvars.iv.next53, %88
  br i1 %89, label %.lr.ph41, label %._crit_edge42, !llvm.loop !31

._crit_edge46.loopexit:                           ; preds = %._crit_edge42, %.lr.ph45
  %.pre = load ptr, ptr @fileList, align 8, !tbaa !5
  br label %._crit_edge46

._crit_edge46:                                    ; preds = %._crit_edge46.loopexit, %.lr.ph49
  %90 = phi ptr [ %.pre, %._crit_edge46.loopexit ], [ %51, %.lr.ph49 ]
  %indvars.iv.next56 = add nuw nsw i64 %indvars.iv55, 1
  %91 = getelementptr inbounds %struct.FileListStr, ptr %90, i64 %14
  %92 = load i32, ptr %91, align 4, !tbaa !9
  %93 = sext i32 %92 to i64
  %94 = icmp slt i64 %indvars.iv.next56, %93
  br i1 %94, label %.lr.ph49, label %._crit_edge50, !llvm.loop !32
}

; 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 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #2

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

; Function Attrs: nounwind uwtable
declare hidden void @InitializeVariables() local_unnamed_addr #0

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

; Function Attrs: nounwind uwtable
declare hidden void @ReadRef(ptr noundef, i32 noundef, i32 noundef, ptr noundef) local_unnamed_addr #0

; 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 noundef i32 @sprintf(ptr noalias nocapture noundef writeonly, ptr nocapture noundef readonly, ...) local_unnamed_addr #2

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

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

declare i32 @ReadGro(ptr noundef) local_unnamed_addr #4

declare void @PrintProcess(i64 noundef) local_unnamed_addr #4

; Function Attrs: nounwind uwtable
declare hidden double @CalRMSD(i32 noundef, i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #0

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

; Function Attrs: nounwind uwtable
declare hidden void @FreeVar() local_unnamed_addr #0

attributes #0 = { 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 #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 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { "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 = { noreturn nounwind }

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

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


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