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

; 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.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 }
%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 }

@chargeAA = external global [9 x i32], align 16
@flow = external global %struct.FlowStr, align 8
@thermostatType = external global [20 x i8], align 16
@.str.14 = external hidden unnamed_addr constant [9 x i8], align 1
@currenttime = external global double, align 8

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

; Function Attrs: nounwind uwtable
define dso_local void @ThermostatEvent(ptr noundef %0) #1 {
  %2 = alloca ptr, align 8
  %3 = alloca [4 x double], align 16
  %4 = alloca [4 x double], align 16
  %5 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 32, ptr %3) #7
  call void @llvm.lifetime.start.p0(i64 32, ptr %4) #7
  call void @llvm.memset.p0.i64(ptr align 16 %4, i8 0, i64 32, i1 false)
  %6 = load i32, ptr getelementptr inbounds ([9 x i32], ptr @chargeAA, i64 0, i64 8), align 16, !tbaa !9
  %7 = icmp ne i32 %6, 0
  br i1 %7, label %8, label %19

8:                                                ; preds = %1
  %9 = load i32, ptr @flow, align 8, !tbaa !11
  %10 = icmp eq i32 %9, 3
  br i1 %10, label %11, label %19

11:                                               ; preds = %8
  %12 = load ptr, ptr %2, align 8, !tbaa !5
  %13 = getelementptr inbounds %struct.AtomStr, ptr %12, i32 0, i32 0
  %14 = load ptr, ptr %13, align 8, !tbaa !16
  %15 = getelementptr inbounds %struct.PropertyStr, ptr %14, i32 0, i32 9
  %16 = getelementptr inbounds %struct.AtomSeqStr, ptr %15, i32 0, i32 1
  %17 = load i32, ptr %16, align 4, !tbaa !18
  %18 = getelementptr inbounds [4 x double], ptr %4, i64 0, i64 0
  call void @CalCOMV(i32 noundef %17, ptr noundef %18)
  br label %19

19:                                               ; preds = %11, %8, %1
  %20 = call i32 @strncmp(ptr noundef @thermostatType, ptr noundef @.str.14, i64 noundef 1) #8
  %21 = icmp eq i32 %20, 0
  br i1 %21, label %22, label %131

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

23:                                               ; preds = %90, %22
  %24 = load i32, ptr %5, align 4, !tbaa !9
  %25 = icmp sle i32 %24, 3
  br i1 %25, label %27, label %26

26:                                               ; preds = %23
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #7
  br label %93

27:                                               ; preds = %23
  br label %28

