; 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.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.MAP_ConstraintStateType = type { ptr, ptr, i32, ptr, i32, ptr, i32, ptr, i32, ptr, i32 }

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

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

; Function Attrs: nounwind
declare double @sqrt(double noundef) #1

; Function Attrs: nounwind uwtable
declare dso_local i32 @line_solve_sequence(ptr noundef, ptr noundef, float noundef, ptr noundef, ptr noundef) #2

declare void @set_universal_error(ptr noundef, ptr noundef, i32 noundef) #3

; Function Attrs: nounwind uwtable
define dso_local i32 @newton_solve_sequence(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4, float noundef %5, ptr noundef %6, ptr noundef %7) #2 {
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca float, align 4
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca ptr, align 8
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca double, align 8
  %22 = alloca i32, align 4
  store ptr %0, ptr %9, align 8, !tbaa !5
  store ptr %1, ptr %10, align 8, !tbaa !5
  store ptr %2, ptr %11, align 8, !tbaa !5
  store ptr %3, ptr %12, align 8, !tbaa !5
  store ptr %4, ptr %13, align 8, !tbaa !5
  store float %5, ptr %14, align 4, !tbaa !9
  store ptr %6, ptr %15, align 8, !tbaa !5
  store ptr %7, ptr %16, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #4
  %23 = load ptr, ptr %9, align 8, !tbaa !5
  %24 = getelementptr inbounds %struct.Domain_t, ptr %23, i32 0, i32 1
  store ptr %24, ptr %17, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #4
  store i32 0, ptr %18, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #4
  store i32 3, ptr %19, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #4
  %25 = load ptr, ptr %12, align 8, !tbaa !5
  %26 = getelementptr inbounds %struct.MAP_ConstraintStateType, ptr %25, i32 0, i32 10
  %27 = load i32, ptr %26, align 8, !tbaa !13
  store i32 %27, ptr %20, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #4
  store double 0.000000e+00, ptr %21, align 8, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #4
  %28 = load i32, ptr %20, align 4, !tbaa !11
  %29 = mul nsw i32 3, %28
  store i32 %29, ptr %22, align 4, !tbaa !11
  %30 = load ptr, ptr %17, align 8, !tbaa !5
  %31 = getelementptr inbounds %struct.OuterSolveAttributes_t, ptr %30, i32 0, i32 24
  store i32 1, ptr %31, align 4, !tbaa !17
  br label %32

32:                                               ; preds = %131, %8
  store double 0.000000e+00, ptr %21, align 8, !tbaa !15
  %33 = load ptr, ptr %9, align 8, !tbaa !5
  %34 = load ptr, ptr %10, align 8, !tbaa !5
  %35 = load float, ptr %14, align 4, !tbaa !9
  %36 = load ptr, ptr %15, align 8, !tbaa !5
  %37 = load ptr, ptr %16, align 8, !tbaa !5
  %38 = call i32 @line_solve_sequence(ptr noundef %33, ptr noundef %34, float noundef %35, ptr noundef %36, ptr noundef %37)
  store i32 %38, ptr %18, align 4, !tbaa !11
  %39 = load i32, ptr %18, align 4, !tbaa !11
  %40 = icmp ne i32 %39, 0
  br i1 %40, label %41, label %44

41:                                               ; preds = %32
  %42 = load ptr, ptr %15, align 8, !tbaa !5
  %43 = load ptr, ptr %16, align 8, !tbaa !5
  call void @set_universal_error(ptr noundef %42, ptr noundef %43, i32 noundef 79)
  br label %138

44:                                               ; preds = %32
  %45 = load ptr, ptr %17, align 8, !tbaa !5
  %46 = getelementptr inbounds %struct.OuterSolveAttributes_t, ptr %45, i32 0, i32 0
  %47 = load i32, ptr %46, align 8, !tbaa !20
  switch i32 %47, label %90 [
    i32 0, label %48
    i32 1, label %62
    i32 2, label %76
  ]

48:                                               ; preds = %44
  %49 = load ptr, ptr %13, align 8, !tbaa !5
  %50 = load ptr, ptr %10, align 8, !tbaa !5
  %51 = load ptr, ptr %12, align 8, !tbaa !5
  %52 = load ptr, ptr %9, align 8, !tbaa !5
  %53 = load ptr, ptr %15, align 8, !tbaa !5
  %54 = load ptr, ptr %16, align 8, !tbaa !5
  %55 = call i32 @backward_difference_jacobian(ptr noundef %49, ptr noundef %50, ptr noundef %51, ptr noundef %52, ptr noundef %53, ptr noundef %54)
  store i32 %55, ptr %18, align 4, !tbaa !11
  %56 = load i32, ptr %18, align 4, !tbaa !11
  %57 = icmp ne i32 %56, 0
  br i1 %57, label %58, label %61

58:                                               ; preds = %48
  %59 = load ptr, ptr %15, align 8, !tbaa !5
  %60 = load ptr, ptr %16, align 8, !tbaa !5
  call void @set_universal_error(ptr noundef %59, ptr noundef %60, i32 noundef 75)
  br label %90

61:                                               ; preds = %48
  br label %90

62:                                               ; preds = %44
  %63 = load ptr, ptr %13, align 8, !tbaa !5
  %64 = load ptr, ptr %10, align 8, !tbaa !5
  %65 = load ptr, ptr %12, align 8, !tbaa !5
  %66 = load ptr, ptr %9, align 8, !tbaa !5
  %67 = load ptr, ptr %15, align 8, !tbaa !5
  %68 = load ptr, ptr %16, align 8, !tbaa !5
  %69 = call i32 @central_difference_jacobian(ptr noundef %63, ptr noundef %64, ptr noundef %65, ptr noundef %66, ptr noundef %67, ptr noundef %68)
  store i32 %69, ptr %18, align 4, !tbaa !11
  %70 = load i32, ptr %18, align 4, !tbaa !11
  %71 = icmp ne i32 %70, 0
  br i1 %71, label %72, label %75

72:                                               ; preds = %62
  %73 = load ptr, ptr %15, align 8, !tbaa !5
  %74 = load ptr, ptr %16, align 8, !tbaa !5
  call void @set_universal_error(ptr noundef %73, ptr noundef %74, i32 noundef 76)
  br label %90

75:                                               ; preds = %62
  br label %90

76:                                               ; preds = %44
  %77 = load ptr, ptr %13, align 8, !tbaa !5
  %78 = load ptr, ptr %10, align 8, !tbaa !5
  %79 = load ptr, ptr %12, align 8, !tbaa !5
  %80 = load ptr, ptr %9, align 8, !tbaa !5
  %81 = load ptr, ptr %15, align 8, !tbaa !5
  %82 = load ptr, ptr %16, align 8, !tbaa !5
  %83 = call i32 @forward_difference_jacobian(ptr noundef %77, ptr noundef %78, ptr noundef %79, ptr noundef %80, ptr noundef %81, ptr noundef %82)
  store i32 %83, ptr %18, align 4, !tbaa !11
  %84 = load i32, ptr %18, align 4, !tbaa !11
  %85 = icmp ne i32 %84, 0
  br i1 %85, label %86, label %89

86:                                               ; preds = %76
  %87 = load ptr, ptr %15, align 8, !tbaa !5
  %88 = load ptr, ptr %16, align 8, !tbaa !5
  call void @set_universal_error(ptr noundef %87, ptr noundef %88, i32 noundef 77)
  br label %90

89:                                               ; preds = %76
  br label %90

90:                                               ; preds = %89, %86, %75, %72, %61, %58, %44
  %91 = load ptr, ptr %9, align 8, !tbaa !5
  %92 = load ptr, ptr %10, align 8, !tbaa !5
  %93 = load float, ptr %14, align 4, !tbaa !9
  %94 = load ptr, ptr %15, align 8, !tbaa !5
  %95 = load ptr, ptr %16, align 8, !tbaa !5
  %96 = call i32 @line_solve_sequence(ptr noundef %91, ptr noundef %92, float noundef %93, ptr noundef %94, ptr noundef %95)
  store i32 %96, ptr %18, align 4, !tbaa !11
  %97 = load i32, ptr %18, align 4, !tbaa !11
  %98 = icmp ne i32 %97, 0
  br i1 %98, label %99, label %102

99:                                               ; preds = %90
  %100 = load ptr, ptr %15, align 8, !tbaa !5
  %101 = load ptr, ptr %16, align 8, !tbaa !5
  call void @set_universal_error(ptr noundef %100, ptr noundef %101, i32 noundef 78)
  br label %138

102:                                              ; preds = %90
  %103 = load ptr, ptr %17, align 8, !tbaa !5
  %104 = load i32, ptr %22, align 4, !tbaa !11
  %105 = load ptr, ptr %12, align 8, !tbaa !5
  %106 = load ptr, ptr %13, align 8, !tbaa !5
  %107 = load ptr, ptr %15, align 8, !tbaa !5
  %108 = load ptr, ptr %16, align 8, !tbaa !5
  %109 = call i32 @root_finding_step(ptr noundef %103, i32 noundef %104, ptr noundef %105, ptr noundef %106, ptr noundef %21, ptr noundef %107, ptr noundef %108)
  store i32 %109, ptr %18, align 4, !tbaa !11
  %110 = load i32, ptr %18, align 4, !tbaa !11
  %111 = icmp ne i32 %110, 0
  br i1 %111, label %112, label %115

