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

; 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.MAP_OutputType = type { ptr, 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.OutputList_t = type { %struct.list_t, %struct.list_t }
%struct.VarTypePtr_t = type { ptr, ptr, ptr, i8, i32, i32 }

; Function Attrs: nounwind uwtable
define dso_local i32 @get_iteration_output_stream(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3) #0 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !5
  store ptr %3, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  store i32 0, ptr %9, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  store i32 0, ptr %10, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #4
  %14 = load ptr, ptr %6, align 8, !tbaa !5
  %15 = getelementptr inbounds %struct.MAP_OtherStateType, ptr %14, i32 0, i32 0
  %16 = load ptr, ptr %15, align 8, !tbaa !11
  store ptr %16, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #4
  store ptr null, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #4
  store ptr null, ptr %13, align 8, !tbaa !5
  %17 = load ptr, ptr %5, align 8, !tbaa !5
  %18 = getelementptr inbounds %struct.MAP_OutputType, ptr %17, i32 0, i32 9
  %19 = load ptr, ptr %18, align 8, !tbaa !13
  %20 = icmp ne ptr %19, null
  br i1 %20, label %46, label %21

21:                                               ; preds = %4
  %22 = load ptr, ptr %11, align 8, !tbaa !5
  %23 = getelementptr inbounds %struct.Domain_t, ptr %22, i32 0, i32 3
  %24 = load ptr, ptr %23, align 8, !tbaa !15
  %25 = getelementptr inbounds %struct.OutputList_t, ptr %24, i32 0, i32 1
  %26 = call i32 @list_size(ptr noundef %25)
  %27 = load ptr, ptr %5, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct.MAP_OutputType, ptr %27, i32 0, i32 10
  store i32 %26, ptr %28, align 8, !tbaa !29
  %29 = load ptr, ptr %11, align 8, !tbaa !5
  %30 = getelementptr inbounds %struct.Domain_t, ptr %29, i32 0, i32 3
  %31 = load ptr, ptr %30, align 8, !tbaa !15
  %32 = getelementptr inbounds %struct.OutputList_t, ptr %31, i32 0, i32 0
  %33 = call i32 @list_size(ptr noundef %32)
  %34 = load ptr, ptr %5, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct.MAP_OutputType, ptr %34, i32 0, i32 10
  %36 = load i32, ptr %35, align 8, !tbaa !29
  %37 = add nsw i32 %36, %33
  store i32 %37, ptr %35, align 8, !tbaa !29
  %38 = load ptr, ptr %5, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct.MAP_OutputType, ptr %38, i32 0, i32 10
  %40 = load i32, ptr %39, align 8, !tbaa !29
  %41 = sext i32 %40 to i64
  %42 = mul i64 8, %41
  %43 = call noalias ptr @malloc(i64 noundef %42) #5
  %44 = load ptr, ptr %5, align 8, !tbaa !5
  %45 = getelementptr inbounds %struct.MAP_OutputType, ptr %44, i32 0, i32 9
  store ptr %43, ptr %45, align 8, !tbaa !13
  br label %46

46:                                               ; preds = %21, %4
  %47 = load ptr, ptr %11, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct.Domain_t, ptr %47, i32 0, i32 3
  %49 = load ptr, ptr %48, align 8, !tbaa !15
  %50 = getelementptr inbounds %struct.OutputList_t, ptr %49, i32 0, i32 1
  %51 = call i32 @list_iterator_start(ptr noundef %50)
  br label %52

52:                                               ; preds = %59, %46
  %53 = load ptr, ptr %11, align 8, !tbaa !5
  %54 = getelementptr inbounds %struct.Domain_t, ptr %53, i32 0, i32 3
  %55 = load ptr, ptr %54, align 8, !tbaa !15
  %56 = getelementptr inbounds %struct.OutputList_t, ptr %55, i32 0, i32 1
  %57 = call i32 @list_iterator_hasnext(ptr noundef %56)
  %58 = icmp ne i32 %57, 0
  br i1 %58, label %59, label %77

59:                                               ; preds = %52
  %60 = load ptr, ptr %11, align 8, !tbaa !5
  %61 = getelementptr inbounds %struct.Domain_t, ptr %60, i32 0, i32 3
  %62 = load ptr, ptr %61, align 8, !tbaa !15
  %63 = getelementptr inbounds %struct.OutputList_t, ptr %62, i32 0, i32 1
  %64 = call ptr @list_iterator_next(ptr noundef %63)
  store ptr %64, ptr %12, align 8, !tbaa !5
  %65 = load ptr, ptr %12, align 8, !tbaa !5
  %66 = getelementptr inbounds %struct.VarTypePtr_t, ptr %65, i32 0, i32 2
  %67 = load ptr, ptr %66, align 8, !tbaa !30
  %68 = load double, ptr %67, align 8, !tbaa !32
  %69 = load ptr, ptr %5, align 8, !tbaa !5
  %70 = getelementptr inbounds %struct.MAP_OutputType, ptr %69, i32 0, i32 9
  %71 = load ptr, ptr %70, align 8, !tbaa !13
  %72 = load i32, ptr %9, align 4, !tbaa !9
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds double, ptr %71, i64 %73
  store double %68, ptr %74, align 8, !tbaa !32
  %75 = load i32, ptr %9, align 4, !tbaa !9
  %76 = add nsw i32 %75, 1
  store i32 %76, ptr %9, align 4, !tbaa !9
  br label %52, !llvm.loop !33

77:                                               ; preds = %52
  %78 = load ptr, ptr %11, align 8, !tbaa !5
  %79 = getelementptr inbounds %struct.Domain_t, ptr %78, i32 0, i32 3
  %80 = load ptr, ptr %79, align 8, !tbaa !15
  %81 = getelementptr inbounds %struct.OutputList_t, ptr %80, i32 0, i32 1
  %82 = call i32 @list_iterator_stop(ptr noundef %81)
  %83 = load ptr, ptr %11, align 8, !tbaa !5
  %84 = getelementptr inbounds %struct.Domain_t, ptr %83, i32 0, i32 3
  %85 = load ptr, ptr %84, align 8, !tbaa !15
  %86 = getelementptr inbounds %struct.OutputList_t, ptr %85, i32 0, i32 0
  %87 = call i32 @list_iterator_start(ptr noundef %86)
  br label %88

88:                                               ; preds = %95, %77
  %89 = load ptr, ptr %11, align 8, !tbaa !5
  %90 = getelementptr inbounds %struct.Domain_t, ptr %89, i32 0, i32 3
  %91 = load ptr, ptr %90, align 8, !tbaa !15
  %92 = getelementptr inbounds %struct.OutputList_t, ptr %91, i32 0, i32 0
  %93 = call i32 @list_iterator_hasnext(ptr noundef %92)
  %94 = icmp ne i32 %93, 0
  br i1 %94, label %95, label %112

95:                                               ; preds = %88
  %96 = load ptr, ptr %11, align 8, !tbaa !5
  %97 = getelementptr inbounds %struct.Domain_t, ptr %96, i32 0, i32 3
  %98 = load ptr, ptr %97, align 8, !tbaa !15
  %99 = getelementptr inbounds %struct.OutputList_t, ptr %98, i32 0, i32 0
  %100 = call ptr @list_iterator_next(ptr noundef %99)
  store ptr %100, ptr %13, align 8, !tbaa !5
  %101 = load ptr, ptr %13, align 8, !tbaa !5
  %102 = getelementptr inbounds %struct.VarType_t, ptr %101, i32 0, i32 2
  %103 = load double, ptr %102, align 8, !tbaa !35
  %104 = load ptr, ptr %5, align 8, !tbaa !5
  %105 = getelementptr inbounds %struct.MAP_OutputType, ptr %104, i32 0, i32 9
  %106 = load ptr, ptr %105, align 8, !tbaa !13
  %107 = load i32, ptr %9, align 4, !tbaa !9
  %108 = sext i32 %107 to i64
  %109 = getelementptr inbounds double, ptr %106, i64 %108
  store double %103, ptr %109, align 8, !tbaa !32
  %110 = load i32, ptr %9, align 4, !tbaa !9
  %111 = add nsw i32 %110, 1
  store i32 %111, ptr %9, align 4, !tbaa !9
  br label %88, !llvm.loop !36

112:                                              ; preds = %88
  %113 = load ptr, ptr %11, align 8, !tbaa !5
  %114 = getelementptr inbounds %struct.Domain_t, ptr %113, i32 0, i32 3
  %115 = load ptr, ptr %114, align 8, !tbaa !15
  %116 = getelementptr inbounds %struct.OutputList_t, ptr %115, i32 0, i32 0
  %117 = call i32 @list_iterator_stop(ptr noundef %116)
  store i32 0, ptr %10, align 4, !tbaa !9
  br label %118

118:                                              ; preds = %123, %112
  %119 = load i32, ptr %10, align 4, !tbaa !9
  %120 = load i32, ptr %9, align 4, !tbaa !9
  %121 = icmp slt i32 %119, %120
  br i1 %121, label %122, label %126

122:                                              ; preds = %118
  br label %123

123:                                              ; preds = %122
  %124 = load i32, ptr %10, align 4, !tbaa !9
  %125 = add nsw i32 %124, 1
  store i32 %125, ptr %10, align 4, !tbaa !9
  br label %118, !llvm.loop !37

126:                                              ; preds = %118
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  ret i32 0
}

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

