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

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

; Function Attrs: nounwind uwtable
define dso_local i32 @CheckDuplication(ptr noundef %0, ptr noundef %1, i32 noundef %2) #0 {
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store i32 %2, ptr %7, align 4, !tbaa !9
  %8 = load ptr, ptr %6, align 8, !tbaa !5
  %9 = getelementptr inbounds %struct.AtomStr, ptr %8, i32 0, i32 1
  %10 = load ptr, ptr %9, align 8, !tbaa !11
  %11 = getelementptr inbounds %struct.DynamicStr, ptr %10, i32 0, i32 5
  %12 = getelementptr inbounds %struct.InteractionEventStr, ptr %11, i32 0, i32 0
  %13 = load i32, ptr %12, align 8, !tbaa !13
  %14 = load ptr, ptr %5, align 8, !tbaa !5
  %15 = getelementptr inbounds %struct.AtomStr, ptr %14, i32 0, i32 0
  %16 = load ptr, ptr %15, align 8, !tbaa !20
  %17 = getelementptr inbounds %struct.PropertyStr, ptr %16, i32 0, i32 3
  %18 = load i32, ptr %17, align 8, !tbaa !21
  %19 = icmp eq i32 %13, %18
  br i1 %19, label %20, label %118

20:                                               ; preds = %3
  %21 = load ptr, ptr %6, align 8, !tbaa !5
  %22 = getelementptr inbounds %struct.AtomStr, ptr %21, i32 0, i32 1
  %23 = load ptr, ptr %22, align 8, !tbaa !11
  %24 = getelementptr inbounds %struct.DynamicStr, ptr %23, i32 0, i32 5
  %25 = getelementptr inbounds %struct.InteractionEventStr, ptr %24, i32 0, i32 5
  %26 = load i32, ptr %25, align 8, !tbaa !24
  %27 = load i32, ptr %7, align 4, !tbaa !9
  %28 = icmp eq i32 %26, %27
  br i1 %28, label %29, label %118

29:                                               ; preds = %20
  %30 = load ptr, ptr %6, align 8, !tbaa !5
  %31 = getelementptr inbounds %struct.AtomStr, ptr %30, i32 0, i32 1
  %32 = load ptr, ptr %31, align 8, !tbaa !11
  %33 = getelementptr inbounds %struct.DynamicStr, ptr %32, i32 0, i32 5
  %34 = getelementptr inbounds %struct.InteractionEventStr, ptr %33, i32 0, i32 2
  %35 = load i64, ptr %34, align 8, !tbaa !25
  %36 = load ptr, ptr %5, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct.AtomStr, ptr %36, i32 0, i32 1
  %38 = load ptr, ptr %37, align 8, !tbaa !11
  %39 = getelementptr inbounds %struct.DynamicStr, ptr %38, i32 0, i32 5
  %40 = getelementptr inbounds %struct.InteractionEventStr, ptr %39, i32 0, i32 1
  %41 = load i64, ptr %40, align 8, !tbaa !26
  %42 = icmp eq i64 %35, %41
  br i1 %42, label %43, label %118

43:                                               ; preds = %29
  %44 = load ptr, ptr %5, align 8, !tbaa !5
  %45 = getelementptr inbounds %struct.AtomStr, ptr %44, i32 0, i32 1
  %46 = load ptr, ptr %45, align 8, !tbaa !11
  %47 = getelementptr inbounds %struct.DynamicStr, ptr %46, i32 0, i32 5
  %48 = getelementptr inbounds %struct.InteractionEventStr, ptr %47, i32 0, i32 3
  %49 = load double, ptr %48, align 8, !tbaa !27
  %50 = load ptr, ptr %6, align 8, !tbaa !5
  %51 = getelementptr inbounds %struct.AtomStr, ptr %50, i32 0, i32 1
  %52 = load ptr, ptr %51, align 8, !tbaa !11
  %53 = getelementptr inbounds %struct.DynamicStr, ptr %52, i32 0, i32 5
  %54 = getelementptr inbounds %struct.InteractionEventStr, ptr %53, i32 0, i32 3
  %55 = load double, ptr %54, align 8, !tbaa !27
  %56 = fcmp ogt double %49, %55
  br i1 %56, label %57, label %118

57:                                               ; preds = %43
  %58 = load ptr, ptr %6, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct.AtomStr, ptr %58, i32 0, i32 0
  %60 = load ptr, ptr %59, align 8, !tbaa !20
  %61 = getelementptr inbounds %struct.PropertyStr, ptr %60, i32 0, i32 3
  %62 = load i32, ptr %61, align 8, !tbaa !21
  %63 = load ptr, ptr %5, align 8, !tbaa !5
  %64 = getelementptr inbounds %struct.AtomStr, ptr %63, i32 0, i32 1
  %65 = load ptr, ptr %64, align 8, !tbaa !11
  %66 = getelementptr inbounds %struct.DynamicStr, ptr %65, i32 0, i32 5
  %67 = getelementptr inbounds %struct.InteractionEventStr, ptr %66, i32 0, i32 0
  store i32 %62, ptr %67, align 8, !tbaa !13
  %68 = load ptr, ptr %6, align 8, !tbaa !5
  %69 = getelementptr inbounds %struct.AtomStr, ptr %68, i32 0, i32 1
  %70 = load ptr, ptr %69, align 8, !tbaa !11
  %71 = getelementptr inbounds %struct.DynamicStr, ptr %70, i32 0, i32 5
  %72 = getelementptr inbounds %struct.InteractionEventStr, ptr %71, i32 0, i32 4
  %73 = load double, ptr %72, align 8, !tbaa !28
  %74 = load ptr, ptr %5, align 8, !tbaa !5
  %75 = getelementptr inbounds %struct.AtomStr, ptr %74, i32 0, i32 1
  %76 = load ptr, ptr %75, align 8, !tbaa !11
  %77 = getelementptr inbounds %struct.DynamicStr, ptr %76, i32 0, i32 5
  %78 = getelementptr inbounds %struct.InteractionEventStr, ptr %77, i32 0, i32 4
  store double %73, ptr %78, align 8, !tbaa !28
  %79 = load ptr, ptr %6, align 8, !tbaa !5
  %80 = getelementptr inbounds %struct.AtomStr, ptr %79, i32 0, i32 1
  %81 = load ptr, ptr %80, align 8, !tbaa !11
  %82 = getelementptr inbounds %struct.DynamicStr, ptr %81, i32 0, i32 5
  %83 = getelementptr inbounds %struct.InteractionEventStr, ptr %82, i32 0, i32 6
  %84 = load i32, ptr %83, align 4, !tbaa !29
  %85 = load ptr, ptr %5, align 8, !tbaa !5
  %86 = getelementptr inbounds %struct.AtomStr, ptr %85, i32 0, i32 1
  %87 = load ptr, ptr %86, align 8, !tbaa !11
  %88 = getelementptr inbounds %struct.DynamicStr, ptr %87, i32 0, i32 5
  %89 = getelementptr inbounds %struct.InteractionEventStr, ptr %88, i32 0, i32 6
  store i32 %84, ptr %89, align 4, !tbaa !29
  %90 = load ptr, ptr %6, align 8, !tbaa !5
  %91 = getelementptr inbounds %struct.AtomStr, ptr %90, i32 0, i32 1
  %92 = load ptr, ptr %91, align 8, !tbaa !11
  %93 = getelementptr inbounds %struct.DynamicStr, ptr %92, i32 0, i32 5
  %94 = getelementptr inbounds %struct.InteractionEventStr, ptr %93, i32 0, i32 3
  %95 = load double, ptr %94, align 8, !tbaa !27
  %96 = load ptr, ptr %5, align 8, !tbaa !5
  %97 = getelementptr inbounds %struct.AtomStr, ptr %96, i32 0, i32 1
  %98 = load ptr, ptr %97, align 8, !tbaa !11
  %99 = getelementptr inbounds %struct.DynamicStr, ptr %98, i32 0, i32 5
  %100 = getelementptr inbounds %struct.InteractionEventStr, ptr %99, i32 0, i32 3
  store double %95, ptr %100, align 8, !tbaa !27
  %101 = load i32, ptr %7, align 4, !tbaa !9
  %102 = load ptr, ptr %5, align 8, !tbaa !5
  %103 = getelementptr inbounds %struct.AtomStr, ptr %102, i32 0, i32 1
  %104 = load ptr, ptr %103, align 8, !tbaa !11
  %105 = getelementptr inbounds %struct.DynamicStr, ptr %104, i32 0, i32 5
  %106 = getelementptr inbounds %struct.InteractionEventStr, ptr %105, i32 0, i32 5
  store i32 %101, ptr %106, align 8, !tbaa !24
  %107 = load ptr, ptr %6, align 8, !tbaa !5
  %108 = getelementptr inbounds %struct.AtomStr, ptr %107, i32 0, i32 1
  %109 = load ptr, ptr %108, align 8, !tbaa !11
  %110 = getelementptr inbounds %struct.DynamicStr, ptr %109, i32 0, i32 5
  %111 = getelementptr inbounds %struct.InteractionEventStr, ptr %110, i32 0, i32 1
  %112 = load i64, ptr %111, align 8, !tbaa !26
  %113 = load ptr, ptr %5, align 8, !tbaa !5
  %114 = getelementptr inbounds %struct.AtomStr, ptr %113, i32 0, i32 1
  %115 = load ptr, ptr %114, align 8, !tbaa !11
  %116 = getelementptr inbounds %struct.DynamicStr, ptr %115, i32 0, i32 5
  %117 = getelementptr inbounds %struct.InteractionEventStr, ptr %116, i32 0, i32 2
  store i64 %112, ptr %117, align 8, !tbaa !25
  store i32 1, ptr %4, align 4
  br label %119

118:                                              ; preds = %43, %29, %20, %3
  store i32 0, ptr %4, align 4
  br label %119

119:                                              ; preds = %118, %57
  %120 = load i32, ptr %4, align 4
  ret i32 %120
}

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" }

!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 8}
!12 = !{!"AtomStr", !6, i64 0, !6, i64 8}
!13 = !{!14, !10, i64 128}
!14 = !{!"DynamicStr", !7, i64 0, !7, i64 16, !7, i64 48, !15, i64 80, !16, i64 96, !17, i64 128}
!15 = !{!"HBStr", !10, i64 0, !10, i64 4, !7, i64 8, !10, i64 12}
!16 = !{!"HBNeighborStr", !7, i64 0, !10, i64 20, !10, i64 24}
!17 = !{!"InteractionEventStr", !10, i64 0, !18, i64 8, !18, i64 16, !19, i64 24, !19, i64 32, !10, i64 40, !10, i64 44}
!18 = !{!"long", !7, i64 0}
!19 = !{!"double", !7, i64 0}
!20 = !{!12, !6, i64 0}
!21 = !{!22, !10, i64 48}
!22 = !{!"PropertyStr", !7, i64 0, !7, i64 8, !7, i64 40, !10, i64 48, !10, i64 52, !10, i64 56, !19, i64 64, !19, i64 72, !7, i64 80, !23, i64 104, !6, i64 120, !6, i64 128}
!23 = !{!"AtomSeqStr", !10, i64 0, !10, i64 4, !10, i64 8}
!24 = !{!14, !10, i64 168}
!25 = !{!14, !18, i64 144}
!26 = !{!14, !18, i64 136}
!27 = !{!14, !19, i64 152}
!28 = !{!14, !19, i64 160}
!29 = !{!14, !10, i64 172}


; 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"

; Function Attrs: mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, inaccessiblemem: none) uwtable
define dso_local range(i32 0, 2) i32 @CheckDuplication(ptr nocapture noundef readonly %0, ptr nocapture noundef readonly %1, i32 noundef %2) local_unnamed_addr #0 {
  %4 = getelementptr inbounds i8, ptr %1, i64 8
  %5 = load ptr, ptr %4, align 8, !tbaa !5
  %6 = getelementptr inbounds i8, ptr %5, i64 128
  %7 = load i32, ptr %6, align 8, !tbaa !10
  %8 = load ptr, ptr %0, align 8, !tbaa !18
  %9 = getelementptr inbounds i8, ptr %8, i64 48
  %10 = load i32, ptr %9, align 8, !tbaa !19
  %11 = icmp eq i32 %7, %10
  br i1 %11, label %12, label %45

12:                                               ; preds = %3
  %13 = getelementptr inbounds i8, ptr %5, i64 168
  %14 = load i32, ptr %13, align 8, !tbaa !22
  %15 = icmp eq i32 %14, %2
  br i1 %15, label %16, label %45

16:                                               ; preds = %12
  %17 = getelementptr inbounds i8, ptr %5, i64 144
  %18 = load i64, ptr %17, align 8, !tbaa !23
  %19 = getelementptr inbounds i8, ptr %0, i64 8
  %20 = load ptr, ptr %19, align 8, !tbaa !5
  %21 = getelementptr inbounds i8, ptr %20, i64 128
  %22 = getelementptr inbounds i8, ptr %20, i64 136
  %23 = load i64, ptr %22, align 8, !tbaa !24
  %24 = icmp eq i64 %18, %23
  br i1 %24, label %25, label %45

25:                                               ; preds = %16
  %26 = getelementptr inbounds i8, ptr %20, i64 152
  %27 = load double, ptr %26, align 8, !tbaa !25
  %28 = getelementptr inbounds i8, ptr %5, i64 152
  %29 = load double, ptr %28, align 8, !tbaa !25
  %30 = fcmp ogt double %27, %29
  br i1 %30, label %31, label %45

31:                                               ; preds = %25
  %32 = load ptr, ptr %1, align 8, !tbaa !18
  %33 = getelementptr inbounds i8, ptr %32, i64 48
  %34 = load i32, ptr %33, align 8, !tbaa !19
  store i32 %34, ptr %21, align 8, !tbaa !10
  %35 = getelementptr inbounds i8, ptr %5, i64 160
  %36 = load double, ptr %35, align 8, !tbaa !26
  %37 = getelementptr inbounds i8, ptr %20, i64 160
  store double %36, ptr %37, align 8, !tbaa !26
  %38 = getelementptr inbounds i8, ptr %5, i64 172
  %39 = load i32, ptr %38, align 4, !tbaa !27
  %40 = getelementptr inbounds i8, ptr %20, i64 172
  store i32 %39, ptr %40, align 4, !tbaa !27
  store double %29, ptr %26, align 8, !tbaa !25
  %41 = getelementptr inbounds i8, ptr %20, i64 168
  store i32 %2, ptr %41, align 8, !tbaa !22
  %42 = getelementptr inbounds i8, ptr %5, i64 136
  %43 = load i64, ptr %42, align 8, !tbaa !24
  %44 = getelementptr inbounds i8, ptr %20, i64 144
  store i64 %43, ptr %44, align 8, !tbaa !23
  br label %45

45:                                               ; preds = %3, %12, %16, %25, %31
  %.0 = phi i32 [ 1, %31 ], [ 0, %25 ], [ 0, %16 ], [ 0, %12 ], [ 0, %3 ]
  ret i32 %.0
}

attributes #0 = { mustprogress nofree norecurse nosync nounwind willreturn memory(readwrite, inaccessiblemem: none) 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" }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !7, i64 8}
!6 = !{!"AtomStr", !7, i64 0, !7, i64 8}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!11, !13, i64 128}
!11 = !{!"DynamicStr", !8, i64 0, !8, i64 16, !8, i64 48, !12, i64 80, !14, i64 96, !15, i64 128}
!12 = !{!"HBStr", !13, i64 0, !13, i64 4, !8, i64 8, !13, i64 12}
!13 = !{!"int", !8, i64 0}
!14 = !{!"HBNeighborStr", !8, i64 0, !13, i64 20, !13, i64 24}
!15 = !{!"InteractionEventStr", !13, i64 0, !16, i64 8, !16, i64 16, !17, i64 24, !17, i64 32, !13, i64 40, !13, i64 44}
!16 = !{!"long", !8, i64 0}
!17 = !{!"double", !8, i64 0}
!18 = !{!6, !7, i64 0}
!19 = !{!20, !13, i64 48}
!20 = !{!"PropertyStr", !8, i64 0, !8, i64 8, !8, i64 40, !13, i64 48, !13, i64 52, !13, i64 56, !17, i64 64, !17, i64 72, !8, i64 80, !21, i64 104, !7, i64 120, !7, i64 128}
!21 = !{!"AtomSeqStr", !13, i64 0, !13, i64 4, !13, i64 8}
!22 = !{!11, !13, i64 168}
!23 = !{!11, !16, i64 144}
!24 = !{!11, !16, i64 136}
!25 = !{!11, !17, i64 152}
!26 = !{!11, !17, i64 160}
!27 = !{!11, !13, i64 172}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InstCombinePass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass