; LLVM IR from ddemidov/amgcl :: tests/test_static_matrix.ll (ZN18test_static_matrix18inverse_pivoting_211test_methodEv)

; 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.boost::unit_test::lazy_ostream_impl" = type { %"class.boost::unit_test::lazy_ostream.base", ptr, ptr }
%"class.boost::unit_test::lazy_ostream.base" = type <{ ptr, i8 }>
%"struct.amgcl::static_matrix.4" = type { %"struct.std::array.5" }
%"struct.std::array.5" = type { [16 x double] }
%"class.boost::unit_test::basic_cstring" = type { ptr, ptr }
%"struct.boost::test_tools::check_is_small_t" = type { i8 }

@_ZN5boost9unit_test12_GLOBAL__N_113unit_test_logE = external hidden global ptr, align 8
@.str.9 = external hidden unnamed_addr constant [77 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [1 x i8], align 1
@.str.34 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.35 = external hidden unnamed_addr constant [5 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: mustprogress nounwind uwtable
declare dso_local void @_ZN5boost9unit_test13basic_cstringIKcEC2ImEEPS2_T_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef, i64 noundef) unnamed_addr #1 align 2

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

declare i32 @__gxx_personality_v0(...)

declare void @_ZN5boost9unit_test15unit_test_log_t14set_checkpointENS0_13basic_cstringIKcEEmS4_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef, i64 noundef, ptr noundef) #2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN5boost9unit_test13basic_cstringIKcEC2Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN5boost9unit_testlsIA1_cEENS0_17lazy_ostream_implINS0_12lazy_ostreamET_RKS5_EERKS4_S7_(ptr dead_on_unwind noalias writable sret(%"class.boost::unit_test::lazy_ostream_impl") align 8, ptr noundef nonnull align 8 dereferenceable(9), ptr noundef nonnull align 1 dereferenceable(1)) #3

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN5boost10test_tools9tt_detail10dummy_condEv() #4

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN5boost10test_tools9tt_detail10check_frwdINS0_16check_is_small_tEddEEbT_RKNS_9unit_test12lazy_ostreamENS5_13basic_cstringIKcEEmNS1_10tool_levelENS1_10check_typeERKT0_PSA_RKT1_SH_(ptr noundef nonnull align 8 dereferenceable(9), ptr noundef, i64 noundef, i32 noundef, i32 noundef, ptr noundef nonnull align 8 dereferenceable(8), ptr noundef, ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #3

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN5amgcl4math7inverseINS_13static_matrixIdLi4ELi4EEEEET_RKS4_(ptr dead_on_unwind noalias writable sret(%"struct.amgcl::static_matrix.4") align 8, ptr noundef nonnull align 8 dereferenceable(128)) #5

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN5amgclmlIddLi4ELi4ELi4EEENS_13static_matrixIT_XT1_EXT3_EEERKNS1_IS2_XT1_EXT2_EEERKNS1_IT0_XT2_EXT3_EEE(ptr dead_on_unwind noalias writable sret(%"struct.amgcl::static_matrix.4") align 8, ptr noundef nonnull align 8 dereferenceable(128), ptr noundef nonnull align 8 dereferenceable(128)) #5

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN18test_static_matrix18inverse_pivoting_211test_methodEv(ptr noundef nonnull align 1 dereferenceable(1) %0) #5 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca ptr, align 8
  %3 = alloca %"struct.amgcl::static_matrix.4", align 8
  %4 = alloca %"struct.amgcl::static_matrix.4", align 8
  %5 = alloca %"struct.amgcl::static_matrix.4", align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca %"class.boost::unit_test::basic_cstring", align 8
  %10 = alloca %"class.boost::unit_test::basic_cstring", align 8
  %11 = alloca %"struct.boost::test_tools::check_is_small_t", align 1
  %12 = alloca %"class.boost::unit_test::lazy_ostream_impl", align 8
  %13 = alloca %"class.boost::unit_test::basic_cstring", align 8
  %14 = alloca ptr, align 8
  %15 = alloca i32, align 4
  %16 = alloca double, align 8
  %17 = alloca double, align 8
  store ptr %0, ptr %2, align 8, !tbaa !5
  %18 = load ptr, ptr %2, align 8
  call void @llvm.lifetime.start.p0(i64 128, ptr %3) #7
  call void @llvm.memset.p0.i64(ptr align 8 %3, i8 0, i64 128, i1 false)
  %19 = getelementptr inbounds %"struct.amgcl::static_matrix.4", ptr %3, i32 0, i32 0
  %20 = getelementptr inbounds %"struct.std::array.5", ptr %19, i32 0, i32 0
  %21 = getelementptr inbounds [16 x double], ptr %20, i32 0, i32 1
  store double 1.000000e+00, ptr %21, align 8
  %22 = getelementptr inbounds [16 x double], ptr %20, i32 0, i32 6
  store double 1.000000e+00, ptr %22, align 8
  %23 = getelementptr inbounds [16 x double], ptr %20, i32 0, i32 8
  store double 1.000000e+00, ptr %23, align 8
  %24 = getelementptr inbounds [16 x double], ptr %20, i32 0, i32 15
  store double 1.000000e+00, ptr %24, align 8
  call void @llvm.lifetime.start.p0(i64 128, ptr %4) #7
  call void @_ZN5amgcl4math7inverseINS_13static_matrixIdLi4ELi4EEEEET_RKS4_(ptr dead_on_unwind writable sret(%"struct.amgcl::static_matrix.4") align 8 %4, ptr noundef nonnull align 8 dereferenceable(128) %3)
  call void @llvm.lifetime.start.p0(i64 128, ptr %5) #7
  call void @_ZN5amgclmlIddLi4ELi4ELi4EEENS_13static_matrixIT_XT1_EXT3_EEERKNS1_IS2_XT1_EXT2_EEERKNS1_IT0_XT2_EXT3_EEE(ptr dead_on_unwind writable sret(%"struct.amgcl::static_matrix.4") align 8 %5, ptr noundef nonnull align 8 dereferenceable(128) %4, ptr noundef nonnull align 8 dereferenceable(128) %3)
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  store i32 0, ptr %6, align 4, !tbaa !9
  br label %25

25:                                               ; preds = %73, %1
  %26 = load i32, ptr %6, align 4, !tbaa !9
  %27 = icmp slt i32 %26, 4
  br i1 %27, label %29, label %28

28:                                               ; preds = %25
  store i32 2, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  br label %76

29:                                               ; preds = %25
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #7
  store i32 0, ptr %8, align 4, !tbaa !9
  br label %30

30:                                               ; preds = %55, %29
  %31 = load i32, ptr %8, align 4, !tbaa !9
  %32 = icmp slt i32 %31, 4
  br i1 %32, label %34, label %33

33:                                               ; preds = %30
  store i32 5, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  br label %72

34:                                               ; preds = %30
  br label %35

35:                                               ; preds = %52, %34
  %36 = load ptr, ptr @_ZN5boost9unit_test12_GLOBAL__N_113unit_test_logE, align 8, !tbaa !5
  call void @_ZN5boost9unit_test13basic_cstringIKcEC2ImEEPS2_T_(ptr noundef nonnull align 8 dereferenceable(16) %9, ptr noundef @.str.9, i64 noundef 76)
  call void @_ZN5boost9unit_test13basic_cstringIKcEC2Ev(ptr noundef nonnull align 8 dereferenceable(16) %10)
  call void @_ZN5boost9unit_test15unit_test_log_t14set_checkpointENS0_13basic_cstringIKcEEmS4_(ptr noundef nonnull align 8 dereferenceable(8) %36, ptr noundef %9, i64 noundef 89, ptr noundef %10)
  call void @llvm.lifetime.start.p0(i64 32, ptr %12) #7
  %37 = call noundef nonnull align 8 dereferenceable(9) ptr @_ZN5boost9unit_test12lazy_ostream8instanceEv()
  call void @_ZN5boost9unit_testlsIA1_cEENS0_17lazy_ostream_implINS0_12lazy_ostreamET_RKS5_EERKS4_S7_(ptr dead_on_unwind writable sret(%"class.boost::unit_test::lazy_ostream_impl") align 8 %12, ptr noundef nonnull align 8 dereferenceable(9) %37, ptr noundef nonnull align 1 dereferenceable(1) @.str.12)
  invoke void @_ZN5boost9unit_test13basic_cstringIKcEC2ImEEPS2_T_(ptr noundef nonnull align 8 dereferenceable(16) %13, ptr noundef @.str.9, i64 noundef 76)
          to label %38 unwind label %58

38:                                               ; preds = %35
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #7
  %39 = load i32, ptr %6, align 4, !tbaa !9
  %40 = load i32, ptr %8, align 4, !tbaa !9
  %41 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZN5amgcl13static_matrixIdLi4ELi4EEclEii(ptr noundef nonnull align 8 dereferenceable(128) %5, i32 noundef %39, i32 noundef %40)
          to label %42 unwind label %62

42:                                               ; preds = %38
  %43 = load double, ptr %41, align 8, !tbaa !11
  %44 = load i32, ptr %6, align 4, !tbaa !9
  %45 = load i32, ptr %8, align 4, !tbaa !9
  %46 = icmp eq i32 %44, %45
  %47 = zext i1 %46 to i32
  %48 = sitofp i32 %47 to double
  %49 = fsub double %43, %48
  store double %49, ptr %16, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #7
  store double 1.000000e-08, ptr %17, align 8, !tbaa !11
  %50 = invoke noundef zeroext i1 @_ZN5boost10test_tools9tt_detail10check_frwdINS0_16check_is_small_tEddEEbT_RKNS_9unit_test12lazy_ostreamENS5_13basic_cstringIKcEEmNS1_10tool_levelENS1_10check_typeERKT0_PSA_RKT1_SH_(ptr noundef nonnull align 8 dereferenceable(9) %12, ptr noundef %13, i64 noundef 89, i32 noundef 1, i32 noundef 10, ptr noundef nonnull align 8 dereferenceable(8) %16, ptr noundef @.str.34, ptr noundef nonnull align 8 dereferenceable(8) %17, ptr noundef @.str.35)
          to label %51 unwind label %66

51:                                               ; preds = %42
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  call void @_ZN5boost9unit_test12lazy_ostreamD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %12) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %12) #7
  br label %52

52:                                               ; preds = %51
  %53 = call noundef zeroext i1 @_ZN5boost10test_tools9tt_detail10dummy_condEv()
  br i1 %53, label %35, label %54, !llvm.loop !13

54:                                               ; preds = %52
  br label %55

55:                                               ; preds = %54
  %56 = load i32, ptr %8, align 4, !tbaa !9
  %57 = add nsw i32 %56, 1
  store i32 %57, ptr %8, align 4, !tbaa !9
  br label %30, !llvm.loop !15

58:                                               ; preds = %35
  %59 = landingpad { ptr, i32 }
          cleanup
  %60 = extractvalue { ptr, i32 } %59, 0
  store ptr %60, ptr %14, align 8
  %61 = extractvalue { ptr, i32 } %59, 1
  store i32 %61, ptr %15, align 4
  br label %71

62:                                               ; preds = %38
  %63 = landingpad { ptr, i32 }
          cleanup
  %64 = extractvalue { ptr, i32 } %63, 0
  store ptr %64, ptr %14, align 8
  %65 = extractvalue { ptr, i32 } %63, 1
  store i32 %65, ptr %15, align 4
  br label %70

66:                                               ; preds = %42
  %67 = landingpad { ptr, i32 }
          cleanup
  %68 = extractvalue { ptr, i32 } %67, 0
  store ptr %68, ptr %14, align 8
  %69 = extractvalue { ptr, i32 } %67, 1
  store i32 %69, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  br label %70

