; LLVM IR from OpenFAST/openfast :: modules/map/src (lineroutines)

; 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.MAP_ParameterType = type { ptr, double, double, double, double, i32 }
%struct.Domain_t = type { %struct.InnerSolveAttributes_t, %struct.OuterSolveAttributes_t, %struct.DomainOptions_t, ptr, i32, %struct.Vessel_t, %struct.list_t, %struct.list_t, %struct.list_t, %struct.list_t, ptr }
%struct.InnerSolveAttributes_t = type { ptr, double, double, double, [2 x double], [2 x double], [4 x double], [2 x double], [2 x double], [2 x double], [2 x double], [2 x double], [2 x double], double, i32, i32, i32, i32, i32, [2 x i32], i32, i32 }
%struct.OuterSolveAttributes_t = type { i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, double, double, double, double, double, double, i8, i8, i8, i32, i32, i32 }
%struct.DomainOptions_t = type { ptr, double, double, double, i8, i8, i32 }
%struct.Vessel_t = type { %struct.EulerAngle_t, ptr, ptr, ptr, %struct.Point_t, %struct.Point_t, %struct.Force_t }
%struct.EulerAngle_t = type { %struct.VarType_t, %struct.VarType_t, %struct.VarType_t }
%struct.VarType_t = type { ptr, ptr, double, i8, i8, i32, i32 }
%struct.Point_t = type { %struct.VarType_t, %struct.VarType_t, %struct.VarType_t }
%struct.Force_t = type { %struct.VarType_t, %struct.VarType_t, %struct.VarType_t }
%struct.list_t = type { ptr, ptr, ptr, i32, ptr, i32, i32, i32, ptr, %struct.list_attributes_s }
%struct.list_attributes_s = type { ptr, ptr, ptr, i32, ptr, ptr, ptr }
%struct.Line_t = type { ptr, %struct.LineOptions, %struct.VarTypePtr_t, %struct.VarTypePtr_t, %struct.VarType_t, ptr, ptr, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, double, %struct.list_t, ptr, ptr, i32, i32, i32, i32, i32 }
%struct.LineOptions = type { i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8 }
%struct.VarTypePtr_t = type { ptr, ptr, ptr, i8, i32, i32 }
%struct.Node_t = type { %struct.PointPtr_t, %struct.PointPtr_t, %struct.PointPtr_t, i32, %struct.ForcePtr_t, %struct.VarType_t, %struct.VarType_t, %struct.Force_t }
%struct.PointPtr_t = type { %struct.VarTypePtr_t, %struct.VarTypePtr_t, %struct.VarTypePtr_t }
%struct.ForcePtr_t = type { %struct.VarTypePtr_t, %struct.VarTypePtr_t, %struct.VarTypePtr_t }

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

declare i32 @list_iterator_start(ptr noundef) #1

declare i32 @list_iterator_hasnext(ptr noundef) #1

declare ptr @list_iterator_next(ptr noundef) #1

declare i32 @list_iterator_stop(ptr noundef) #1

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

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

28:                                               ; preds = %33, %2
  %29 = load ptr, ptr %3, align 8, !tbaa !5
  %30 = getelementptr inbounds %struct.Domain_t, ptr %29, i32 0, i32 7
  %31 = call i32 @list_iterator_hasnext(ptr noundef %30)
  %32 = icmp ne i32 %31, 0
  br i1 %32, label %33, label %103

33:                                               ; preds = %28
  %34 = load ptr, ptr %3, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct.Domain_t, ptr %34, i32 0, i32 7
  %36 = call ptr @list_iterator_next(ptr noundef %35)
  store ptr %36, ptr %5, align 8, !tbaa !5
  %37 = load ptr, ptr %5, align 8, !tbaa !5
  %38 = getelementptr inbounds %struct.Line_t, ptr %37, i32 0, i32 7
  %39 = load double, ptr %38, align 8, !tbaa !15
  store double %39, ptr %9, align 8, !tbaa !13
  %40 = load ptr, ptr %5, align 8, !tbaa !5
  %41 = getelementptr inbounds %struct.Line_t, ptr %40, i32 0, i32 2
  %42 = getelementptr inbounds %struct.VarTypePtr_t, ptr %41, i32 0, i32 2
  %43 = load ptr, ptr %42, align 8, !tbaa !23
  %44 = load double, ptr %43, align 8, !tbaa !13
  %45 = load double, ptr %9, align 8, !tbaa !13
  %46 = call double @cos(double noundef %45) #5
  %47 = fmul double %44, %46
  store double %47, ptr %13, align 8, !tbaa !13
  %48 = load ptr, ptr %5, align 8, !tbaa !5
  %49 = getelementptr inbounds %struct.Line_t, ptr %48, i32 0, i32 13
  %50 = load double, ptr %49, align 8, !tbaa !24
  %51 = fneg double %50
  %52 = load double, ptr %9, align 8, !tbaa !13
  %53 = call double @cos(double noundef %52) #5
  %54 = fmul double %51, %53
  store double %54, ptr %16, align 8, !tbaa !13
  %55 = load ptr, ptr %5, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct.Line_t, ptr %55, i32 0, i32 2
  %57 = getelementptr inbounds %struct.VarTypePtr_t, ptr %56, i32 0, i32 2
  %58 = load ptr, ptr %57, align 8, !tbaa !23
  %59 = load double, ptr %58, align 8, !tbaa !13
  %60 = load double, ptr %9, align 8, !tbaa !13
  %61 = call double @sin(double noundef %60) #5
  %62 = fmul double %59, %61
  store double %62, ptr %14, align 8, !tbaa !13
  %63 = load ptr, ptr %5, align 8, !tbaa !5
  %64 = getelementptr inbounds %struct.Line_t, ptr %63, i32 0, i32 13
  %65 = load double, ptr %64, align 8, !tbaa !24
  %66 = fneg double %65
  %67 = load double, ptr %9, align 8, !tbaa !13
  %68 = call double @sin(double noundef %67) #5
  %69 = fmul double %66, %68
  store double %69, ptr %17, align 8, !tbaa !13
  %70 = load ptr, ptr %5, align 8, !tbaa !5
  %71 = getelementptr inbounds %struct.Line_t, ptr %70, i32 0, i32 3
  %72 = getelementptr inbounds %struct.VarTypePtr_t, ptr %71, i32 0, i32 2
  %73 = load ptr, ptr %72, align 8, !tbaa !25
  %74 = load double, ptr %73, align 8, !tbaa !13
  store double %74, ptr %15, align 8, !tbaa !13
  %75 = load ptr, ptr %5, align 8, !tbaa !5
  %76 = getelementptr inbounds %struct.Line_t, ptr %75, i32 0, i32 14
  %77 = load double, ptr %76, align 8, !tbaa !26
  %78 = fneg double %77
  store double %78, ptr %18, align 8, !tbaa !13
  %79 = load ptr, ptr %5, align 8, !tbaa !5
  %80 = getelementptr inbounds %struct.Line_t, ptr %79, i32 0, i32 27
  %81 = load ptr, ptr %80, align 8, !tbaa !27
  %82 = load double, ptr %13, align 8, !tbaa !13
  call void @add_to_sum_fx(ptr noundef %81, double noundef %82)
  %83 = load ptr, ptr %5, align 8, !tbaa !5
  %84 = getelementptr inbounds %struct.Line_t, ptr %83, i32 0, i32 26
  %85 = load ptr, ptr %84, align 8, !tbaa !28
  %86 = load double, ptr %16, align 8, !tbaa !13
  call void @add_to_sum_fx(ptr noundef %85, double noundef %86)
  %87 = load ptr, ptr %5, align 8, !tbaa !5
  %88 = getelementptr inbounds %struct.Line_t, ptr %87, i32 0, i32 27
  %89 = load ptr, ptr %88, align 8, !tbaa !27
  %90 = load double, ptr %14, align 8, !tbaa !13
  call void @add_to_sum_fy(ptr noundef %89, double noundef %90)
  %91 = load ptr, ptr %5, align 8, !tbaa !5
  %92 = getelementptr inbounds %struct.Line_t, ptr %91, i32 0, i32 26
  %93 = load ptr, ptr %92, align 8, !tbaa !28
  %94 = load double, ptr %17, align 8, !tbaa !13
  call void @add_to_sum_fy(ptr noundef %93, double noundef %94)
  %95 = load ptr, ptr %5, align 8, !tbaa !5
  %96 = getelementptr inbounds %struct.Line_t, ptr %95, i32 0, i32 27
  %97 = load ptr, ptr %96, align 8, !tbaa !27
  %98 = load double, ptr %15, align 8, !tbaa !13
  call void @add_to_sum_fz(ptr noundef %97, double noundef %98)
  %99 = load ptr, ptr %5, align 8, !tbaa !5
  %100 = getelementptr inbounds %struct.Line_t, ptr %99, i32 0, i32 26
  %101 = load ptr, ptr %100, align 8, !tbaa !28
  %102 = load double, ptr %18, align 8, !tbaa !13
  call void @add_to_sum_fz(ptr noundef %101, double noundef %102)
  br label %28, !llvm.loop !29

103:                                              ; preds = %28
  %104 = load ptr, ptr %3, align 8, !tbaa !5
  %105 = getelementptr inbounds %struct.Domain_t, ptr %104, i32 0, i32 7
  %106 = call i32 @list_iterator_stop(ptr noundef %105)
  %107 = load ptr, ptr %3, align 8, !tbaa !5
  %108 = getelementptr inbounds %struct.Domain_t, ptr %107, i32 0, i32 8
  %109 = call i32 @list_iterator_start(ptr noundef %108)
  br label %110

110:                                              ; preds = %163, %103
  %111 = load ptr, ptr %3, align 8, !tbaa !5
  %112 = getelementptr inbounds %struct.Domain_t, ptr %111, i32 0, i32 8
  %113 = call i32 @list_iterator_hasnext(ptr noundef %112)
  %114 = icmp ne i32 %113, 0
  br i1 %114, label %115, label %164

115:                                              ; preds = %110
  %116 = load ptr, ptr %3, align 8, !tbaa !5
  %117 = getelementptr inbounds %struct.Domain_t, ptr %116, i32 0, i32 8
  %118 = call ptr @list_iterator_next(ptr noundef %117)
  store ptr %118, ptr %6, align 8, !tbaa !5
  %119 = load ptr, ptr %6, align 8, !tbaa !5
  %120 = getelementptr inbounds %struct.Node_t, ptr %119, i32 0, i32 3
  %121 = load i32, ptr %120, align 8, !tbaa !31
  %122 = icmp eq i32 %121, 2
  br i1 %122, label %123, label %163

