; 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.InteractionEventStr = type { i32, i64, i64, double, double, i32, i32 }
%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.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 @JobAssign(ptr noundef %0, ptr noundef %1, ptr noundef %2, i32 noundef %3) #0 {
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  store ptr %0, ptr %6, align 8, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !5
  store ptr %2, ptr %8, align 8, !tbaa !5
  store i32 %3, ptr %9, align 4, !tbaa !9
  %10 = load ptr, ptr %8, align 8, !tbaa !5
  %11 = getelementptr inbounds %struct.InteractionEventStr, ptr %10, i32 0, i32 3
  %12 = load double, ptr %11, align 8, !tbaa !11
  %13 = fcmp ogt double %12, 0.000000e+00
  br i1 %13, label %14, label %87

14:                                               ; preds = %4
  %15 = load ptr, ptr %6, align 8, !tbaa !5
  %16 = getelementptr inbounds %struct.AtomStr, ptr %15, i32 0, i32 1
  %17 = load ptr, ptr %16, align 8, !tbaa !15
  %18 = getelementptr inbounds %struct.DynamicStr, ptr %17, i32 0, i32 5
  %19 = getelementptr inbounds %struct.InteractionEventStr, ptr %18, i32 0, i32 3
  %20 = load double, ptr %19, align 8, !tbaa !17
  %21 = load ptr, ptr %8, align 8, !tbaa !5
  %22 = getelementptr inbounds %struct.InteractionEventStr, ptr %21, i32 0, i32 3
  %23 = load double, ptr %22, align 8, !tbaa !11
  %24 = fcmp ogt double %20, %23
  br i1 %24, label %25, label %87

25:                                               ; preds = %14
  %26 = load ptr, ptr %8, align 8, !tbaa !5
  %27 = getelementptr inbounds %struct.InteractionEventStr, ptr %26, i32 0, i32 4
  %28 = load double, ptr %27, align 8, !tbaa !21
  %29 = load ptr, ptr %6, align 8, !tbaa !5
  %30 = getelementptr inbounds %struct.AtomStr, ptr %29, i32 0, i32 1
  %31 = load ptr, ptr %30, align 8, !tbaa !15
  %32 = getelementptr inbounds %struct.DynamicStr, ptr %31, i32 0, i32 5
  %33 = getelementptr inbounds %struct.InteractionEventStr, ptr %32, i32 0, i32 4
  store double %28, ptr %33, align 8, !tbaa !22
  %34 = load ptr, ptr %8, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct.InteractionEventStr, ptr %34, i32 0, i32 6
  %36 = load i32, ptr %35, align 4, !tbaa !23
  %37 = load ptr, ptr %6, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct.AtomStr, ptr %37, i32 0, i32 1
  %39 = load ptr, ptr %38, align 8, !tbaa !15
  %40 = getelementptr inbounds %struct.DynamicStr, ptr %39, i32 0, i32 5
  %41 = getelementptr inbounds %struct.InteractionEventStr, ptr %40, i32 0, i32 6
  store i32 %36, ptr %41, align 4, !tbaa !24
  %42 = load ptr, ptr %8, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct.InteractionEventStr, ptr %42, i32 0, i32 3
  %44 = load double, ptr %43, align 8, !tbaa !11
  %45 = load ptr, ptr %6, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct.AtomStr, ptr %45, i32 0, i32 1
  %47 = load ptr, ptr %46, align 8, !tbaa !15
  %48 = getelementptr inbounds %struct.DynamicStr, ptr %47, i32 0, i32 5
  %49 = getelementptr inbounds %struct.InteractionEventStr, ptr %48, i32 0, i32 3
  store double %44, ptr %49, align 8, !tbaa !17
  %50 = load i32, ptr %9, align 4, !tbaa !9
  %51 = load ptr, ptr %6, align 8, !tbaa !5
  %52 = getelementptr inbounds %struct.AtomStr, ptr %51, i32 0, i32 1
  %53 = load ptr, ptr %52, align 8, !tbaa !15
  %54 = getelementptr inbounds %struct.DynamicStr, ptr %53, i32 0, i32 5
  %55 = getelementptr inbounds %struct.InteractionEventStr, ptr %54, i32 0, i32 5
  store i32 %50, ptr %55, align 8, !tbaa !25
  %56 = load ptr, ptr %7, align 8, !tbaa !5
  %57 = icmp ne ptr %56, null
  br i1 %57, label %58, label %80

58:                                               ; preds = %25
  %59 = load ptr, ptr %7, align 8, !tbaa !5
  %60 = getelementptr inbounds %struct.AtomStr, ptr %59, i32 0, i32 0
  %61 = load ptr, ptr %60, align 8, !tbaa !26
  %62 = getelementptr inbounds %struct.PropertyStr, ptr %61, i32 0, i32 3
  %63 = load i32, ptr %62, align 8, !tbaa !27
  %64 = load ptr, ptr %6, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct.AtomStr, ptr %64, i32 0, i32 1
  %66 = load ptr, ptr %65, align 8, !tbaa !15
  %67 = getelementptr inbounds %struct.DynamicStr, ptr %66, i32 0, i32 5
  %68 = getelementptr inbounds %struct.InteractionEventStr, ptr %67, i32 0, i32 0
  store i32 %63, ptr %68, align 8, !tbaa !30
  %69 = load ptr, ptr %7, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct.AtomStr, ptr %69, i32 0, i32 1
  %71 = load ptr, ptr %70, align 8, !tbaa !15
  %72 = getelementptr inbounds %struct.DynamicStr, ptr %71, i32 0, i32 5
  %73 = getelementptr inbounds %struct.InteractionEventStr, ptr %72, i32 0, i32 1
  %74 = load i64, ptr %73, align 8, !tbaa !31
  %75 = load ptr, ptr %6, align 8, !tbaa !5
  %76 = getelementptr inbounds %struct.AtomStr, ptr %75, i32 0, i32 1
  %77 = load ptr, ptr %76, align 8, !tbaa !15
  %78 = getelementptr inbounds %struct.DynamicStr, ptr %77, i32 0, i32 5
  %79 = getelementptr inbounds %struct.InteractionEventStr, ptr %78, i32 0, i32 2
  store i64 %74, ptr %79, align 8, !tbaa !32
  br label %86

80:                                               ; preds = %25
  %81 = load ptr, ptr %6, align 8, !tbaa !5
  %82 = getelementptr inbounds %struct.AtomStr, ptr %81, i32 0, i32 1
  %83 = load ptr, ptr %82, align 8, !tbaa !15
  %84 = getelementptr inbounds %struct.DynamicStr, ptr %83, i32 0, i32 5
  %85 = getelementptr inbounds %struct.InteractionEventStr, ptr %84, i32 0, i32 0
  store i32 -111, ptr %85, align 8, !tbaa !30
  br label %86

86:                                               ; preds = %80, %58
  store i32 1, ptr %5, align 4
  br label %88

87:                                               ; preds = %14, %4
  store i32 0, ptr %5, align 4
  br label %88

88:                                               ; preds = %87, %86
  %89 = load i32, ptr %5, align 4
  ret i32 %89
}

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


; 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 @JobAssign(ptr nocapture noundef readonly %0, ptr noundef readonly %1, ptr nocapture noundef readonly %2, i32 noundef %3) local_unnamed_addr #0 {
  %5 = getelementptr inbounds i8, ptr %2, i64 24
  %6 = load double, ptr %5, align 8, !tbaa !5
  %7 = fcmp ogt double %6, 0.000000e+00
  br i1 %7, label %8, label %34

8:                                                ; preds = %4
  %9 = getelementptr inbounds i8, ptr %0, i64 8
  %10 = load ptr, ptr %9, align 8, !tbaa !12
  %11 = getelementptr inbounds i8, ptr %10, i64 152
  %12 = load double, ptr %11, align 8, !tbaa !15
  %13 = fcmp ogt double %12, %6
  br i1 %13, label %14, label %34

14:                                               ; preds = %8
  %15 = getelementptr inbounds i8, ptr %2, i64 32
  %16 = load double, ptr %15, align 8, !tbaa !19
  %17 = getelementptr inbounds i8, ptr %10, i64 160
  store double %16, ptr %17, align 8, !tbaa !20
  %18 = getelementptr inbounds i8, ptr %2, i64 44
  %19 = load i32, ptr %18, align 4, !tbaa !21
  %20 = getelementptr inbounds i8, ptr %10, i64 172
  store i32 %19, ptr %20, align 4, !tbaa !22
  store double %6, ptr %11, align 8, !tbaa !15
  %21 = getelementptr inbounds i8, ptr %10, i64 168
  store i32 %3, ptr %21, align 8, !tbaa !23
  %.not = icmp eq ptr %1, null
  br i1 %.not, label %32, label %22

22:                                               ; preds = %14
  %23 = load ptr, ptr %1, align 8, !tbaa !24
  %24 = getelementptr inbounds i8, ptr %23, i64 48
  %25 = load i32, ptr %24, align 8, !tbaa !25
  %26 = getelementptr inbounds i8, ptr %10, i64 128
  store i32 %25, ptr %26, align 8, !tbaa !28
  %27 = getelementptr inbounds i8, ptr %1, i64 8
  %28 = load ptr, ptr %27, align 8, !tbaa !12
  %29 = getelementptr inbounds i8, ptr %28, i64 136
  %30 = load i64, ptr %29, align 8, !tbaa !29
  %31 = getelementptr inbounds i8, ptr %10, i64 144
  store i64 %30, ptr %31, align 8, !tbaa !30
  br label %34

32:                                               ; preds = %14
  %33 = getelementptr inbounds i8, ptr %10, i64 128
  store i32 -111, ptr %33, align 8, !tbaa !28
  br label %34

34:                                               ; preds = %4, %8, %22, %32
  %.0 = phi i32 [ 1, %32 ], [ 1, %22 ], [ 0, %8 ], [ 0, %4 ]
  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, !11, i64 24}
!6 = !{!"InteractionEventStr", !7, i64 0, !10, i64 8, !10, i64 16, !11, i64 24, !11, i64 32, !7, i64 40, !7, i64 44}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"long", !8, i64 0}
!11 = !{!"double", !8, i64 0}
!12 = !{!13, !14, i64 8}
!13 = !{!"AtomStr", !14, i64 0, !14, i64 8}
!14 = !{!"any pointer", !8, i64 0}
!15 = !{!16, !11, i64 152}
!16 = !{!"DynamicStr", !8, i64 0, !8, i64 16, !8, i64 48, !17, i64 80, !18, i64 96, !6, i64 128}
!17 = !{!"HBStr", !7, i64 0, !7, i64 4, !8, i64 8, !7, i64 12}
!18 = !{!"HBNeighborStr", !8, i64 0, !7, i64 20, !7, i64 24}
!19 = !{!6, !11, i64 32}
!20 = !{!16, !11, i64 160}
!21 = !{!6, !7, i64 44}
!22 = !{!16, !7, i64 172}
!23 = !{!16, !7, i64 168}
!24 = !{!13, !14, i64 0}
!25 = !{!26, !7, i64 48}
!26 = !{!"PropertyStr", !8, i64 0, !8, i64 8, !8, i64 40, !7, i64 48, !7, i64 52, !7, i64 56, !11, i64 64, !11, i64 72, !8, i64 80, !27, i64 104, !14, i64 120, !14, i64 128}
!27 = !{!"AtomSeqStr", !7, i64 0, !7, i64 4, !7, i64 8}
!28 = !{!16, !7, i64 128}
!29 = !{!16, !10, i64 136}
!30 = !{!16, !10, i64 144}


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