declare i32 @list_size(ptr noundef) #2

; Function Attrs: nounwind allocsize(0)
declare noalias ptr @malloc(i64 noundef) #3

declare i32 @list_iterator_start(ptr noundef) #2

declare i32 @list_iterator_hasnext(ptr noundef) #2

declare ptr @list_iterator_next(ptr noundef) #2

declare i32 @list_iterator_stop(ptr noundef) #2

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

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "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 allocsize(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 #4 = { nounwind }
attributes #5 = { nounwind allocsize(0) }

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


; 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: nounwind uwtable
define dso_local noundef i32 @get_iteration_output_stream(ptr nocapture noundef %0, ptr nocapture noundef readonly %1, ptr nocapture noundef readnone %2, ptr nocapture noundef readnone %3) local_unnamed_addr #0 {
  %5 = load ptr, ptr %1, align 8, !tbaa !5
  %6 = getelementptr inbounds i8, ptr %0, i64 72
  %7 = load ptr, ptr %6, align 8, !tbaa !11
  %.not = icmp eq ptr %7, null
  br i1 %.not, label %8, label %21

8:                                                ; preds = %4
  %9 = getelementptr inbounds i8, ptr %5, i64 448
  %10 = load ptr, ptr %9, align 8, !tbaa !13
  %11 = getelementptr inbounds i8, ptr %10, i64 120
  %12 = tail call i32 @list_size(ptr noundef nonnull %11) #3
  %13 = getelementptr inbounds i8, ptr %0, i64 80
  store i32 %12, ptr %13, align 8, !tbaa !27
  %14 = load ptr, ptr %9, align 8, !tbaa !13
  %15 = tail call i32 @list_size(ptr noundef %14) #3
  %16 = load i32, ptr %13, align 8, !tbaa !27
  %17 = add nsw i32 %16, %15
  store i32 %17, ptr %13, align 8, !tbaa !27
  %18 = sext i32 %17 to i64
  %19 = shl nsw i64 %18, 3
  %20 = tail call noalias ptr @malloc(i64 noundef %19) #4
  store ptr %20, ptr %6, align 8, !tbaa !11
  br label %21

21:                                               ; preds = %8, %4
  %22 = getelementptr inbounds i8, ptr %5, i64 448
  %23 = load ptr, ptr %22, align 8, !tbaa !13
  %24 = getelementptr inbounds i8, ptr %23, i64 120
  %25 = tail call i32 @list_iterator_start(ptr noundef nonnull %24) #3
  %26 = load ptr, ptr %22, align 8, !tbaa !13
  %27 = getelementptr inbounds i8, ptr %26, i64 120
  %28 = tail call i32 @list_iterator_hasnext(ptr noundef nonnull %27) #3
  %.not2729 = icmp eq i32 %28, 0
  br i1 %.not2729, label %._crit_edge, label %.lr.ph

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

._crit_edge.loopexit:                             ; preds = %.lr.ph
  %40 = and i64 %indvars.iv.next, 4294967295
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %21
  %.0.lcssa = phi i64 [ 0, %21 ], [ %40, %._crit_edge.loopexit ]
  %41 = load ptr, ptr %22, align 8, !tbaa !13
  %42 = getelementptr inbounds i8, ptr %41, i64 120
  %43 = tail call i32 @list_iterator_stop(ptr noundef nonnull %42) #3
  %44 = load ptr, ptr %22, align 8, !tbaa !13
  %45 = tail call i32 @list_iterator_start(ptr noundef %44) #3
  %46 = load ptr, ptr %22, align 8, !tbaa !13
  %47 = tail call i32 @list_iterator_hasnext(ptr noundef %46) #3
  %.not2831 = icmp eq i32 %47, 0
  br i1 %.not2831, label %._crit_edge35, label %.lr.ph34

.lr.ph34:                                         ; preds = %._crit_edge, %.lr.ph34
  %indvars.iv39 = phi i64 [ %indvars.iv.next40, %.lr.ph34 ], [ %.0.lcssa, %._crit_edge ]
  %48 = load ptr, ptr %22, align 8, !tbaa !13
  %49 = tail call ptr @list_iterator_next(ptr noundef %48) #3
  %50 = getelementptr inbounds i8, ptr %49, i64 16
  %51 = load double, ptr %50, align 8, !tbaa !33
  %52 = load ptr, ptr %6, align 8, !tbaa !11
  %53 = getelementptr inbounds double, ptr %52, i64 %indvars.iv39
  store double %51, ptr %53, align 8, !tbaa !30
  %indvars.iv.next40 = add nuw nsw i64 %indvars.iv39, 1
  %54 = load ptr, ptr %22, align 8, !tbaa !13
  %55 = tail call i32 @list_iterator_hasnext(ptr noundef %54) #3
  %.not28 = icmp eq i32 %55, 0
  br i1 %.not28, label %._crit_edge35, label %.lr.ph34, !llvm.loop !34

._crit_edge35:                                    ; preds = %.lr.ph34, %._crit_edge
  %56 = load ptr, ptr %22, align 8, !tbaa !13
  %57 = tail call i32 @list_iterator_stop(ptr noundef %56) #3
  ret i32 0
}

declare i32 @list_size(ptr noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #2

declare i32 @list_iterator_start(ptr noundef) local_unnamed_addr #1

declare i32 @list_iterator_hasnext(ptr noundef) local_unnamed_addr #1

declare ptr @list_iterator_next(ptr noundef) local_unnamed_addr #1

declare i32 @list_iterator_stop(ptr noundef) local_unnamed_addr #1

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
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 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "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 }
attributes #4 = { nounwind allocsize(0) }

!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 72}
!12 = !{!"MAP_OutputType", !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}
!13 = !{!14, !7, i64 448}
!14 = !{!"Domain_t", !15, i64 0, !17, i64 240, !19, i64 408, !7, i64 448, !10, i64 456, !20, i64 464, !25, i64 968, !25, i64 1088, !25, i64 1208, !25, i64 1328, !7, i64 1448}
!15 = !{!"InnerSolveAttributes_t", !7, i64 0, !16, i64 8, !16, i64 16, !16, 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, !16, 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}
!16 = !{!"double", !8, i64 0}
!17 = !{!"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, !16, i64 104, !16, i64 112, !16, i64 120, !16, i64 128, !16, i64 136, !16, i64 144, !18, i64 152, !18, i64 153, !18, i64 154, !10, i64 156, !10, i64 160, !10, i64 164}
!18 = !{!"_Bool", !8, i64 0}
!19 = !{!"DomainOptions_t", !7, i64 0, !16, i64 8, !16, i64 16, !16, i64 24, !18, i64 32, !18, i64 33, !10, i64 36}
!20 = !{!"Vessel_t", !21, i64 0, !7, i64 120, !7, i64 128, !7, i64 136, !23, i64 144, !23, i64 264, !24, i64 384}
!21 = !{!"EulerAngle_t", !22, i64 0, !22, i64 40, !22, i64 80}
!22 = !{!"VarType_t", !7, i64 0, !7, i64 8, !16, i64 16, !18, i64 24, !18, i64 25, !10, i64 28, !10, i64 32}
!23 = !{!"Point_t", !22, i64 0, !22, i64 40, !22, i64 80}
!24 = !{!"Force_t", !22, i64 0, !22, i64 40, !22, i64 80}
!25 = !{!"", !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, !26, i64 64}
!26 = !{!"list_attributes_s", !7, i64 0, !7, i64 8, !7, i64 16, !10, i64 24, !7, i64 32, !7, i64 40, !7, i64 48}
!27 = !{!12, !10, i64 80}
!28 = !{!29, !7, i64 16}
!29 = !{!"VarTypePtr_t", !7, i64 0, !7, i64 8, !7, i64 16, !18, i64 24, !10, i64 28, !10, i64 32}
!30 = !{!16, !16, i64 0}
!31 = distinct !{!31, !32}
!32 = !{!"llvm.loop.mustprogress"}
!33 = !{!22, !16, i64 16}
!34 = distinct !{!34, !32}


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