28:                                               ; preds = %88, %27
  %29 = load ptr, ptr %2, align 8, !tbaa !5
  %30 = getelementptr inbounds %struct.AtomStr, ptr %29, i32 0, i32 0
  %31 = load ptr, ptr %30, align 8, !tbaa !16
  %32 = getelementptr inbounds %struct.PropertyStr, ptr %31, i32 0, i32 7
  %33 = load double, ptr %32, align 8, !tbaa !22
  %34 = call double @RandomVelocity(double noundef %33)
  %35 = load i32, ptr %5, align 4, !tbaa !9
  %36 = sext i32 %35 to i64
  %37 = getelementptr inbounds [4 x double], ptr %3, i64 0, i64 %36
  store double %34, ptr %37, align 8, !tbaa !23
  %38 = load i32, ptr %5, align 4, !tbaa !9
  %39 = sext i32 %38 to i64
  %40 = getelementptr inbounds [4 x double], ptr getelementptr inbounds (%struct.FlowStr, ptr @flow, i32 0, i32 1), i64 0, i64 %39
  %41 = load double, ptr %40, align 8, !tbaa !23
  %42 = load i32, ptr %5, align 4, !tbaa !9
  %43 = sext i32 %42 to i64
  %44 = getelementptr inbounds [4 x double], ptr %4, i64 0, i64 %43
  %45 = load double, ptr %44, align 8, !tbaa !23
  %46 = fadd double %41, %45
  %47 = load ptr, ptr getelementptr inbounds (%struct.ForceStr, ptr getelementptr inbounds (%struct.FlowStr, ptr @flow, i32 0, i32 2), i32 0, i32 2), align 8, !tbaa !24
  %48 = load ptr, ptr %2, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct.AtomStr, ptr %48, i32 0, i32 0
  %50 = load ptr, ptr %49, align 8, !tbaa !16
  %51 = getelementptr inbounds %struct.PropertyStr, ptr %50, i32 0, i32 3
  %52 = load i32, ptr %51, align 8, !tbaa !25
  %53 = sext i32 %52 to i64
  %54 = getelementptr inbounds ptr, ptr %47, i64 %53
  %55 = load ptr, ptr %54, align 8, !tbaa !5
  %56 = load i32, ptr %5, align 4, !tbaa !9
  %57 = sext i32 %56 to i64
  %58 = getelementptr inbounds double, ptr %55, i64 %57
  %59 = load double, ptr %58, align 8, !tbaa !23
  %60 = load double, ptr @currenttime, align 8, !tbaa !23
  %61 = load ptr, ptr getelementptr inbounds (%struct.ForceStr, ptr getelementptr inbounds (%struct.FlowStr, ptr @flow, i32 0, i32 2), i32 0, i32 1), align 8, !tbaa !26
  %62 = load ptr, ptr %2, align 8, !tbaa !5
  %63 = getelementptr inbounds %struct.AtomStr, ptr %62, i32 0, i32 0
  %64 = load ptr, ptr %63, align 8, !tbaa !16
  %65 = getelementptr inbounds %struct.PropertyStr, ptr %64, i32 0, i32 3
  %66 = load i32, ptr %65, align 8, !tbaa !25
  %67 = sext i32 %66 to i64
  %68 = getelementptr inbounds double, ptr %61, i64 %67
  %69 = load double, ptr %68, align 8, !tbaa !23
  %70 = fsub double %60, %69
  %71 = call double @llvm.fmuladd.f64(double %59, double %70, double %46)
  %72 = load i32, ptr %5, align 4, !tbaa !9
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds [4 x double], ptr %3, i64 0, i64 %73
  %75 = load double, ptr %74, align 8, !tbaa !23
  %76 = fadd double %75, %71
  store double %76, ptr %74, align 8, !tbaa !23
  %77 = load i32, ptr %5, align 4, !tbaa !9
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds [4 x double], ptr %3, i64 0, i64 %78
  %80 = load double, ptr %79, align 8, !tbaa !23
  %81 = fcmp oeq double %80, 0.000000e+00
  %82 = xor i1 %81, true
  %83 = xor i1 %82, true
  %84 = zext i1 %83 to i32
  %85 = sext i32 %84 to i64
  %86 = call i64 @llvm.expect.i64(i64 %85, i64 0)
  %87 = icmp ne i64 %86, 0
  br i1 %87, label %88, label %89

88:                                               ; preds = %28
  br label %28

89:                                               ; preds = %28
  br label %90

90:                                               ; preds = %89
  %91 = load i32, ptr %5, align 4, !tbaa !9
  %92 = add nsw i32 %91, 1
  store i32 %92, ptr %5, align 4, !tbaa !9
  br label %23, !llvm.loop !27

93:                                               ; preds = %26
  %94 = getelementptr inbounds [4 x double], ptr %3, i64 0, i64 0
  %95 = load double, ptr %94, align 16, !tbaa !23
  %96 = load ptr, ptr %2, align 8, !tbaa !5
  %97 = getelementptr inbounds %struct.AtomStr, ptr %96, i32 0, i32 1
  %98 = load ptr, ptr %97, align 8, !tbaa !29
  %99 = getelementptr inbounds %struct.DynamicStr, ptr %98, i32 0, i32 2
  %100 = getelementptr inbounds [4 x double], ptr %99, i64 0, i64 0
  store double %95, ptr %100, align 8, !tbaa !23
  %101 = getelementptr inbounds [4 x double], ptr %3, i64 0, i64 1
  %102 = load double, ptr %101, align 8, !tbaa !23
  %103 = load ptr, ptr %2, align 8, !tbaa !5
  %104 = getelementptr inbounds %struct.AtomStr, ptr %103, i32 0, i32 1
  %105 = load ptr, ptr %104, align 8, !tbaa !29
  %106 = getelementptr inbounds %struct.DynamicStr, ptr %105, i32 0, i32 2
  %107 = getelementptr inbounds [4 x double], ptr %106, i64 0, i64 1
  store double %102, ptr %107, align 8, !tbaa !23
  %108 = getelementptr inbounds [4 x double], ptr %3, i64 0, i64 2
  %109 = load double, ptr %108, align 16, !tbaa !23
  %110 = load ptr, ptr %2, align 8, !tbaa !5
  %111 = getelementptr inbounds %struct.AtomStr, ptr %110, i32 0, i32 1
  %112 = load ptr, ptr %111, align 8, !tbaa !29
  %113 = getelementptr inbounds %struct.DynamicStr, ptr %112, i32 0, i32 2
  %114 = getelementptr inbounds [4 x double], ptr %113, i64 0, i64 2
  store double %109, ptr %114, align 8, !tbaa !23
  %115 = getelementptr inbounds [4 x double], ptr %3, i64 0, i64 3
  %116 = load double, ptr %115, align 8, !tbaa !23
  %117 = load ptr, ptr %2, align 8, !tbaa !5
  %118 = getelementptr inbounds %struct.AtomStr, ptr %117, i32 0, i32 1
  %119 = load ptr, ptr %118, align 8, !tbaa !29
  %120 = getelementptr inbounds %struct.DynamicStr, ptr %119, i32 0, i32 2
  %121 = getelementptr inbounds [4 x double], ptr %120, i64 0, i64 3
  store double %116, ptr %121, align 8, !tbaa !23
  %122 = load double, ptr @currenttime, align 8, !tbaa !23
  %123 = load ptr, ptr getelementptr inbounds (%struct.ForceStr, ptr getelementptr inbounds (%struct.FlowStr, ptr @flow, i32 0, i32 2), i32 0, i32 1), align 8, !tbaa !26
  %124 = load ptr, ptr %2, align 8, !tbaa !5
  %125 = getelementptr inbounds %struct.AtomStr, ptr %124, i32 0, i32 0
  %126 = load ptr, ptr %125, align 8, !tbaa !16
  %127 = getelementptr inbounds %struct.PropertyStr, ptr %126, i32 0, i32 3
  %128 = load i32, ptr %127, align 8, !tbaa !25
  %129 = sext i32 %128 to i64
  %130 = getelementptr inbounds double, ptr %123, i64 %129
  store double %122, ptr %130, align 8, !tbaa !23
  br label %131