123:                                              ; preds = %115
  %124 = load ptr, ptr %6, align 8, !tbaa !5
  %125 = getelementptr inbounds %struct.Node_t, ptr %124, i32 0, i32 7
  %126 = getelementptr inbounds %struct.Force_t, ptr %125, i32 0, i32 0
  %127 = getelementptr inbounds %struct.VarType_t, ptr %126, i32 0, i32 2
  %128 = load double, ptr %127, align 8, !tbaa !36
  %129 = fneg double %128
  store double %129, ptr %10, align 8, !tbaa !13
  %130 = load ptr, ptr %6, align 8, !tbaa !5
  %131 = getelementptr inbounds %struct.Node_t, ptr %130, i32 0, i32 7
  %132 = getelementptr inbounds %struct.Force_t, ptr %131, i32 0, i32 1
  %133 = getelementptr inbounds %struct.VarType_t, ptr %132, i32 0, i32 2
  %134 = load double, ptr %133, align 8, !tbaa !37
  %135 = fneg double %134
  store double %135, ptr %11, align 8, !tbaa !13
  %136 = load ptr, ptr %6, align 8, !tbaa !5
  %137 = getelementptr inbounds %struct.Node_t, ptr %136, i32 0, i32 7
  %138 = getelementptr inbounds %struct.Force_t, ptr %137, i32 0, i32 2
  %139 = getelementptr inbounds %struct.VarType_t, ptr %138, i32 0, i32 2
  %140 = load double, ptr %139, align 8, !tbaa !38
  %141 = load ptr, ptr %6, align 8, !tbaa !5
  %142 = getelementptr inbounds %struct.Node_t, ptr %141, i32 0, i32 5
  %143 = getelementptr inbounds %struct.VarType_t, ptr %142, i32 0, i32 2
  %144 = load double, ptr %143, align 8, !tbaa !39
  %145 = load double, ptr %7, align 8, !tbaa !13
  %146 = fneg double %144
  %147 = call double @llvm.fmuladd.f64(double %146, double %145, double %140)
  %148 = load ptr, ptr %6, align 8, !tbaa !5
  %149 = getelementptr inbounds %struct.Node_t, ptr %148, i32 0, i32 6
  %150 = getelementptr inbounds %struct.VarType_t, ptr %149, i32 0, i32 2
  %151 = load double, ptr %150, align 8, !tbaa !40
  %152 = load double, ptr %8, align 8, !tbaa !13
  %153 = fmul double %151, %152
  %154 = load double, ptr %7, align 8, !tbaa !13
  %155 = call double @llvm.fmuladd.f64(double %153, double %154, double %147)
  %156 = fneg double %155
  store double %156, ptr %12, align 8, !tbaa !13
  %157 = load ptr, ptr %6, align 8, !tbaa !5
  %158 = load double, ptr %10, align 8, !tbaa !13
  call void @add_to_sum_fx(ptr noundef %157, double noundef %158)
  %159 = load ptr, ptr %6, align 8, !tbaa !5
  %160 = load double, ptr %11, align 8, !tbaa !13
  call void @add_to_sum_fy(ptr noundef %159, double noundef %160)
  %161 = load ptr, ptr %6, align 8, !tbaa !5
  %162 = load double, ptr %12, align 8, !tbaa !13
  call void @add_to_sum_fz(ptr noundef %161, double noundef %162)
  br label %163

163:                                              ; preds = %123, %115
  br label %110, !llvm.loop !41

164:                                              ; preds = %110
  %165 = load ptr, ptr %3, align 8, !tbaa !5
  %166 = getelementptr inbounds %struct.Domain_t, ptr %165, i32 0, i32 8
  %167 = call i32 @list_iterator_stop(ptr noundef %166)
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  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 8, ptr %5) #5
  ret i32 0
}

; Function Attrs: nounwind
declare double @cos(double noundef) #3

; Function Attrs: nounwind
declare double @sin(double noundef) #3

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

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

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "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 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 = { 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 = { 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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !11, i64 8}
!10 = !{!"MAP_ParameterType", !6, i64 0, !11, i64 8, !11, i64 16, !11, i64 24, !11, i64 32, !12, i64 40}
!11 = !{!"double", !7, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!11, !11, i64 0}
!14 = !{!10, !11, i64 24}
!15 = !{!16, !11, i64 176}
!16 = !{!"Line_t", !6, i64 0, !17, i64 8, !19, i64 40, !19, i64 80, !20, i64 120, !6, i64 160, !6, i64 168, !11, i64 176, !11, i64 184, !11, i64 192, !11, i64 200, !11, i64 208, !11, i64 216, !11, i64 224, !11, i64 232, !11, i64 240, !11, i64 248, !11, i64 256, !11, i64 264, !11, i64 272, !11, i64 280, !11, i64 288, !11, i64 296, !11, i64 304, !11, i64 312, !21, i64 320, !6, i64 440, !6, i64 448, !12, i64 456, !12, i64 460, !12, i64 464, !12, i64 468, !12, i64 472}
!17 = !{!"", !18, i64 0, !18, i64 1, !18, i64 2, !18, i64 3, !18, i64 4, !18, i64 5, !18, i64 6, !18, i64 7, !18, i64 8, !18, i64 9, !18, i64 10, !18, i64 11, !18, i64 12, !18, i64 13, !18, i64 14, !18, i64 15, !18, i64 16, !18, i64 17, !18, i64 18, !18, i64 19, !18, i64 20, !18, i64 21, !18, i64 22, !18, i64 23, !18, i64 24, !18, i64 25}
!18 = !{!"_Bool", !7, i64 0}
!19 = !{!"VarTypePtr_t", !6, i64 0, !6, i64 8, !6, i64 16, !18, i64 24, !12, i64 28, !12, i64 32}
!20 = !{!"VarType_t", !6, i64 0, !6, i64 8, !11, i64 16, !18, i64 24, !18, i64 25, !12, i64 28, !12, i64 32}
!21 = !{!"", !6, i64 0, !6, i64 8, !6, i64 16, !12, i64 24, !6, i64 32, !12, i64 40, !12, i64 44, !12, i64 48, !6, i64 56, !22, i64 64}
!22 = !{!"list_attributes_s", !6, i64 0, !6, i64 8, !6, i64 16, !12, i64 24, !6, i64 32, !6, i64 40, !6, i64 48}
!23 = !{!16, !6, i64 56}
!24 = !{!16, !11, i64 224}
!25 = !{!16, !6, i64 96}
!26 = !{!16, !11, i64 232}
!27 = !{!16, !6, i64 448}
!28 = !{!16, !6, i64 440}
!29 = distinct !{!29, !30}
!30 = !{!"llvm.loop.mustprogress"}
!31 = !{!32, !12, i64 360}
!32 = !{!"Node_t", !33, i64 0, !33, i64 120, !33, i64 240, !12, i64 360, !34, i64 368, !20, i64 488, !20, i64 528, !35, i64 568}
!33 = !{!"PointPtr_t", !19, i64 0, !19, i64 40, !19, i64 80}
!34 = !{!"ForcePtr_t", !19, i64 0, !19, i64 40, !19, i64 80}
!35 = !{!"Force_t", !20, i64 0, !20, i64 40, !20, i64 80}
!36 = !{!32, !11, i64 584}
!37 = !{!32, !11, i64 624}
!38 = !{!32, !11, i64 664}
!39 = !{!32, !11, i64 504}
!40 = !{!32, !11, i64 544}
!41 = distinct !{!41, !30}


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

declare i32 @list_iterator_start(ptr noundef) local_unnamed_addr #0

declare i32 @list_iterator_hasnext(ptr noundef) local_unnamed_addr #0

declare ptr @list_iterator_next(ptr noundef) local_unnamed_addr #0

declare i32 @list_iterator_stop(ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local noundef i32 @calculate_node_sum_force(ptr noundef %0, ptr nocapture noundef readonly %1) local_unnamed_addr #1 {
  %3 = getelementptr inbounds i8, ptr %1, i64 8
  %4 = load double, ptr %3, align 8, !tbaa !5
  %5 = getelementptr inbounds i8, ptr %1, i64 24
  %6 = load double, ptr %5, align 8, !tbaa !12
  %7 = getelementptr inbounds i8, ptr %0, i64 1088
  %8 = tail call i32 @list_iterator_start(ptr noundef nonnull %7) #4
  %9 = tail call i32 @list_iterator_hasnext(ptr noundef nonnull %7) #4
  %.not49 = icmp eq i32 %9, 0
  br i1 %.not49, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %2, %.lr.ph
  %10 = tail call ptr @list_iterator_next(ptr noundef nonnull %7) #4
  %11 = getelementptr inbounds i8, ptr %10, i64 176
  %12 = load double, ptr %11, align 8, !tbaa !13
  %13 = getelementptr inbounds i8, ptr %10, i64 56
  %14 = load ptr, ptr %13, align 8, !tbaa !21
  %15 = load double, ptr %14, align 8, !tbaa !22
  %16 = tail call double @cos(double noundef %12) #4
  %17 = fmul double %15, %16
  %18 = getelementptr inbounds i8, ptr %10, i64 224
  %19 = load double, ptr %18, align 8, !tbaa !23
  %20 = fneg double %19
  %21 = tail call double @cos(double noundef %12) #4
  %22 = fmul double %21, %20
  %23 = load ptr, ptr %13, align 8, !tbaa !21
  %24 = load double, ptr %23, align 8, !tbaa !22
  %25 = tail call double @sin(double noundef %12) #4
  %26 = fmul double %24, %25
  %27 = load double, ptr %18, align 8, !tbaa !23
  %28 = fneg double %27
  %29 = tail call double @sin(double noundef %12) #4
  %30 = fmul double %29, %28
  %31 = getelementptr inbounds i8, ptr %10, i64 96
  %32 = load ptr, ptr %31, align 8, !tbaa !24
  %33 = load double, ptr %32, align 8, !tbaa !22
  %34 = getelementptr inbounds i8, ptr %10, i64 232
  %35 = load double, ptr %34, align 8, !tbaa !25
  %36 = fneg double %35
  %37 = getelementptr inbounds i8, ptr %10, i64 448
  %38 = load ptr, ptr %37, align 8, !tbaa !26
  tail call void @add_to_sum_fx(ptr noundef %38, double noundef %17)
  %39 = getelementptr inbounds i8, ptr %10, i64 440
  %40 = load ptr, ptr %39, align 8, !tbaa !27
  tail call void @add_to_sum_fx(ptr noundef %40, double noundef %22)
  %41 = load ptr, ptr %37, align 8, !tbaa !26
  tail call void @add_to_sum_fy(ptr noundef %41, double noundef %26)
  %42 = load ptr, ptr %39, align 8, !tbaa !27
  tail call void @add_to_sum_fy(ptr noundef %42, double noundef %30)
  %43 = load ptr, ptr %37, align 8, !tbaa !26
  tail call void @add_to_sum_fz(ptr noundef %43, double noundef %33)
  %44 = load ptr, ptr %39, align 8, !tbaa !27
  tail call void @add_to_sum_fz(ptr noundef %44, double noundef %36)
  %45 = tail call i32 @list_iterator_hasnext(ptr noundef nonnull %7) #4
  %.not = icmp eq i32 %45, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph, !llvm.loop !28

._crit_edge:                                      ; preds = %.lr.ph, %2
  %46 = tail call i32 @list_iterator_stop(ptr noundef nonnull %7) #4
  %47 = getelementptr inbounds i8, ptr %0, i64 1208
  %48 = tail call i32 @list_iterator_start(ptr noundef nonnull %47) #4
  %49 = tail call i32 @list_iterator_hasnext(ptr noundef nonnull %47) #4
  %.not4850 = icmp eq i32 %49, 0
  br i1 %.not4850, label %._crit_edge53, label %.lr.ph52

.lr.ph52:                                         ; preds = %._crit_edge, %72
  %50 = tail call ptr @list_iterator_next(ptr noundef nonnull %47) #4
  %51 = getelementptr inbounds i8, ptr %50, i64 360
  %52 = load i32, ptr %51, align 8, !tbaa !30
  %53 = icmp eq i32 %52, 2
  br i1 %53, label %54, label %72

54:                                               ; preds = %.lr.ph52
  %55 = getelementptr inbounds i8, ptr %50, i64 584
  %56 = load double, ptr %55, align 8, !tbaa !35
  %57 = fneg double %56
  %58 = getelementptr inbounds i8, ptr %50, i64 624
  %59 = load double, ptr %58, align 8, !tbaa !36
  %60 = fneg double %59
  %61 = getelementptr inbounds i8, ptr %50, i64 664
  %62 = load double, ptr %61, align 8, !tbaa !37
  %63 = getelementptr inbounds i8, ptr %50, i64 504
  %64 = load double, ptr %63, align 8, !tbaa !38
  %65 = fneg double %64
  %66 = tail call double @llvm.fmuladd.f64(double %65, double %4, double %62)
  %67 = getelementptr inbounds i8, ptr %50, i64 544
  %68 = load double, ptr %67, align 8, !tbaa !39
  %69 = fmul double %6, %68
  %70 = tail call double @llvm.fmuladd.f64(double %69, double %4, double %66)
  %71 = fneg double %70
  tail call void @add_to_sum_fx(ptr noundef nonnull %50, double noundef %57)
  tail call void @add_to_sum_fy(ptr noundef nonnull %50, double noundef %60)
  tail call void @add_to_sum_fz(ptr noundef nonnull %50, double noundef %71)
  br label %72

72:                                               ; preds = %54, %.lr.ph52
  %73 = tail call i32 @list_iterator_hasnext(ptr noundef nonnull %47) #4
  %.not48 = icmp eq i32 %73, 0
  br i1 %.not48, label %._crit_edge53, label %.lr.ph52, !llvm.loop !40

._crit_edge53:                                    ; preds = %72, %._crit_edge
  %74 = tail call i32 @list_iterator_stop(ptr noundef nonnull %47) #4
  ret i32 0
}

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @cos(double noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @sin(double noundef) local_unnamed_addr #2

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

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

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

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

attributes #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 = { 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 nofree nounwind willreturn memory(write) "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 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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, !10, i64 8}
!6 = !{!"MAP_ParameterType", !7, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !11, i64 40}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"double", !8, i64 0}
!11 = !{!"int", !8, i64 0}
!12 = !{!6, !10, i64 24}
!13 = !{!14, !10, i64 176}
!14 = !{!"Line_t", !7, i64 0, !15, i64 8, !17, i64 40, !17, i64 80, !18, i64 120, !7, i64 160, !7, i64 168, !10, i64 176, !10, i64 184, !10, i64 192, !10, i64 200, !10, i64 208, !10, i64 216, !10, i64 224, !10, i64 232, !10, i64 240, !10, i64 248, !10, i64 256, !10, i64 264, !10, i64 272, !10, i64 280, !10, i64 288, !10, i64 296, !10, i64 304, !10, i64 312, !19, i64 320, !7, i64 440, !7, i64 448, !11, i64 456, !11, i64 460, !11, i64 464, !11, i64 468, !11, i64 472}
!15 = !{!"", !16, i64 0, !16, i64 1, !16, i64 2, !16, i64 3, !16, i64 4, !16, i64 5, !16, i64 6, !16, i64 7, !16, i64 8, !16, i64 9, !16, i64 10, !16, i64 11, !16, i64 12, !16, i64 13, !16, i64 14, !16, i64 15, !16, i64 16, !16, i64 17, !16, i64 18, !16, i64 19, !16, i64 20, !16, i64 21, !16, i64 22, !16, i64 23, !16, i64 24, !16, i64 25}
!16 = !{!"_Bool", !8, i64 0}
!17 = !{!"VarTypePtr_t", !7, i64 0, !7, i64 8, !7, i64 16, !16, i64 24, !11, i64 28, !11, i64 32}
!18 = !{!"VarType_t", !7, i64 0, !7, i64 8, !10, i64 16, !16, i64 24, !16, i64 25, !11, i64 28, !11, i64 32}
!19 = !{!"", !7, i64 0, !7, i64 8, !7, i64 16, !11, i64 24, !7, i64 32, !11, i64 40, !11, i64 44, !11, i64 48, !7, i64 56, !20, i64 64}
!20 = !{!"list_attributes_s", !7, i64 0, !7, i64 8, !7, i64 16, !11, i64 24, !7, i64 32, !7, i64 40, !7, i64 48}
!21 = !{!14, !7, i64 56}
!22 = !{!10, !10, i64 0}
!23 = !{!14, !10, i64 224}
!24 = !{!14, !7, i64 96}
!25 = !{!14, !10, i64 232}
!26 = !{!14, !7, i64 448}
!27 = !{!14, !7, i64 440}
!28 = distinct !{!28, !29}
!29 = !{!"llvm.loop.mustprogress"}
!30 = !{!31, !11, i64 360}
!31 = !{!"Node_t", !32, i64 0, !32, i64 120, !32, i64 240, !11, i64 360, !33, i64 368, !18, i64 488, !18, i64 528, !34, i64 568}
!32 = !{!"PointPtr_t", !17, i64 0, !17, i64 40, !17, i64 80}
!33 = !{!"ForcePtr_t", !17, i64 0, !17, i64 40, !17, i64 80}
!34 = !{!"Force_t", !18, i64 0, !18, i64 40, !18, i64 80}
!35 = !{!31, !10, i64 584}
!36 = !{!31, !10, i64 624}
!37 = !{!31, !10, i64 664}
!38 = !{!31, !10, i64 504}
!39 = !{!31, !10, i64 544}
!40 = distinct !{!40, !29}


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