; LLVM IR from NOAA-PMEL/Ferret :: fer/ef_utility (ef_set_axis_inheritance_6d)

; 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.ExternalFunction = type { ptr, [40 x i8], [128 x i8], i32, i32, ptr }
%struct.ExternalFunctionInternals = type { float, [128 x i8], [40 x i8], [40 x i8], i32, i32, i32, i32, [9 x [6 x i32]], [9 x [6 x i32]], [6 x i32], [6 x i32], [6 x i32], i32, [6 x i32], [6 x %struct.Axis], [9 x [6 x i32]], [9 x [6 x i32]], [9 x [6 x i32]], [9 x i32], [9 x [40 x i8]], [9 x [40 x i8]], [9 x [128 x i8]] }
%struct.Axis = type { i32, i32, i32, i32, i32, double, double, double, [40 x i8] }

@.str = external hidden unnamed_addr constant [55 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [55 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [55 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [55 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [55 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [55 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local void @ef_set_axis_inheritance_6d_(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4, ptr noundef %5, ptr noundef %6) #0 {
  %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 ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  store ptr %0, ptr %8, align 8, !tbaa !5
  store ptr %1, ptr %9, align 8, !tbaa !5
  store ptr %2, ptr %10, align 8, !tbaa !5
  store ptr %3, ptr %11, align 8, !tbaa !5
  store ptr %4, ptr %12, align 8, !tbaa !5
  store ptr %5, ptr %13, align 8, !tbaa !5
  store ptr %6, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #4
  %16 = load ptr, ptr %8, align 8, !tbaa !5
  %17 = call ptr @ef_ptr_from_id_ptr(ptr noundef %16)
  store ptr %17, ptr %15, align 8, !tbaa !5
  %18 = load ptr, ptr %15, align 8, !tbaa !5
  %19 = icmp eq ptr %18, null
  br i1 %19, label %20, label %21

20:                                               ; preds = %7
  call void @abort() #5
  unreachable

21:                                               ; preds = %7
  %22 = load ptr, ptr %9, align 8, !tbaa !5
  %23 = load i32, ptr %22, align 4, !tbaa !9
  %24 = icmp ne i32 %23, 101
  br i1 %24, label %25, label %39

25:                                               ; preds = %21
  %26 = load ptr, ptr %9, align 8, !tbaa !5
  %27 = load i32, ptr %26, align 4, !tbaa !9
  %28 = icmp ne i32 %27, 102
  br i1 %28, label %29, label %39

29:                                               ; preds = %25
  %30 = load ptr, ptr %9, align 8, !tbaa !5
  %31 = load i32, ptr %30, align 4, !tbaa !9
  %32 = icmp ne i32 %31, 103
  br i1 %32, label %33, label %39

33:                                               ; preds = %29
  %34 = load ptr, ptr %9, align 8, !tbaa !5
  %35 = load i32, ptr %34, align 4, !tbaa !9
  %36 = icmp ne i32 %35, 104
  br i1 %36, label %37, label %39

37:                                               ; preds = %33
  %38 = load ptr, ptr %8, align 8, !tbaa !5
  call void @ef_err_bail_out_(ptr noundef %38, ptr noundef @.str)
  call void @abort() #5
  unreachable

39:                                               ; preds = %33, %29, %25, %21
  %40 = load ptr, ptr %10, align 8, !tbaa !5
  %41 = load i32, ptr %40, align 4, !tbaa !9
  %42 = icmp ne i32 %41, 101
  br i1 %42, label %43, label %57

43:                                               ; preds = %39
  %44 = load ptr, ptr %10, align 8, !tbaa !5
  %45 = load i32, ptr %44, align 4, !tbaa !9
  %46 = icmp ne i32 %45, 102
  br i1 %46, label %47, label %57

47:                                               ; preds = %43
  %48 = load ptr, ptr %10, align 8, !tbaa !5
  %49 = load i32, ptr %48, align 4, !tbaa !9
  %50 = icmp ne i32 %49, 103
  br i1 %50, label %51, label %57

51:                                               ; preds = %47
  %52 = load ptr, ptr %10, align 8, !tbaa !5
  %53 = load i32, ptr %52, align 4, !tbaa !9
  %54 = icmp ne i32 %53, 104
  br i1 %54, label %55, label %57

55:                                               ; preds = %51
  %56 = load ptr, ptr %8, align 8, !tbaa !5
  call void @ef_err_bail_out_(ptr noundef %56, ptr noundef @.str.1)
  call void @abort() #5
  unreachable

57:                                               ; preds = %51, %47, %43, %39
  %58 = load ptr, ptr %11, align 8, !tbaa !5
  %59 = load i32, ptr %58, align 4, !tbaa !9
  %60 = icmp ne i32 %59, 101
  br i1 %60, label %61, label %75

61:                                               ; preds = %57
  %62 = load ptr, ptr %11, align 8, !tbaa !5
  %63 = load i32, ptr %62, align 4, !tbaa !9
  %64 = icmp ne i32 %63, 102
  br i1 %64, label %65, label %75

65:                                               ; preds = %61
  %66 = load ptr, ptr %11, align 8, !tbaa !5
  %67 = load i32, ptr %66, align 4, !tbaa !9
  %68 = icmp ne i32 %67, 103
  br i1 %68, label %69, label %75

69:                                               ; preds = %65
  %70 = load ptr, ptr %11, align 8, !tbaa !5
  %71 = load i32, ptr %70, align 4, !tbaa !9
  %72 = icmp ne i32 %71, 104
  br i1 %72, label %73, label %75

73:                                               ; preds = %69
  %74 = load ptr, ptr %8, align 8, !tbaa !5
  call void @ef_err_bail_out_(ptr noundef %74, ptr noundef @.str.2)
  call void @abort() #5
  unreachable

75:                                               ; preds = %69, %65, %61, %57
  %76 = load ptr, ptr %12, align 8, !tbaa !5
  %77 = load i32, ptr %76, align 4, !tbaa !9
  %78 = icmp ne i32 %77, 101
  br i1 %78, label %79, label %93

79:                                               ; preds = %75
  %80 = load ptr, ptr %12, align 8, !tbaa !5
  %81 = load i32, ptr %80, align 4, !tbaa !9
  %82 = icmp ne i32 %81, 102
  br i1 %82, label %83, label %93

83:                                               ; preds = %79
  %84 = load ptr, ptr %12, align 8, !tbaa !5
  %85 = load i32, ptr %84, align 4, !tbaa !9
  %86 = icmp ne i32 %85, 103
  br i1 %86, label %87, label %93

87:                                               ; preds = %83
  %88 = load ptr, ptr %12, align 8, !tbaa !5
  %89 = load i32, ptr %88, align 4, !tbaa !9
  %90 = icmp ne i32 %89, 104
  br i1 %90, label %91, label %93

91:                                               ; preds = %87
  %92 = load ptr, ptr %8, align 8, !tbaa !5
  call void @ef_err_bail_out_(ptr noundef %92, ptr noundef @.str.3)
  call void @abort() #5
  unreachable

93:                                               ; preds = %87, %83, %79, %75
  %94 = load ptr, ptr %13, align 8, !tbaa !5
  %95 = load i32, ptr %94, align 4, !tbaa !9
  %96 = icmp ne i32 %95, 101
  br i1 %96, label %97, label %111

97:                                               ; preds = %93
  %98 = load ptr, ptr %13, align 8, !tbaa !5
  %99 = load i32, ptr %98, align 4, !tbaa !9
  %100 = icmp ne i32 %99, 102
  br i1 %100, label %101, label %111

101:                                              ; preds = %97
  %102 = load ptr, ptr %13, align 8, !tbaa !5
  %103 = load i32, ptr %102, align 4, !tbaa !9
  %104 = icmp ne i32 %103, 103
  br i1 %104, label %105, label %111

105:                                              ; preds = %101
  %106 = load ptr, ptr %13, align 8, !tbaa !5
  %107 = load i32, ptr %106, align 4, !tbaa !9
  %108 = icmp ne i32 %107, 104
  br i1 %108, label %109, label %111

109:                                              ; preds = %105
  %110 = load ptr, ptr %8, align 8, !tbaa !5
  call void @ef_err_bail_out_(ptr noundef %110, ptr noundef @.str.4)
  call void @abort() #5
  unreachable

111:                                              ; preds = %105, %101, %97, %93
  %112 = load ptr, ptr %14, align 8, !tbaa !5
  %113 = load i32, ptr %112, align 4, !tbaa !9
  %114 = icmp ne i32 %113, 101
  br i1 %114, label %115, label %129

115:                                              ; preds = %111
  %116 = load ptr, ptr %14, align 8, !tbaa !5
  %117 = load i32, ptr %116, align 4, !tbaa !9
  %118 = icmp ne i32 %117, 102
  br i1 %118, label %119, label %129

119:                                              ; preds = %115
  %120 = load ptr, ptr %14, align 8, !tbaa !5
  %121 = load i32, ptr %120, align 4, !tbaa !9
  %122 = icmp ne i32 %121, 103
  br i1 %122, label %123, label %129

123:                                              ; preds = %119
  %124 = load ptr, ptr %14, align 8, !tbaa !5
  %125 = load i32, ptr %124, align 4, !tbaa !9
  %126 = icmp ne i32 %125, 104
  br i1 %126, label %127, label %129

127:                                              ; preds = %123
  %128 = load ptr, ptr %8, align 8, !tbaa !5
  call void @ef_err_bail_out_(ptr noundef %128, ptr noundef @.str.5)
  call void @abort() #5
  unreachable

129:                                              ; preds = %123, %119, %115, %111
  %130 = load ptr, ptr %9, align 8, !tbaa !5
  %131 = load i32, ptr %130, align 4, !tbaa !9
  %132 = load ptr, ptr %15, align 8, !tbaa !5
  %133 = getelementptr inbounds %struct.ExternalFunction, ptr %132, i32 0, i32 5
  %134 = load ptr, ptr %133, align 8, !tbaa !11
  %135 = getelementptr inbounds %struct.ExternalFunctionInternals, ptr %134, i32 0, i32 10
  %136 = getelementptr inbounds [6 x i32], ptr %135, i64 0, i64 0
  store i32 %131, ptr %136, align 4, !tbaa !9
  %137 = load ptr, ptr %10, align 8, !tbaa !5
  %138 = load i32, ptr %137, align 4, !tbaa !9
  %139 = load ptr, ptr %15, align 8, !tbaa !5
  %140 = getelementptr inbounds %struct.ExternalFunction, ptr %139, i32 0, i32 5
  %141 = load ptr, ptr %140, align 8, !tbaa !11
  %142 = getelementptr inbounds %struct.ExternalFunctionInternals, ptr %141, i32 0, i32 10
  %143 = getelementptr inbounds [6 x i32], ptr %142, i64 0, i64 1
  store i32 %138, ptr %143, align 4, !tbaa !9
  %144 = load ptr, ptr %11, align 8, !tbaa !5
  %145 = load i32, ptr %144, align 4, !tbaa !9
  %146 = load ptr, ptr %15, align 8, !tbaa !5
  %147 = getelementptr inbounds %struct.ExternalFunction, ptr %146, i32 0, i32 5
  %148 = load ptr, ptr %147, align 8, !tbaa !11
  %149 = getelementptr inbounds %struct.ExternalFunctionInternals, ptr %148, i32 0, i32 10
  %150 = getelementptr inbounds [6 x i32], ptr %149, i64 0, i64 2
  store i32 %145, ptr %150, align 4, !tbaa !9
  %151 = load ptr, ptr %12, align 8, !tbaa !5
  %152 = load i32, ptr %151, align 4, !tbaa !9
  %153 = load ptr, ptr %15, align 8, !tbaa !5
  %154 = getelementptr inbounds %struct.ExternalFunction, ptr %153, i32 0, i32 5
  %155 = load ptr, ptr %154, align 8, !tbaa !11
  %156 = getelementptr inbounds %struct.ExternalFunctionInternals, ptr %155, i32 0, i32 10
  %157 = getelementptr inbounds [6 x i32], ptr %156, i64 0, i64 3
  store i32 %152, ptr %157, align 4, !tbaa !9
  %158 = load ptr, ptr %13, align 8, !tbaa !5
  %159 = load i32, ptr %158, align 4, !tbaa !9
  %160 = load ptr, ptr %15, align 8, !tbaa !5
  %161 = getelementptr inbounds %struct.ExternalFunction, ptr %160, i32 0, i32 5
  %162 = load ptr, ptr %161, align 8, !tbaa !11
  %163 = getelementptr inbounds %struct.ExternalFunctionInternals, ptr %162, i32 0, i32 10
  %164 = getelementptr inbounds [6 x i32], ptr %163, i64 0, i64 4
  store i32 %159, ptr %164, align 4, !tbaa !9
  %165 = load ptr, ptr %14, align 8, !tbaa !5
  %166 = load i32, ptr %165, align 4, !tbaa !9
  %167 = load ptr, ptr %15, align 8, !tbaa !5
  %168 = getelementptr inbounds %struct.ExternalFunction, ptr %167, i32 0, i32 5
  %169 = load ptr, ptr %168, align 8, !tbaa !11
  %170 = getelementptr inbounds %struct.ExternalFunctionInternals, ptr %169, i32 0, i32 10
  %171 = getelementptr inbounds [6 x i32], ptr %170, i64 0, i64 5
  store i32 %166, ptr %171, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #4
  ret void
}

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

declare ptr @ef_ptr_from_id_ptr(ptr noundef) #2

; Function Attrs: noreturn nounwind
declare void @abort() #3

declare void @ef_err_bail_out_(ptr noundef, 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 = { noreturn 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 = { nounwind }
attributes #5 = { noreturn 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 = !{!"int", !7, i64 0}
!11 = !{!12, !6, i64 184}
!12 = !{!"", !6, i64 0, !7, i64 8, !7, i64 48, !10, i64 176, !10, i64 180, !6, i64 184}


; 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 = external hidden unnamed_addr constant [55 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [55 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [55 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [55 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [55 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [55 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local void @ef_set_axis_inheritance_6d_(ptr noundef %0, ptr nocapture noundef readonly %1, ptr nocapture noundef readonly %2, ptr nocapture noundef readonly %3, ptr nocapture noundef readonly %4, ptr nocapture noundef readonly %5, ptr nocapture noundef readonly %6) local_unnamed_addr #0 {
  %8 = tail call ptr @ef_ptr_from_id_ptr(ptr noundef %0) #3
  %9 = icmp eq ptr %8, null
  br i1 %9, label %10, label %11

10:                                               ; preds = %7
  tail call void @abort() #4
  unreachable

11:                                               ; preds = %7
  %12 = load i32, ptr %1, align 4, !tbaa !5
  %.off = add i32 %12, -101
  %switch = icmp ult i32 %.off, 4
  br i1 %switch, label %14, label %13

13:                                               ; preds = %11
  tail call void @ef_err_bail_out_(ptr noundef %0, ptr noundef nonnull @.str) #3
  tail call void @abort() #4
  unreachable

14:                                               ; preds = %11
  %15 = load i32, ptr %2, align 4, !tbaa !5
  %.off73 = add i32 %15, -101
  %switch74 = icmp ult i32 %.off73, 4
  br i1 %switch74, label %17, label %16

16:                                               ; preds = %14
  tail call void @ef_err_bail_out_(ptr noundef %0, ptr noundef nonnull @.str.1) #3
  tail call void @abort() #4
  unreachable

17:                                               ; preds = %14
  %18 = load i32, ptr %3, align 4, !tbaa !5
  %.off75 = add i32 %18, -101
  %switch76 = icmp ult i32 %.off75, 4
  br i1 %switch76, label %20, label %19

19:                                               ; preds = %17
  tail call void @ef_err_bail_out_(ptr noundef %0, ptr noundef nonnull @.str.2) #3
  tail call void @abort() #4
  unreachable

20:                                               ; preds = %17
  %21 = load i32, ptr %4, align 4, !tbaa !5
  %.off77 = add i32 %21, -101
  %switch78 = icmp ult i32 %.off77, 4
  br i1 %switch78, label %23, label %22

22:                                               ; preds = %20
  tail call void @ef_err_bail_out_(ptr noundef %0, ptr noundef nonnull @.str.3) #3
  tail call void @abort() #4
  unreachable

23:                                               ; preds = %20
  %24 = load i32, ptr %5, align 4, !tbaa !5
  %.off79 = add i32 %24, -101
  %switch80 = icmp ult i32 %.off79, 4
  br i1 %switch80, label %26, label %25

25:                                               ; preds = %23
  tail call void @ef_err_bail_out_(ptr noundef %0, ptr noundef nonnull @.str.4) #3
  tail call void @abort() #4
  unreachable

26:                                               ; preds = %23
  %27 = load i32, ptr %6, align 4, !tbaa !5
  %.off81 = add i32 %27, -101
  %switch82 = icmp ult i32 %.off81, 4
  br i1 %switch82, label %29, label %28

28:                                               ; preds = %26
  tail call void @ef_err_bail_out_(ptr noundef %0, ptr noundef nonnull @.str.5) #3
  tail call void @abort() #4
  unreachable

29:                                               ; preds = %26
  %30 = getelementptr inbounds i8, ptr %8, i64 184
  %31 = load ptr, ptr %30, align 8, !tbaa !9
  %32 = getelementptr inbounds i8, ptr %31, i64 660
  store i32 %12, ptr %32, align 4, !tbaa !5
  %33 = load i32, ptr %2, align 4, !tbaa !5
  %34 = getelementptr inbounds i8, ptr %31, i64 664
  store i32 %33, ptr %34, align 4, !tbaa !5
  %35 = load i32, ptr %3, align 4, !tbaa !5
  %36 = getelementptr inbounds i8, ptr %31, i64 668
  store i32 %35, ptr %36, align 4, !tbaa !5
  %37 = load i32, ptr %4, align 4, !tbaa !5
  %38 = getelementptr inbounds i8, ptr %31, i64 672
  store i32 %37, ptr %38, align 4, !tbaa !5
  %39 = load i32, ptr %5, align 4, !tbaa !5
  %40 = getelementptr inbounds i8, ptr %31, i64 676
  store i32 %39, ptr %40, align 4, !tbaa !5
  %41 = load i32, ptr %6, align 4, !tbaa !5
  %42 = getelementptr inbounds i8, ptr %31, i64 680
  store i32 %41, ptr %42, align 4, !tbaa !5
  ret void
}

declare ptr @ef_ptr_from_id_ptr(ptr noundef) local_unnamed_addr #1

; Function Attrs: noreturn nounwind
declare void @abort() local_unnamed_addr #2

declare void @ef_err_bail_out_(ptr noundef, 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 = { noreturn 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 #3 = { nounwind }
attributes #4 = { noreturn 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !11, i64 184}
!10 = !{!"", !11, i64 0, !7, i64 8, !7, i64 48, !6, i64 176, !6, i64 180, !11, i64 184}
!11 = !{!"any pointer", !7, i64 0}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass