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

; 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_OtherStateType = type { ptr, ptr, i32, ptr, i32, ptr, i32, ptr, i32, ptr, i32, ptr, i32, ptr, i32, ptr, i32, ptr, i32, ptr, i32, ptr, i32, ptr, i32, ptr, i32, ptr, i32, ptr, i32, ptr, 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.MAP_InputType = type { ptr, ptr, i32, ptr, i32, ptr, i32 }
%struct.ReferencePoint_t = type { ptr, ptr, ptr }
%struct.VarTypePtr_t = type { ptr, ptr, ptr, i8, i32, i32 }

@.str.6 = external hidden unnamed_addr constant [46 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [25 x i8], align 1

; 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

declare void @map_reset_universal_error(ptr noundef, ptr noundef) #1

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

declare i32 @printf(ptr noundef, ...) #1

declare i32 @associate_constraint_states(ptr noundef, ptr noundef) #1

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

declare void @set_universal_error_with_message(ptr noundef, ptr noundef, i32 noundef, ptr noundef, ...) #1

declare i32 @line_solve_sequence(ptr noundef, ptr noundef, float noundef, ptr noundef, ptr noundef) #1

declare i32 @node_solve_sequence(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, float noundef, ptr noundef, ptr noundef) #1

; Function Attrs: nounwind uwtable
define dso_local void @map_calc_output(float noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4, ptr noundef %5, ptr noundef %6, ptr noundef %7, ptr noundef %8, ptr noundef %9) #2 {
  %11 = alloca float, align 4
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca ptr, align 8
  %17 = alloca ptr, align 8
  %18 = alloca ptr, align 8
  %19 = alloca ptr, align 8
  %20 = alloca ptr, align 8
  %21 = alloca ptr, align 8
  %22 = alloca i32, align 4
  %23 = alloca ptr, align 8
  %24 = alloca i32, align 4
  store float %0, ptr %11, align 4, !tbaa !5
  store ptr %1, ptr %12, align 8, !tbaa !9
  store ptr %2, ptr %13, align 8, !tbaa !9
  store ptr %3, ptr %14, align 8, !tbaa !9
  store ptr %4, ptr %15, align 8, !tbaa !9
  store ptr %5, ptr %16, align 8, !tbaa !9
  store ptr %6, ptr %17, align 8, !tbaa !9
  store ptr %7, ptr %18, align 8, !tbaa !9
  store ptr %8, ptr %19, align 8, !tbaa !9
  store ptr %9, ptr %20, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #3
  %25 = load ptr, ptr %17, align 8, !tbaa !9
  %26 = getelementptr inbounds %struct.MAP_OtherStateType, ptr %25, i32 0, i32 0
  %27 = load ptr, ptr %26, align 8, !tbaa !11
  store ptr %27, ptr %21, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #3
  store i32 0, ptr %22, align 4, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #3
  store ptr null, ptr %23, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #3
  store i32 0, ptr %24, align 4, !tbaa !14
  %28 = load ptr, ptr %20, align 8, !tbaa !9
  %29 = load ptr, ptr %19, align 8, !tbaa !9
  call void @map_reset_universal_error(ptr noundef %28, ptr noundef %29)
  br label %30

30:                                               ; preds = %10
  %31 = load ptr, ptr %21, align 8, !tbaa !9
  %32 = load ptr, ptr %16, align 8, !tbaa !9
  %33 = call i32 @associate_constraint_states(ptr noundef %31, ptr noundef %32)
  store i32 %33, ptr %22, align 4, !tbaa !14
  %34 = load i32, ptr %22, align 4, !tbaa !14
  %35 = icmp ne i32 %34, 0
  br i1 %35, label %36, label %39

36:                                               ; preds = %30
  %37 = load ptr, ptr %20, align 8, !tbaa !9
  %38 = load ptr, ptr %19, align 8, !tbaa !9
  call void @set_universal_error(ptr noundef %37, ptr noundef %38, i32 noundef 98)
  br label %132

39:                                               ; preds = %30
  %40 = load ptr, ptr %21, align 8, !tbaa !9
  %41 = getelementptr inbounds %struct.Domain_t, ptr %40, i32 0, i32 9
  %42 = call i32 @list_iterator_start(ptr noundef %41)
  br label %43

43:                                               ; preds = %48, %39
  %44 = load ptr, ptr %21, align 8, !tbaa !9
  %45 = getelementptr inbounds %struct.Domain_t, ptr %44, i32 0, i32 9
  %46 = call i32 @list_iterator_hasnext(ptr noundef %45)
  %47 = icmp ne i32 %46, 0
  br i1 %47, label %48, label %84

48:                                               ; preds = %43
  %49 = load ptr, ptr %21, align 8, !tbaa !9
  %50 = getelementptr inbounds %struct.Domain_t, ptr %49, i32 0, i32 9
  %51 = call ptr @list_iterator_next(ptr noundef %50)
  store ptr %51, ptr %23, align 8, !tbaa !9
  %52 = load ptr, ptr %12, align 8, !tbaa !9
  %53 = getelementptr inbounds %struct.MAP_InputType, ptr %52, i32 0, i32 1
  %54 = load ptr, ptr %53, align 8, !tbaa !15
  %55 = load i32, ptr %24, align 4, !tbaa !14
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds double, ptr %54, i64 %56
  %58 = load ptr, ptr %23, align 8, !tbaa !9
  %59 = getelementptr inbounds %struct.ReferencePoint_t, ptr %58, i32 0, i32 0
  %60 = load ptr, ptr %59, align 8, !tbaa !17
  %61 = getelementptr inbounds %struct.VarTypePtr_t, ptr %60, i32 0, i32 2
  store ptr %57, ptr %61, align 8, !tbaa !19
  %62 = load ptr, ptr %12, align 8, !tbaa !9
  %63 = getelementptr inbounds %struct.MAP_InputType, ptr %62, i32 0, i32 3
  %64 = load ptr, ptr %63, align 8, !tbaa !22
  %65 = load i32, ptr %24, align 4, !tbaa !14
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds double, ptr %64, i64 %66
  %68 = load ptr, ptr %23, align 8, !tbaa !9
  %69 = getelementptr inbounds %struct.ReferencePoint_t, ptr %68, i32 0, i32 1
  %70 = load ptr, ptr %69, align 8, !tbaa !23
  %71 = getelementptr inbounds %struct.VarTypePtr_t, ptr %70, i32 0, i32 2
  store ptr %67, ptr %71, align 8, !tbaa !19
  %72 = load ptr, ptr %12, align 8, !tbaa !9
  %73 = getelementptr inbounds %struct.MAP_InputType, ptr %72, i32 0, i32 5
  %74 = load ptr, ptr %73, align 8, !tbaa !24
  %75 = load i32, ptr %24, align 4, !tbaa !14
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds double, ptr %74, i64 %76
  %78 = load ptr, ptr %23, align 8, !tbaa !9
  %79 = getelementptr inbounds %struct.ReferencePoint_t, ptr %78, i32 0, i32 2
  %80 = load ptr, ptr %79, align 8, !tbaa !25
  %81 = getelementptr inbounds %struct.VarTypePtr_t, ptr %80, i32 0, i32 2
  store ptr %77, ptr %81, align 8, !tbaa !19
  %82 = load i32, ptr %24, align 4, !tbaa !14
  %83 = add nsw i32 %82, 1
  store i32 %83, ptr %24, align 4, !tbaa !14
  br label %43, !llvm.loop !26

84:                                               ; preds = %43
  %85 = load ptr, ptr %21, align 8, !tbaa !9
  %86 = getelementptr inbounds %struct.Domain_t, ptr %85, i32 0, i32 9
  %87 = call i32 @list_iterator_stop(ptr noundef %86)
  %88 = load ptr, ptr %12, align 8, !tbaa !9
  %89 = load ptr, ptr %21, align 8, !tbaa !9
  %90 = getelementptr inbounds %struct.Domain_t, ptr %89, i32 0, i32 10
  store ptr %88, ptr %90, align 8, !tbaa !28
  %91 = load i32, ptr %24, align 4, !tbaa !14
  %92 = load ptr, ptr %12, align 8, !tbaa !9
  %93 = getelementptr inbounds %struct.MAP_InputType, ptr %92, i32 0, i32 2
  %94 = load i32, ptr %93, align 8, !tbaa !41
  %95 = icmp ne i32 %91, %94
  br i1 %95, label %96, label %103

96:                                               ; preds = %84
  %97 = load ptr, ptr %20, align 8, !tbaa !9
  %98 = load ptr, ptr %19, align 8, !tbaa !9
  %99 = load ptr, ptr %12, align 8, !tbaa !9
  %100 = getelementptr inbounds %struct.MAP_InputType, ptr %99, i32 0, i32 2
  %101 = load i32, ptr %100, align 8, !tbaa !41
  %102 = load i32, ptr %24, align 4, !tbaa !14
  call void (ptr, ptr, i32, ptr, ...) @set_universal_error_with_message(ptr noundef %97, ptr noundef %98, i32 noundef 89, ptr noundef @.str.6, i32 noundef %101, i32 noundef %102)
  br label %132

103:                                              ; preds = %84
  %104 = load ptr, ptr %21, align 8, !tbaa !9
  %105 = getelementptr inbounds %struct.Domain_t, ptr %104, i32 0, i32 4
  %106 = load i32, ptr %105, align 8, !tbaa !42
  %107 = icmp eq i32 %106, 0
  br i1 %107, label %108, label %115

108:                                              ; preds = %103
  %109 = load ptr, ptr %21, align 8, !tbaa !9
  %110 = load ptr, ptr %13, align 8, !tbaa !9
  %111 = load float, ptr %11, align 4, !tbaa !5
  %112 = load ptr, ptr %20, align 8, !tbaa !9
  %113 = load ptr, ptr %19, align 8, !tbaa !9
  %114 = call i32 @line_solve_sequence(ptr noundef %109, ptr noundef %110, float noundef %111, ptr noundef %112, ptr noundef %113)
  store i32 %114, ptr %22, align 4, !tbaa !14
  br label %125

115:                                              ; preds = %103
  %116 = load ptr, ptr %21, align 8, !tbaa !9
  %117 = load ptr, ptr %13, align 8, !tbaa !9
  %118 = load ptr, ptr %12, align 8, !tbaa !9
  %119 = load ptr, ptr %16, align 8, !tbaa !9
  %120 = load ptr, ptr %17, align 8, !tbaa !9
  %121 = load float, ptr %11, align 4, !tbaa !5
  %122 = load ptr, ptr %20, align 8, !tbaa !9
  %123 = load ptr, ptr %19, align 8, !tbaa !9
  %124 = call i32 @node_solve_sequence(ptr noundef %116, ptr noundef %117, ptr noundef %118, ptr noundef %119, ptr noundef %120, float noundef %121, ptr noundef %122, ptr noundef %123)
  store i32 %124, ptr %22, align 4, !tbaa !14
  br label %125

125:                                              ; preds = %115, %108
  %126 = load ptr, ptr %18, align 8, !tbaa !9
  %127 = load ptr, ptr %17, align 8, !tbaa !9
  %128 = load ptr, ptr %20, align 8, !tbaa !9
  %129 = load ptr, ptr %19, align 8, !tbaa !9
  %130 = call i32 @get_iteration_output_stream(ptr noundef %126, ptr noundef %127, ptr noundef %128, ptr noundef %129)
  store i32 %130, ptr %22, align 4, !tbaa !14
  br label %131

131:                                              ; preds = %125
  br label %132

132:                                              ; preds = %131, %96, %36
  %133 = load ptr, ptr %19, align 8, !tbaa !9
  %134 = load i32, ptr %133, align 4, !tbaa !14
  %135 = icmp ne i32 %134, 0
  br i1 %135, label %136, label %141

136:                                              ; preds = %132
  %137 = load float, ptr %11, align 4, !tbaa !5
  %138 = fpext float %137 to double
  %139 = load ptr, ptr %20, align 8, !tbaa !9
  %140 = call i32 (ptr, ...) @printf(ptr noundef @.str.8, double noundef %138, ptr noundef %139)
  br label %141

141:                                              ; preds = %136, %132
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #3
  ret void
}

declare i32 @get_iteration_output_stream(ptr noundef, ptr noundef, ptr noundef, ptr noundef) #1

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 }

!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 = !{!"float", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !10, i64 0}
!12 = !{!"MAP_OtherStateType", !10, i64 0, !10, i64 8, !13, i64 16, !10, i64 24, !13, i64 32, !10, i64 40, !13, i64 48, !10, i64 56, !13, i64 64, !10, i64 72, !13, i64 80, !10, i64 88, !13, i64 96, !10, i64 104, !13, i64 112, !10, i64 120, !13, i64 128, !10, i64 136, !13, i64 144, !10, i64 152, !13, i64 160, !10, i64 168, !13, i64 176, !10, i64 184, !13, i64 192, !10, i64 200, !13, i64 208, !10, i64 216, !13, i64 224, !10, i64 232, !13, i64 240, !10, i64 248, !13, i64 256}
!13 = !{!"int", !7, i64 0}
!14 = !{!13, !13, i64 0}
!15 = !{!16, !10, i64 8}
!16 = !{!"MAP_InputType", !10, i64 0, !10, i64 8, !13, i64 16, !10, i64 24, !13, i64 32, !10, i64 40, !13, i64 48}
!17 = !{!18, !10, i64 0}
!18 = !{!"ReferencePoint_t", !10, i64 0, !10, i64 8, !10, i64 16}
!19 = !{!20, !10, i64 16}
!20 = !{!"VarTypePtr_t", !10, i64 0, !10, i64 8, !10, i64 16, !21, i64 24, !13, i64 28, !13, i64 32}
!21 = !{!"_Bool", !7, i64 0}
!22 = !{!16, !10, i64 24}
!23 = !{!18, !10, i64 8}
!24 = !{!16, !10, i64 40}
!25 = !{!18, !10, i64 16}
!26 = distinct !{!26, !27}
!27 = !{!"llvm.loop.mustprogress"}
!28 = !{!29, !10, i64 1448}
!29 = !{!"Domain_t", !30, i64 0, !32, i64 240, !33, i64 408, !10, i64 448, !13, i64 456, !34, i64 464, !39, i64 968, !39, i64 1088, !39, i64 1208, !39, i64 1328, !10, i64 1448}
!30 = !{!"InnerSolveAttributes_t", !10, i64 0, !31, i64 8, !31, i64 16, !31, i64 24, !7, i64 32, !7, i64 48, !7, i64 64, !7, i64 96, !7, i64 112, !7, i64 128, !7, i64 144, !7, i64 160, !7, i64 176, !31, i64 192, !13, i64 200, !13, i64 204, !13, i64 208, !13, i64 212, !13, i64 216, !7, i64 220, !13, i64 228, !13, i64 232}
!31 = !{!"double", !7, i64 0}
!32 = !{!"OuterSolveAttributes_t", !13, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !10, i64 40, !10, i64 48, !10, i64 56, !10, i64 64, !10, i64 72, !10, i64 80, !10, i64 88, !10, i64 96, !31, i64 104, !31, i64 112, !31, i64 120, !31, i64 128, !31, i64 136, !31, i64 144, !21, i64 152, !21, i64 153, !21, i64 154, !13, i64 156, !13, i64 160, !13, i64 164}
!33 = !{!"DomainOptions_t", !10, i64 0, !31, i64 8, !31, i64 16, !31, i64 24, !21, i64 32, !21, i64 33, !13, i64 36}
!34 = !{!"Vessel_t", !35, i64 0, !10, i64 120, !10, i64 128, !10, i64 136, !37, i64 144, !37, i64 264, !38, i64 384}
!35 = !{!"EulerAngle_t", !36, i64 0, !36, i64 40, !36, i64 80}
!36 = !{!"VarType_t", !10, i64 0, !10, i64 8, !31, i64 16, !21, i64 24, !21, i64 25, !13, i64 28, !13, i64 32}
!37 = !{!"Point_t", !36, i64 0, !36, i64 40, !36, i64 80}
!38 = !{!"Force_t", !36, i64 0, !36, i64 40, !36, i64 80}
!39 = !{!"", !10, i64 0, !10, i64 8, !10, i64 16, !13, i64 24, !10, i64 32, !13, i64 40, !13, i64 44, !13, i64 48, !10, i64 56, !40, i64 64}
!40 = !{!"list_attributes_s", !10, i64 0, !10, i64 8, !10, i64 16, !13, i64 24, !10, i64 32, !10, i64 40, !10, i64 48}
!41 = !{!16, !13, i64 16}
!42 = !{!29, !13, i64 456}


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

@.str.6 = external hidden unnamed_addr constant [46 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [25 x i8], align 1

declare void @map_reset_universal_error(ptr noundef, ptr noundef) local_unnamed_addr #0

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

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #1

declare i32 @associate_constraint_states(ptr noundef, ptr noundef) local_unnamed_addr #0

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

declare void @set_universal_error_with_message(ptr noundef, ptr noundef, i32 noundef, ptr noundef, ...) local_unnamed_addr #0

declare i32 @line_solve_sequence(ptr noundef, ptr noundef, float noundef, ptr noundef, ptr noundef) local_unnamed_addr #0

declare i32 @node_solve_sequence(ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, float noundef, ptr noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local void @map_calc_output(float noundef %0, ptr noundef %1, ptr noundef %2, ptr nocapture noundef readnone %3, ptr nocapture noundef readnone %4, ptr noundef %5, ptr noundef %6, ptr noundef %7, ptr noundef %8, ptr noundef %9) local_unnamed_addr #2 {
  %11 = load ptr, ptr %6, align 8, !tbaa !5
  tail call void @map_reset_universal_error(ptr noundef %9, ptr noundef %8) #3
  %12 = tail call i32 @associate_constraint_states(ptr noundef %11, ptr noundef %5) #3
  %.not = icmp eq i32 %12, 0
  br i1 %.not, label %14, label %13

13:                                               ; preds = %10
  tail call void @set_universal_error(ptr noundef %9, ptr noundef %8, i32 noundef 98) #3
  br label %54

14:                                               ; preds = %10
  %15 = getelementptr inbounds i8, ptr %11, i64 1328
  %16 = tail call i32 @list_iterator_start(ptr noundef nonnull %15) #3
  %17 = tail call i32 @list_iterator_hasnext(ptr noundef nonnull %15) #3
  %.not5154 = icmp eq i32 %17, 0
  br i1 %.not5154, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %14
  %18 = getelementptr inbounds i8, ptr %1, i64 8
  %19 = getelementptr inbounds i8, ptr %1, i64 24
  %20 = getelementptr inbounds i8, ptr %1, i64 40
  br label %21

21:                                               ; preds = %.lr.ph, %21
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %21 ]
  %22 = tail call ptr @list_iterator_next(ptr noundef nonnull %15) #3
  %23 = load ptr, ptr %18, align 8, !tbaa !11
  %24 = getelementptr inbounds double, ptr %23, i64 %indvars.iv
  %25 = load ptr, ptr %22, align 8, !tbaa !13
  %26 = getelementptr inbounds i8, ptr %25, i64 16
  store ptr %24, ptr %26, align 8, !tbaa !15
  %27 = load ptr, ptr %19, align 8, !tbaa !18
  %28 = getelementptr inbounds double, ptr %27, i64 %indvars.iv
  %29 = getelementptr inbounds i8, ptr %22, i64 8
  %30 = load ptr, ptr %29, align 8, !tbaa !19
  %31 = getelementptr inbounds i8, ptr %30, i64 16
  store ptr %28, ptr %31, align 8, !tbaa !15
  %32 = load ptr, ptr %20, align 8, !tbaa !20
  %33 = getelementptr inbounds double, ptr %32, i64 %indvars.iv
  %34 = getelementptr inbounds i8, ptr %22, i64 16
  %35 = load ptr, ptr %34, align 8, !tbaa !21
  %36 = getelementptr inbounds i8, ptr %35, i64 16
  store ptr %33, ptr %36, align 8, !tbaa !15
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %37 = tail call i32 @list_iterator_hasnext(ptr noundef nonnull %15) #3
  %.not51 = icmp eq i32 %37, 0
  br i1 %.not51, label %._crit_edge.loopexit, label %21, !llvm.loop !22

._crit_edge.loopexit:                             ; preds = %21
  %38 = trunc nuw i64 %indvars.iv.next to i32
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %14
  %.0.lcssa = phi i32 [ 0, %14 ], [ %38, %._crit_edge.loopexit ]
  %39 = tail call i32 @list_iterator_stop(ptr noundef nonnull %15) #3
  %40 = getelementptr inbounds i8, ptr %11, i64 1448
  store ptr %1, ptr %40, align 8, !tbaa !24
  %41 = getelementptr inbounds i8, ptr %1, i64 16
  %42 = load i32, ptr %41, align 8, !tbaa !37
  %.not52 = icmp eq i32 %.0.lcssa, %42
  br i1 %.not52, label %44, label %43

43:                                               ; preds = %._crit_edge
  tail call void (ptr, ptr, i32, ptr, ...) @set_universal_error_with_message(ptr noundef %9, ptr noundef %8, i32 noundef 89, ptr noundef nonnull @.str.6, i32 noundef %42, i32 noundef %.0.lcssa) #3
  br label %54

44:                                               ; preds = %._crit_edge
  %45 = getelementptr inbounds i8, ptr %11, i64 456
  %46 = load i32, ptr %45, align 8, !tbaa !38
  %47 = icmp eq i32 %46, 0
  br i1 %47, label %48, label %50

48:                                               ; preds = %44
  %49 = tail call i32 @line_solve_sequence(ptr noundef nonnull %11, ptr noundef %2, float noundef %0, ptr noundef %9, ptr noundef %8) #3
  br label %52

50:                                               ; preds = %44
  %51 = tail call i32 @node_solve_sequence(ptr noundef nonnull %11, ptr noundef %2, ptr noundef nonnull %1, ptr noundef %5, ptr noundef nonnull %6, float noundef %0, ptr noundef %9, ptr noundef %8) #3
  br label %52

52:                                               ; preds = %50, %48
  %53 = tail call i32 @get_iteration_output_stream(ptr noundef %7, ptr noundef nonnull %6, ptr noundef %9, ptr noundef %8) #3
  br label %54

54:                                               ; preds = %52, %43, %13
  %55 = load i32, ptr %8, align 4, !tbaa !39
  %.not53 = icmp eq i32 %55, 0
  br i1 %.not53, label %59, label %56

56:                                               ; preds = %54
  %57 = fpext float %0 to double
  %58 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.8, double noundef %57, ptr noundef %9)
  br label %59

59:                                               ; preds = %56, %54
  ret void
}

declare i32 @get_iteration_output_stream(ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #0

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 = { nofree 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 = { 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, !7, i64 0}
!6 = !{!"MAP_OtherStateType", !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, i64 88, !10, i64 96, !7, i64 104, !10, i64 112, !7, i64 120, !10, i64 128, !7, i64 136, !10, i64 144, !7, i64 152, !10, i64 160, !7, i64 168, !10, i64 176, !7, i64 184, !10, i64 192, !7, i64 200, !10, i64 208, !7, i64 216, !10, i64 224, !7, i64 232, !10, i64 240, !7, i64 248, !10, i64 256}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!12, !7, i64 8}
!12 = !{!"MAP_InputType", !7, i64 0, !7, i64 8, !10, i64 16, !7, i64 24, !10, i64 32, !7, i64 40, !10, i64 48}
!13 = !{!14, !7, i64 0}
!14 = !{!"ReferencePoint_t", !7, i64 0, !7, i64 8, !7, i64 16}
!15 = !{!16, !7, i64 16}
!16 = !{!"VarTypePtr_t", !7, i64 0, !7, i64 8, !7, i64 16, !17, i64 24, !10, i64 28, !10, i64 32}
!17 = !{!"_Bool", !8, i64 0}
!18 = !{!12, !7, i64 24}
!19 = !{!14, !7, i64 8}
!20 = !{!12, !7, i64 40}
!21 = !{!14, !7, i64 16}
!22 = distinct !{!22, !23}
!23 = !{!"llvm.loop.mustprogress"}
!24 = !{!25, !7, i64 1448}
!25 = !{!"Domain_t", !26, i64 0, !28, i64 240, !29, i64 408, !7, i64 448, !10, i64 456, !30, i64 464, !35, i64 968, !35, i64 1088, !35, i64 1208, !35, i64 1328, !7, i64 1448}
!26 = !{!"InnerSolveAttributes_t", !7, i64 0, !27, i64 8, !27, i64 16, !27, i64 24, !8, i64 32, !8, i64 48, !8, i64 64, !8, i64 96, !8, i64 112, !8, i64 128, !8, i64 144, !8, i64 160, !8, i64 176, !27, i64 192, !10, i64 200, !10, i64 204, !10, i64 208, !10, i64 212, !10, i64 216, !8, i64 220, !10, i64 228, !10, i64 232}
!27 = !{!"double", !8, i64 0}
!28 = !{!"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, !27, i64 104, !27, i64 112, !27, i64 120, !27, i64 128, !27, i64 136, !27, i64 144, !17, i64 152, !17, i64 153, !17, i64 154, !10, i64 156, !10, i64 160, !10, i64 164}
!29 = !{!"DomainOptions_t", !7, i64 0, !27, i64 8, !27, i64 16, !27, i64 24, !17, i64 32, !17, i64 33, !10, i64 36}
!30 = !{!"Vessel_t", !31, i64 0, !7, i64 120, !7, i64 128, !7, i64 136, !33, i64 144, !33, i64 264, !34, i64 384}
!31 = !{!"EulerAngle_t", !32, i64 0, !32, i64 40, !32, i64 80}
!32 = !{!"VarType_t", !7, i64 0, !7, i64 8, !27, i64 16, !17, i64 24, !17, i64 25, !10, i64 28, !10, i64 32}
!33 = !{!"Point_t", !32, i64 0, !32, i64 40, !32, i64 80}
!34 = !{!"Force_t", !32, i64 0, !32, i64 40, !32, i64 80}
!35 = !{!"", !7, i64 0, !7, i64 8, !7, i64 16, !10, i64 24, !7, i64 32, !10, i64 40, !10, i64 44, !10, i64 48, !7, i64 56, !36, i64 64}
!36 = !{!"list_attributes_s", !7, i64 0, !7, i64 8, !7, i64 16, !10, i64 24, !7, i64 32, !7, i64 40, !7, i64 48}
!37 = !{!12, !10, i64 16}
!38 = !{!25, !10, i64 456}
!39 = !{!10, !10, i64 0}


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