; LLVM IR from NOAA-PMEL/Ferret :: fer/ef_utility (ef_set_axis_influence_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 [53 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [53 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [53 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [53 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [53 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [53 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local void @ef_set_axis_influence_6d_(ptr noundef %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4, ptr noundef %5, ptr noundef %6, ptr noundef %7) #0 {
  %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
  %16 = alloca ptr, align 8
  %17 = alloca ptr, align 8
  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 ptr %5, ptr %14, align 8, !tbaa !5
  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
  %18 = load ptr, ptr %9, align 8, !tbaa !5
  %19 = call ptr @ef_ptr_from_id_ptr(ptr noundef %18)
  store ptr %19, ptr %17, align 8, !tbaa !5
  %20 = load ptr, ptr %17, align 8, !tbaa !5
  %21 = icmp eq ptr %20, null
  br i1 %21, label %22, label %23

22:                                               ; preds = %8
  call void @abort() #5
  unreachable

23:                                               ; preds = %8
  %24 = load ptr, ptr %11, align 8, !tbaa !5
  %25 = load i32, ptr %24, align 4, !tbaa !9
  %26 = icmp ne i32 %25, 1
  br i1 %26, label %27, label %33

27:                                               ; preds = %23
  %28 = load ptr, ptr %11, align 8, !tbaa !5
  %29 = load i32, ptr %28, align 4, !tbaa !9
  %30 = icmp ne i32 %29, 0
  br i1 %30, label %31, label %33

31:                                               ; preds = %27
  %32 = load ptr, ptr %9, align 8, !tbaa !5
  call void @ef_err_bail_out_(ptr noundef %32, ptr noundef @.str)
  call void @abort() #5
  unreachable

33:                                               ; preds = %27, %23
  %34 = load ptr, ptr %12, align 8, !tbaa !5
  %35 = load i32, ptr %34, align 4, !tbaa !9
  %36 = icmp ne i32 %35, 1
  br i1 %36, label %37, label %43

37:                                               ; preds = %33
  %38 = load ptr, ptr %12, align 8, !tbaa !5
  %39 = load i32, ptr %38, align 4, !tbaa !9
  %40 = icmp ne i32 %39, 0
  br i1 %40, label %41, label %43

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

43:                                               ; preds = %37, %33
  %44 = load ptr, ptr %13, align 8, !tbaa !5
  %45 = load i32, ptr %44, align 4, !tbaa !9
  %46 = icmp ne i32 %45, 1
  br i1 %46, label %47, label %53

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

51:                                               ; preds = %47
  %52 = load ptr, ptr %9, align 8, !tbaa !5
  call void @ef_err_bail_out_(ptr noundef %52, ptr noundef @.str.2)
  call void @abort() #5
  unreachable

53:                                               ; preds = %47, %43
  %54 = load ptr, ptr %14, align 8, !tbaa !5
  %55 = load i32, ptr %54, align 4, !tbaa !9
  %56 = icmp ne i32 %55, 1
  br i1 %56, label %57, label %63

57:                                               ; preds = %53
  %58 = load ptr, ptr %14, align 8, !tbaa !5
  %59 = load i32, ptr %58, align 4, !tbaa !9
  %60 = icmp ne i32 %59, 0
  br i1 %60, label %61, label %63

61:                                               ; preds = %57
  %62 = load ptr, ptr %9, align 8, !tbaa !5
  call void @ef_err_bail_out_(ptr noundef %62, ptr noundef @.str.3)
  call void @abort() #5
  unreachable

63:                                               ; preds = %57, %53
  %64 = load ptr, ptr %15, align 8, !tbaa !5
  %65 = load i32, ptr %64, align 4, !tbaa !9
  %66 = icmp ne i32 %65, 1
  br i1 %66, label %67, label %73

67:                                               ; preds = %63
  %68 = load ptr, ptr %15, align 8, !tbaa !5
  %69 = load i32, ptr %68, align 4, !tbaa !9
  %70 = icmp ne i32 %69, 0
  br i1 %70, label %71, label %73

71:                                               ; preds = %67
  %72 = load ptr, ptr %9, align 8, !tbaa !5
  call void @ef_err_bail_out_(ptr noundef %72, ptr noundef @.str.4)
  call void @abort() #5
  unreachable

73:                                               ; preds = %67, %63
  %74 = load ptr, ptr %16, align 8, !tbaa !5
  %75 = load i32, ptr %74, align 4, !tbaa !9
  %76 = icmp ne i32 %75, 1
  br i1 %76, label %77, label %83

77:                                               ; preds = %73
  %78 = load ptr, ptr %16, align 8, !tbaa !5
  %79 = load i32, ptr %78, align 4, !tbaa !9
  %80 = icmp ne i32 %79, 0
  br i1 %80, label %81, label %83

81:                                               ; preds = %77
  %82 = load ptr, ptr %9, align 8, !tbaa !5
  call void @ef_err_bail_out_(ptr noundef %82, ptr noundef @.str.5)
  call void @abort() #5
  unreachable

83:                                               ; preds = %77, %73
  %84 = load ptr, ptr %11, align 8, !tbaa !5
  %85 = load i32, ptr %84, align 4, !tbaa !9
  %86 = load ptr, ptr %17, align 8, !tbaa !5
  %87 = getelementptr inbounds %struct.ExternalFunction, ptr %86, i32 0, i32 5
  %88 = load ptr, ptr %87, align 8, !tbaa !11
  %89 = getelementptr inbounds %struct.ExternalFunctionInternals, ptr %88, i32 0, i32 16
  %90 = load ptr, ptr %10, align 8, !tbaa !5
  %91 = load i32, ptr %90, align 4, !tbaa !9
  %92 = sub nsw i32 %91, 1
  %93 = sext i32 %92 to i64
  %94 = getelementptr inbounds [9 x [6 x i32]], ptr %89, i64 0, i64 %93
  %95 = getelementptr inbounds [6 x i32], ptr %94, i64 0, i64 0
  store i32 %85, ptr %95, align 8, !tbaa !9
  %96 = load ptr, ptr %12, align 8, !tbaa !5
  %97 = load i32, ptr %96, align 4, !tbaa !9
  %98 = load ptr, ptr %17, align 8, !tbaa !5
  %99 = getelementptr inbounds %struct.ExternalFunction, ptr %98, i32 0, i32 5
  %100 = load ptr, ptr %99, align 8, !tbaa !11
  %101 = getelementptr inbounds %struct.ExternalFunctionInternals, ptr %100, i32 0, i32 16
  %102 = load ptr, ptr %10, align 8, !tbaa !5
  %103 = load i32, ptr %102, align 4, !tbaa !9
  %104 = sub nsw i32 %103, 1
  %105 = sext i32 %104 to i64
  %106 = getelementptr inbounds [9 x [6 x i32]], ptr %101, i64 0, i64 %105
  %107 = getelementptr inbounds [6 x i32], ptr %106, i64 0, i64 1
  store i32 %97, ptr %107, align 4, !tbaa !9
  %108 = load ptr, ptr %13, align 8, !tbaa !5
  %109 = load i32, ptr %108, align 4, !tbaa !9
  %110 = load ptr, ptr %17, align 8, !tbaa !5
  %111 = getelementptr inbounds %struct.ExternalFunction, ptr %110, i32 0, i32 5
  %112 = load ptr, ptr %111, align 8, !tbaa !11
  %113 = getelementptr inbounds %struct.ExternalFunctionInternals, ptr %112, i32 0, i32 16
  %114 = load ptr, ptr %10, align 8, !tbaa !5
  %115 = load i32, ptr %114, align 4, !tbaa !9
  %116 = sub nsw i32 %115, 1
  %117 = sext i32 %116 to i64
  %118 = getelementptr inbounds [9 x [6 x i32]], ptr %113, i64 0, i64 %117
  %119 = getelementptr inbounds [6 x i32], ptr %118, i64 0, i64 2
  store i32 %109, ptr %119, align 8, !tbaa !9
  %120 = load ptr, ptr %14, align 8, !tbaa !5
  %121 = load i32, ptr %120, align 4, !tbaa !9
  %122 = load ptr, ptr %17, align 8, !tbaa !5
  %123 = getelementptr inbounds %struct.ExternalFunction, ptr %122, i32 0, i32 5
  %124 = load ptr, ptr %123, align 8, !tbaa !11
  %125 = getelementptr inbounds %struct.ExternalFunctionInternals, ptr %124, i32 0, i32 16
  %126 = load ptr, ptr %10, align 8, !tbaa !5
  %127 = load i32, ptr %126, align 4, !tbaa !9
  %128 = sub nsw i32 %127, 1
  %129 = sext i32 %128 to i64
  %130 = getelementptr inbounds [9 x [6 x i32]], ptr %125, i64 0, i64 %129
  %131 = getelementptr inbounds [6 x i32], ptr %130, i64 0, i64 3
  store i32 %121, ptr %131, align 4, !tbaa !9
  %132 = load ptr, ptr %15, align 8, !tbaa !5
  %133 = load i32, ptr %132, align 4, !tbaa !9
  %134 = load ptr, ptr %17, align 8, !tbaa !5
  %135 = getelementptr inbounds %struct.ExternalFunction, ptr %134, i32 0, i32 5
  %136 = load ptr, ptr %135, align 8, !tbaa !11
  %137 = getelementptr inbounds %struct.ExternalFunctionInternals, ptr %136, i32 0, i32 16
  %138 = load ptr, ptr %10, align 8, !tbaa !5
  %139 = load i32, ptr %138, align 4, !tbaa !9
  %140 = sub nsw i32 %139, 1
  %141 = sext i32 %140 to i64
  %142 = getelementptr inbounds [9 x [6 x i32]], ptr %137, i64 0, i64 %141
  %143 = getelementptr inbounds [6 x i32], ptr %142, i64 0, i64 4
  store i32 %133, ptr %143, align 8, !tbaa !9
  %144 = load ptr, ptr %16, align 8, !tbaa !5
  %145 = load i32, ptr %144, align 4, !tbaa !9
  %146 = load ptr, ptr %17, 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 16
  %150 = load ptr, ptr %10, align 8, !tbaa !5
  %151 = load i32, ptr %150, align 4, !tbaa !9
  %152 = sub nsw i32 %151, 1
  %153 = sext i32 %152 to i64
  %154 = getelementptr inbounds [9 x [6 x i32]], ptr %149, i64 0, i64 %153
  %155 = getelementptr inbounds [6 x i32], ptr %154, i64 0, i64 5
  store i32 %145, ptr %155, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #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 [53 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [53 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [53 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [53 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [53 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [53 x i8], align 1

; Function Attrs: nounwind uwtable
define dso_local void @ef_set_axis_influence_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, ptr nocapture noundef readonly %7) local_unnamed_addr #0 {
  %9 = tail call ptr @ef_ptr_from_id_ptr(ptr noundef %0) #3
  %10 = icmp eq ptr %9, null
  br i1 %10, label %11, label %12

11:                                               ; preds = %8
  tail call void @abort() #4
  unreachable

12:                                               ; preds = %8
  %13 = load i32, ptr %2, align 4, !tbaa !5
  %switch = icmp ult i32 %13, 2
  br i1 %switch, label %15, label %14

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

15:                                               ; preds = %12
  %16 = load i32, ptr %3, align 4, !tbaa !5
  %switch55 = icmp ult i32 %16, 2
  br i1 %switch55, label %18, label %17

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

18:                                               ; preds = %15
  %19 = load i32, ptr %4, align 4, !tbaa !5
  %switch56 = icmp ult i32 %19, 2
  br i1 %switch56, label %21, label %20

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

21:                                               ; preds = %18
  %22 = load i32, ptr %5, align 4, !tbaa !5
  %switch57 = icmp ult i32 %22, 2
  br i1 %switch57, label %24, label %23

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

24:                                               ; preds = %21
  %25 = load i32, ptr %6, align 4, !tbaa !5
  %switch58 = icmp ult i32 %25, 2
  br i1 %switch58, label %27, label %26

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

27:                                               ; preds = %24
  %28 = load i32, ptr %7, align 4, !tbaa !5
  %switch59 = icmp ult i32 %28, 2
  br i1 %switch59, label %30, label %29

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

30:                                               ; preds = %27
  %31 = getelementptr inbounds i8, ptr %9, i64 184
  %32 = load ptr, ptr %31, align 8, !tbaa !9
  %33 = getelementptr inbounds i8, ptr %32, i64 1288
  %34 = load i32, ptr %1, align 4, !tbaa !5
  %35 = add nsw i32 %34, -1
  %36 = sext i32 %35 to i64
  %37 = getelementptr inbounds [9 x [6 x i32]], ptr %33, i64 0, i64 %36
  store i32 %13, ptr %37, align 8, !tbaa !5
  %38 = load i32, ptr %3, align 4, !tbaa !5
  %39 = load i32, ptr %1, align 4, !tbaa !5
  %40 = add nsw i32 %39, -1
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds [9 x [6 x i32]], ptr %33, i64 0, i64 %41, i64 1
  store i32 %38, ptr %42, align 4, !tbaa !5
  %43 = load i32, ptr %4, align 4, !tbaa !5
  %44 = load i32, ptr %1, align 4, !tbaa !5
  %45 = add nsw i32 %44, -1
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds [9 x [6 x i32]], ptr %33, i64 0, i64 %46, i64 2
  store i32 %43, ptr %47, align 8, !tbaa !5
  %48 = load i32, ptr %5, align 4, !tbaa !5
  %49 = load i32, ptr %1, align 4, !tbaa !5
  %50 = add nsw i32 %49, -1
  %51 = sext i32 %50 to i64
  %52 = getelementptr inbounds [9 x [6 x i32]], ptr %33, i64 0, i64 %51, i64 3
  store i32 %48, ptr %52, align 4, !tbaa !5
  %53 = load i32, ptr %6, align 4, !tbaa !5
  %54 = load i32, ptr %1, align 4, !tbaa !5
  %55 = add nsw i32 %54, -1
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds [9 x [6 x i32]], ptr %33, i64 0, i64 %56, i64 4
  store i32 %53, ptr %57, align 8, !tbaa !5
  %58 = load i32, ptr %7, align 4, !tbaa !5
  %59 = load i32, ptr %1, align 4, !tbaa !5
  %60 = add nsw i32 %59, -1
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds [9 x [6 x i32]], ptr %33, i64 0, i64 %61, i64 5
  store i32 %58, ptr %62, 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