112:                                              ; preds = %102
  %113 = load ptr, ptr %15, align 8, !tbaa !5
  %114 = load ptr, ptr %16, align 8, !tbaa !5
  call void @set_universal_error(ptr noundef %113, ptr noundef %114, i32 noundef 92)
  br label %138

115:                                              ; preds = %102
  %116 = load ptr, ptr %17, align 8, !tbaa !5
  %117 = getelementptr inbounds %struct.OuterSolveAttributes_t, ptr %116, i32 0, i32 24
  %118 = load i32, ptr %117, align 4, !tbaa !17
  %119 = add nsw i32 %118, 1
  store i32 %119, ptr %117, align 4, !tbaa !17
  %120 = load ptr, ptr %17, align 8, !tbaa !5
  %121 = getelementptr inbounds %struct.OuterSolveAttributes_t, ptr %120, i32 0, i32 24
  %122 = load i32, ptr %121, align 4, !tbaa !17
  %123 = load ptr, ptr %17, align 8, !tbaa !5
  %124 = getelementptr inbounds %struct.OuterSolveAttributes_t, ptr %123, i32 0, i32 23
  %125 = load i32, ptr %124, align 8, !tbaa !21
  %126 = icmp sgt i32 %122, %125
  br i1 %126, label %127, label %130

127:                                              ; preds = %115
  %128 = load ptr, ptr %15, align 8, !tbaa !5
  %129 = load ptr, ptr %16, align 8, !tbaa !5
  call void @set_universal_error(ptr noundef %128, ptr noundef %129, i32 noundef 80)
  br label %138

130:                                              ; preds = %115
  br label %131

131:                                              ; preds = %130
  %132 = load double, ptr %21, align 8, !tbaa !15
  %133 = call double @sqrt(double noundef %132) #4
  %134 = load ptr, ptr %17, align 8, !tbaa !5
  %135 = getelementptr inbounds %struct.OuterSolveAttributes_t, ptr %134, i32 0, i32 17
  %136 = load double, ptr %135, align 8, !tbaa !22
  %137 = fcmp ogt double %133, %136
  br i1 %137, label %32, label %138, !llvm.loop !23

138:                                              ; preds = %131, %127, %112, %99, %41
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #4
  ret i32 0
}

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

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

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 }

!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 = !{!"float", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!14, !12, i64 80}
!14 = !{!"MAP_ConstraintStateType", !6, i64 0, !6, i64 8, !12, i64 16, !6, i64 24, !12, i64 32, !6, i64 40, !12, i64 48, !6, i64 56, !12, i64 64, !6, i64 72, !12, i64 80}
!15 = !{!16, !16, i64 0}
!16 = !{!"double", !7, i64 0}
!17 = !{!18, !12, i64 164}
!18 = !{!"OuterSolveAttributes_t", !12, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !16, i64 104, !16, i64 112, !16, i64 120, !16, i64 128, !16, i64 136, !16, i64 144, !19, i64 152, !19, i64 153, !19, i64 154, !12, i64 156, !12, i64 160, !12, i64 164}
!19 = !{!"_Bool", !7, i64 0}
!20 = !{!18, !12, i64 0}
!21 = !{!18, !12, i64 160}
!22 = !{!18, !16, i64 136}
!23 = distinct !{!23, !24}
!24 = !{!"llvm.loop.mustprogress"}


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

; 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 nofree nounwind willreturn memory(write)
declare double @sqrt(double noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare dso_local i32 @line_solve_sequence(ptr noundef, ptr noundef, float noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

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

; Function Attrs: nounwind uwtable
define dso_local noundef i32 @newton_solve_sequence(ptr noundef %0, ptr noundef %1, ptr nocapture noundef readnone %2, ptr noundef %3, ptr noundef %4, float noundef %5, ptr noundef %6, ptr noundef %7) local_unnamed_addr #2 {
  %9 = alloca double, align 8
  %10 = getelementptr inbounds i8, ptr %0, i64 240
  %11 = getelementptr inbounds i8, ptr %3, i64 80
  %12 = load i32, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #4
  %13 = mul nsw i32 %12, 3
  %14 = getelementptr inbounds i8, ptr %0, i64 404
  store i32 1, ptr %14, align 4, !tbaa !11
  %15 = getelementptr inbounds i8, ptr %0, i64 400
  %16 = getelementptr inbounds i8, ptr %0, i64 376
  br label %17

17:                                               ; preds = %35, %8
  store double 0.000000e+00, ptr %9, align 8, !tbaa !15
  %18 = call i32 @line_solve_sequence(ptr noundef nonnull %0, ptr noundef %1, float noundef %5, ptr noundef %6, ptr noundef %7)
  %.not = icmp eq i32 %18, 0
  br i1 %.not, label %19, label %.loopexit.sink.split

19:                                               ; preds = %17
  %20 = load i32, ptr %10, align 8, !tbaa !16
  switch i32 %20, label %27 [
    i32 0, label %21
    i32 1, label %23
    i32 2, label %25
  ]

21:                                               ; preds = %19
  %22 = call i32 @backward_difference_jacobian(ptr noundef %4, ptr noundef %1, ptr noundef %3, ptr noundef nonnull %0, ptr noundef %6, ptr noundef %7) #4
  %.not64 = icmp eq i32 %22, 0
  br i1 %.not64, label %27, label %.sink.split

23:                                               ; preds = %19
  %24 = call i32 @central_difference_jacobian(ptr noundef %4, ptr noundef %1, ptr noundef %3, ptr noundef nonnull %0, ptr noundef %6, ptr noundef %7) #4
  %.not63 = icmp eq i32 %24, 0
  br i1 %.not63, label %27, label %.sink.split

25:                                               ; preds = %19
  %26 = call i32 @forward_difference_jacobian(ptr noundef %4, ptr noundef %1, ptr noundef %3, ptr noundef nonnull %0, ptr noundef %6, ptr noundef %7) #4
  %.not62 = icmp eq i32 %26, 0
  br i1 %.not62, label %27, label %.sink.split

.sink.split:                                      ; preds = %25, %23, %21
  %.sink = phi i32 [ 75, %21 ], [ 76, %23 ], [ 77, %25 ]
  call void @set_universal_error(ptr noundef %6, ptr noundef %7, i32 noundef %.sink) #4
  br label %27

27:                                               ; preds = %.sink.split, %25, %23, %21, %19
  %28 = call i32 @line_solve_sequence(ptr noundef nonnull %0, ptr noundef %1, float noundef %5, ptr noundef %6, ptr noundef %7)
  %.not65 = icmp eq i32 %28, 0
  br i1 %.not65, label %29, label %.loopexit.sink.split

29:                                               ; preds = %27
  %30 = call i32 @root_finding_step(ptr noundef nonnull %10, i32 noundef %13, ptr noundef %3, ptr noundef %4, ptr noundef nonnull %9, ptr noundef %6, ptr noundef %7) #4
  %.not66 = icmp eq i32 %30, 0
  br i1 %.not66, label %31, label %.loopexit.sink.split

31:                                               ; preds = %29
  %32 = load i32, ptr %14, align 4, !tbaa !11
  %33 = add nsw i32 %32, 1
  store i32 %33, ptr %14, align 4, !tbaa !11
  %34 = load i32, ptr %15, align 8, !tbaa !17
  %.not67 = icmp slt i32 %32, %34
  br i1 %.not67, label %35, label %.loopexit.sink.split

35:                                               ; preds = %31
  %36 = load double, ptr %9, align 8, !tbaa !15
  %37 = call double @sqrt(double noundef %36) #4
  %38 = load double, ptr %16, align 8, !tbaa !18
  %39 = fcmp ogt double %37, %38
  br i1 %39, label %17, label %.loopexit, !llvm.loop !19

.loopexit.sink.split:                             ; preds = %31, %29, %27, %17
  %.sink68 = phi i32 [ 79, %17 ], [ 78, %27 ], [ 92, %29 ], [ 80, %31 ]
  call void @set_universal_error(ptr noundef %6, ptr noundef %7, i32 noundef %.sink68) #4
  br label %.loopexit

.loopexit:                                        ; preds = %35, %.loopexit.sink.split
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #4
  ret i32 0
}

declare i32 @backward_difference_jacobian(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #3

declare i32 @central_difference_jacobian(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #3

declare i32 @forward_difference_jacobian(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #3

declare i32 @root_finding_step(ptr noundef, i32 noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #3

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 }

!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 80}
!6 = !{!"MAP_ConstraintStateType", !7, i64 0, !7, i64 8, !10, i64 16, !7, i64 24, !10, i64 32, !7, i64 40, !10, i64 48, !7, i64 56, !10, i64 64, !7, i64 72, !10, i64 80}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!12, !10, i64 164}
!12 = !{!"OuterSolveAttributes_t", !10, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !7, i64 40, !7, i64 48, !7, i64 56, !7, i64 64, !7, i64 72, !7, i64 80, !7, i64 88, !7, i64 96, !13, i64 104, !13, i64 112, !13, i64 120, !13, i64 128, !13, i64 136, !13, i64 144, !14, i64 152, !14, i64 153, !14, i64 154, !10, i64 156, !10, i64 160, !10, i64 164}
!13 = !{!"double", !8, i64 0}
!14 = !{!"_Bool", !8, i64 0}
!15 = !{!13, !13, i64 0}
!16 = !{!12, !10, i64 0}
!17 = !{!12, !10, i64 160}
!18 = !{!12, !13, i64 136}
!19 = distinct !{!19, !20}
!20 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: CorrelatedValuePropagationPass,DSEPass,EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass