; 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.CGGovStr = type { [2 x [16 x i8]], i32, i32, ptr, ptr }
%struct.AtomListStr = type { i32, [27 x i32], [27 x i32], [27 x i32], double, ptr, ptr, ptr }
%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.PepStr = type { i32, i32, i32, i32, double }
%struct.CGStr = 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 }

@CG = external global %struct.CGGovStr, align 8
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@protein = external global ptr, align 8

; 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: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: nounwind uwtable
declare dso_local void @CGSurfaceEvent(ptr noundef, ptr noundef) #2

; Function Attrs: nounwind uwtable
define dso_local void @CGResidueRenew(ptr noundef %0, ptr noundef %1) #2 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca ptr, 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
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #4
  store i32 0, ptr %5, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  store i32 0, ptr %6, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  store i32 0, ptr %7, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  store ptr null, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  %15 = load ptr, ptr %4, align 8, !tbaa !5
  %16 = getelementptr inbounds %struct.AtomListStr, ptr %15, i32 0, i32 7
  %17 = load ptr, ptr %16, align 8, !tbaa !11
  %18 = load ptr, ptr %3, align 8, !tbaa !5
  %19 = getelementptr inbounds i32, ptr %18, i64 1
  %20 = load i32, ptr %19, align 4, !tbaa !9
  %21 = sext i32 %20 to i64
  %22 = getelementptr inbounds ptr, ptr %17, i64 %21
  %23 = load ptr, ptr %22, align 8, !tbaa !5
  store ptr %23, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  store i32 1, ptr %10, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  %24 = load ptr, ptr %3, align 8, !tbaa !5
  %25 = getelementptr inbounds i32, ptr %24, i64 0
  %26 = load i32, ptr %25, align 4, !tbaa !9
  %27 = add nsw i32 %26, 1
  store i32 %27, ptr %11, align 4, !tbaa !9
  br label %28

28:                                               ; preds = %118, %2
  %29 = load i32, ptr %10, align 4, !tbaa !9
  %30 = load ptr, ptr %3, align 8, !tbaa !5
  %31 = getelementptr inbounds i32, ptr %30, i64 0
  %32 = load i32, ptr %31, align 4, !tbaa !9
  %33 = icmp sle i32 %29, %32
  br i1 %33, label %35, label %34

34:                                               ; preds = %28
  store i32 2, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  br label %121

35:                                               ; preds = %28
  %36 = load ptr, ptr %4, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct.AtomListStr, ptr %36, i32 0, i32 7
  %38 = load ptr, ptr %37, align 8, !tbaa !11
  %39 = load ptr, ptr %3, align 8, !tbaa !5
  %40 = load i32, ptr %10, align 4, !tbaa !9
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds i32, ptr %39, i64 %41
  %43 = load i32, ptr %42, align 4, !tbaa !9
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds ptr, ptr %38, i64 %44
  %46 = load ptr, ptr %45, align 8, !tbaa !5
  store ptr %46, ptr %8, align 8, !tbaa !5
  %47 = load ptr, ptr %8, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct.AtomStr, ptr %47, i32 0, i32 0
  %49 = load ptr, ptr %48, align 8, !tbaa !14
  %50 = getelementptr inbounds %struct.PropertyStr, ptr %49, i32 0, i32 1
  %51 = getelementptr inbounds [2 x [16 x i8]], ptr %50, i64 0, i64 0
  %52 = getelementptr inbounds [16 x i8], ptr %51, i64 0, i64 0
  %53 = call i32 @strcmp(ptr noundef %52, ptr noundef @.str.2) #5
  %54 = icmp ne i32 %53, 0
  br i1 %54, label %55, label %56

55:                                               ; preds = %35
  br label %118

56:                                               ; preds = %35
  %57 = load ptr, ptr @protein, align 8, !tbaa !5
  %58 = load ptr, ptr %8, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct.AtomStr, ptr %58, i32 0, i32 0
  %60 = load ptr, ptr %59, align 8, !tbaa !14
  %61 = getelementptr inbounds %struct.PropertyStr, ptr %60, i32 0, i32 9
  %62 = getelementptr inbounds %struct.AtomSeqStr, ptr %61, i32 0, i32 1
  %63 = load i32, ptr %62, align 4, !tbaa !16
  %64 = sub nsw i32 %63, 1
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds %struct.PepStr, ptr %57, i64 %65
  %67 = getelementptr inbounds %struct.PepStr, ptr %66, i32 0, i32 3
  %68 = load i32, ptr %67, align 4, !tbaa !19
  %69 = load ptr, ptr %8, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct.AtomStr, ptr %69, i32 0, i32 0
  %71 = load ptr, ptr %70, align 8, !tbaa !14
  %72 = getelementptr inbounds %struct.PropertyStr, ptr %71, i32 0, i32 9
  %73 = getelementptr inbounds %struct.AtomSeqStr, ptr %72, i32 0, i32 2
  %74 = load i32, ptr %73, align 8, !tbaa !21
  %75 = add nsw i32 %68, %74
  store i32 %75, ptr %5, align 4, !tbaa !9
  %76 = load ptr, ptr getelementptr inbounds (%struct.CGGovStr, ptr @CG, i32 0, i32 4), align 8, !tbaa !22
  %77 = load i32, ptr %5, align 4, !tbaa !9
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds %struct.CGStr, ptr %76, i64 %78
  %80 = getelementptr inbounds %struct.CGStr, ptr %79, i32 0, i32 0
  %81 = load i32, ptr %80, align 4, !tbaa !24
  store i32 %81, ptr %6, align 4, !tbaa !9
  %82 = load ptr, ptr getelementptr inbounds (%struct.CGGovStr, ptr @CG, i32 0, i32 4), align 8, !tbaa !22
  %83 = load i32, ptr %5, align 4, !tbaa !9
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds %struct.CGStr, ptr %82, i64 %84
  %86 = getelementptr inbounds %struct.CGStr, ptr %85, i32 0, i32 1
  %87 = load i32, ptr %86, align 4, !tbaa !26
  store i32 %87, ptr %7, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #4
  %88 = load i32, ptr %6, align 4, !tbaa !9
  store i32 %88, ptr %13, align 4, !tbaa !9
  br label %89

89:                                               ; preds = %110, %56
  %90 = load i32, ptr %13, align 4, !tbaa !9
  %91 = load i32, ptr %7, align 4, !tbaa !9
  %92 = icmp sle i32 %90, %91
  br i1 %92, label %94, label %93

93:                                               ; preds = %89
  store i32 5, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #4
  br label %113

94:                                               ; preds = %89
  %95 = load ptr, ptr %3, align 8, !tbaa !5
  %96 = load i32, ptr %13, align 4, !tbaa !9
  %97 = load ptr, ptr %3, align 8, !tbaa !5
  %98 = getelementptr inbounds i32, ptr %97, i64 0
  %99 = load i32, ptr %98, align 4, !tbaa !9
  %100 = call i32 @FindElemInList(ptr noundef %95, i32 noundef %96, i32 noundef 1, i32 noundef %99, i32 noundef 0)
  %101 = icmp ne i32 %100, 0
  br i1 %101, label %109, label %102

102:                                              ; preds = %94
  %103 = load i32, ptr %13, align 4, !tbaa !9
  %104 = load ptr, ptr %3, align 8, !tbaa !5
  %105 = load i32, ptr %11, align 4, !tbaa !9
  %106 = add nsw i32 %105, 1
  store i32 %106, ptr %11, align 4, !tbaa !9
  %107 = sext i32 %105 to i64
  %108 = getelementptr inbounds i32, ptr %104, i64 %107
  store i32 %103, ptr %108, align 4, !tbaa !9
  br label %109

109:                                              ; preds = %102, %94
  br label %110

110:                                              ; preds = %109
  %111 = load i32, ptr %13, align 4, !tbaa !9
  %112 = add nsw i32 %111, 1
  store i32 %112, ptr %13, align 4, !tbaa !9
  br label %89, !llvm.loop !27

113:                                              ; preds = %93
  %114 = load ptr, ptr %3, align 8, !tbaa !5
  %115 = load i32, ptr %11, align 4, !tbaa !9
  %116 = sext i32 %115 to i64
  %117 = getelementptr inbounds i32, ptr %114, i64 %116
  store i32 0, ptr %117, align 4, !tbaa !9
  br label %118

118:                                              ; preds = %113, %55
  %119 = load i32, ptr %10, align 4, !tbaa !9
  %120 = add nsw i32 %119, 1
  store i32 %120, ptr %10, align 4, !tbaa !9
  br label %28, !llvm.loop !29

121:                                              ; preds = %34
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #4
  %122 = load ptr, ptr %3, align 8, !tbaa !5
  %123 = getelementptr inbounds i32, ptr %122, i64 0
  %124 = load i32, ptr %123, align 4, !tbaa !9
  %125 = add nsw i32 %124, 1
  store i32 %125, ptr %14, align 4, !tbaa !9
  br label %126

126:                                              ; preds = %199, %121
  %127 = load ptr, ptr %3, align 8, !tbaa !5
  %128 = load i32, ptr %14, align 4, !tbaa !9
  %129 = sext i32 %128 to i64
  %130 = getelementptr inbounds i32, ptr %127, i64 %129
  %131 = load i32, ptr %130, align 4, !tbaa !9
  %132 = icmp ne i32 %131, 0
  br i1 %132, label %134, label %133

133:                                              ; preds = %126
  store i32 8, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #4
  br label %202

134:                                              ; preds = %126
  %135 = load ptr, ptr %4, align 8, !tbaa !5
  %136 = getelementptr inbounds %struct.AtomListStr, ptr %135, i32 0, i32 7
  %137 = load ptr, ptr %136, align 8, !tbaa !11
  %138 = load ptr, ptr %3, align 8, !tbaa !5
  %139 = load i32, ptr %14, align 4, !tbaa !9
  %140 = sext i32 %139 to i64
  %141 = getelementptr inbounds i32, ptr %138, i64 %140
  %142 = load i32, ptr %141, align 4, !tbaa !9
  %143 = sext i32 %142 to i64
  %144 = getelementptr inbounds ptr, ptr %137, i64 %143
  %145 = load ptr, ptr %144, align 8, !tbaa !5
  store ptr %145, ptr %8, align 8, !tbaa !5
  %146 = load ptr, ptr %9, align 8, !tbaa !5
  %147 = getelementptr inbounds %struct.AtomStr, ptr %146, i32 0, i32 1
  %148 = load ptr, ptr %147, align 8, !tbaa !30
  %149 = getelementptr inbounds %struct.DynamicStr, ptr %148, i32 0, i32 5
  %150 = getelementptr inbounds %struct.InteractionEventStr, ptr %149, i32 0, i32 4
  %151 = load double, ptr %150, align 8, !tbaa !31
  %152 = load ptr, ptr %8, align 8, !tbaa !5
  %153 = getelementptr inbounds %struct.AtomStr, ptr %152, i32 0, i32 1
  %154 = load ptr, ptr %153, align 8, !tbaa !30
  %155 = getelementptr inbounds %struct.DynamicStr, ptr %154, i32 0, i32 5
  %156 = getelementptr inbounds %struct.InteractionEventStr, ptr %155, i32 0, i32 4
  store double %151, ptr %156, align 8, !tbaa !31
  %157 = load ptr, ptr %9, align 8, !tbaa !5
  %158 = getelementptr inbounds %struct.AtomStr, ptr %157, i32 0, i32 1
  %159 = load ptr, ptr %158, align 8, !tbaa !30
  %160 = getelementptr inbounds %struct.DynamicStr, ptr %159, i32 0, i32 5
  %161 = getelementptr inbounds %struct.InteractionEventStr, ptr %160, i32 0, i32 6
  %162 = load i32, ptr %161, align 4, !tbaa !37
  %163 = load ptr, ptr %8, align 8, !tbaa !5
  %164 = getelementptr inbounds %struct.AtomStr, ptr %163, i32 0, i32 1
  %165 = load ptr, ptr %164, align 8, !tbaa !30
  %166 = getelementptr inbounds %struct.DynamicStr, ptr %165, i32 0, i32 5
  %167 = getelementptr inbounds %struct.InteractionEventStr, ptr %166, i32 0, i32 6
  store i32 %162, ptr %167, align 4, !tbaa !37
  %168 = load ptr, ptr %9, align 8, !tbaa !5
  %169 = getelementptr inbounds %struct.AtomStr, ptr %168, i32 0, i32 1
  %170 = load ptr, ptr %169, align 8, !tbaa !30
  %171 = getelementptr inbounds %struct.DynamicStr, ptr %170, i32 0, i32 5
  %172 = getelementptr inbounds %struct.InteractionEventStr, ptr %171, i32 0, i32 5
  %173 = load i32, ptr %172, align 8, !tbaa !38
  %174 = load ptr, ptr %8, align 8, !tbaa !5
  %175 = getelementptr inbounds %struct.AtomStr, ptr %174, i32 0, i32 1
  %176 = load ptr, ptr %175, align 8, !tbaa !30
  %177 = getelementptr inbounds %struct.DynamicStr, ptr %176, i32 0, i32 5
  %178 = getelementptr inbounds %struct.InteractionEventStr, ptr %177, i32 0, i32 5
  store i32 %173, ptr %178, align 8, !tbaa !38
  %179 = load ptr, ptr %9, align 8, !tbaa !5
  %180 = getelementptr inbounds %struct.AtomStr, ptr %179, i32 0, i32 1
  %181 = load ptr, ptr %180, align 8, !tbaa !30
  %182 = getelementptr inbounds %struct.DynamicStr, ptr %181, i32 0, i32 5
  %183 = getelementptr inbounds %struct.InteractionEventStr, ptr %182, i32 0, i32 0
  %184 = load i32, ptr %183, align 8, !tbaa !39
  %185 = load ptr, ptr %8, align 8, !tbaa !5
  %186 = getelementptr inbounds %struct.AtomStr, ptr %185, i32 0, i32 1
  %187 = load ptr, ptr %186, align 8, !tbaa !30
  %188 = getelementptr inbounds %struct.DynamicStr, ptr %187, i32 0, i32 5
  %189 = getelementptr inbounds %struct.InteractionEventStr, ptr %188, i32 0, i32 0
  store i32 %184, ptr %189, align 8, !tbaa !39
  %190 = load ptr, ptr %8, align 8, !tbaa !5
  %191 = load ptr, ptr %4, align 8, !tbaa !5
  call void @CGSurfaceEvent(ptr noundef %190, ptr noundef %191)
  %192 = load ptr, ptr %8, align 8, !tbaa !5
  %193 = getelementptr inbounds %struct.AtomStr, ptr %192, i32 0, i32 1
  %194 = load ptr, ptr %193, align 8, !tbaa !30
  %195 = getelementptr inbounds %struct.DynamicStr, ptr %194, i32 0, i32 5
  %196 = getelementptr inbounds %struct.InteractionEventStr, ptr %195, i32 0, i32 1
  %197 = load i64, ptr %196, align 8, !tbaa !40
  %198 = add nsw i64 %197, 1
  store i64 %198, ptr %196, align 8, !tbaa !40
  br label %199

199:                                              ; preds = %134
  %200 = load i32, ptr %14, align 4, !tbaa !9
  %201 = add nsw i32 %200, 1
  store i32 %201, ptr %14, align 4, !tbaa !9
  br label %126, !llvm.loop !41

202:                                              ; preds = %133
  store i32 1, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  ret void
}

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

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 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 #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 }
attributes #5 = { 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, !6, i64 352}
!12 = !{!"AtomListStr", !10, i64 0, !7, i64 4, !7, i64 112, !7, i64 220, !13, i64 328, !6, i64 336, !6, i64 344, !6, i64 352}
!13 = !{!"double", !7, i64 0}
!14 = !{!15, !6, i64 0}
!15 = !{!"AtomStr", !6, i64 0, !6, i64 8}
!16 = !{!17, !10, i64 108}
!17 = !{!"PropertyStr", !7, i64 0, !7, i64 8, !7, i64 40, !10, i64 48, !10, i64 52, !10, i64 56, !13, i64 64, !13, i64 72, !7, i64 80, !18, i64 104, !6, i64 120, !6, i64 128}
!18 = !{!"AtomSeqStr", !10, i64 0, !10, i64 4, !10, i64 8}
!19 = !{!20, !10, i64 12}
!20 = !{!"PepStr", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !13, i64 16}
!21 = !{!17, !10, i64 112}
!22 = !{!23, !6, i64 48}
!23 = !{!"CGGovStr", !7, i64 0, !10, i64 32, !10, i64 36, !6, i64 40, !6, i64 48}
!24 = !{!25, !10, i64 0}
!25 = !{!"CGStr", !10, i64 0, !10, i64 4, !10, i64 8}
!26 = !{!25, !10, i64 4}
!27 = distinct !{!27, !28}
!28 = !{!"llvm.loop.mustprogress"}
!29 = distinct !{!29, !28}
!30 = !{!15, !6, i64 8}
!31 = !{!32, !13, i64 160}
!32 = !{!"DynamicStr", !7, i64 0, !7, i64 16, !7, i64 48, !33, i64 80, !34, i64 96, !35, i64 128}
!33 = !{!"HBStr", !10, i64 0, !10, i64 4, !7, i64 8, !10, i64 12}
!34 = !{!"HBNeighborStr", !7, i64 0, !10, i64 20, !10, i64 24}
!35 = !{!"InteractionEventStr", !10, i64 0, !36, i64 8, !36, i64 16, !13, i64 24, !13, i64 32, !10, i64 40, !10, i64 44}
!36 = !{!"long", !7, i64 0}
!37 = !{!32, !10, i64 172}
!38 = !{!32, !10, i64 168}
!39 = !{!32, !10, i64 128}
!40 = !{!32, !36, i64 136}
!41 = distinct !{!41, !28}


; 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.CGGovStr = type { [2 x [16 x i8]], i32, i32, ptr, ptr }
%struct.PepStr = type { i32, i32, i32, i32, double }
%struct.CGStr = type { i32, i32, i32 }

@CG = external local_unnamed_addr global %struct.CGGovStr, align 8
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@protein = external local_unnamed_addr global ptr, align 8

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

; Function Attrs: nounwind uwtable
declare dso_local void @CGSurfaceEvent(ptr noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
define dso_local void @CGResidueRenew(ptr noundef %0, ptr noundef %1) local_unnamed_addr #1 {
  %3 = getelementptr inbounds i8, ptr %1, i64 352
  %4 = load ptr, ptr %3, align 8, !tbaa !5
  %5 = getelementptr inbounds i8, ptr %0, i64 4
  %6 = load i32, ptr %5, align 4, !tbaa !12
  %7 = sext i32 %6 to i64
  %8 = getelementptr inbounds ptr, ptr %4, i64 %7
  %9 = load ptr, ptr %8, align 8, !tbaa !13
  %10 = load i32, ptr %0, align 4, !tbaa !12
  %11 = add nsw i32 %10, 1
  %.not55 = icmp slt i32 %10, 1
  br i1 %.not55, label %.preheader, label %.lr.ph59

.preheader.loopexit:                              ; preds = %55
  %.pre71 = add nsw i32 %56, 1
  br label %.preheader

.preheader:                                       ; preds = %.preheader.loopexit, %2
  %.061.pre-phi = phi i32 [ %.pre71, %.preheader.loopexit ], [ %11, %2 ]
  %.lcssa = phi i32 [ %56, %.preheader.loopexit ], [ %10, %2 ]
  %12 = sext i32 %.061.pre-phi to i64
  %13 = getelementptr inbounds i32, ptr %0, i64 %12
  %14 = load i32, ptr %13, align 4, !tbaa !12
  %.not4862 = icmp eq i32 %14, 0
  br i1 %.not4862, label %._crit_edge65, label %.lr.ph64

.lr.ph64:                                         ; preds = %.preheader
  %15 = getelementptr inbounds i8, ptr %9, i64 8
  %16 = sext i32 %.lcssa to i64
  %17 = add nsw i64 %16, 1
  br label %58

.lr.ph59:                                         ; preds = %2, %55
  %18 = phi i32 [ %56, %55 ], [ %10, %2 ]
  %indvars.iv = phi i64 [ %indvars.iv.next, %55 ], [ 1, %2 ]
  %.04457 = phi i32 [ %.3, %55 ], [ %11, %2 ]
  %19 = load ptr, ptr %3, align 8, !tbaa !5
  %20 = getelementptr inbounds i32, ptr %0, i64 %indvars.iv
  %21 = load i32, ptr %20, align 4, !tbaa !12
  %22 = sext i32 %21 to i64
  %23 = getelementptr inbounds ptr, ptr %19, i64 %22
  %24 = load ptr, ptr %23, align 8, !tbaa !13
  %25 = load ptr, ptr %24, align 8, !tbaa !14
  %26 = getelementptr inbounds i8, ptr %25, i64 8
  %27 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %26, ptr noundef nonnull dereferenceable(1) @.str.2) #3
  %.not49 = icmp eq i32 %27, 0
  br i1 %.not49, label %28, label %55

28:                                               ; preds = %.lr.ph59
  %29 = load ptr, ptr @protein, align 8, !tbaa !13
  %30 = getelementptr inbounds i8, ptr %25, i64 108
  %31 = load i32, ptr %30, align 4, !tbaa !16
  %32 = sext i32 %31 to i64
  %33 = getelementptr %struct.PepStr, ptr %29, i64 %32
  %34 = getelementptr i8, ptr %33, i64 -12
  %35 = load i32, ptr %34, align 4, !tbaa !19
  %36 = getelementptr inbounds i8, ptr %25, i64 112
  %37 = load i32, ptr %36, align 8, !tbaa !21
  %38 = add nsw i32 %37, %35
  %39 = load ptr, ptr getelementptr inbounds (i8, ptr @CG, i64 48), align 8, !tbaa !22
  %40 = sext i32 %38 to i64
  %41 = getelementptr inbounds %struct.CGStr, ptr %39, i64 %40
  %42 = load i32, ptr %41, align 4, !tbaa !24
  %43 = getelementptr inbounds i8, ptr %41, i64 4
  %44 = load i32, ptr %43, align 4, !tbaa !26
  %.not5052 = icmp sgt i32 %42, %44
  br i1 %.not5052, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %53, %28
  %.1.lcssa = phi i32 [ %.04457, %28 ], [ %.2, %53 ]
  %45 = sext i32 %.1.lcssa to i64
  %46 = getelementptr inbounds i32, ptr %0, i64 %45
  store i32 0, ptr %46, align 4, !tbaa !12
  %.pre = load i32, ptr %0, align 4, !tbaa !12
  br label %55

.lr.ph:                                           ; preds = %28, %53
  %.04354 = phi i32 [ %54, %53 ], [ %42, %28 ]
  %.153 = phi i32 [ %.2, %53 ], [ %.04457, %28 ]
  %47 = load i32, ptr %0, align 4, !tbaa !12
  %48 = tail call i32 @FindElemInList(ptr noundef nonnull %0, i32 noundef %.04354, i32 noundef 1, i32 noundef %47, i32 noundef 0) #4
  %.not51 = icmp eq i32 %48, 0
  br i1 %.not51, label %49, label %53

49:                                               ; preds = %.lr.ph
  %50 = add nsw i32 %.153, 1
  %51 = sext i32 %.153 to i64
  %52 = getelementptr inbounds i32, ptr %0, i64 %51
  store i32 %.04354, ptr %52, align 4, !tbaa !12
  br label %53

53:                                               ; preds = %.lr.ph, %49
  %.2 = phi i32 [ %.153, %.lr.ph ], [ %50, %49 ]
  %54 = add i32 %.04354, 1
  %exitcond.not = icmp eq i32 %.04354, %44
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !27

55:                                               ; preds = %.lr.ph59, %._crit_edge
  %56 = phi i32 [ %18, %.lr.ph59 ], [ %.pre, %._crit_edge ]
  %.3 = phi i32 [ %.04457, %.lr.ph59 ], [ %.1.lcssa, %._crit_edge ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %57 = sext i32 %56 to i64
  %.not.not = icmp slt i64 %indvars.iv, %57
  br i1 %.not.not, label %.lr.ph59, label %.preheader.loopexit, !llvm.loop !29

._crit_edge65:                                    ; preds = %58, %.preheader
  ret void

58:                                               ; preds = %.lr.ph64, %58
  %indvars.iv68 = phi i64 [ %17, %.lr.ph64 ], [ %indvars.iv.next69, %58 ]
  %59 = phi i32 [ %14, %.lr.ph64 ], [ %81, %58 ]
  %60 = load ptr, ptr %3, align 8, !tbaa !5
  %61 = sext i32 %59 to i64
  %62 = getelementptr inbounds ptr, ptr %60, i64 %61
  %63 = load ptr, ptr %62, align 8, !tbaa !13
  %64 = load ptr, ptr %15, align 8, !tbaa !30
  %65 = getelementptr inbounds i8, ptr %64, i64 160
  %66 = load double, ptr %65, align 8, !tbaa !31
  %67 = getelementptr inbounds i8, ptr %63, i64 8
  %68 = load ptr, ptr %67, align 8, !tbaa !30
  %69 = getelementptr inbounds i8, ptr %68, i64 160
  store double %66, ptr %69, align 8, !tbaa !31
  %70 = getelementptr inbounds i8, ptr %64, i64 168
  %71 = getelementptr inbounds i8, ptr %68, i64 168
  %72 = load <2 x i32>, ptr %70, align 8, !tbaa !12
  store <2 x i32> %72, ptr %71, align 8, !tbaa !12
  %73 = getelementptr inbounds i8, ptr %64, i64 128
  %74 = load i32, ptr %73, align 8, !tbaa !37
  %75 = getelementptr inbounds i8, ptr %68, i64 128
  store i32 %74, ptr %75, align 8, !tbaa !37
  tail call void @CGSurfaceEvent(ptr noundef %63, ptr noundef %1)
  %76 = load ptr, ptr %67, align 8, !tbaa !30
  %77 = getelementptr inbounds i8, ptr %76, i64 136
  %78 = load i64, ptr %77, align 8, !tbaa !38
  %79 = add nsw i64 %78, 1
  store i64 %79, ptr %77, align 8, !tbaa !38
  %indvars.iv.next69 = add nsw i64 %indvars.iv68, 1
  %80 = getelementptr inbounds i32, ptr %0, i64 %indvars.iv.next69
  %81 = load i32, ptr %80, align 4, !tbaa !12
  %.not48 = icmp eq i32 %81, 0
  br i1 %.not48, label %._crit_edge65, label %58, !llvm.loop !39
}

declare i32 @FindElemInList(ptr noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #2

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 = { 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 #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 = { nounwind willreturn memory(read) }
attributes #4 = { 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, !11, i64 352}
!6 = !{!"AtomListStr", !7, i64 0, !8, i64 4, !8, i64 112, !8, i64 220, !10, i64 328, !11, i64 336, !11, i64 344, !11, i64 352}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"double", !8, i64 0}
!11 = !{!"any pointer", !8, i64 0}
!12 = !{!7, !7, i64 0}
!13 = !{!11, !11, i64 0}
!14 = !{!15, !11, i64 0}
!15 = !{!"AtomStr", !11, i64 0, !11, i64 8}
!16 = !{!17, !7, i64 108}
!17 = !{!"PropertyStr", !8, i64 0, !8, i64 8, !8, i64 40, !7, i64 48, !7, i64 52, !7, i64 56, !10, i64 64, !10, i64 72, !8, i64 80, !18, i64 104, !11, i64 120, !11, i64 128}
!18 = !{!"AtomSeqStr", !7, i64 0, !7, i64 4, !7, i64 8}
!19 = !{!20, !7, i64 12}
!20 = !{!"PepStr", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !10, i64 16}
!21 = !{!17, !7, i64 112}
!22 = !{!23, !11, i64 48}
!23 = !{!"CGGovStr", !8, i64 0, !7, i64 32, !7, i64 36, !11, i64 40, !11, i64 48}
!24 = !{!25, !7, i64 0}
!25 = !{!"CGStr", !7, i64 0, !7, i64 4, !7, i64 8}
!26 = !{!25, !7, i64 4}
!27 = distinct !{!27, !28}
!28 = !{!"llvm.loop.mustprogress"}
!29 = distinct !{!29, !28}
!30 = !{!15, !11, i64 8}
!31 = !{!32, !10, i64 160}
!32 = !{!"DynamicStr", !8, i64 0, !8, i64 16, !8, i64 48, !33, i64 80, !34, i64 96, !35, i64 128}
!33 = !{!"HBStr", !7, i64 0, !7, i64 4, !8, i64 8, !7, i64 12}
!34 = !{!"HBNeighborStr", !8, i64 0, !7, i64 20, !7, i64 24}
!35 = !{!"InteractionEventStr", !7, i64 0, !36, i64 8, !36, i64 16, !10, i64 24, !10, i64 32, !7, i64 40, !7, i64 44}
!36 = !{!"long", !8, i64 0}
!37 = !{!32, !7, i64 128}
!38 = !{!32, !36, i64 136}
!39 = distinct !{!39, !28}


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