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

; 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.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.VarType_t = type { ptr, ptr, double, i8, i8, i32, i32 }
%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.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.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.CableLibrary_t = type { double, double, double, double, double, double, double, double, double, double, ptr }

@.str.110 = 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 i32 @biseqcstrcaseless(ptr noundef, ptr noundef) #1

declare void @set_universal_error_with_message(ptr noundef, ptr noundef, i32 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

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

19:                                               ; preds = %41, %5
  %20 = load ptr, ptr %8, align 8, !tbaa !5
  %21 = getelementptr inbounds %struct.Domain_t, ptr %20, i32 0, i32 6
  %22 = call i32 @list_iterator_hasnext(ptr noundef %21)
  %23 = icmp ne i32 %22, 0
  br i1 %23, label %24, label %42

24:                                               ; preds = %19
  %25 = load ptr, ptr %8, align 8, !tbaa !5
  %26 = getelementptr inbounds %struct.Domain_t, ptr %25, i32 0, i32 6
  %27 = call ptr @list_iterator_next(ptr noundef %26)
  store ptr %27, ptr %12, align 8, !tbaa !5
  %28 = load ptr, ptr %12, align 8, !tbaa !5
  %29 = getelementptr inbounds %struct.CableLibrary_t, ptr %28, i32 0, i32 10
  %30 = load ptr, ptr %29, align 8, !tbaa !19
  %31 = load ptr, ptr %9, align 8, !tbaa !5
  %32 = call i32 @biseqcstrcaseless(ptr noundef %30, ptr noundef %31)
  %33 = icmp ne i32 %32, 0
  br i1 %33, label %34, label %41

34:                                               ; preds = %24
  %35 = load ptr, ptr %12, align 8, !tbaa !5
  %36 = load ptr, ptr %7, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct.Line_t, ptr %36, i32 0, i32 0
  store ptr %35, ptr %37, align 8, !tbaa !9
  %38 = load ptr, ptr %8, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct.Domain_t, ptr %38, i32 0, i32 6
  %40 = call i32 @list_iterator_stop(ptr noundef %39)
  br label %42

41:                                               ; preds = %24
  br label %19, !llvm.loop !21

42:                                               ; preds = %34, %19
  %43 = load ptr, ptr %8, align 8, !tbaa !5
  %44 = getelementptr inbounds %struct.Domain_t, ptr %43, i32 0, i32 6
  %45 = call i32 @list_iterator_stop(ptr noundef %44)
  %46 = load ptr, ptr %7, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct.Line_t, ptr %46, i32 0, i32 0
  %48 = load ptr, ptr %47, align 8, !tbaa !9
  %49 = icmp eq ptr %48, null
  br i1 %49, label %50, label %54

50:                                               ; preds = %42
  %51 = load ptr, ptr %10, align 8, !tbaa !5
  %52 = load ptr, ptr %11, align 8, !tbaa !5
  %53 = load ptr, ptr %9, align 8, !tbaa !5
  call void (ptr, ptr, i32, ptr, ...) @set_universal_error_with_message(ptr noundef %51, ptr noundef %52, i32 noundef 27, ptr noundef @.str.110, ptr noundef %53)
  store i32 3, ptr %6, align 4
  store i32 1, ptr %13, align 4
  br label %55

54:                                               ; preds = %42
  store i32 0, ptr %6, align 4
  store i32 1, ptr %13, align 4
  br label %55

55:                                               ; preds = %54, %50
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #3
  %56 = load i32, ptr %6, align 4
  ret i32 %56
}

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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !6, i64 0}
!10 = !{!"Line_t", !6, i64 0, !11, i64 8, !13, i64 40, !13, i64 80, !15, i64 120, !6, i64 160, !6, i64 168, !16, i64 176, !16, i64 184, !16, i64 192, !16, i64 200, !16, i64 208, !16, i64 216, !16, i64 224, !16, i64 232, !16, i64 240, !16, i64 248, !16, i64 256, !16, i64 264, !16, i64 272, !16, i64 280, !16, i64 288, !16, i64 296, !16, i64 304, !16, i64 312, !17, i64 320, !6, i64 440, !6, i64 448, !14, i64 456, !14, i64 460, !14, i64 464, !14, i64 468, !14, i64 472}
!11 = !{!"", !12, i64 0, !12, i64 1, !12, i64 2, !12, i64 3, !12, i64 4, !12, i64 5, !12, i64 6, !12, i64 7, !12, i64 8, !12, i64 9, !12, i64 10, !12, i64 11, !12, i64 12, !12, i64 13, !12, i64 14, !12, i64 15, !12, i64 16, !12, i64 17, !12, i64 18, !12, i64 19, !12, i64 20, !12, i64 21, !12, i64 22, !12, i64 23, !12, i64 24, !12, i64 25}
!12 = !{!"_Bool", !7, i64 0}
!13 = !{!"VarTypePtr_t", !6, i64 0, !6, i64 8, !6, i64 16, !12, i64 24, !14, i64 28, !14, i64 32}
!14 = !{!"int", !7, i64 0}
!15 = !{!"VarType_t", !6, i64 0, !6, i64 8, !16, i64 16, !12, i64 24, !12, i64 25, !14, i64 28, !14, i64 32}
!16 = !{!"double", !7, i64 0}
!17 = !{!"", !6, i64 0, !6, i64 8, !6, i64 16, !14, i64 24, !6, i64 32, !14, i64 40, !14, i64 44, !14, i64 48, !6, i64 56, !18, i64 64}
!18 = !{!"list_attributes_s", !6, i64 0, !6, i64 8, !6, i64 16, !14, i64 24, !6, i64 32, !6, i64 40, !6, i64 48}
!19 = !{!20, !6, i64 80}
!20 = !{!"CableLibrary_t", !16, i64 0, !16, i64 8, !16, i64 16, !16, i64 24, !16, i64 32, !16, i64 40, !16, i64 48, !16, i64 56, !16, i64 64, !16, i64 72, !6, i64 80}
!21 = distinct !{!21, !22}
!22 = !{!"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"

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

declare i32 @biseqcstrcaseless(ptr noundef, 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 @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 range(i32 0, 4) i32 @associate_line_with_cable_property(ptr nocapture noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4) local_unnamed_addr #1 {
  store ptr null, ptr %0, align 8, !tbaa !5
  %6 = getelementptr inbounds i8, ptr %1, i64 968
  %7 = tail call i32 @list_iterator_start(ptr noundef nonnull %6) #2
  br label %8

8:                                                ; preds = %10, %5
  %9 = tail call i32 @list_iterator_hasnext(ptr noundef nonnull %6) #2
  %.not = icmp eq i32 %9, 0
  br i1 %.not, label %.loopexit, label %10

10:                                               ; preds = %8
  %11 = tail call ptr @list_iterator_next(ptr noundef nonnull %6) #2
  %12 = getelementptr inbounds i8, ptr %11, i64 80
  %13 = load ptr, ptr %12, align 8, !tbaa !18
  %14 = tail call i32 @biseqcstrcaseless(ptr noundef %13, ptr noundef %2) #2
  %.not14 = icmp eq i32 %14, 0
  br i1 %.not14, label %8, label %15, !llvm.loop !20

15:                                               ; preds = %10
  store ptr %11, ptr %0, align 8, !tbaa !5
  %16 = tail call i32 @list_iterator_stop(ptr noundef nonnull %6) #2
  br label %.loopexit

.loopexit:                                        ; preds = %8, %15
  %17 = tail call i32 @list_iterator_stop(ptr noundef nonnull %6) #2
  %18 = load ptr, ptr %0, align 8, !tbaa !5
  %19 = icmp eq ptr %18, null
  br i1 %19, label %20, label %21

20:                                               ; preds = %.loopexit
  tail call void (ptr, ptr, i32, ptr, ...) @set_universal_error_with_message(ptr noundef %3, ptr noundef %4, i32 noundef 27, ptr noundef nonnull @.str.110, ptr noundef %2) #2
  br label %21

21:                                               ; preds = %.loopexit, %20
  %.0 = phi i32 [ 3, %20 ], [ 0, %.loopexit ]
  ret i32 %.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 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nounwind }

!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 = !{!"Line_t", !7, i64 0, !10, i64 8, !12, i64 40, !12, i64 80, !14, i64 120, !7, i64 160, !7, i64 168, !15, i64 176, !15, i64 184, !15, i64 192, !15, i64 200, !15, i64 208, !15, i64 216, !15, i64 224, !15, i64 232, !15, i64 240, !15, i64 248, !15, i64 256, !15, i64 264, !15, i64 272, !15, i64 280, !15, i64 288, !15, i64 296, !15, i64 304, !15, i64 312, !16, i64 320, !7, i64 440, !7, i64 448, !13, i64 456, !13, i64 460, !13, i64 464, !13, i64 468, !13, i64 472}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"", !11, i64 0, !11, i64 1, !11, i64 2, !11, i64 3, !11, i64 4, !11, i64 5, !11, i64 6, !11, i64 7, !11, i64 8, !11, i64 9, !11, i64 10, !11, i64 11, !11, i64 12, !11, i64 13, !11, i64 14, !11, i64 15, !11, i64 16, !11, i64 17, !11, i64 18, !11, i64 19, !11, i64 20, !11, i64 21, !11, i64 22, !11, i64 23, !11, i64 24, !11, i64 25}
!11 = !{!"_Bool", !8, i64 0}
!12 = !{!"VarTypePtr_t", !7, i64 0, !7, i64 8, !7, i64 16, !11, i64 24, !13, i64 28, !13, i64 32}
!13 = !{!"int", !8, i64 0}
!14 = !{!"VarType_t", !7, i64 0, !7, i64 8, !15, i64 16, !11, i64 24, !11, i64 25, !13, i64 28, !13, i64 32}
!15 = !{!"double", !8, i64 0}
!16 = !{!"", !7, i64 0, !7, i64 8, !7, i64 16, !13, i64 24, !7, i64 32, !13, i64 40, !13, i64 44, !13, i64 48, !7, i64 56, !17, i64 64}
!17 = !{!"list_attributes_s", !7, i64 0, !7, i64 8, !7, i64 16, !13, i64 24, !7, i64 32, !7, i64 40, !7, i64 48}
!18 = !{!19, !7, i64 80}
!19 = !{!"CableLibrary_t", !15, i64 0, !15, i64 8, !15, i64 16, !15, i64 24, !15, i64 32, !15, i64 40, !15, i64 48, !15, i64 56, !15, i64 64, !15, i64 72, !7, i64 80}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.mustprogress"}


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