70:                                               ; preds = %66, %62
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  br label %71

71:                                               ; preds = %70, %58
  call void @_ZN5boost9unit_test12lazy_ostreamD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %12) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  call void @llvm.lifetime.end.p0(i64 128, ptr %5) #7
  call void @llvm.lifetime.end.p0(i64 128, ptr %4) #7
  call void @llvm.lifetime.end.p0(i64 128, ptr %3) #7
  br label %77

72:                                               ; preds = %33
  br label %73

73:                                               ; preds = %72
  %74 = load i32, ptr %6, align 4, !tbaa !9
  %75 = add nsw i32 %74, 1
  store i32 %75, ptr %6, align 4, !tbaa !9
  br label %25, !llvm.loop !16

76:                                               ; preds = %28
  call void @llvm.lifetime.end.p0(i64 128, ptr %5) #7
  call void @llvm.lifetime.end.p0(i64 128, ptr %4) #7
  call void @llvm.lifetime.end.p0(i64 128, ptr %3) #7
  ret void

77:                                               ; preds = %71
  %78 = load ptr, ptr %14, align 8
  %79 = load i32, ptr %15, align 4
  %80 = insertvalue { ptr, i32 } poison, ptr %78, 0
  %81 = insertvalue { ptr, i32 } %80, i32 %79, 1
  resume { ptr, i32 } %81
}

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #6

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN5boost9unit_test12lazy_ostreamD2Ev(ptr noundef nonnull align 8 dereferenceable(9)) unnamed_addr #1 align 2

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 = { "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 = { inlinehint 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 #4 = { 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 #5 = { 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 #6 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #7 = { 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, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"double", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = distinct !{!16, !14}


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

%"class.boost::unit_test::lazy_ostream_impl" = type { %"class.boost::unit_test::lazy_ostream.base", ptr, ptr }
%"class.boost::unit_test::lazy_ostream.base" = type <{ ptr, i8 }>
%"struct.amgcl::static_matrix.4" = type { %"struct.std::array.5" }
%"struct.std::array.5" = type { [16 x double] }
%"class.boost::unit_test::basic_cstring" = type { ptr, ptr }

@_ZN5boost9unit_test12_GLOBAL__N_113unit_test_logE = external hidden local_unnamed_addr global ptr, align 8
@.str.9 = external hidden unnamed_addr constant [77 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [1 x i8], align 1
@.str.34 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.35 = external hidden unnamed_addr constant [5 x i8], align 1

; 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 nounwind uwtable
declare dso_local void @_ZN5boost9unit_test13basic_cstringIKcEC2ImEEPS2_T_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef, i64 noundef) unnamed_addr #1 align 2

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

declare i32 @__gxx_personality_v0(...)

declare void @_ZN5boost9unit_test15unit_test_log_t14set_checkpointENS0_13basic_cstringIKcEEmS4_(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef, i64 noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN5boost9unit_test13basic_cstringIKcEC2Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN5boost9unit_testlsIA1_cEENS0_17lazy_ostream_implINS0_12lazy_ostreamET_RKS5_EERKS4_S7_(ptr dead_on_unwind noalias writable sret(%"class.boost::unit_test::lazy_ostream_impl") align 8, ptr noundef nonnull align 8 dereferenceable(9), ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #3

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZN5boost10test_tools9tt_detail10dummy_condEv() local_unnamed_addr #4

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN5boost10test_tools9tt_detail10check_frwdINS0_16check_is_small_tEddEEbT_RKNS_9unit_test12lazy_ostreamENS5_13basic_cstringIKcEEmNS1_10tool_levelENS1_10check_typeERKT0_PSA_RKT1_SH_(ptr noundef nonnull align 8 dereferenceable(9), ptr noundef, i64 noundef, i32 noundef, i32 noundef, ptr noundef nonnull align 8 dereferenceable(8), ptr noundef, ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN5amgcl4math7inverseINS_13static_matrixIdLi4ELi4EEEEET_RKS4_(ptr dead_on_unwind noalias writable sret(%"struct.amgcl::static_matrix.4") align 8, ptr noundef nonnull align 8 dereferenceable(128)) local_unnamed_addr #5

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN5amgclmlIddLi4ELi4ELi4EEENS_13static_matrixIT_XT1_EXT3_EEERKNS1_IS2_XT1_EXT2_EEERKNS1_IT0_XT2_EXT3_EEE(ptr dead_on_unwind noalias writable sret(%"struct.amgcl::static_matrix.4") align 8, ptr noundef nonnull align 8 dereferenceable(128), ptr noundef nonnull align 8 dereferenceable(128)) local_unnamed_addr #5

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN18test_static_matrix18inverse_pivoting_211test_methodEv(ptr nocapture noundef nonnull readnone align 1 dereferenceable(1) %0) local_unnamed_addr #5 align 2 personality ptr @__gxx_personality_v0 {
  %2 = alloca %"struct.amgcl::static_matrix.4", align 8
  %3 = alloca %"struct.amgcl::static_matrix.4", align 8
  %4 = alloca %"struct.amgcl::static_matrix.4", align 8
  %5 = alloca %"class.boost::unit_test::basic_cstring", align 8
  %6 = alloca %"class.boost::unit_test::basic_cstring", align 8
  %7 = alloca %"class.boost::unit_test::lazy_ostream_impl", align 8
  %8 = alloca %"class.boost::unit_test::basic_cstring", align 8
  %9 = alloca double, align 8
  %10 = alloca double, align 8
  call void @llvm.lifetime.start.p0(i64 128, ptr nonnull %2) #7
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(128) %2, i8 0, i64 120, i1 false)
  %11 = getelementptr inbounds i8, ptr %2, i64 8
  store double 1.000000e+00, ptr %11, align 8
  %12 = getelementptr inbounds i8, ptr %2, i64 48
  store double 1.000000e+00, ptr %12, align 8
  %13 = getelementptr inbounds i8, ptr %2, i64 64
  store double 1.000000e+00, ptr %13, align 8
  %14 = getelementptr inbounds i8, ptr %2, i64 120
  store double 1.000000e+00, ptr %14, align 8
  call void @llvm.lifetime.start.p0(i64 128, ptr nonnull %3) #7
  call void @_ZN5amgcl4math7inverseINS_13static_matrixIdLi4ELi4EEEEET_RKS4_(ptr dead_on_unwind nonnull writable sret(%"struct.amgcl::static_matrix.4") align 8 %3, ptr noundef nonnull align 8 dereferenceable(128) %2)
  call void @llvm.lifetime.start.p0(i64 128, ptr nonnull %4) #7
  call void @_ZN5amgclmlIddLi4ELi4ELi4EEENS_13static_matrixIT_XT1_EXT3_EEERKNS1_IS2_XT1_EXT2_EEERKNS1_IT0_XT2_EXT3_EEE(ptr dead_on_unwind nonnull writable sret(%"struct.amgcl::static_matrix.4") align 8 %4, ptr noundef nonnull align 8 dereferenceable(128) %3, ptr noundef nonnull align 8 dereferenceable(128) %2)
  br label %.preheader11

.preheader11:                                     ; preds = %1, %60
  %.013 = phi i32 [ 0, %1 ], [ %61, %60 ]
  %15 = icmp eq i32 %.013, 0
  %16 = uitofp i1 %15 to double
  br label %18

17:                                               ; preds = %60
  call void @llvm.lifetime.end.p0(i64 128, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 128, ptr nonnull %3) #7
  call void @llvm.lifetime.end.p0(i64 128, ptr nonnull %2) #7
  ret void

18:                                               ; preds = %.preheader11, %25
  %19 = load ptr, ptr @_ZN5boost9unit_test12_GLOBAL__N_113unit_test_logE, align 8, !tbaa !5
  call void @_ZN5boost9unit_test13basic_cstringIKcEC2ImEEPS2_T_(ptr noundef nonnull align 8 dereferenceable(16) %5, ptr noundef nonnull @.str.9, i64 noundef 76)
  call void @_ZN5boost9unit_test13basic_cstringIKcEC2Ev(ptr noundef nonnull align 8 dereferenceable(16) %6)
  call void @_ZN5boost9unit_test15unit_test_log_t14set_checkpointENS0_13basic_cstringIKcEEmS4_(ptr noundef nonnull align 8 dereferenceable(8) %19, ptr noundef nonnull %5, i64 noundef 89, ptr noundef nonnull %6)
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %7) #7
  %20 = call noundef nonnull align 8 dereferenceable(9) ptr @_ZN5boost9unit_test12lazy_ostream8instanceEv()
  call void @_ZN5boost9unit_testlsIA1_cEENS0_17lazy_ostream_implINS0_12lazy_ostreamET_RKS5_EERKS4_S7_(ptr dead_on_unwind nonnull writable sret(%"class.boost::unit_test::lazy_ostream_impl") align 8 %7, ptr noundef nonnull align 8 dereferenceable(9) %20, ptr noundef nonnull align 1 dereferenceable(1) @.str.12)
  call void @_ZN5boost9unit_test13basic_cstringIKcEC2ImEEPS2_T_(ptr noundef nonnull align 8 dereferenceable(16) %8, ptr noundef nonnull @.str.9, i64 noundef 76)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #7
  %21 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN5amgcl13static_matrixIdLi4ELi4EEclEii(ptr noundef nonnull align 8 dereferenceable(128) %4, i32 noundef %.013, i32 noundef 0)
  %22 = load double, ptr %21, align 8, !tbaa !9
  %23 = fsub double %22, %16
  store double %23, ptr %9, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #7
  store double 1.000000e-08, ptr %10, align 8, !tbaa !9
  %24 = invoke noundef zeroext i1 @_ZN5boost10test_tools9tt_detail10check_frwdINS0_16check_is_small_tEddEEbT_RKNS_9unit_test12lazy_ostreamENS5_13basic_cstringIKcEEmNS1_10tool_levelENS1_10check_typeERKT0_PSA_RKT1_SH_(ptr noundef nonnull align 8 dereferenceable(9) %7, ptr noundef nonnull %8, i64 noundef 89, i32 noundef 1, i32 noundef 10, ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull @.str.34, ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull @.str.35)
          to label %25 unwind label %.loopexit

25:                                               ; preds = %18
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #7
  call void @_ZN5boost9unit_test12lazy_ostreamD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %7) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %7) #7
  %26 = call noundef zeroext i1 @_ZN5boost10test_tools9tt_detail10dummy_condEv()
  br i1 %26, label %18, label %.preheader.1, !llvm.loop !11

.preheader.1:                                     ; preds = %25
  %27 = icmp eq i32 %.013, 1
  %28 = uitofp i1 %27 to double
  br label %29

29:                                               ; preds = %36, %.preheader.1
  %30 = load ptr, ptr @_ZN5boost9unit_test12_GLOBAL__N_113unit_test_logE, align 8, !tbaa !5
  call void @_ZN5boost9unit_test13basic_cstringIKcEC2ImEEPS2_T_(ptr noundef nonnull align 8 dereferenceable(16) %5, ptr noundef nonnull @.str.9, i64 noundef 76)
  call void @_ZN5boost9unit_test13basic_cstringIKcEC2Ev(ptr noundef nonnull align 8 dereferenceable(16) %6)
  call void @_ZN5boost9unit_test15unit_test_log_t14set_checkpointENS0_13basic_cstringIKcEEmS4_(ptr noundef nonnull align 8 dereferenceable(8) %30, ptr noundef nonnull %5, i64 noundef 89, ptr noundef nonnull %6)
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %7) #7
  %31 = call noundef nonnull align 8 dereferenceable(9) ptr @_ZN5boost9unit_test12lazy_ostream8instanceEv()
  call void @_ZN5boost9unit_testlsIA1_cEENS0_17lazy_ostream_implINS0_12lazy_ostreamET_RKS5_EERKS4_S7_(ptr dead_on_unwind nonnull writable sret(%"class.boost::unit_test::lazy_ostream_impl") align 8 %7, ptr noundef nonnull align 8 dereferenceable(9) %31, ptr noundef nonnull align 1 dereferenceable(1) @.str.12)
  call void @_ZN5boost9unit_test13basic_cstringIKcEC2ImEEPS2_T_(ptr noundef nonnull align 8 dereferenceable(16) %8, ptr noundef nonnull @.str.9, i64 noundef 76)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #7
  %32 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN5amgcl13static_matrixIdLi4ELi4EEclEii(ptr noundef nonnull align 8 dereferenceable(128) %4, i32 noundef %.013, i32 noundef 1)
  %33 = load double, ptr %32, align 8, !tbaa !9
  %34 = fsub double %33, %28
  store double %34, ptr %9, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #7
  store double 1.000000e-08, ptr %10, align 8, !tbaa !9
  %35 = invoke noundef zeroext i1 @_ZN5boost10test_tools9tt_detail10check_frwdINS0_16check_is_small_tEddEEbT_RKNS_9unit_test12lazy_ostreamENS5_13basic_cstringIKcEEmNS1_10tool_levelENS1_10check_typeERKT0_PSA_RKT1_SH_(ptr noundef nonnull align 8 dereferenceable(9) %7, ptr noundef nonnull %8, i64 noundef 89, i32 noundef 1, i32 noundef 10, ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull @.str.34, ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull @.str.35)
          to label %36 unwind label %.loopexit.split-lp.loopexit

36:                                               ; preds = %29
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #7
  call void @_ZN5boost9unit_test12lazy_ostreamD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %7) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %7) #7
  %37 = call noundef zeroext i1 @_ZN5boost10test_tools9tt_detail10dummy_condEv()
  br i1 %37, label %29, label %.preheader.2, !llvm.loop !11

.preheader.2:                                     ; preds = %36
  %38 = icmp eq i32 %.013, 2
  %39 = uitofp i1 %38 to double
  br label %40

40:                                               ; preds = %47, %.preheader.2
  %41 = load ptr, ptr @_ZN5boost9unit_test12_GLOBAL__N_113unit_test_logE, align 8, !tbaa !5
  call void @_ZN5boost9unit_test13basic_cstringIKcEC2ImEEPS2_T_(ptr noundef nonnull align 8 dereferenceable(16) %5, ptr noundef nonnull @.str.9, i64 noundef 76)
  call void @_ZN5boost9unit_test13basic_cstringIKcEC2Ev(ptr noundef nonnull align 8 dereferenceable(16) %6)
  call void @_ZN5boost9unit_test15unit_test_log_t14set_checkpointENS0_13basic_cstringIKcEEmS4_(ptr noundef nonnull align 8 dereferenceable(8) %41, ptr noundef nonnull %5, i64 noundef 89, ptr noundef nonnull %6)
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %7) #7
  %42 = call noundef nonnull align 8 dereferenceable(9) ptr @_ZN5boost9unit_test12lazy_ostream8instanceEv()
  call void @_ZN5boost9unit_testlsIA1_cEENS0_17lazy_ostream_implINS0_12lazy_ostreamET_RKS5_EERKS4_S7_(ptr dead_on_unwind nonnull writable sret(%"class.boost::unit_test::lazy_ostream_impl") align 8 %7, ptr noundef nonnull align 8 dereferenceable(9) %42, ptr noundef nonnull align 1 dereferenceable(1) @.str.12)
  call void @_ZN5boost9unit_test13basic_cstringIKcEC2ImEEPS2_T_(ptr noundef nonnull align 8 dereferenceable(16) %8, ptr noundef nonnull @.str.9, i64 noundef 76)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #7
  %43 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN5amgcl13static_matrixIdLi4ELi4EEclEii(ptr noundef nonnull align 8 dereferenceable(128) %4, i32 noundef %.013, i32 noundef 2)
  %44 = load double, ptr %43, align 8, !tbaa !9
  %45 = fsub double %44, %39
  store double %45, ptr %9, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #7
  store double 1.000000e-08, ptr %10, align 8, !tbaa !9
  %46 = invoke noundef zeroext i1 @_ZN5boost10test_tools9tt_detail10check_frwdINS0_16check_is_small_tEddEEbT_RKNS_9unit_test12lazy_ostreamENS5_13basic_cstringIKcEEmNS1_10tool_levelENS1_10check_typeERKT0_PSA_RKT1_SH_(ptr noundef nonnull align 8 dereferenceable(9) %7, ptr noundef nonnull %8, i64 noundef 89, i32 noundef 1, i32 noundef 10, ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull @.str.34, ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull @.str.35)
          to label %47 unwind label %.loopexit.split-lp.loopexit.split-lp.loopexit

47:                                               ; preds = %40
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #7
  call void @_ZN5boost9unit_test12lazy_ostreamD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %7) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %7) #7
  %48 = call noundef zeroext i1 @_ZN5boost10test_tools9tt_detail10dummy_condEv()
  br i1 %48, label %40, label %.preheader.3, !llvm.loop !11

.preheader.3:                                     ; preds = %47
  %49 = icmp eq i32 %.013, 3
  %50 = uitofp i1 %49 to double
  br label %51

51:                                               ; preds = %58, %.preheader.3
  %52 = load ptr, ptr @_ZN5boost9unit_test12_GLOBAL__N_113unit_test_logE, align 8, !tbaa !5
  call void @_ZN5boost9unit_test13basic_cstringIKcEC2ImEEPS2_T_(ptr noundef nonnull align 8 dereferenceable(16) %5, ptr noundef nonnull @.str.9, i64 noundef 76)
  call void @_ZN5boost9unit_test13basic_cstringIKcEC2Ev(ptr noundef nonnull align 8 dereferenceable(16) %6)
  call void @_ZN5boost9unit_test15unit_test_log_t14set_checkpointENS0_13basic_cstringIKcEEmS4_(ptr noundef nonnull align 8 dereferenceable(8) %52, ptr noundef nonnull %5, i64 noundef 89, ptr noundef nonnull %6)
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %7) #7
  %53 = call noundef nonnull align 8 dereferenceable(9) ptr @_ZN5boost9unit_test12lazy_ostream8instanceEv()
  call void @_ZN5boost9unit_testlsIA1_cEENS0_17lazy_ostream_implINS0_12lazy_ostreamET_RKS5_EERKS4_S7_(ptr dead_on_unwind nonnull writable sret(%"class.boost::unit_test::lazy_ostream_impl") align 8 %7, ptr noundef nonnull align 8 dereferenceable(9) %53, ptr noundef nonnull align 1 dereferenceable(1) @.str.12)
  call void @_ZN5boost9unit_test13basic_cstringIKcEC2ImEEPS2_T_(ptr noundef nonnull align 8 dereferenceable(16) %8, ptr noundef nonnull @.str.9, i64 noundef 76)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #7
  %54 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN5amgcl13static_matrixIdLi4ELi4EEclEii(ptr noundef nonnull align 8 dereferenceable(128) %4, i32 noundef %.013, i32 noundef 3)
  %55 = load double, ptr %54, align 8, !tbaa !9
  %56 = fsub double %55, %50
  store double %56, ptr %9, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #7
  store double 1.000000e-08, ptr %10, align 8, !tbaa !9
  %57 = invoke noundef zeroext i1 @_ZN5boost10test_tools9tt_detail10check_frwdINS0_16check_is_small_tEddEEbT_RKNS_9unit_test12lazy_ostreamENS5_13basic_cstringIKcEEmNS1_10tool_levelENS1_10check_typeERKT0_PSA_RKT1_SH_(ptr noundef nonnull align 8 dereferenceable(9) %7, ptr noundef nonnull %8, i64 noundef 89, i32 noundef 1, i32 noundef 10, ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull @.str.34, ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull @.str.35)
          to label %58 unwind label %.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp

58:                                               ; preds = %51
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #7
  call void @_ZN5boost9unit_test12lazy_ostreamD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %7) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %7) #7
  %59 = call noundef zeroext i1 @_ZN5boost10test_tools9tt_detail10dummy_condEv()
  br i1 %59, label %51, label %60, !llvm.loop !11

60:                                               ; preds = %58
  %61 = add nuw nsw i32 %.013, 1
  %exitcond.not = icmp eq i32 %61, 4
  br i1 %exitcond.not, label %17, label %.preheader11, !llvm.loop !13

.loopexit:                                        ; preds = %18
  %lpad.loopexit = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit.split-lp

.loopexit.split-lp.loopexit:                      ; preds = %29
  %lpad.loopexit14 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit.split-lp

.loopexit.split-lp.loopexit.split-lp.loopexit:    ; preds = %40
  %lpad.loopexit17 = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit.split-lp

.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp: ; preds = %51
  %lpad.loopexit.split-lp = landingpad { ptr, i32 }
          cleanup
  br label %.loopexit.split-lp

.loopexit.split-lp:                               ; preds = %.loopexit.split-lp.loopexit, %.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp, %.loopexit.split-lp.loopexit.split-lp.loopexit, %.loopexit
  %lpad.phi = phi { ptr, i32 } [ %lpad.loopexit, %.loopexit ], [ %lpad.loopexit14, %.loopexit.split-lp.loopexit ], [ %lpad.loopexit17, %.loopexit.split-lp.loopexit.split-lp.loopexit ], [ %lpad.loopexit.split-lp, %.loopexit.split-lp.loopexit.split-lp.loopexit.split-lp ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #7
  call void @_ZN5boost9unit_test12lazy_ostreamD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %7) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %7) #7
  call void @llvm.lifetime.end.p0(i64 128, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 128, ptr nonnull %3) #7
  call void @llvm.lifetime.end.p0(i64 128, ptr nonnull %2) #7
  resume { ptr, i32 } %lpad.phi
}

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #6

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN5boost9unit_test12lazy_ostreamD2Ev(ptr noundef nonnull align 8 dereferenceable(9)) unnamed_addr #1 align 2

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 = { "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 = { inlinehint 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 #4 = { 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 #5 = { 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 #6 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #7 = { 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, !10, i64 0}
!10 = !{!"double", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}


; Effective O3 passes: DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass