; LLVM IR from ERGO-Code/HiGHS :: src/ipm/ipx/iterate.ll (ZNK3ipx7Iterate22ComputeComplementarityEv)

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

%"class.ipx::Iterate" = type { ptr, %"class.std::valarray", %"class.std::valarray", %"class.std::valarray", %"class.std::valarray", %"class.std::valarray", %"class.std::valarray", %"class.std::vector", %"class.std::valarray", %"class.std::valarray", %"class.std::valarray", %"class.std::valarray", double, double, double, double, double, double, double, double, double, i8, i8, double, double, double }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<ipx::Iterate::StateDetail, std::allocator<ipx::Iterate::StateDetail>>::_Vector_impl" }
%"struct.std::_Vector_base<ipx::Iterate::StateDetail, std::allocator<ipx::Iterate::StateDetail>>::_Vector_impl" = type { %"struct.std::_Vector_base<ipx::Iterate::StateDetail, std::allocator<ipx::Iterate::StateDetail>>::_Vector_impl_data" }
%"struct.std::_Vector_base<ipx::Iterate::StateDetail, std::allocator<ipx::Iterate::StateDetail>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::valarray" = type { i64, ptr }

; 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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK3ipx5Model4rowsEv(ptr noundef nonnull align 8 dereferenceable(704)) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK3ipx5Model4colsEv(ptr noundef nonnull align 8 dereferenceable(704)) #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt8valarrayIdEixEm(ptr noundef nonnull align 8 dereferenceable(16), i64 noundef) #2 align 2

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK3ipx7Iterate14has_barrier_lbEi(ptr noundef nonnull align 8 dereferenceable(296), i32 noundef) #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK3ipx7Iterate14has_barrier_ubEi(ptr noundef nonnull align 8 dereferenceable(296), i32 noundef) #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) #2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZNK3ipx7Iterate22ComputeComplementarityEv(ptr noundef nonnull align 8 dereferenceable(296) %0) #4 align 2 {
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca double, align 8
  %8 = alloca double, align 8
  %9 = alloca i32, align 4
  %10 = alloca double, align 8
  %11 = alloca double, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  %12 = load ptr, ptr %2, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  %13 = getelementptr inbounds %"class.ipx::Iterate", ptr %12, i32 0, i32 0
  %14 = load ptr, ptr %13, align 8, !tbaa !9
  %15 = call noundef i32 @_ZNK3ipx5Model4rowsEv(ptr noundef nonnull align 8 dereferenceable(704) %14)
  store i32 %15, ptr %3, align 4, !tbaa !19
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #5
  %16 = getelementptr inbounds %"class.ipx::Iterate", ptr %12, i32 0, i32 0
  %17 = load ptr, ptr %16, align 8, !tbaa !9
  %18 = call noundef i32 @_ZNK3ipx5Model4colsEv(ptr noundef nonnull align 8 dereferenceable(704) %17)
  store i32 %18, ptr %4, align 4, !tbaa !19
  %19 = getelementptr inbounds %"class.ipx::Iterate", ptr %12, i32 0, i32 17
  store double 0.000000e+00, ptr %19, align 8, !tbaa !21
  %20 = getelementptr inbounds %"class.ipx::Iterate", ptr %12, i32 0, i32 19
  store double 0x7FF0000000000000, ptr %20, align 8, !tbaa !22
  %21 = getelementptr inbounds %"class.ipx::Iterate", ptr %12, i32 0, i32 20
  store double 0.000000e+00, ptr %21, align 8, !tbaa !23
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #5
  store i32 0, ptr %5, align 4, !tbaa !19
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #5
  store i32 0, ptr %6, align 4, !tbaa !19
  br label %22

22:                                               ; preds = %79, %1
  %23 = load i32, ptr %6, align 4, !tbaa !19
  %24 = load i32, ptr %4, align 4, !tbaa !19
  %25 = load i32, ptr %3, align 4, !tbaa !19
  %26 = add nsw i32 %24, %25
  %27 = icmp slt i32 %23, %26
  br i1 %27, label %29, label %28

28:                                               ; preds = %22
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #5
  br label %82

29:                                               ; preds = %22
  %30 = load i32, ptr %6, align 4, !tbaa !19
  %31 = call noundef zeroext i1 @_ZNK3ipx7Iterate14has_barrier_lbEi(ptr noundef nonnull align 8 dereferenceable(296) %12, i32 noundef %30)
  br i1 %31, label %32, label %78

32:                                               ; preds = %29
  %33 = getelementptr inbounds %"class.ipx::Iterate", ptr %12, i32 0, i32 2
  %34 = load i32, ptr %6, align 4, !tbaa !19
  %35 = sext i32 %34 to i64
  %36 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt8valarrayIdEixEm(ptr noundef nonnull align 8 dereferenceable(16) %33, i64 noundef %35) #5
  %37 = load double, ptr %36, align 8, !tbaa !24
  %38 = getelementptr inbounds %"class.ipx::Iterate", ptr %12, i32 0, i32 5
  %39 = load i32, ptr %6, align 4, !tbaa !19
  %40 = sext i32 %39 to i64
  %41 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt8valarrayIdEixEm(ptr noundef nonnull align 8 dereferenceable(16) %38, i64 noundef %40) #5
  %42 = load double, ptr %41, align 8, !tbaa !24
  %43 = getelementptr inbounds %"class.ipx::Iterate", ptr %12, i32 0, i32 17
  %44 = load double, ptr %43, align 8, !tbaa !21
  %45 = call double @llvm.fmuladd.f64(double %37, double %42, double %44)
  store double %45, ptr %43, align 8, !tbaa !21
  %46 = getelementptr inbounds %"class.ipx::Iterate", ptr %12, i32 0, i32 19
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  %47 = getelementptr inbounds %"class.ipx::Iterate", ptr %12, i32 0, i32 2
  %48 = load i32, ptr %6, align 4, !tbaa !19
  %49 = sext i32 %48 to i64
  %50 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt8valarrayIdEixEm(ptr noundef nonnull align 8 dereferenceable(16) %47, i64 noundef %49) #5
  %51 = load double, ptr %50, align 8, !tbaa !24
  %52 = getelementptr inbounds %"class.ipx::Iterate", ptr %12, i32 0, i32 5
  %53 = load i32, ptr %6, align 4, !tbaa !19
  %54 = sext i32 %53 to i64
  %55 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt8valarrayIdEixEm(ptr noundef nonnull align 8 dereferenceable(16) %52, i64 noundef %54) #5
  %56 = load double, ptr %55, align 8, !tbaa !24
  %57 = fmul double %51, %56
  store double %57, ptr %7, align 8, !tbaa !24
  %58 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %46, ptr noundef nonnull align 8 dereferenceable(8) %7)
  %59 = load double, ptr %58, align 8, !tbaa !24
  %60 = getelementptr inbounds %"class.ipx::Iterate", ptr %12, i32 0, i32 19
  store double %59, ptr %60, align 8, !tbaa !22
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  %61 = getelementptr inbounds %"class.ipx::Iterate", ptr %12, i32 0, i32 20
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  %62 = getelementptr inbounds %"class.ipx::Iterate", ptr %12, i32 0, i32 2
  %63 = load i32, ptr %6, align 4, !tbaa !19
  %64 = sext i32 %63 to i64
  %65 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt8valarrayIdEixEm(ptr noundef nonnull align 8 dereferenceable(16) %62, i64 noundef %64) #5
  %66 = load double, ptr %65, align 8, !tbaa !24
  %67 = getelementptr inbounds %"class.ipx::Iterate", ptr %12, i32 0, i32 5
  %68 = load i32, ptr %6, align 4, !tbaa !19
  %69 = sext i32 %68 to i64
  %70 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt8valarrayIdEixEm(ptr noundef nonnull align 8 dereferenceable(16) %67, i64 noundef %69) #5
  %71 = load double, ptr %70, align 8, !tbaa !24
  %72 = fmul double %66, %71
  store double %72, ptr %8, align 8, !tbaa !24
  %73 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %61, ptr noundef nonnull align 8 dereferenceable(8) %8)
  %74 = load double, ptr %73, align 8, !tbaa !24
  %75 = getelementptr inbounds %"class.ipx::Iterate", ptr %12, i32 0, i32 20
  store double %74, ptr %75, align 8, !tbaa !23
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  %76 = load i32, ptr %5, align 4, !tbaa !19
  %77 = add nsw i32 %76, 1
  store i32 %77, ptr %5, align 4, !tbaa !19
  br label %78

78:                                               ; preds = %32, %29
  br label %79

79:                                               ; preds = %78
  %80 = load i32, ptr %6, align 4, !tbaa !19
  %81 = add nsw i32 %80, 1
  store i32 %81, ptr %6, align 4, !tbaa !19
  br label %22, !llvm.loop !25

82:                                               ; preds = %28
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  store i32 0, ptr %9, align 4, !tbaa !19
  br label %83

83:                                               ; preds = %140, %82
  %84 = load i32, ptr %9, align 4, !tbaa !19
  %85 = load i32, ptr %4, align 4, !tbaa !19
  %86 = load i32, ptr %3, align 4, !tbaa !19
  %87 = add nsw i32 %85, %86
  %88 = icmp slt i32 %84, %87
  br i1 %88, label %90, label %89

89:                                               ; preds = %83
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  br label %143

90:                                               ; preds = %83
  %91 = load i32, ptr %9, align 4, !tbaa !19
  %92 = call noundef zeroext i1 @_ZNK3ipx7Iterate14has_barrier_ubEi(ptr noundef nonnull align 8 dereferenceable(296) %12, i32 noundef %91)
  br i1 %92, label %93, label %139

93:                                               ; preds = %90
  %94 = getelementptr inbounds %"class.ipx::Iterate", ptr %12, i32 0, i32 3
  %95 = load i32, ptr %9, align 4, !tbaa !19
  %96 = sext i32 %95 to i64
  %97 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt8valarrayIdEixEm(ptr noundef nonnull align 8 dereferenceable(16) %94, i64 noundef %96) #5
  %98 = load double, ptr %97, align 8, !tbaa !24
  %99 = getelementptr inbounds %"class.ipx::Iterate", ptr %12, i32 0, i32 6
  %100 = load i32, ptr %9, align 4, !tbaa !19
  %101 = sext i32 %100 to i64
  %102 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt8valarrayIdEixEm(ptr noundef nonnull align 8 dereferenceable(16) %99, i64 noundef %101) #5
  %103 = load double, ptr %102, align 8, !tbaa !24
  %104 = getelementptr inbounds %"class.ipx::Iterate", ptr %12, i32 0, i32 17
  %105 = load double, ptr %104, align 8, !tbaa !21
  %106 = call double @llvm.fmuladd.f64(double %98, double %103, double %105)
  store double %106, ptr %104, align 8, !tbaa !21
  %107 = getelementptr inbounds %"class.ipx::Iterate", ptr %12, i32 0, i32 19
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  %108 = getelementptr inbounds %"class.ipx::Iterate", ptr %12, i32 0, i32 3
  %109 = load i32, ptr %9, align 4, !tbaa !19
  %110 = sext i32 %109 to i64
  %111 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt8valarrayIdEixEm(ptr noundef nonnull align 8 dereferenceable(16) %108, i64 noundef %110) #5
  %112 = load double, ptr %111, align 8, !tbaa !24
  %113 = getelementptr inbounds %"class.ipx::Iterate", ptr %12, i32 0, i32 6
  %114 = load i32, ptr %9, align 4, !tbaa !19
  %115 = sext i32 %114 to i64
  %116 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt8valarrayIdEixEm(ptr noundef nonnull align 8 dereferenceable(16) %113, i64 noundef %115) #5
  %117 = load double, ptr %116, align 8, !tbaa !24
  %118 = fmul double %112, %117
  store double %118, ptr %10, align 8, !tbaa !24
  %119 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %107, ptr noundef nonnull align 8 dereferenceable(8) %10)
  %120 = load double, ptr %119, align 8, !tbaa !24
  %121 = getelementptr inbounds %"class.ipx::Iterate", ptr %12, i32 0, i32 19
  store double %120, ptr %121, align 8, !tbaa !22
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  %122 = getelementptr inbounds %"class.ipx::Iterate", ptr %12, i32 0, i32 20
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  %123 = getelementptr inbounds %"class.ipx::Iterate", ptr %12, i32 0, i32 3
  %124 = load i32, ptr %9, align 4, !tbaa !19
  %125 = sext i32 %124 to i64
  %126 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt8valarrayIdEixEm(ptr noundef nonnull align 8 dereferenceable(16) %123, i64 noundef %125) #5
  %127 = load double, ptr %126, align 8, !tbaa !24
  %128 = getelementptr inbounds %"class.ipx::Iterate", ptr %12, i32 0, i32 6
  %129 = load i32, ptr %9, align 4, !tbaa !19
  %130 = sext i32 %129 to i64
  %131 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt8valarrayIdEixEm(ptr noundef nonnull align 8 dereferenceable(16) %128, i64 noundef %130) #5
  %132 = load double, ptr %131, align 8, !tbaa !24
  %133 = fmul double %127, %132
  store double %133, ptr %11, align 8, !tbaa !24
  %134 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %122, ptr noundef nonnull align 8 dereferenceable(8) %11)
  %135 = load double, ptr %134, align 8, !tbaa !24
  %136 = getelementptr inbounds %"class.ipx::Iterate", ptr %12, i32 0, i32 20
  store double %135, ptr %136, align 8, !tbaa !23
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  %137 = load i32, ptr %5, align 4, !tbaa !19
  %138 = add nsw i32 %137, 1
  store i32 %138, ptr %5, align 4, !tbaa !19
  br label %139

139:                                              ; preds = %93, %90
  br label %140

140:                                              ; preds = %139
  %141 = load i32, ptr %9, align 4, !tbaa !19
  %142 = add nsw i32 %141, 1
  store i32 %142, ptr %9, align 4, !tbaa !19
  br label %83, !llvm.loop !27

143:                                              ; preds = %89
  %144 = load i32, ptr %5, align 4, !tbaa !19
  %145 = icmp sgt i32 %144, 0
  br i1 %145, label %146, label %153

146:                                              ; preds = %143
  %147 = getelementptr inbounds %"class.ipx::Iterate", ptr %12, i32 0, i32 17
  %148 = load double, ptr %147, align 8, !tbaa !21
  %149 = load i32, ptr %5, align 4, !tbaa !19
  %150 = sitofp i32 %149 to double
  %151 = fdiv double %148, %150
  %152 = getelementptr inbounds %"class.ipx::Iterate", ptr %12, i32 0, i32 18
  store double %151, ptr %152, align 8, !tbaa !28
  br label %156

153:                                              ; preds = %143
  %154 = getelementptr inbounds %"class.ipx::Iterate", ptr %12, i32 0, i32 19
  store double 0.000000e+00, ptr %154, align 8, !tbaa !22
  %155 = getelementptr inbounds %"class.ipx::Iterate", ptr %12, i32 0, i32 18
  store double 0.000000e+00, ptr %155, align 8, !tbaa !28
  br label %156

156:                                              ; preds = %153, %146
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  ret void
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress 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 = { inlinehint mustprogress 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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { mustprogress 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 #5 = { 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++ TBAA"}
!9 = !{!10, !6, i64 0}
!10 = !{!"_ZTSN3ipx7IterateE", !6, i64 0, !11, i64 8, !11, i64 24, !11, i64 40, !11, i64 56, !11, i64 72, !11, i64 88, !13, i64 104, !11, i64 128, !11, i64 144, !11, i64 160, !11, i64 176, !17, i64 192, !17, i64 200, !17, i64 208, !17, i64 216, !17, i64 224, !17, i64 232, !17, i64 240, !17, i64 248, !17, i64 256, !18, i64 264, !18, i64 265, !17, i64 272, !17, i64 280, !17, i64 288}
!11 = !{!"_ZTSSt8valarrayIdE", !12, i64 0, !6, i64 8}
!12 = !{!"long", !7, i64 0}
!13 = !{!"_ZTSSt6vectorIN3ipx7Iterate11StateDetailESaIS2_EE", !14, i64 0}
!14 = !{!"_ZTSSt12_Vector_baseIN3ipx7Iterate11StateDetailESaIS2_EE", !15, i64 0}
!15 = !{!"_ZTSNSt12_Vector_baseIN3ipx7Iterate11StateDetailESaIS2_EE12_Vector_implE", !16, i64 0}
!16 = !{!"_ZTSNSt12_Vector_baseIN3ipx7Iterate11StateDetailESaIS2_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!17 = !{!"double", !7, i64 0}
!18 = !{!"bool", !7, i64 0}
!19 = !{!20, !20, i64 0}
!20 = !{!"int", !7, i64 0}
!21 = !{!10, !17, i64 232}
!22 = !{!10, !17, i64 248}
!23 = !{!10, !17, i64 256}
!24 = !{!17, !17, i64 0}
!25 = distinct !{!25, !26}
!26 = !{!"llvm.loop.mustprogress"}
!27 = distinct !{!27, !26}
!28 = !{!10, !17, i64 240}


; 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: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK3ipx5Model4rowsEv(ptr noundef nonnull align 8 dereferenceable(704)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK3ipx5Model4colsEv(ptr noundef nonnull align 8 dereferenceable(704)) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt8valarrayIdEixEm(ptr noundef nonnull align 8 dereferenceable(16), i64 noundef) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fmuladd.f64(double, double, double) #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK3ipx7Iterate14has_barrier_lbEi(ptr noundef nonnull align 8 dereferenceable(296), i32 noundef) local_unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK3ipx7Iterate14has_barrier_ubEi(ptr noundef nonnull align 8 dereferenceable(296), i32 noundef) local_unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZNK3ipx7Iterate22ComputeComplementarityEv(ptr noundef nonnull align 8 dereferenceable(296) %0) local_unnamed_addr #1 align 2 {
  %2 = alloca double, align 8
  %3 = alloca double, align 8
  %4 = alloca double, align 8
  %5 = alloca double, align 8
  %6 = load ptr, ptr %0, align 8, !tbaa !5
  %7 = tail call noundef i32 @_ZNK3ipx5Model4rowsEv(ptr noundef nonnull align 8 dereferenceable(704) %6)
  %8 = load ptr, ptr %0, align 8, !tbaa !5
  %9 = tail call noundef i32 @_ZNK3ipx5Model4colsEv(ptr noundef nonnull align 8 dereferenceable(704) %8)
  %10 = getelementptr inbounds i8, ptr %0, i64 232
  store double 0.000000e+00, ptr %10, align 8, !tbaa !18
  %11 = getelementptr inbounds i8, ptr %0, i64 248
  %12 = getelementptr inbounds i8, ptr %0, i64 256
  store <2 x double> <double 0x7FF0000000000000, double 0.000000e+00>, ptr %11, align 8, !tbaa !19
  %13 = add nsw i32 %9, %7
  %14 = icmp sgt i32 %13, 0
  br i1 %14, label %.lr.ph, label %._crit_edge.thread

.lr.ph:                                           ; preds = %1
  %15 = getelementptr inbounds i8, ptr %0, i64 24
  %16 = getelementptr inbounds i8, ptr %0, i64 72
  %wide.trip.count = zext nneg i32 %13 to i64
  br label %19

.preheader:                                       ; preds = %44
  br i1 %14, label %.lr.ph34, label %._crit_edge

.lr.ph34:                                         ; preds = %.preheader
  %17 = getelementptr inbounds i8, ptr %0, i64 40
  %18 = getelementptr inbounds i8, ptr %0, i64 88
  %wide.trip.count40 = zext nneg i32 %13 to i64
  br label %46

19:                                               ; preds = %.lr.ph, %44
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %44 ]
  %.02729 = phi i32 [ 0, %.lr.ph ], [ %.1, %44 ]
  %20 = trunc nuw nsw i64 %indvars.iv to i32
  %21 = call noundef zeroext i1 @_ZNK3ipx7Iterate14has_barrier_lbEi(ptr noundef nonnull align 8 dereferenceable(296) %0, i32 noundef %20)
  br i1 %21, label %22, label %44

22:                                               ; preds = %19
  %23 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt8valarrayIdEixEm(ptr noundef nonnull align 8 dereferenceable(16) %15, i64 noundef %indvars.iv) #4
  %24 = load double, ptr %23, align 8, !tbaa !19
  %25 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt8valarrayIdEixEm(ptr noundef nonnull align 8 dereferenceable(16) %16, i64 noundef %indvars.iv) #4
  %26 = load double, ptr %25, align 8, !tbaa !19
  %27 = load double, ptr %10, align 8, !tbaa !18
  %28 = call double @llvm.fmuladd.f64(double %24, double %26, double %27)
  store double %28, ptr %10, align 8, !tbaa !18
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #4
  %29 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt8valarrayIdEixEm(ptr noundef nonnull align 8 dereferenceable(16) %15, i64 noundef %indvars.iv) #4
  %30 = load double, ptr %29, align 8, !tbaa !19
  %31 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt8valarrayIdEixEm(ptr noundef nonnull align 8 dereferenceable(16) %16, i64 noundef %indvars.iv) #4
  %32 = load double, ptr %31, align 8, !tbaa !19
  %33 = fmul double %30, %32
  store double %33, ptr %2, align 8, !tbaa !19
  %34 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %11, ptr noundef nonnull align 8 dereferenceable(8) %2)
  %35 = load double, ptr %34, align 8, !tbaa !19
  store double %35, ptr %11, align 8, !tbaa !20
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #4
  %36 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt8valarrayIdEixEm(ptr noundef nonnull align 8 dereferenceable(16) %15, i64 noundef %indvars.iv) #4
  %37 = load double, ptr %36, align 8, !tbaa !19
  %38 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt8valarrayIdEixEm(ptr noundef nonnull align 8 dereferenceable(16) %16, i64 noundef %indvars.iv) #4
  %39 = load double, ptr %38, align 8, !tbaa !19
  %40 = fmul double %37, %39
  store double %40, ptr %3, align 8, !tbaa !19
  %41 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef nonnull align 8 dereferenceable(8) %3)
  %42 = load double, ptr %41, align 8, !tbaa !19
  store double %42, ptr %12, align 8, !tbaa !21
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #4
  %43 = add nsw i32 %.02729, 1
  br label %44

44:                                               ; preds = %19, %22
  %.1 = phi i32 [ %43, %22 ], [ %.02729, %19 ]
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %.preheader, label %19, !llvm.loop !22

._crit_edge:                                      ; preds = %71, %.preheader
  %.2.lcssa = phi i32 [ %.1, %.preheader ], [ %.3, %71 ]
  %45 = icmp sgt i32 %.2.lcssa, 0
  br i1 %45, label %72, label %._crit_edge.thread

46:                                               ; preds = %.lr.ph34, %71
  %indvars.iv37 = phi i64 [ 0, %.lr.ph34 ], [ %indvars.iv.next38, %71 ]
  %.232 = phi i32 [ %.1, %.lr.ph34 ], [ %.3, %71 ]
  %47 = trunc nuw nsw i64 %indvars.iv37 to i32
  %48 = call noundef zeroext i1 @_ZNK3ipx7Iterate14has_barrier_ubEi(ptr noundef nonnull align 8 dereferenceable(296) %0, i32 noundef %47)
  br i1 %48, label %49, label %71

49:                                               ; preds = %46
  %50 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt8valarrayIdEixEm(ptr noundef nonnull align 8 dereferenceable(16) %17, i64 noundef %indvars.iv37) #4
  %51 = load double, ptr %50, align 8, !tbaa !19
  %52 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt8valarrayIdEixEm(ptr noundef nonnull align 8 dereferenceable(16) %18, i64 noundef %indvars.iv37) #4
  %53 = load double, ptr %52, align 8, !tbaa !19
  %54 = load double, ptr %10, align 8, !tbaa !18
  %55 = call double @llvm.fmuladd.f64(double %51, double %53, double %54)
  store double %55, ptr %10, align 8, !tbaa !18
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #4
  %56 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt8valarrayIdEixEm(ptr noundef nonnull align 8 dereferenceable(16) %17, i64 noundef %indvars.iv37) #4
  %57 = load double, ptr %56, align 8, !tbaa !19
  %58 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt8valarrayIdEixEm(ptr noundef nonnull align 8 dereferenceable(16) %18, i64 noundef %indvars.iv37) #4
  %59 = load double, ptr %58, align 8, !tbaa !19
  %60 = fmul double %57, %59
  store double %60, ptr %4, align 8, !tbaa !19
  %61 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %11, ptr noundef nonnull align 8 dereferenceable(8) %4)
  %62 = load double, ptr %61, align 8, !tbaa !19
  store double %62, ptr %11, align 8, !tbaa !20
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #4
  %63 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt8valarrayIdEixEm(ptr noundef nonnull align 8 dereferenceable(16) %17, i64 noundef %indvars.iv37) #4
  %64 = load double, ptr %63, align 8, !tbaa !19
  %65 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNKSt8valarrayIdEixEm(ptr noundef nonnull align 8 dereferenceable(16) %18, i64 noundef %indvars.iv37) #4
  %66 = load double, ptr %65, align 8, !tbaa !19
  %67 = fmul double %64, %66
  store double %67, ptr %5, align 8, !tbaa !19
  %68 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIdERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef nonnull align 8 dereferenceable(8) %5)
  %69 = load double, ptr %68, align 8, !tbaa !19
  store double %69, ptr %12, align 8, !tbaa !21
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #4
  %70 = add nsw i32 %.232, 1
  br label %71

