; LLVM IR from venumb/ZSPACE :: cpp/depends/alglib/cpp/src (optimization)

; 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.alglib::xparams" = type { i64 }
%struct.__jmp_buf_tag = type { [8 x i64], i32, %struct.__sigset_t }
%struct.__sigset_t = type { [16 x i64] }
%"struct.alglib_impl::ae_state" = type { i64, double, double, double, ptr, %"struct.alglib_impl::ae_dyn_block", ptr, i32, ptr, i64, ptr, ptr, ptr }
%"struct.alglib_impl::ae_dyn_block" = type { ptr, ptr, ptr, ptr }
%"class.alglib::minlmstate" = type { %"class.alglib::_minlmstate_owner", ptr, ptr, ptr, ptr, ptr, ptr, ptr, %"class.alglib::real_1d_array", %"class.alglib::real_1d_array", %"class.alglib::real_2d_array", %"class.alglib::real_2d_array", %"class.alglib::real_1d_array" }
%"class.alglib::_minlmstate_owner" = type { ptr, ptr }
%"class.alglib::real_2d_array" = type { %"class.alglib::ae_matrix_wrapper.base", [7 x i8] }
%"class.alglib::ae_matrix_wrapper.base" = type <{ ptr, ptr, %"struct.alglib_impl::ae_matrix", i8 }>
%"struct.alglib_impl::ae_matrix" = type { i64, i64, i64, i64, i8, %"struct.alglib_impl::ae_dyn_block", %union.anon.1 }
%union.anon.1 = type { ptr }
%"class.alglib::real_1d_array" = type { %"class.alglib::ae_vector_wrapper.base", [7 x i8] }
%"class.alglib::ae_vector_wrapper.base" = type <{ ptr, ptr, %"struct.alglib_impl::ae_vector", i8 }>
%"struct.alglib_impl::ae_vector" = type { i64, i64, i8, %"struct.alglib_impl::ae_dyn_block", %union.anon.0 }
%union.anon.0 = type { ptr }

@_ZTIN6alglib8ap_errorE = external dso_local constant { ptr, ptr }, align 8
@.str.17 = external hidden unnamed_addr constant [45 x i8], align 1
@.str.100 = external hidden unnamed_addr constant [71 x i8], align 1
@.str.101 = external hidden unnamed_addr constant [49 x i8], align 1
@.str.102 = external hidden unnamed_addr constant [50 x i8], align 1
@.str.103 = external hidden unnamed_addr constant [50 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

declare void @_ZN11alglib_impl13ae_state_initEPNS_8ae_stateE(ptr noundef) #1

; Function Attrs: nounwind returns_twice
declare i32 @_setjmp(ptr noundef) #2

declare ptr @__cxa_allocate_exception(i64)

declare void @_ZN6alglib8ap_errorC1EPKc(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef) unnamed_addr #1

declare i32 @__gxx_personality_v0(...)

declare void @__cxa_free_exception(ptr)

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

declare void @__cxa_throw(ptr, ptr, ptr)

declare void @_ZN11alglib_impl23ae_state_set_break_jumpEPNS_8ae_stateEPA1_13__jmp_buf_tag(ptr noundef, ptr noundef) #1

declare void @_ZN11alglib_impl14ae_state_clearEPNS_8ae_stateE(ptr noundef) #1

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

declare void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext, ptr noundef, ptr noundef) #1

declare ptr @__cxa_begin_catch(ptr)

declare void @_ZN11alglib_impl18ae_state_set_flagsEPNS_8ae_stateEy(ptr noundef, i64 noundef) #1

declare void @__cxa_end_catch()

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN6alglib17_minlmstate_owner5c_ptrEv(ptr noundef nonnull align 8 dereferenceable(16)) #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN11alglib_impl14minlmiterationEPNS_10minlmstateEPNS_8ae_stateE(ptr noundef, ptr noundef) #5

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6alglib13minlmoptimizeERNS_10minlmstateEPFvRKNS_13real_1d_arrayERdPvEPFvS4_S5_RS2_S6_EPFvS4_S9_RNS_13real_2d_arrayES6_EPFvS4_dS6_ES6_NS_7xparamsE(ptr noundef nonnull align 8 dereferenceable(544) %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, ptr noundef %4, ptr noundef %5, i64 %6) #5 personality ptr @__gxx_personality_v0 {
  %8 = alloca %"struct.alglib::xparams", 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 [1 x %struct.__jmp_buf_tag], align 16
  %16 = alloca %"struct.alglib_impl::ae_state", align 8
  %17 = alloca ptr, align 8
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = getelementptr inbounds %"struct.alglib::xparams", ptr %8, i32 0, i32 0
  store i64 %6, ptr %20, 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
  call void @llvm.lifetime.start.p0(i64 200, ptr %15) #6
  call void @llvm.lifetime.start.p0(i64 128, ptr %16) #6
  call void @_ZN11alglib_impl13ae_state_initEPNS_8ae_stateE(ptr noundef %16)
  %21 = getelementptr inbounds [1 x %struct.__jmp_buf_tag], ptr %15, i64 0, i64 0
  %22 = call i32 @_setjmp(ptr noundef %21) #7
  %23 = icmp ne i32 %22, 0
  br i1 %23, label %24, label %33

24:                                               ; preds = %7
  %25 = call ptr @__cxa_allocate_exception(i64 32) #6
  %26 = getelementptr inbounds %"struct.alglib_impl::ae_state", ptr %16, i32 0, i32 8
  %27 = load volatile ptr, ptr %26, align 8, !tbaa !9
  invoke void @_ZN6alglib8ap_errorC1EPKc(ptr noundef nonnull align 8 dereferenceable(32) %25, ptr noundef %27)
          to label %28 unwind label %29

28:                                               ; preds = %24
  call void @__cxa_throw(ptr %25, ptr @_ZTIN6alglib8ap_errorE, ptr @_ZN6alglib8ap_errorD2Ev) #8
  unreachable

29:                                               ; preds = %24
  %30 = landingpad { ptr, i32 }
          cleanup
  %31 = extractvalue { ptr, i32 } %30, 0
  store ptr %31, ptr %17, align 8
  %32 = extractvalue { ptr, i32 } %30, 1
  store i32 %32, ptr %18, align 4
  call void @__cxa_free_exception(ptr %25) #6
  call void @llvm.lifetime.end.p0(i64 128, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 200, ptr %15) #6
  br label %131

33:                                               ; preds = %7
  call void @_ZN11alglib_impl23ae_state_set_break_jumpEPNS_8ae_stateEPA1_13__jmp_buf_tag(ptr noundef %16, ptr noundef %15)
  %34 = getelementptr inbounds %"struct.alglib::xparams", ptr %8, i32 0, i32 0
  %35 = load i64, ptr %34, align 8, !tbaa !16
  %36 = icmp ne i64 %35, 0
  br i1 %36, label %37, label %40

37:                                               ; preds = %33
  %38 = getelementptr inbounds %"struct.alglib::xparams", ptr %8, i32 0, i32 0
  %39 = load i64, ptr %38, align 8, !tbaa !16
  call void @_ZN11alglib_impl18ae_state_set_flagsEPNS_8ae_stateEy(ptr noundef %16, i64 noundef %39)
  br label %40

40:                                               ; preds = %37, %33
  %41 = load ptr, ptr %10, align 8, !tbaa !5
  %42 = icmp ne ptr %41, null
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %42, ptr noundef @.str.102, ptr noundef %16)
  %43 = load ptr, ptr %11, align 8, !tbaa !5
  %44 = icmp ne ptr %43, null
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %44, ptr noundef @.str.103, ptr noundef %16)
  %45 = load ptr, ptr %12, align 8, !tbaa !5
  %46 = icmp ne ptr %45, null
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %46, ptr noundef @.str.101, ptr noundef %16)
  br label %47

47:                                               ; preds = %129, %125, %105, %89, %65, %40
  %48 = load ptr, ptr %9, align 8, !tbaa !5
  %49 = call noundef ptr @_ZN6alglib17_minlmstate_owner5c_ptrEv(ptr noundef nonnull align 8 dereferenceable(16) %48)
  %50 = call noundef zeroext i1 @_ZN11alglib_impl14minlmiterationEPNS_10minlmstateEPNS_8ae_stateE(ptr noundef %49, ptr noundef %16)
  br i1 %50, label %51, label %130

51:                                               ; preds = %47
  %52 = load ptr, ptr %9, align 8, !tbaa !5
  %53 = getelementptr inbounds %"class.alglib::minlmstate", ptr %52, i32 0, i32 1
  %54 = load ptr, ptr %53, align 8, !tbaa !18
  %55 = load i8, ptr %54, align 1, !tbaa !28, !range !29, !noundef !30
  %56 = trunc i8 %55 to i1
  br i1 %56, label %57, label %73

57:                                               ; preds = %51
  %58 = load ptr, ptr %10, align 8, !tbaa !5
  %59 = load ptr, ptr %9, align 8, !tbaa !5
  %60 = getelementptr inbounds %"class.alglib::minlmstate", ptr %59, i32 0, i32 12
  %61 = load ptr, ptr %9, align 8, !tbaa !5
  %62 = getelementptr inbounds %"class.alglib::minlmstate", ptr %61, i32 0, i32 7
  %63 = load ptr, ptr %62, align 8, !tbaa !31
  %64 = load ptr, ptr %14, align 8, !tbaa !5
  invoke void %58(ptr noundef nonnull align 8 dereferenceable(81) %60, ptr noundef nonnull align 8 dereferenceable(8) %63, ptr noundef %64)
          to label %65 unwind label %66

65:                                               ; preds = %57
  br label %47, !llvm.loop !32

66:                                               ; preds = %115, %96, %79, %57
  %67 = landingpad { ptr, i32 }
          catch ptr null
  %68 = extractvalue { ptr, i32 } %67, 0
  store ptr %68, ptr %17, align 8
  %69 = extractvalue { ptr, i32 } %67, 1
  store i32 %69, ptr %18, align 4
  br label %70

70:                                               ; preds = %66
  %71 = load ptr, ptr %17, align 8
  %72 = call ptr @__cxa_begin_catch(ptr %71) #6
  store i32 5, ptr %19, align 4
  call void @__cxa_end_catch()
  br label %129

73:                                               ; preds = %51
  %74 = load ptr, ptr %9, align 8, !tbaa !5
  %75 = getelementptr inbounds %"class.alglib::minlmstate", ptr %74, i32 0, i32 2
  %76 = load ptr, ptr %75, align 8, !tbaa !34
  %77 = load i8, ptr %76, align 1, !tbaa !28, !range !29, !noundef !30
  %78 = trunc i8 %77 to i1
  br i1 %78, label %79, label %90

79:                                               ; preds = %73
  %80 = load ptr, ptr %11, align 8, !tbaa !5
  %81 = load ptr, ptr %9, align 8, !tbaa !5
  %82 = getelementptr inbounds %"class.alglib::minlmstate", ptr %81, i32 0, i32 12
  %83 = load ptr, ptr %9, align 8, !tbaa !5
  %84 = getelementptr inbounds %"class.alglib::minlmstate", ptr %83, i32 0, i32 7
  %85 = load ptr, ptr %84, align 8, !tbaa !31
  %86 = load ptr, ptr %9, align 8, !tbaa !5
  %87 = getelementptr inbounds %"class.alglib::minlmstate", ptr %86, i32 0, i32 9
  %88 = load ptr, ptr %14, align 8, !tbaa !5
  invoke void %80(ptr noundef nonnull align 8 dereferenceable(81) %82, ptr noundef nonnull align 8 dereferenceable(8) %85, ptr noundef nonnull align 8 dereferenceable(81) %87, ptr noundef %88)
          to label %89 unwind label %66

89:                                               ; preds = %79
  br label %47, !llvm.loop !32

90:                                               ; preds = %73
  %91 = load ptr, ptr %9, align 8, !tbaa !5
  %92 = getelementptr inbounds %"class.alglib::minlmstate", ptr %91, i32 0, i32 5
  %93 = load ptr, ptr %92, align 8, !tbaa !35
  %94 = load i8, ptr %93, align 1, !tbaa !28, !range !29, !noundef !30
  %95 = trunc i8 %94 to i1
  br i1 %95, label %96, label %106

96:                                               ; preds = %90
  %97 = load ptr, ptr %12, align 8, !tbaa !5
  %98 = load ptr, ptr %9, align 8, !tbaa !5
  %99 = getelementptr inbounds %"class.alglib::minlmstate", ptr %98, i32 0, i32 12
  %100 = load ptr, ptr %9, align 8, !tbaa !5
  %101 = getelementptr inbounds %"class.alglib::minlmstate", ptr %100, i32 0, i32 8
  %102 = load ptr, ptr %9, align 8, !tbaa !5
  %103 = getelementptr inbounds %"class.alglib::minlmstate", ptr %102, i32 0, i32 11
  %104 = load ptr, ptr %14, align 8, !tbaa !5
  invoke void %97(ptr noundef nonnull align 8 dereferenceable(81) %99, ptr noundef nonnull align 8 dereferenceable(81) %101, ptr noundef nonnull align 8 dereferenceable(97) %103, ptr noundef %104)
          to label %105 unwind label %66

105:                                              ; preds = %96
  br label %47, !llvm.loop !32

106:                                              ; preds = %90
  %107 = load ptr, ptr %9, align 8, !tbaa !5
  %108 = getelementptr inbounds %"class.alglib::minlmstate", ptr %107, i32 0, i32 6
  %109 = load ptr, ptr %108, align 8, !tbaa !36
  %110 = load i8, ptr %109, align 1, !tbaa !28, !range !29, !noundef !30
  %111 = trunc i8 %110 to i1
  br i1 %111, label %112, label %126

112:                                              ; preds = %106
  %113 = load ptr, ptr %13, align 8, !tbaa !5
  %114 = icmp ne ptr %113, null
  br i1 %114, label %115, label %125

115:                                              ; preds = %112
  %116 = load ptr, ptr %13, align 8, !tbaa !5
  %117 = load ptr, ptr %9, align 8, !tbaa !5
  %118 = getelementptr inbounds %"class.alglib::minlmstate", ptr %117, i32 0, i32 12
  %119 = load ptr, ptr %9, align 8, !tbaa !5
  %120 = getelementptr inbounds %"class.alglib::minlmstate", ptr %119, i32 0, i32 7
  %121 = load ptr, ptr %120, align 8, !tbaa !31
  %122 = load double, ptr %121, align 8, !tbaa !37
  %123 = load ptr, ptr %14, align 8, !tbaa !5
  invoke void %116(ptr noundef nonnull align 8 dereferenceable(81) %118, double noundef %122, ptr noundef %123)
          to label %124 unwind label %66

124:                                              ; preds = %115
  br label %125

125:                                              ; preds = %124, %112
  br label %47, !llvm.loop !32

126:                                              ; preds = %106
  br label %128

127:                                              ; No predecessors!
  br label %128

128:                                              ; preds = %127, %126
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext false, ptr noundef @.str.100, ptr noundef %16)
  br label %129

129:                                              ; preds = %128, %70
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext false, ptr noundef @.str.17, ptr noundef %16)
  br label %47, !llvm.loop !32

130:                                              ; preds = %47
  call void @_ZN11alglib_impl14ae_state_clearEPNS_8ae_stateE(ptr noundef %16)
  call void @llvm.lifetime.end.p0(i64 128, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 200, ptr %15) #6
  ret void

131:                                              ; preds = %29
  %132 = load ptr, ptr %17, align 8
  %133 = load i32, ptr %18, align 4
  %134 = insertvalue { ptr, i32 } poison, ptr %132, 0
  %135 = insertvalue { ptr, i32 } %134, i32 %133, 1
  resume { ptr, i32 } %135
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nounwind returns_twice "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 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 #4 = { 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 = { nounwind }
attributes #7 = { nounwind returns_twice }
attributes #8 = { noreturn }

!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 88}
!10 = !{!"_ZTSN11alglib_impl8ae_stateE", !11, i64 0, !12, i64 8, !12, i64 16, !12, i64 24, !6, i64 32, !13, i64 40, !6, i64 72, !14, i64 80, !6, i64 88, !15, i64 96, !6, i64 104, !6, i64 112, !6, i64 120}
!11 = !{!"long", !7, i64 0}
!12 = !{!"double", !7, i64 0}
!13 = !{!"_ZTSN11alglib_impl12ae_dyn_blockE", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!14 = !{!"_ZTSN11alglib_impl13ae_error_typeE", !7, i64 0}
!15 = !{!"long long", !7, i64 0}
!16 = !{!17, !15, i64 0}
!17 = !{!"_ZTSN6alglib7xparamsE", !15, i64 0}
!18 = !{!19, !6, i64 16}
!19 = !{!"_ZTSN6alglib10minlmstateE", !20, i64 0, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !21, i64 72, !21, i64 160, !25, i64 248, !25, i64 352, !21, i64 456}
!20 = !{!"_ZTSN6alglib17_minlmstate_ownerE", !6, i64 8}
!21 = !{!"_ZTSN6alglib13real_1d_arrayE", !22, i64 0}
!22 = !{!"_ZTSN6alglib17ae_vector_wrapperE", !6, i64 8, !23, i64 16, !24, i64 80}
!23 = !{!"_ZTSN11alglib_impl9ae_vectorE", !11, i64 0, !11, i64 8, !24, i64 16, !13, i64 24, !7, i64 56}
!24 = !{!"bool", !7, i64 0}
!25 = !{!"_ZTSN6alglib13real_2d_arrayE", !26, i64 0}
!26 = !{!"_ZTSN6alglib17ae_matrix_wrapperE", !6, i64 8, !27, i64 16, !24, i64 96}
!27 = !{!"_ZTSN11alglib_impl9ae_matrixE", !11, i64 0, !11, i64 8, !11, i64 16, !11, i64 24, !24, i64 32, !13, i64 40, !7, i64 72}
!28 = !{!24, !24, i64 0}
!29 = !{i8 0, i8 2}
!30 = !{}
!31 = !{!19, !6, i64 64}
!32 = distinct !{!32, !33}
!33 = !{!"llvm.loop.mustprogress"}
!34 = !{!19, !6, i64 24}
!35 = !{!19, !6, i64 48}
!36 = !{!19, !6, i64 56}
!37 = !{!12, !12, i64 0}


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

%struct.__jmp_buf_tag = type { [8 x i64], i32, %struct.__sigset_t }
%struct.__sigset_t = type { [16 x i64] }
%"struct.alglib_impl::ae_state" = type { i64, double, double, double, ptr, %"struct.alglib_impl::ae_dyn_block", ptr, i32, ptr, i64, ptr, ptr, ptr }
%"struct.alglib_impl::ae_dyn_block" = type { ptr, ptr, ptr, ptr }

@_ZTIN6alglib8ap_errorE = external dso_local constant { ptr, ptr }, align 8
@.str.17 = external hidden unnamed_addr constant [45 x i8], align 1
@.str.100 = external hidden unnamed_addr constant [71 x i8], align 1
@.str.101 = external hidden unnamed_addr constant [49 x i8], align 1
@.str.102 = external hidden unnamed_addr constant [50 x i8], align 1
@.str.103 = external hidden unnamed_addr constant [50 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

declare void @_ZN11alglib_impl13ae_state_initEPNS_8ae_stateE(ptr noundef) local_unnamed_addr #1

; Function Attrs: nounwind returns_twice
declare i32 @_setjmp(ptr noundef) local_unnamed_addr #2

declare ptr @__cxa_allocate_exception(i64) local_unnamed_addr

declare void @_ZN6alglib8ap_errorC1EPKc(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef) unnamed_addr #1

declare i32 @__gxx_personality_v0(...)

declare void @__cxa_free_exception(ptr) local_unnamed_addr

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

declare void @__cxa_throw(ptr, ptr, ptr) local_unnamed_addr

declare void @_ZN11alglib_impl23ae_state_set_break_jumpEPNS_8ae_stateEPA1_13__jmp_buf_tag(ptr noundef, ptr noundef) local_unnamed_addr #1

declare void @_ZN11alglib_impl14ae_state_clearEPNS_8ae_stateE(ptr noundef) local_unnamed_addr #1

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

declare void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext, ptr noundef, ptr noundef) local_unnamed_addr #1

declare ptr @__cxa_begin_catch(ptr) local_unnamed_addr

declare void @_ZN11alglib_impl18ae_state_set_flagsEPNS_8ae_stateEy(ptr noundef, i64 noundef) local_unnamed_addr #1

declare void @__cxa_end_catch() local_unnamed_addr

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN6alglib17_minlmstate_owner5c_ptrEv(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN11alglib_impl14minlmiterationEPNS_10minlmstateEPNS_8ae_stateE(ptr noundef, ptr noundef) local_unnamed_addr #5

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6alglib13minlmoptimizeERNS_10minlmstateEPFvRKNS_13real_1d_arrayERdPvEPFvS4_S5_RS2_S6_EPFvS4_S9_RNS_13real_2d_arrayES6_EPFvS4_dS6_ES6_NS_7xparamsE(ptr noundef nonnull align 8 dereferenceable(544) %0, ptr noundef readonly %1, ptr noundef readonly %2, ptr noundef readonly %3, ptr noundef readonly %4, ptr noundef %5, i64 %6) local_unnamed_addr #5 personality ptr @__gxx_personality_v0 {
  %8 = alloca [1 x %struct.__jmp_buf_tag], align 16
  %9 = alloca %"struct.alglib_impl::ae_state", align 8
  call void @llvm.lifetime.start.p0(i64 200, ptr nonnull %8) #6
  call void @llvm.lifetime.start.p0(i64 128, ptr nonnull %9) #6
  call void @_ZN11alglib_impl13ae_state_initEPNS_8ae_stateE(ptr noundef nonnull %9)
  %10 = call i32 @_setjmp(ptr noundef nonnull %8) #7
  %.not = icmp eq i32 %10, 0
  br i1 %.not, label %18, label %11

11:                                               ; preds = %7
  %12 = call ptr @__cxa_allocate_exception(i64 32) #6
  %13 = getelementptr inbounds i8, ptr %9, i64 88
  %14 = load volatile ptr, ptr %13, align 8, !tbaa !5
  invoke void @_ZN6alglib8ap_errorC1EPKc(ptr noundef nonnull align 8 dereferenceable(32) %12, ptr noundef %14)
          to label %15 unwind label %16

15:                                               ; preds = %11
  call void @__cxa_throw(ptr nonnull %12, ptr nonnull @_ZTIN6alglib8ap_errorE, ptr nonnull @_ZN6alglib8ap_errorD2Ev) #8
  unreachable

16:                                               ; preds = %11
  %17 = landingpad { ptr, i32 }
          cleanup
  call void @__cxa_free_exception(ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 128, ptr nonnull %9) #6
  call void @llvm.lifetime.end.p0(i64 200, ptr nonnull %8) #6
  resume { ptr, i32 } %17

18:                                               ; preds = %7
  call void @_ZN11alglib_impl23ae_state_set_break_jumpEPNS_8ae_stateEPA1_13__jmp_buf_tag(ptr noundef nonnull %9, ptr noundef nonnull %8)
  %.not31 = icmp eq i64 %6, 0
  br i1 %.not31, label %20, label %19

19:                                               ; preds = %18
  call void @_ZN11alglib_impl18ae_state_set_flagsEPNS_8ae_stateEy(ptr noundef nonnull %9, i64 noundef %6)
  br label %20

20:                                               ; preds = %19, %18
  %21 = icmp ne ptr %1, null
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %21, ptr noundef nonnull @.str.102, ptr noundef nonnull %9)
  %22 = icmp ne ptr %2, null
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %22, ptr noundef nonnull @.str.103, ptr noundef nonnull %9)
  %23 = icmp ne ptr %3, null
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext %23, ptr noundef nonnull @.str.101, ptr noundef nonnull %9)
  %24 = call noundef ptr @_ZN6alglib17_minlmstate_owner5c_ptrEv(ptr noundef nonnull align 8 dereferenceable(16) %0)
  %25 = call noundef zeroext i1 @_ZN11alglib_impl14minlmiterationEPNS_10minlmstateEPNS_8ae_stateE(ptr noundef %24, ptr noundef nonnull %9)
  br i1 %25, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %20
  %26 = getelementptr inbounds i8, ptr %0, i64 16
  %27 = getelementptr inbounds i8, ptr %0, i64 24
  %28 = getelementptr inbounds i8, ptr %0, i64 48
  %29 = getelementptr inbounds i8, ptr %0, i64 56
  %.not32 = icmp eq ptr %4, null
  %30 = getelementptr inbounds i8, ptr %0, i64 456
  %31 = getelementptr inbounds i8, ptr %0, i64 64
  %32 = getelementptr inbounds i8, ptr %0, i64 72
  %33 = getelementptr inbounds i8, ptr %0, i64 352
  %34 = getelementptr inbounds i8, ptr %0, i64 160
  br label %35

35:                                               ; preds = %.lr.ph, %.backedge
  %36 = load ptr, ptr %26, align 8, !tbaa !15
  %37 = load i8, ptr %36, align 1, !tbaa !25, !range !26, !noundef !27
  %38 = trunc nuw i8 %37 to i1
  br i1 %38, label %39, label %45

39:                                               ; preds = %35
  %40 = load ptr, ptr %31, align 8, !tbaa !28
  invoke void %1(ptr noundef nonnull align 8 dereferenceable(81) %30, ptr noundef nonnull align 8 dereferenceable(8) %40, ptr noundef %5)
          to label %.backedge unwind label %41

41:                                               ; preds = %61, %55, %49, %39
  %42 = landingpad { ptr, i32 }
          catch ptr null
  %43 = extractvalue { ptr, i32 } %42, 0
  %44 = call ptr @__cxa_begin_catch(ptr %43) #6
  call void @__cxa_end_catch()
  br label %67

45:                                               ; preds = %35
  %46 = load ptr, ptr %27, align 8, !tbaa !29
  %47 = load i8, ptr %46, align 1, !tbaa !25, !range !26, !noundef !27
  %48 = trunc nuw i8 %47 to i1
  br i1 %48, label %49, label %51

49:                                               ; preds = %45
  %50 = load ptr, ptr %31, align 8, !tbaa !28
  invoke void %2(ptr noundef nonnull align 8 dereferenceable(81) %30, ptr noundef nonnull align 8 dereferenceable(8) %50, ptr noundef nonnull align 8 dereferenceable(81) %34, ptr noundef %5)
          to label %.backedge unwind label %41

51:                                               ; preds = %45
  %52 = load ptr, ptr %28, align 8, !tbaa !30
  %53 = load i8, ptr %52, align 1, !tbaa !25, !range !26, !noundef !27
  %54 = trunc nuw i8 %53 to i1
  br i1 %54, label %55, label %56

55:                                               ; preds = %51
  invoke void %3(ptr noundef nonnull align 8 dereferenceable(81) %30, ptr noundef nonnull align 8 dereferenceable(81) %32, ptr noundef nonnull align 8 dereferenceable(97) %33, ptr noundef %5)
          to label %.backedge unwind label %41

56:                                               ; preds = %51
  %57 = load ptr, ptr %29, align 8, !tbaa !31
  %58 = load i8, ptr %57, align 1, !tbaa !25, !range !26, !noundef !27
  %59 = trunc nuw i8 %58 to i1
  br i1 %59, label %60, label %66

60:                                               ; preds = %56
  br i1 %.not32, label %.backedge, label %61

61:                                               ; preds = %60
  %62 = load ptr, ptr %31, align 8, !tbaa !28
  %63 = load double, ptr %62, align 8, !tbaa !32
  invoke void %4(ptr noundef nonnull align 8 dereferenceable(81) %30, double noundef %63, ptr noundef %5)
          to label %.backedge unwind label %41

.backedge:                                        ; preds = %60, %61, %67, %39, %49, %55
  %64 = call noundef ptr @_ZN6alglib17_minlmstate_owner5c_ptrEv(ptr noundef nonnull align 8 dereferenceable(16) %0)
  %65 = call noundef zeroext i1 @_ZN11alglib_impl14minlmiterationEPNS_10minlmstateEPNS_8ae_stateE(ptr noundef %64, ptr noundef nonnull %9)
  br i1 %65, label %35, label %._crit_edge, !llvm.loop !33

66:                                               ; preds = %56
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext false, ptr noundef nonnull @.str.100, ptr noundef nonnull %9)
  br label %67

67:                                               ; preds = %66, %41
  call void @_ZN11alglib_impl9ae_assertEbPKcPNS_8ae_stateE(i1 noundef zeroext false, ptr noundef nonnull @.str.17, ptr noundef nonnull %9)
  br label %.backedge

._crit_edge:                                      ; preds = %.backedge, %20
  call void @_ZN11alglib_impl14ae_state_clearEPNS_8ae_stateE(ptr noundef nonnull %9)
  call void @llvm.lifetime.end.p0(i64 128, ptr nonnull %9) #6
  call void @llvm.lifetime.end.p0(i64 200, ptr nonnull %8) #6
  ret void
}

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { nounwind returns_twice "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 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 #4 = { 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 = { nounwind }
attributes #7 = { nounwind returns_twice }
attributes #8 = { noreturn }

!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, !11, i64 88}
!6 = !{!"_ZTSN11alglib_impl8ae_stateE", !7, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !11, i64 32, !12, i64 40, !11, i64 72, !13, i64 80, !11, i64 88, !14, i64 96, !11, i64 104, !11, i64 112, !11, i64 120}
!7 = !{!"long", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"double", !8, i64 0}
!11 = !{!"any pointer", !8, i64 0}
!12 = !{!"_ZTSN11alglib_impl12ae_dyn_blockE", !11, i64 0, !11, i64 8, !11, i64 16, !11, i64 24}
!13 = !{!"_ZTSN11alglib_impl13ae_error_typeE", !8, i64 0}
!14 = !{!"long long", !8, i64 0}
!15 = !{!16, !11, i64 16}
!16 = !{!"_ZTSN6alglib10minlmstateE", !17, i64 0, !11, i64 16, !11, i64 24, !11, i64 32, !11, i64 40, !11, i64 48, !11, i64 56, !11, i64 64, !18, i64 72, !18, i64 160, !22, i64 248, !22, i64 352, !18, i64 456}
!17 = !{!"_ZTSN6alglib17_minlmstate_ownerE", !11, i64 8}
!18 = !{!"_ZTSN6alglib13real_1d_arrayE", !19, i64 0}
!19 = !{!"_ZTSN6alglib17ae_vector_wrapperE", !11, i64 8, !20, i64 16, !21, i64 80}
!20 = !{!"_ZTSN11alglib_impl9ae_vectorE", !7, i64 0, !7, i64 8, !21, i64 16, !12, i64 24, !8, i64 56}
!21 = !{!"bool", !8, i64 0}
!22 = !{!"_ZTSN6alglib13real_2d_arrayE", !23, i64 0}
!23 = !{!"_ZTSN6alglib17ae_matrix_wrapperE", !11, i64 8, !24, i64 16, !21, i64 96}
!24 = !{!"_ZTSN11alglib_impl9ae_matrixE", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !21, i64 32, !12, i64 40, !8, i64 72}
!25 = !{!21, !21, i64 0}
!26 = !{i8 0, i8 2}
!27 = !{}
!28 = !{!16, !11, i64 64}
!29 = !{!16, !11, i64 24}
!30 = !{!16, !11, i64 48}
!31 = !{!16, !11, i64 56}
!32 = !{!10, !10, i64 0}
!33 = distinct !{!33, !34}
!34 = !{!"llvm.loop.mustprogress"}


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