131:                                              ; preds = %93, %19
  call void @llvm.lifetime.end.p0(i64 32, ptr %4) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %3) #7
  ret void
}

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

; Function Attrs: nounwind willreturn memory(read)
declare i32 @strncmp(ptr noundef, ptr noundef, i64 noundef) #2

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(none)
declare i64 @llvm.expect.i64(i64, i64) #3

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4

declare void @CalCOMV(i32 noundef, ptr noundef) #5

declare double @RandomVelocity(double noundef) #5

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #6

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { 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 #3 = { nocallback nofree nosync nounwind willreturn memory(none) }
attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { "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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #7 = { nounwind }
attributes #8 = { 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 0}
!12 = !{!"FlowStr", !10, i64 0, !13, i64 8, !14, i64 40, !15, i64 88}
!13 = !{!"ConstVStr", !7, i64 0}
!14 = !{!"ForceStr", !7, i64 0, !6, i64 32, !6, i64 40}
!15 = !{!"ChargeStr", !10, i64 0, !10, i64 4, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32}
!16 = !{!17, !6, i64 0}
!17 = !{!"AtomStr", !6, i64 0, !6, i64 8}
!18 = !{!19, !10, i64 108}
!19 = !{!"PropertyStr", !7, i64 0, !7, i64 8, !7, i64 40, !10, i64 48, !10, i64 52, !10, i64 56, !20, i64 64, !20, i64 72, !7, i64 80, !21, i64 104, !6, i64 120, !6, i64 128}
!20 = !{!"double", !7, i64 0}
!21 = !{!"AtomSeqStr", !10, i64 0, !10, i64 4, !10, i64 8}
!22 = !{!19, !20, i64 72}
!23 = !{!20, !20, i64 0}
!24 = !{!12, !6, i64 80}
!25 = !{!19, !10, i64 48}
!26 = !{!12, !6, i64 72}
!27 = distinct !{!27, !28}
!28 = !{!"llvm.loop.mustprogress"}
!29 = !{!17, !6, i64 8}


; 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.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 }

@chargeAA = external local_unnamed_addr global [9 x i32], align 16
@flow = external local_unnamed_addr global %struct.FlowStr, align 8
@thermostatType = external local_unnamed_addr global [20 x i8], align 16
@.str.14 = external hidden unnamed_addr constant [9 x i8], align 1
@currenttime = external local_unnamed_addr global double, align 8

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

; Function Attrs: nounwind uwtable
define dso_local void @ThermostatEvent(ptr nocapture noundef readonly %0) local_unnamed_addr #1 {
  %2 = alloca [4 x double], align 16
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %2) #5
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(32) %2, i8 0, i64 32, i1 false)
  %3 = load i32, ptr getelementptr inbounds (i8, ptr @chargeAA, i64 32), align 16, !tbaa !5
  %4 = icmp ne i32 %3, 0
  %5 = load i32, ptr @flow, align 8
  %6 = icmp eq i32 %5, 3
  %or.cond = select i1 %4, i1 %6, i1 false
  br i1 %or.cond, label %7, label %11