71:                                               ; preds = %46, %49
  %.3 = phi i32 [ %70, %49 ], [ %.232, %46 ]
  %indvars.iv.next38 = add nuw nsw i64 %indvars.iv37, 1
  %exitcond41.not = icmp eq i64 %indvars.iv.next38, %wide.trip.count40
  br i1 %exitcond41.not, label %._crit_edge, label %46, !llvm.loop !24

72:                                               ; preds = %._crit_edge
  %73 = load double, ptr %10, align 8, !tbaa !18
  %74 = uitofp nneg i32 %.2.lcssa to double
  %75 = fdiv double %73, %74
  br label %76

._crit_edge.thread:                               ; preds = %1, %._crit_edge
  store double 0.000000e+00, ptr %11, align 8, !tbaa !20
  br label %76

76:                                               ; preds = %._crit_edge.thread, %72
  %.sink = phi double [ %75, %72 ], [ 0.000000e+00, %._crit_edge.thread ]
  %77 = getelementptr inbounds i8, ptr %0, i64 240
  store double %.sink, ptr %77, align 8
  ret void
}

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress 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 = { inlinehint mustprogress 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 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #4 = { 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 = !{!"_ZTSN3ipx7IterateE", !7, i64 0, !10, i64 8, !10, i64 24, !10, i64 40, !10, i64 56, !10, i64 72, !10, i64 88, !12, i64 104, !10, i64 128, !10, i64 144, !10, i64 160, !10, i64 176, !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, !17, i64 264, !17, i64 265, !16, i64 272, !16, i64 280, !16, i64 288}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"_ZTSSt8valarrayIdE", !11, i64 0, !7, i64 8}
!11 = !{!"long", !8, i64 0}
!12 = !{!"_ZTSSt6vectorIN3ipx7Iterate11StateDetailESaIS2_EE", !13, i64 0}
!13 = !{!"_ZTSSt12_Vector_baseIN3ipx7Iterate11StateDetailESaIS2_EE", !14, i64 0}
!14 = !{!"_ZTSNSt12_Vector_baseIN3ipx7Iterate11StateDetailESaIS2_EE12_Vector_implE", !15, i64 0}
!15 = !{!"_ZTSNSt12_Vector_baseIN3ipx7Iterate11StateDetailESaIS2_EE17_Vector_impl_dataE", !7, i64 0, !7, i64 8, !7, i64 16}
!16 = !{!"double", !8, i64 0}
!17 = !{!"bool", !8, i64 0}
!18 = !{!6, !16, i64 232}
!19 = !{!16, !16, i64 0}
!20 = !{!6, !16, i64 248}
!21 = !{!6, !16, i64 256}
!22 = distinct !{!22, !23}
!23 = !{!"llvm.loop.mustprogress"}
!24 = distinct !{!24, !23}


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