7:                                                ; preds = %1
  %8 = load ptr, ptr %0, align 8, !tbaa !9
  %9 = getelementptr inbounds i8, ptr %8, i64 108
  %10 = load i32, ptr %9, align 4, !tbaa !12
  call void @CalCOMV(i32 noundef %10, ptr noundef nonnull %2) #5
  br label %11

11:                                               ; preds = %7, %1
  %lhsc = load i8, ptr @thermostatType, align 16
  %rhsc = load i8, ptr @.str.14, align 1
  %12 = icmp eq i8 %lhsc, %rhsc
  br i1 %12, label %.preheader.preheader, label %98

.preheader.preheader:                             ; preds = %11
  %13 = getelementptr inbounds i8, ptr %2, i64 8
  %.pre = load ptr, ptr %0, align 8, !tbaa !9
  br label %14

14:                                               ; preds = %.preheader.preheader, %14
  %15 = phi ptr [ %.pre, %.preheader.preheader ], [ %23, %14 ]
  %16 = getelementptr inbounds i8, ptr %15, i64 72
  %17 = load double, ptr %16, align 8, !tbaa !16
  %18 = call double @RandomVelocity(double noundef %17) #5
  %19 = load double, ptr getelementptr inbounds (i8, ptr @flow, i64 16), align 8, !tbaa !17
  %20 = load double, ptr %13, align 8, !tbaa !17
  %21 = fadd double %19, %20
  %22 = load ptr, ptr getelementptr inbounds (i8, ptr @flow, i64 80), align 8, !tbaa !18
  %23 = load ptr, ptr %0, align 8, !tbaa !9
  %24 = getelementptr inbounds i8, ptr %23, i64 48
  %25 = load i32, ptr %24, align 8, !tbaa !23
  %26 = sext i32 %25 to i64
  %27 = getelementptr inbounds ptr, ptr %22, i64 %26
  %28 = load ptr, ptr %27, align 8, !tbaa !24
  %29 = getelementptr inbounds i8, ptr %28, i64 8
  %30 = load double, ptr %29, align 8, !tbaa !17
  %31 = load double, ptr @currenttime, align 8, !tbaa !17
  %32 = load ptr, ptr getelementptr inbounds (i8, ptr @flow, i64 72), align 8, !tbaa !25
  %33 = getelementptr inbounds double, ptr %32, i64 %26
  %34 = load double, ptr %33, align 8, !tbaa !17
  %35 = fsub double %31, %34
  %36 = call double @llvm.fmuladd.f64(double %30, double %35, double %21)
  %37 = fadd double %18, %36
  %38 = fcmp oeq double %37, 0.000000e+00
  br i1 %38, label %14, label %.preheader.1, !prof !26

.preheader.1:                                     ; preds = %14
  %39 = getelementptr inbounds i8, ptr %2, i64 16
  br label %40

40:                                               ; preds = %40, %.preheader.1
  %41 = phi ptr [ %49, %40 ], [ %23, %.preheader.1 ]
  %42 = getelementptr inbounds i8, ptr %41, i64 72
  %43 = load double, ptr %42, align 8, !tbaa !16
  %44 = call double @RandomVelocity(double noundef %43) #5
  %45 = load double, ptr getelementptr inbounds (i8, ptr @flow, i64 24), align 8, !tbaa !17
  %46 = load double, ptr %39, align 16, !tbaa !17
  %47 = fadd double %45, %46
  %48 = load ptr, ptr getelementptr inbounds (i8, ptr @flow, i64 80), align 8, !tbaa !18
  %49 = load ptr, ptr %0, align 8, !tbaa !9
  %50 = getelementptr inbounds i8, ptr %49, i64 48
  %51 = load i32, ptr %50, align 8, !tbaa !23
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds ptr, ptr %48, i64 %52
  %54 = load ptr, ptr %53, align 8, !tbaa !24
  %55 = getelementptr inbounds i8, ptr %54, i64 16
  %56 = load double, ptr %55, align 8, !tbaa !17
  %57 = load double, ptr @currenttime, align 8, !tbaa !17
  %58 = load ptr, ptr getelementptr inbounds (i8, ptr @flow, i64 72), align 8, !tbaa !25
  %59 = getelementptr inbounds double, ptr %58, i64 %52
  %60 = load double, ptr %59, align 8, !tbaa !17
  %61 = fsub double %57, %60
  %62 = call double @llvm.fmuladd.f64(double %56, double %61, double %47)
  %63 = fadd double %44, %62
  %64 = fcmp oeq double %63, 0.000000e+00
  br i1 %64, label %40, label %.preheader.2, !prof !26

.preheader.2:                                     ; preds = %40
  %65 = getelementptr inbounds i8, ptr %2, i64 24
  br label %66

66:                                               ; preds = %66, %.preheader.2
  %67 = phi ptr [ %75, %66 ], [ %49, %.preheader.2 ]
  %68 = getelementptr inbounds i8, ptr %67, i64 72
  %69 = load double, ptr %68, align 8, !tbaa !16
  %70 = call double @RandomVelocity(double noundef %69) #5
  %71 = load double, ptr getelementptr inbounds (i8, ptr @flow, i64 32), align 8, !tbaa !17
  %72 = load double, ptr %65, align 8, !tbaa !17
  %73 = fadd double %71, %72
  %74 = load ptr, ptr getelementptr inbounds (i8, ptr @flow, i64 80), align 8, !tbaa !18
  %75 = load ptr, ptr %0, align 8, !tbaa !9
  %76 = getelementptr inbounds i8, ptr %75, i64 48
  %77 = load i32, ptr %76, align 8, !tbaa !23
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds ptr, ptr %74, i64 %78
  %80 = load ptr, ptr %79, align 8, !tbaa !24
  %81 = getelementptr inbounds i8, ptr %80, i64 24
  %82 = load double, ptr %81, align 8, !tbaa !17
  %83 = load double, ptr @currenttime, align 8, !tbaa !17
  %84 = load ptr, ptr getelementptr inbounds (i8, ptr @flow, i64 72), align 8, !tbaa !25
  %85 = getelementptr inbounds double, ptr %84, i64 %78
  %86 = load double, ptr %85, align 8, !tbaa !17
  %87 = fsub double %83, %86
  %88 = call double @llvm.fmuladd.f64(double %82, double %87, double %73)
  %89 = fadd double %70, %88
  %90 = fcmp oeq double %89, 0.000000e+00
  br i1 %90, label %66, label %91, !prof !26

91:                                               ; preds = %66
  %92 = getelementptr inbounds double, ptr %84, i64 %78
  %93 = getelementptr inbounds i8, ptr %0, i64 8
  %94 = load ptr, ptr %93, align 8, !tbaa !27
  %95 = getelementptr inbounds i8, ptr %94, i64 56
  store double %37, ptr %95, align 8, !tbaa !17
  %96 = getelementptr inbounds i8, ptr %94, i64 64
  store double %63, ptr %96, align 8, !tbaa !17
  %97 = getelementptr inbounds i8, ptr %94, i64 72
  store double %89, ptr %97, align 8, !tbaa !17
  store double %83, ptr %92, align 8, !tbaa !17
  br label %98

98:                                               ; preds = %91, %11
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %2) #5
  ret void
}

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

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #2

declare void @CalCOMV(i32 noundef, ptr noundef) local_unnamed_addr #3

declare double @RandomVelocity(double noundef) local_unnamed_addr #3

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #4

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
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 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { 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, !11, i64 0}
!10 = !{!"AtomStr", !11, i64 0, !11, i64 8}
!11 = !{!"any pointer", !7, i64 0}
!12 = !{!13, !6, i64 108}
!13 = !{!"PropertyStr", !7, i64 0, !7, i64 8, !7, i64 40, !6, i64 48, !6, i64 52, !6, i64 56, !14, i64 64, !14, i64 72, !7, i64 80, !15, i64 104, !11, i64 120, !11, i64 128}
!14 = !{!"double", !7, i64 0}
!15 = !{!"AtomSeqStr", !6, i64 0, !6, i64 4, !6, i64 8}
!16 = !{!13, !14, i64 72}
!17 = !{!14, !14, i64 0}
!18 = !{!19, !11, i64 80}
!19 = !{!"FlowStr", !6, i64 0, !20, i64 8, !21, i64 40, !22, i64 88}
!20 = !{!"ConstVStr", !7, i64 0}
!21 = !{!"ForceStr", !7, i64 0, !11, i64 32, !11, i64 40}
!22 = !{!"ChargeStr", !6, i64 0, !6, i64 4, !11, i64 8, !11, i64 16, !11, i64 24, !11, i64 32}
!23 = !{!13, !6, i64 48}
!24 = !{!11, !11, i64 0}
!25 = !{!19, !11, i64 72}
!26 = !{!"branch_weights", !"expected", i32 1, i32 2000}
!27 = !{!10, !11, i64 8}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,LowerExpectIntrinsicPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass