; LLVM IR from Dimandragon/non-parametric-dsp :: alglib-cpp/tests/test_c.ll (Z13testserializePbPN11alglib_impl8ae_stateE)

; 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_impl::ae_frame" = type { %"struct.alglib_impl::ae_dyn_block" }
%"struct.alglib_impl::ae_dyn_block" = type { ptr, ptr, ptr, ptr }
%"struct.alglib_impl::hqrndstate" = type { i64, i64, i64 }
%"struct.alglib_impl::sparsematrix" = type { %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_vector", i64, i64, i64, i64, i64, i64 }
%"struct.alglib_impl::ae_vector" = type { i64, i64, i8, %"struct.alglib_impl::ae_dyn_block", %union.anon }
%union.anon = type { ptr }
%"struct.alglib_impl::ae_serializer" = type { i64, i64, i64, i64, i64, ptr, ptr, ptr, i64, ptr, ptr }

@.str.19 = external hidden unnamed_addr constant [92 x i8], align 1
@_ZL22testsparseunit_maxtype = external hidden global i64, align 8
@.str.215 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.216 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.217 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.218 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.219 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.220 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.221 = external hidden unnamed_addr constant [23 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: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

declare noundef zeroext i1 @_ZN11alglib_impl9ae_fp_neqEdd(double noundef, double noundef) #1

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

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

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

declare noundef double @_ZN11alglib_impl13hqrnduniformrEPNS_10hqrndstateEPNS_8ae_stateE(ptr noundef, ptr noundef) #1

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

declare noundef zeroext i1 @_ZN11alglib_impl13ae_fp_less_eqEdd(double noundef, double noundef) #1

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

declare noundef i64 @_ZN11alglib_impl8ae_roundEdPNS_8ae_stateE(double noundef, ptr noundef) #1

declare void @_ZN11alglib_impl14ae_frame_leaveEPNS_8ae_stateE(ptr noundef) #1

; Function Attrs: mustprogress uwtable
define dso_local void @_Z13testserializePbPN11alglib_impl8ae_stateE(ptr noundef %0, ptr noundef %1) #3 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca %"struct.alglib_impl::ae_frame", align 8
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca double, align 8
  %11 = alloca %"struct.alglib_impl::hqrndstate", align 8
  %12 = alloca %"struct.alglib_impl::sparsematrix", align 8
  %13 = alloca %"struct.alglib_impl::sparsematrix", align 8
  %14 = alloca %"struct.alglib_impl::sparsematrix", align 8
  %15 = alloca %"struct.alglib_impl::sparsematrix", align 8
  %16 = alloca %"struct.alglib_impl::sparsematrix", align 8
  %17 = alloca i64, align 8
  %18 = alloca i64, align 8
  %19 = alloca %"struct.alglib_impl::ae_serializer", align 8
  %20 = alloca i64, align 8
  %21 = alloca %"struct.alglib_impl::ae_frame", align 8
  %22 = alloca %"struct.alglib_impl::ae_dyn_block", align 8
  %23 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 32, ptr %5) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #4
  call void @llvm.lifetime.start.p0(i64 24, ptr %11) #4
  call void @llvm.lifetime.start.p0(i64 368, ptr %12) #4
  call void @llvm.lifetime.start.p0(i64 368, ptr %13) #4
  call void @llvm.lifetime.start.p0(i64 368, ptr %14) #4
  call void @llvm.lifetime.start.p0(i64 368, ptr %15) #4
  call void @llvm.lifetime.start.p0(i64 368, ptr %16) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #4
  %24 = load ptr, ptr %4, align 8, !tbaa !5
  call void @_ZN11alglib_impl13ae_frame_makeEPNS_8ae_stateEPNS_8ae_frameE(ptr noundef %24, ptr noundef %5)
  call void @llvm.memset.p0.i64(ptr align 8 %11, i8 0, i64 24, i1 false)
  call void @llvm.memset.p0.i64(ptr align 8 %12, i8 0, i64 368, i1 false)
  call void @llvm.memset.p0.i64(ptr align 8 %13, i8 0, i64 368, i1 false)
  call void @llvm.memset.p0.i64(ptr align 8 %14, i8 0, i64 368, i1 false)
  call void @llvm.memset.p0.i64(ptr align 8 %15, i8 0, i64 368, i1 false)
  call void @llvm.memset.p0.i64(ptr align 8 %16, i8 0, i64 368, i1 false)
  %25 = load ptr, ptr %4, align 8, !tbaa !5
  call void @_ZN11alglib_impl16_hqrndstate_initEPvPNS_8ae_stateEb(ptr noundef %11, ptr noundef %25, i1 noundef zeroext true)
  %26 = load ptr, ptr %4, align 8, !tbaa !5
  call void @_ZN11alglib_impl18_sparsematrix_initEPvPNS_8ae_stateEb(ptr noundef %12, ptr noundef %26, i1 noundef zeroext true)
  %27 = load ptr, ptr %4, align 8, !tbaa !5
  call void @_ZN11alglib_impl18_sparsematrix_initEPvPNS_8ae_stateEb(ptr noundef %13, ptr noundef %27, i1 noundef zeroext true)
  %28 = load ptr, ptr %4, align 8, !tbaa !5
  call void @_ZN11alglib_impl18_sparsematrix_initEPvPNS_8ae_stateEb(ptr noundef %14, ptr noundef %28, i1 noundef zeroext true)
  %29 = load ptr, ptr %4, align 8, !tbaa !5
  call void @_ZN11alglib_impl18_sparsematrix_initEPvPNS_8ae_stateEb(ptr noundef %15, ptr noundef %29, i1 noundef zeroext true)
  %30 = load ptr, ptr %4, align 8, !tbaa !5
  call void @_ZN11alglib_impl18_sparsematrix_initEPvPNS_8ae_stateEb(ptr noundef %16, ptr noundef %30, i1 noundef zeroext true)
  %31 = load ptr, ptr %4, align 8, !tbaa !5
  call void @_ZN11alglib_impl14hqrndrandomizeEPNS_10hqrndstateEPNS_8ae_stateE(ptr noundef %11, ptr noundef %31)
  store i64 1, ptr %6, align 8, !tbaa !9
  br label %32

32:                                               ; preds = %224, %2
  %33 = load i64, ptr %6, align 8, !tbaa !9
  %34 = icmp sle i64 %33, 10
  br i1 %34, label %35, label %227

35:                                               ; preds = %32
  store i64 1, ptr %7, align 8, !tbaa !9
  br label %36

36:                                               ; preds = %220, %35
  %37 = load i64, ptr %7, align 8, !tbaa !9
  %38 = icmp sle i64 %37, 10
  br i1 %38, label %39, label %223

39:                                               ; preds = %36
  store i64 0, ptr %8, align 8, !tbaa !9
  br label %40

40:                                               ; preds = %216, %39
  %41 = load i64, ptr %8, align 8, !tbaa !9
  %42 = load i64, ptr @_ZL22testsparseunit_maxtype, align 8, !tbaa !9
  %43 = icmp sle i64 %41, %42
  br i1 %43, label %44, label %219

44:                                               ; preds = %40
  %45 = load i64, ptr %8, align 8, !tbaa !9
  %46 = icmp eq i64 %45, 2
  br i1 %46, label %47, label %52

47:                                               ; preds = %44
  %48 = load i64, ptr %7, align 8, !tbaa !9
  %49 = load i64, ptr %6, align 8, !tbaa !9
  %50 = icmp ne i64 %48, %49
  br i1 %50, label %51, label %52

51:                                               ; preds = %47
  br label %216

52:                                               ; preds = %47, %44
  %53 = load i64, ptr %6, align 8, !tbaa !9
  %54 = load i64, ptr %7, align 8, !tbaa !9
  %55 = mul nsw i64 %53, %54
  store i64 %55, ptr %9, align 8, !tbaa !9
  br label %56

56:                                               ; preds = %205, %52
  %57 = load i64, ptr %6, align 8, !tbaa !9
  %58 = icmp sgt i64 %57, 1
  br i1 %58, label %59, label %67

59:                                               ; preds = %56
  %60 = load i64, ptr %9, align 8, !tbaa !9
  %61 = sitofp i64 %60 to double
  %62 = load i64, ptr %7, align 8, !tbaa !9
  %63 = load i64, ptr %6, align 8, !tbaa !9
  %64 = mul nsw i64 %62, %63
  %65 = sitofp i64 %64 to double
  %66 = fdiv double %61, %65
  store double %66, ptr %10, align 8, !tbaa !11
  br label %68

67:                                               ; preds = %56
  store double 5.000000e-01, ptr %10, align 8, !tbaa !11
  br label %68

68:                                               ; preds = %67, %59
  %69 = load i64, ptr %7, align 8, !tbaa !9
  %70 = load i64, ptr %6, align 8, !tbaa !9
  %71 = load i64, ptr %9, align 8, !tbaa !9
  %72 = sitofp i64 %71 to double
  %73 = load ptr, ptr %4, align 8, !tbaa !5
  %74 = call noundef double @_ZN11alglib_impl13hqrnduniformrEPNS_10hqrndstateEPNS_8ae_stateE(ptr noundef %11, ptr noundef %73)
  %75 = fmul double %72, %74
  %76 = load ptr, ptr %4, align 8, !tbaa !5
  %77 = call noundef i64 @_ZN11alglib_impl8ae_roundEdPNS_8ae_stateE(double noundef %75, ptr noundef %76)
  %78 = load ptr, ptr %4, align 8, !tbaa !5
  call void @_ZN11alglib_impl12sparsecreateElllPNS_12sparsematrixEPNS_8ae_stateE(i64 noundef %69, i64 noundef %70, i64 noundef %77, ptr noundef %12, ptr noundef %78)
  store i64 0, ptr %17, align 8, !tbaa !9
  br label %79

79:                                               ; preds = %117, %68
  %80 = load i64, ptr %17, align 8, !tbaa !9
  %81 = load i64, ptr %7, align 8, !tbaa !9
  %82 = sub nsw i64 %81, 1
  %83 = icmp sle i64 %80, %82
  br i1 %83, label %84, label %120

84:                                               ; preds = %79
  store i64 0, ptr %18, align 8, !tbaa !9
  br label %85

85:                                               ; preds = %113, %84
  %86 = load i64, ptr %18, align 8, !tbaa !9
  %87 = load i64, ptr %6, align 8, !tbaa !9
  %88 = sub nsw i64 %87, 1
  %89 = icmp sle i64 %86, %88
  br i1 %89, label %90, label %116

90:                                               ; preds = %85
  %91 = load ptr, ptr %3, align 8, !tbaa !5
  %92 = load i64, ptr %17, align 8, !tbaa !9
  %93 = load i64, ptr %18, align 8, !tbaa !9
  %94 = load ptr, ptr %4, align 8, !tbaa !5
  %95 = call noundef zeroext i1 @_ZN11alglib_impl12sparseexistsEPKNS_12sparsematrixEllPNS_8ae_stateE(ptr noundef %12, i64 noundef %92, i64 noundef %93, ptr noundef %94)
  call void @_ZN11alglib_impl17ae_set_error_flagEPbbPKciS2_(ptr noundef %91, i1 noundef zeroext %95, ptr noundef @.str.19, i32 noundef 15261, ptr noundef @.str.215)
  %96 = load ptr, ptr %4, align 8, !tbaa !5
  %97 = call noundef double @_ZN11alglib_impl13hqrnduniformrEPNS_10hqrndstateEPNS_8ae_stateE(ptr noundef %11, ptr noundef %96)
  %98 = load double, ptr %10, align 8, !tbaa !11
  %99 = call noundef zeroext i1 @_ZN11alglib_impl13ae_fp_less_eqEdd(double noundef %97, double noundef %98)
  br i1 %99, label %100, label %112

100:                                              ; preds = %90
  %101 = load i64, ptr %17, align 8, !tbaa !9
  %102 = load i64, ptr %18, align 8, !tbaa !9
  %103 = load ptr, ptr %4, align 8, !tbaa !5
  %104 = call noundef double @_ZN11alglib_impl11hqrndnormalEPNS_10hqrndstateEPNS_8ae_stateE(ptr noundef %11, ptr noundef %103)
  %105 = load ptr, ptr %4, align 8, !tbaa !5
  call void @_ZN11alglib_impl9sparsesetEPNS_12sparsematrixElldPNS_8ae_stateE(ptr noundef %12, i64 noundef %101, i64 noundef %102, double noundef %104, ptr noundef %105)
  %106 = load ptr, ptr %3, align 8, !tbaa !5
  %107 = load i64, ptr %17, align 8, !tbaa !9
  %108 = load i64, ptr %18, align 8, !tbaa !9
  %109 = load ptr, ptr %4, align 8, !tbaa !5
  %110 = call noundef zeroext i1 @_ZN11alglib_impl12sparseexistsEPKNS_12sparsematrixEllPNS_8ae_stateE(ptr noundef %12, i64 noundef %107, i64 noundef %108, ptr noundef %109)
  %111 = xor i1 %110, true
  call void @_ZN11alglib_impl17ae_set_error_flagEPbbPKciS2_(ptr noundef %106, i1 noundef zeroext %111, ptr noundef @.str.19, i32 noundef 15265, ptr noundef @.str.216)
  br label %112

112:                                              ; preds = %100, %90
  br label %113

113:                                              ; preds = %112
  %114 = load i64, ptr %18, align 8, !tbaa !9
  %115 = add nsw i64 %114, 1
  store i64 %115, ptr %18, align 8, !tbaa !9
  br label %85, !llvm.loop !13

116:                                              ; preds = %85
  br label %117

117:                                              ; preds = %116
  %118 = load i64, ptr %17, align 8, !tbaa !9
  %119 = add nsw i64 %118, 1
  store i64 %119, ptr %17, align 8, !tbaa !9
  br label %79, !llvm.loop !15

120:                                              ; preds = %79
  %121 = load i64, ptr %8, align 8, !tbaa !9
  %122 = load ptr, ptr %4, align 8, !tbaa !5
  call void @_ZN11alglib_impl15sparseconverttoEPNS_12sparsematrixElPNS_8ae_stateE(ptr noundef %12, i64 noundef %121, ptr noundef %122)
  %123 = load ptr, ptr %3, align 8, !tbaa !5
  %124 = load ptr, ptr %4, align 8, !tbaa !5
  %125 = call noundef i64 @_ZN11alglib_impl19sparsegetmatrixtypeEPKNS_12sparsematrixEPNS_8ae_stateE(ptr noundef %12, ptr noundef %124)
  %126 = load i64, ptr %8, align 8, !tbaa !9
  %127 = icmp ne i64 %125, %126
  call void @_ZN11alglib_impl17ae_set_error_flagEPbbPKciS2_(ptr noundef %123, i1 noundef zeroext %127, ptr noundef @.str.19, i32 noundef 15270, ptr noundef @.str.217)
  call void @llvm.lifetime.start.p0(i64 88, ptr %19) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #4
  call void @llvm.lifetime.start.p0(i64 32, ptr %21) #4
  call void @llvm.lifetime.start.p0(i64 32, ptr %22) #4
  %128 = load ptr, ptr %4, align 8, !tbaa !5
  call void @_ZN11alglib_impl13ae_frame_makeEPNS_8ae_stateEPNS_8ae_frameE(ptr noundef %128, ptr noundef %21)
  call void @_ZN11alglib_impl18ae_serializer_initEPNS_13ae_serializerE(ptr noundef %19)
  call void @_ZN11alglib_impl25ae_serializer_alloc_startEPNS_13ae_serializerE(ptr noundef %19)
  %129 = load ptr, ptr %4, align 8, !tbaa !5
  call void @_ZN11alglib_impl11sparseallocEPNS_13ae_serializerEPKNS_12sparsematrixEPNS_8ae_stateE(ptr noundef %19, ptr noundef %12, ptr noundef %129)
  %130 = call noundef i64 @_ZN11alglib_impl28ae_serializer_get_alloc_sizeEPNS_13ae_serializerE(ptr noundef %19)
  store i64 %130, ptr %20, align 8, !tbaa !9
  call void @llvm.memset.p0.i64(ptr align 8 %22, i8 0, i64 32, i1 false)
  %131 = load i64, ptr %20, align 8, !tbaa !9
  %132 = add nsw i64 %131, 1
  %133 = load ptr, ptr %4, align 8, !tbaa !5
  call void @_ZN11alglib_impl10ae_db_initEPNS_12ae_dyn_blockElPNS_8ae_stateEb(ptr noundef %22, i64 noundef %132, ptr noundef %133, i1 noundef zeroext true)
  %134 = getelementptr inbounds %"struct.alglib_impl::ae_dyn_block", ptr %22, i32 0, i32 2
  %135 = load volatile ptr, ptr %134, align 8, !tbaa !16
  call void @_ZN11alglib_impl24ae_serializer_sstart_strEPNS_13ae_serializerEPc(ptr noundef %19, ptr noundef %135)
  %136 = load ptr, ptr %4, align 8, !tbaa !5
  call void @_ZN11alglib_impl15sparseserializeEPNS_13ae_serializerEPKNS_12sparsematrixEPNS_8ae_stateE(ptr noundef %19, ptr noundef %12, ptr noundef %136)
  %137 = load ptr, ptr %4, align 8, !tbaa !5
  call void @_ZN11alglib_impl18ae_serializer_stopEPNS_13ae_serializerEPNS_8ae_stateE(ptr noundef %19, ptr noundef %137)
  call void @_ZN11alglib_impl19ae_serializer_clearEPNS_13ae_serializerE(ptr noundef %19)
  call void @_ZN11alglib_impl18ae_serializer_initEPNS_13ae_serializerE(ptr noundef %19)
  %138 = getelementptr inbounds %"struct.alglib_impl::ae_dyn_block", ptr %22, i32 0, i32 2
  %139 = load volatile ptr, ptr %138, align 8, !tbaa !16
  call void @_ZN11alglib_impl24ae_serializer_ustart_strEPNS_13ae_serializerEPKc(ptr noundef %19, ptr noundef %139)
  %140 = load ptr, ptr %4, align 8, !tbaa !5
  call void @_ZN11alglib_impl17sparseunserializeEPNS_13ae_serializerEPNS_12sparsematrixEPNS_8ae_stateE(ptr noundef %19, ptr noundef %13, ptr noundef %140)
  %141 = load ptr, ptr %4, align 8, !tbaa !5
  call void @_ZN11alglib_impl18ae_serializer_stopEPNS_13ae_serializerEPNS_8ae_stateE(ptr noundef %19, ptr noundef %141)
  call void @_ZN11alglib_impl19ae_serializer_clearEPNS_13ae_serializerE(ptr noundef %19)
  %142 = load ptr, ptr %4, align 8, !tbaa !5
  call void @_ZN11alglib_impl14ae_frame_leaveEPNS_8ae_stateE(ptr noundef %142)
  call void @llvm.lifetime.end.p0(i64 32, ptr %22) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %21) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #4
  call void @llvm.lifetime.end.p0(i64 88, ptr %19) #4
  %143 = load ptr, ptr %3, align 8, !tbaa !5
  %144 = load ptr, ptr %4, align 8, !tbaa !5
  %145 = call noundef i64 @_ZN11alglib_impl19sparsegetmatrixtypeEPKNS_12sparsematrixEPNS_8ae_stateE(ptr noundef %13, ptr noundef %144)
  %146 = load i64, ptr %8, align 8, !tbaa !9
  %147 = icmp ne i64 %145, %146
  call void @_ZN11alglib_impl17ae_set_error_flagEPbbPKciS2_(ptr noundef %143, i1 noundef zeroext %147, ptr noundef @.str.19, i32 noundef 15306, ptr noundef @.str.218)
  %148 = load ptr, ptr %3, align 8, !tbaa !5
  %149 = load ptr, ptr %4, align 8, !tbaa !5
  %150 = call noundef i64 @_ZN11alglib_impl14sparsegetnrowsEPKNS_12sparsematrixEPNS_8ae_stateE(ptr noundef %12, ptr noundef %149)
  %151 = load ptr, ptr %4, align 8, !tbaa !5
  %152 = call noundef i64 @_ZN11alglib_impl14sparsegetnrowsEPKNS_12sparsematrixEPNS_8ae_stateE(ptr noundef %13, ptr noundef %151)
  %153 = icmp ne i64 %150, %152
  call void @_ZN11alglib_impl17ae_set_error_flagEPbbPKciS2_(ptr noundef %148, i1 noundef zeroext %153, ptr noundef @.str.19, i32 noundef 15307, ptr noundef @.str.219)
  %154 = load ptr, ptr %3, align 8, !tbaa !5
  %155 = load ptr, ptr %4, align 8, !tbaa !5
  %156 = call noundef i64 @_ZN11alglib_impl14sparsegetncolsEPKNS_12sparsematrixEPNS_8ae_stateE(ptr noundef %12, ptr noundef %155)
  %157 = load ptr, ptr %4, align 8, !tbaa !5
  %158 = call noundef i64 @_ZN11alglib_impl14sparsegetncolsEPKNS_12sparsematrixEPNS_8ae_stateE(ptr noundef %13, ptr noundef %157)
  %159 = icmp ne i64 %156, %158
  call void @_ZN11alglib_impl17ae_set_error_flagEPbbPKciS2_(ptr noundef %154, i1 noundef zeroext %159, ptr noundef @.str.19, i32 noundef 15308, ptr noundef @.str.220)
  %160 = load ptr, ptr %3, align 8, !tbaa !5
  %161 = load i8, ptr %160, align 1, !tbaa !18, !range !20, !noundef !21
  %162 = trunc i8 %161 to i1
  br i1 %162, label %163, label %165

163:                                              ; preds = %120
  %164 = load ptr, ptr %4, align 8, !tbaa !5
  call void @_ZN11alglib_impl14ae_frame_leaveEPNS_8ae_stateE(ptr noundef %164)
  store i32 1, ptr %23, align 4
  br label %229

165:                                              ; preds = %120
  store i64 0, ptr %17, align 8, !tbaa !9
  br label %166

166:                                              ; preds = %192, %165
  %167 = load i64, ptr %17, align 8, !tbaa !9
  %168 = load i64, ptr %7, align 8, !tbaa !9
  %169 = sub nsw i64 %168, 1
  %170 = icmp sle i64 %167, %169
  br i1 %170, label %171, label %195

171:                                              ; preds = %166
  store i64 0, ptr %18, align 8, !tbaa !9
  br label %172

172:                                              ; preds = %188, %171
  %173 = load i64, ptr %18, align 8, !tbaa !9
  %174 = load i64, ptr %6, align 8, !tbaa !9
  %175 = sub nsw i64 %174, 1
  %176 = icmp sle i64 %173, %175
  br i1 %176, label %177, label %191

177:                                              ; preds = %172
  %178 = load ptr, ptr %3, align 8, !tbaa !5
  %179 = load i64, ptr %17, align 8, !tbaa !9
  %180 = load i64, ptr %18, align 8, !tbaa !9
  %181 = load ptr, ptr %4, align 8, !tbaa !5
  %182 = call noundef double @_ZN11alglib_impl9sparsegetEPKNS_12sparsematrixEllPNS_8ae_stateE(ptr noundef %12, i64 noundef %179, i64 noundef %180, ptr noundef %181)
  %183 = load i64, ptr %17, align 8, !tbaa !9
  %184 = load i64, ptr %18, align 8, !tbaa !9
  %185 = load ptr, ptr %4, align 8, !tbaa !5
  %186 = call noundef double @_ZN11alglib_impl9sparsegetEPKNS_12sparsematrixEllPNS_8ae_stateE(ptr noundef %13, i64 noundef %183, i64 noundef %184, ptr noundef %185)
  %187 = call noundef zeroext i1 @_ZN11alglib_impl9ae_fp_neqEdd(double noundef %182, double noundef %186)
  call void @_ZN11alglib_impl17ae_set_error_flagEPbbPKciS2_(ptr noundef %178, i1 noundef zeroext %187, ptr noundef @.str.19, i32 noundef 15318, ptr noundef @.str.221)
  br label %188

188:                                              ; preds = %177
  %189 = load i64, ptr %18, align 8, !tbaa !9
  %190 = add nsw i64 %189, 1
  store i64 %190, ptr %18, align 8, !tbaa !9
  br label %172, !llvm.loop !22

191:                                              ; preds = %172
  br label %192

192:                                              ; preds = %191
  %193 = load i64, ptr %17, align 8, !tbaa !9
  %194 = add nsw i64 %193, 1
  store i64 %194, ptr %17, align 8, !tbaa !9
  br label %166, !llvm.loop !23

195:                                              ; preds = %166
  %196 = load ptr, ptr %3, align 8, !tbaa !5
  %197 = load i8, ptr %196, align 1, !tbaa !18, !range !20, !noundef !21
  %198 = trunc i8 %197 to i1
  br i1 %198, label %199, label %201

199:                                              ; preds = %195
  %200 = load ptr, ptr %4, align 8, !tbaa !5
  call void @_ZN11alglib_impl14ae_frame_leaveEPNS_8ae_stateE(ptr noundef %200)
  store i32 1, ptr %23, align 4
  br label %229

201:                                              ; preds = %195
  %202 = load i64, ptr %9, align 8, !tbaa !9
  %203 = icmp eq i64 %202, 0
  br i1 %203, label %204, label %205

204:                                              ; preds = %201
  br label %215

205:                                              ; preds = %201
  %206 = load i64, ptr %9, align 8, !tbaa !9
  %207 = sitofp i64 %206 to double
  %208 = fmul double %207, 0x3FEE666666666666
  %209 = load ptr, ptr %4, align 8, !tbaa !5
  %210 = call noundef i64 @_ZN11alglib_impl8ae_roundEdPNS_8ae_stateE(double noundef %208, ptr noundef %209)
  %211 = load i64, ptr %9, align 8, !tbaa !9
  %212 = sub nsw i64 %211, 1
  %213 = load ptr, ptr %4, align 8, !tbaa !5
  %214 = call noundef i64 @_ZN11alglib_impl9ae_minintEllPNS_8ae_stateE(i64 noundef %210, i64 noundef %212, ptr noundef %213)
  store i64 %214, ptr %9, align 8, !tbaa !9
  br label %56, !llvm.loop !24

215:                                              ; preds = %204
  br label %216

216:                                              ; preds = %215, %51
  %217 = load i64, ptr %8, align 8, !tbaa !9
  %218 = add nsw i64 %217, 1
  store i64 %218, ptr %8, align 8, !tbaa !9
  br label %40, !llvm.loop !25

219:                                              ; preds = %40
  br label %220

220:                                              ; preds = %219
  %221 = load i64, ptr %7, align 8, !tbaa !9
  %222 = add nsw i64 %221, 1
  store i64 %222, ptr %7, align 8, !tbaa !9
  br label %36, !llvm.loop !26

223:                                              ; preds = %36
  br label %224

224:                                              ; preds = %223
  %225 = load i64, ptr %6, align 8, !tbaa !9
  %226 = add nsw i64 %225, 1
  store i64 %226, ptr %6, align 8, !tbaa !9
  br label %32, !llvm.loop !27

227:                                              ; preds = %32
  %228 = load ptr, ptr %4, align 8, !tbaa !5
  call void @_ZN11alglib_impl14ae_frame_leaveEPNS_8ae_stateE(ptr noundef %228)
  store i32 0, ptr %23, align 4
  br label %229

229:                                              ; preds = %227, %199, %163
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #4
  call void @llvm.lifetime.end.p0(i64 368, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 368, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 368, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 368, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 368, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr %5) #4
  %230 = load i32, ptr %23, align 4
  switch i32 %230, label %232 [
    i32 0, label %231
    i32 1, label %231
  ]

231:                                              ; preds = %229, %229
  ret void

232:                                              ; preds = %229
  unreachable
}

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

declare noundef double @_ZN11alglib_impl11hqrndnormalEPNS_10hqrndstateEPNS_8ae_stateE(ptr noundef, ptr noundef) #1

declare noundef i64 @_ZN11alglib_impl9ae_minintEllPNS_8ae_stateE(i64 noundef, i64 noundef, ptr noundef) #1

declare void @_ZN11alglib_impl9sparsesetEPNS_12sparsematrixElldPNS_8ae_stateE(ptr noundef, i64 noundef, i64 noundef, double noundef, ptr noundef) #1

declare noundef zeroext i1 @_ZN11alglib_impl12sparseexistsEPKNS_12sparsematrixEllPNS_8ae_stateE(ptr noundef, i64 noundef, i64 noundef, ptr noundef) #1

declare noundef i64 @_ZN11alglib_impl14sparsegetnrowsEPKNS_12sparsematrixEPNS_8ae_stateE(ptr noundef, ptr noundef) #1

declare noundef i64 @_ZN11alglib_impl14sparsegetncolsEPKNS_12sparsematrixEPNS_8ae_stateE(ptr noundef, ptr noundef) #1

declare noundef i64 @_ZN11alglib_impl19sparsegetmatrixtypeEPKNS_12sparsematrixEPNS_8ae_stateE(ptr noundef, ptr noundef) #1

declare noundef double @_ZN11alglib_impl9sparsegetEPKNS_12sparsematrixEllPNS_8ae_stateE(ptr noundef, i64 noundef, i64 noundef, ptr noundef) #1

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

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

declare void @_ZN11alglib_impl18ae_serializer_initEPNS_13ae_serializerE(ptr noundef) #1

declare void @_ZN11alglib_impl25ae_serializer_alloc_startEPNS_13ae_serializerE(ptr noundef) #1

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

declare noundef i64 @_ZN11alglib_impl28ae_serializer_get_alloc_sizeEPNS_13ae_serializerE(ptr noundef) #1

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

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

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

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

declare void @_ZN11alglib_impl19ae_serializer_clearEPNS_13ae_serializerE(ptr noundef) #1

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

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

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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { 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 = { 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 = !{!"long", !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 = !{!17, !6, i64 16}
!17 = !{!"_ZTSN11alglib_impl12ae_dyn_blockE", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!18 = !{!19, !19, i64 0}
!19 = !{!"bool", !7, i64 0}
!20 = !{i8 0, i8 2}
!21 = !{}
!22 = distinct !{!22, !14}
!23 = distinct !{!23, !14}
!24 = distinct !{!24, !14}
!25 = distinct !{!25, !14}
!26 = distinct !{!26, !14}
!27 = distinct !{!27, !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"

%"struct.alglib_impl::ae_frame" = type { %"struct.alglib_impl::ae_dyn_block" }
%"struct.alglib_impl::ae_dyn_block" = type { ptr, ptr, ptr, ptr }
%"struct.alglib_impl::hqrndstate" = type { i64, i64, i64 }
%"struct.alglib_impl::sparsematrix" = type { %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_vector", %"struct.alglib_impl::ae_vector", i64, i64, i64, i64, i64, i64 }
%"struct.alglib_impl::ae_vector" = type { i64, i64, i8, %"struct.alglib_impl::ae_dyn_block", %union.anon }
%union.anon = type { ptr }
%"struct.alglib_impl::ae_serializer" = type { i64, i64, i64, i64, i64, ptr, ptr, ptr, i64, ptr, ptr }

@.str.19 = external hidden unnamed_addr constant [92 x i8], align 1
@_ZL22testsparseunit_maxtype = external hidden local_unnamed_addr global i64, align 8
@.str.215 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.216 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.217 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.218 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.219 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.220 = external hidden unnamed_addr constant [23 x i8], align 1
@.str.221 = external hidden unnamed_addr constant [23 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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #0

declare noundef zeroext i1 @_ZN11alglib_impl9ae_fp_neqEdd(double noundef, double noundef) local_unnamed_addr #1

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

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

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

declare noundef double @_ZN11alglib_impl13hqrnduniformrEPNS_10hqrndstateEPNS_8ae_stateE(ptr noundef, ptr noundef) local_unnamed_addr #1

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

declare noundef zeroext i1 @_ZN11alglib_impl13ae_fp_less_eqEdd(double noundef, double noundef) local_unnamed_addr #1

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

declare noundef i64 @_ZN11alglib_impl8ae_roundEdPNS_8ae_stateE(double noundef, ptr noundef) local_unnamed_addr #1

declare void @_ZN11alglib_impl14ae_frame_leaveEPNS_8ae_stateE(ptr noundef) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
define dso_local void @_Z13testserializePbPN11alglib_impl8ae_stateE(ptr noundef %0, ptr noundef %1) local_unnamed_addr #3 {
  %3 = alloca %"struct.alglib_impl::ae_frame", align 8
  %4 = alloca %"struct.alglib_impl::hqrndstate", align 8
  %5 = alloca %"struct.alglib_impl::sparsematrix", align 8
  %6 = alloca %"struct.alglib_impl::sparsematrix", align 8
  %7 = alloca %"struct.alglib_impl::sparsematrix", align 8
  %8 = alloca %"struct.alglib_impl::sparsematrix", align 8
  %9 = alloca %"struct.alglib_impl::sparsematrix", align 8
  %10 = alloca %"struct.alglib_impl::ae_serializer", align 8
  %11 = alloca %"struct.alglib_impl::ae_frame", align 8
  %12 = alloca %"struct.alglib_impl::ae_dyn_block", align 8
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %3) #4
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %4) #4
  call void @llvm.lifetime.start.p0(i64 368, ptr nonnull %5) #4
  call void @llvm.lifetime.start.p0(i64 368, ptr nonnull %6) #4
  call void @llvm.lifetime.start.p0(i64 368, ptr nonnull %7) #4
  call void @llvm.lifetime.start.p0(i64 368, ptr nonnull %8) #4
  call void @llvm.lifetime.start.p0(i64 368, ptr nonnull %9) #4
  call void @_ZN11alglib_impl13ae_frame_makeEPNS_8ae_stateEPNS_8ae_frameE(ptr noundef %1, ptr noundef nonnull %3)
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %4, i8 0, i64 24, i1 false)
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(368) %5, i8 0, i64 368, i1 false)
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(368) %6, i8 0, i64 368, i1 false)
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(368) %7, i8 0, i64 368, i1 false)
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(368) %8, i8 0, i64 368, i1 false)
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(368) %9, i8 0, i64 368, i1 false)
  call void @_ZN11alglib_impl16_hqrndstate_initEPvPNS_8ae_stateEb(ptr noundef nonnull %4, ptr noundef %1, i1 noundef zeroext true)
  call void @_ZN11alglib_impl18_sparsematrix_initEPvPNS_8ae_stateEb(ptr noundef nonnull %5, ptr noundef %1, i1 noundef zeroext true)
  call void @_ZN11alglib_impl18_sparsematrix_initEPvPNS_8ae_stateEb(ptr noundef nonnull %6, ptr noundef %1, i1 noundef zeroext true)
  call void @_ZN11alglib_impl18_sparsematrix_initEPvPNS_8ae_stateEb(ptr noundef nonnull %7, ptr noundef %1, i1 noundef zeroext true)
  call void @_ZN11alglib_impl18_sparsematrix_initEPvPNS_8ae_stateEb(ptr noundef nonnull %8, ptr noundef %1, i1 noundef zeroext true)
  call void @_ZN11alglib_impl18_sparsematrix_initEPvPNS_8ae_stateEb(ptr noundef nonnull %9, ptr noundef %1, i1 noundef zeroext true)
  call void @_ZN11alglib_impl14hqrndrandomizeEPNS_10hqrndstateEPNS_8ae_stateE(ptr noundef nonnull %4, ptr noundef %1)
  %13 = getelementptr inbounds i8, ptr %12, i64 16
  %14 = load i64, ptr @_ZL22testsparseunit_maxtype, align 8, !tbaa !5
  %15 = icmp slt i64 %14, 0
  br i1 %15, label %.split121.us, label %.preheader110

.preheader110:                                    ; preds = %2, %.split.us
  %16 = phi i64 [ %84, %.split.us ], [ %14, %2 ]
  %17 = phi i64 [ %85, %.split.us ], [ %14, %2 ]
  %18 = phi i64 [ %86, %.split.us ], [ %14, %2 ]
  %.0118 = phi i64 [ %87, %.split.us ], [ 1, %2 ]
  %19 = icmp ugt i64 %.0118, 1
  %20 = icmp slt i64 %18, 0
  br i1 %20, label %.split.us, label %.preheader109

.preheader109:                                    ; preds = %.preheader110, %._crit_edge
  %21 = phi i64 [ %81, %._crit_edge ], [ %16, %.preheader110 ]
  %22 = phi i64 [ %82, %._crit_edge ], [ %17, %.preheader110 ]
  %.0100117 = phi i64 [ %83, %._crit_edge ], [ 1, %.preheader110 ]
  %.not115 = icmp slt i64 %22, 0
  br i1 %.not115, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %.preheader109
  %.not102 = icmp eq i64 %.0100117, %.0118
  %23 = mul nuw nsw i64 %.0100117, %.0118
  %24 = uitofp nneg i64 %23 to double
  br label %25

25:                                               ; preds = %.lr.ph, %.loopexit
  %26 = phi i64 [ %21, %.lr.ph ], [ %79, %.loopexit ]
  %.099116 = phi i64 [ 0, %.lr.ph ], [ %80, %.loopexit ]
  %27 = icmp ne i64 %.099116, 2
  %or.cond = or i1 %.not102, %27
  br i1 %or.cond, label %.preheader122, label %.loopexit

.preheader122:                                    ; preds = %25, %74
  %.098 = phi i64 [ %78, %74 ], [ %23, %25 ]
  %28 = sitofp i64 %.098 to double
  %29 = fdiv double %28, %24
  %.097 = select i1 %19, double %29, double 5.000000e-01
  %30 = call noundef double @_ZN11alglib_impl13hqrnduniformrEPNS_10hqrndstateEPNS_8ae_stateE(ptr noundef nonnull %4, ptr noundef %1)
  %31 = fmul double %30, %28
  %32 = call noundef i64 @_ZN11alglib_impl8ae_roundEdPNS_8ae_stateE(double noundef %31, ptr noundef %1)
  call void @_ZN11alglib_impl12sparsecreateElllPNS_12sparsematrixEPNS_8ae_stateE(i64 noundef %.0100117, i64 noundef %.0118, i64 noundef %32, ptr noundef nonnull %5, ptr noundef %1)
  br label %.preheader107

.preheader107:                                    ; preds = %.preheader122, %43
  %.095112 = phi i64 [ 0, %.preheader122 ], [ %44, %43 ]
  br label %33

33:                                               ; preds = %.preheader107, %41
  %.094111 = phi i64 [ 0, %.preheader107 ], [ %42, %41 ]
  %34 = call noundef zeroext i1 @_ZN11alglib_impl12sparseexistsEPKNS_12sparsematrixEllPNS_8ae_stateE(ptr noundef nonnull %5, i64 noundef %.095112, i64 noundef %.094111, ptr noundef %1)
  call void @_ZN11alglib_impl17ae_set_error_flagEPbbPKciS2_(ptr noundef %0, i1 noundef zeroext %34, ptr noundef nonnull @.str.19, i32 noundef 15261, ptr noundef nonnull @.str.215)
  %35 = call noundef double @_ZN11alglib_impl13hqrnduniformrEPNS_10hqrndstateEPNS_8ae_stateE(ptr noundef nonnull %4, ptr noundef %1)
  %36 = call noundef zeroext i1 @_ZN11alglib_impl13ae_fp_less_eqEdd(double noundef %35, double noundef %.097)
  br i1 %36, label %37, label %41

37:                                               ; preds = %33
  %38 = call noundef double @_ZN11alglib_impl11hqrndnormalEPNS_10hqrndstateEPNS_8ae_stateE(ptr noundef nonnull %4, ptr noundef %1)
  call void @_ZN11alglib_impl9sparsesetEPNS_12sparsematrixElldPNS_8ae_stateE(ptr noundef nonnull %5, i64 noundef %.095112, i64 noundef %.094111, double noundef %38, ptr noundef %1)
  %39 = call noundef zeroext i1 @_ZN11alglib_impl12sparseexistsEPKNS_12sparsematrixEllPNS_8ae_stateE(ptr noundef nonnull %5, i64 noundef %.095112, i64 noundef %.094111, ptr noundef %1)
  %40 = xor i1 %39, true
  call void @_ZN11alglib_impl17ae_set_error_flagEPbbPKciS2_(ptr noundef %0, i1 noundef zeroext %40, ptr noundef nonnull @.str.19, i32 noundef 15265, ptr noundef nonnull @.str.216)
  br label %41

41:                                               ; preds = %33, %37
  %42 = add nuw nsw i64 %.094111, 1
  %exitcond.not = icmp eq i64 %42, %.0118
  br i1 %exitcond.not, label %43, label %33, !llvm.loop !9

43:                                               ; preds = %41
  %44 = add nuw nsw i64 %.095112, 1
  %exitcond125.not = icmp eq i64 %44, %.0100117
  br i1 %exitcond125.not, label %45, label %.preheader107, !llvm.loop !11

45:                                               ; preds = %43
  call void @_ZN11alglib_impl15sparseconverttoEPNS_12sparsematrixElPNS_8ae_stateE(ptr noundef nonnull %5, i64 noundef %.099116, ptr noundef %1)
  %46 = call noundef i64 @_ZN11alglib_impl19sparsegetmatrixtypeEPKNS_12sparsematrixEPNS_8ae_stateE(ptr noundef nonnull %5, ptr noundef %1)
  %47 = icmp ne i64 %46, %.099116
  call void @_ZN11alglib_impl17ae_set_error_flagEPbbPKciS2_(ptr noundef %0, i1 noundef zeroext %47, ptr noundef nonnull @.str.19, i32 noundef 15270, ptr noundef nonnull @.str.217)
  call void @llvm.lifetime.start.p0(i64 88, ptr nonnull %10) #4
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %11) #4
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %12) #4
  call void @_ZN11alglib_impl13ae_frame_makeEPNS_8ae_stateEPNS_8ae_frameE(ptr noundef %1, ptr noundef nonnull %11)
  call void @_ZN11alglib_impl18ae_serializer_initEPNS_13ae_serializerE(ptr noundef nonnull %10)
  call void @_ZN11alglib_impl25ae_serializer_alloc_startEPNS_13ae_serializerE(ptr noundef nonnull %10)
  call void @_ZN11alglib_impl11sparseallocEPNS_13ae_serializerEPKNS_12sparsematrixEPNS_8ae_stateE(ptr noundef nonnull %10, ptr noundef nonnull %5, ptr noundef %1)
  %48 = call noundef i64 @_ZN11alglib_impl28ae_serializer_get_alloc_sizeEPNS_13ae_serializerE(ptr noundef nonnull %10)
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(32) %12, i8 0, i64 32, i1 false)
  %49 = add nsw i64 %48, 1
  call void @_ZN11alglib_impl10ae_db_initEPNS_12ae_dyn_blockElPNS_8ae_stateEb(ptr noundef nonnull %12, i64 noundef %49, ptr noundef %1, i1 noundef zeroext true)
  %50 = load volatile ptr, ptr %13, align 8, !tbaa !12
  call void @_ZN11alglib_impl24ae_serializer_sstart_strEPNS_13ae_serializerEPc(ptr noundef nonnull %10, ptr noundef %50)
  call void @_ZN11alglib_impl15sparseserializeEPNS_13ae_serializerEPKNS_12sparsematrixEPNS_8ae_stateE(ptr noundef nonnull %10, ptr noundef nonnull %5, ptr noundef %1)
  call void @_ZN11alglib_impl18ae_serializer_stopEPNS_13ae_serializerEPNS_8ae_stateE(ptr noundef nonnull %10, ptr noundef %1)
  call void @_ZN11alglib_impl19ae_serializer_clearEPNS_13ae_serializerE(ptr noundef nonnull %10)
  call void @_ZN11alglib_impl18ae_serializer_initEPNS_13ae_serializerE(ptr noundef nonnull %10)
  %51 = load volatile ptr, ptr %13, align 8, !tbaa !12
  call void @_ZN11alglib_impl24ae_serializer_ustart_strEPNS_13ae_serializerEPKc(ptr noundef nonnull %10, ptr noundef %51)
  call void @_ZN11alglib_impl17sparseunserializeEPNS_13ae_serializerEPNS_12sparsematrixEPNS_8ae_stateE(ptr noundef nonnull %10, ptr noundef nonnull %6, ptr noundef %1)
  call void @_ZN11alglib_impl18ae_serializer_stopEPNS_13ae_serializerEPNS_8ae_stateE(ptr noundef nonnull %10, ptr noundef %1)
  call void @_ZN11alglib_impl19ae_serializer_clearEPNS_13ae_serializerE(ptr noundef nonnull %10)
  call void @_ZN11alglib_impl14ae_frame_leaveEPNS_8ae_stateE(ptr noundef %1)
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %12) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %11) #4
  call void @llvm.lifetime.end.p0(i64 88, ptr nonnull %10) #4
  %52 = call noundef i64 @_ZN11alglib_impl19sparsegetmatrixtypeEPKNS_12sparsematrixEPNS_8ae_stateE(ptr noundef nonnull %6, ptr noundef %1)
  %53 = icmp ne i64 %52, %.099116
  call void @_ZN11alglib_impl17ae_set_error_flagEPbbPKciS2_(ptr noundef %0, i1 noundef zeroext %53, ptr noundef nonnull @.str.19, i32 noundef 15306, ptr noundef nonnull @.str.218)
  %54 = call noundef i64 @_ZN11alglib_impl14sparsegetnrowsEPKNS_12sparsematrixEPNS_8ae_stateE(ptr noundef nonnull %5, ptr noundef %1)
  %55 = call noundef i64 @_ZN11alglib_impl14sparsegetnrowsEPKNS_12sparsematrixEPNS_8ae_stateE(ptr noundef nonnull %6, ptr noundef %1)
  %56 = icmp ne i64 %54, %55
  call void @_ZN11alglib_impl17ae_set_error_flagEPbbPKciS2_(ptr noundef %0, i1 noundef zeroext %56, ptr noundef nonnull @.str.19, i32 noundef 15307, ptr noundef nonnull @.str.219)
  %57 = call noundef i64 @_ZN11alglib_impl14sparsegetncolsEPKNS_12sparsematrixEPNS_8ae_stateE(ptr noundef nonnull %5, ptr noundef %1)
  %58 = call noundef i64 @_ZN11alglib_impl14sparsegetncolsEPKNS_12sparsematrixEPNS_8ae_stateE(ptr noundef nonnull %6, ptr noundef %1)
  %59 = icmp ne i64 %57, %58
  call void @_ZN11alglib_impl17ae_set_error_flagEPbbPKciS2_(ptr noundef %0, i1 noundef zeroext %59, ptr noundef nonnull @.str.19, i32 noundef 15308, ptr noundef nonnull @.str.220)
  %60 = load i8, ptr %0, align 1, !tbaa !15, !range !17, !noundef !18
  %61 = trunc nuw i8 %60 to i1
  br i1 %61, label %.split121.us, label %.preheader

.preheader:                                       ; preds = %45, %67
  %.196114 = phi i64 [ %68, %67 ], [ 0, %45 ]
  br label %62

62:                                               ; preds = %.preheader, %62
  %.1113 = phi i64 [ 0, %.preheader ], [ %66, %62 ]
  %63 = call noundef double @_ZN11alglib_impl9sparsegetEPKNS_12sparsematrixEllPNS_8ae_stateE(ptr noundef nonnull %5, i64 noundef %.196114, i64 noundef %.1113, ptr noundef %1)
  %64 = call noundef double @_ZN11alglib_impl9sparsegetEPKNS_12sparsematrixEllPNS_8ae_stateE(ptr noundef nonnull %6, i64 noundef %.196114, i64 noundef %.1113, ptr noundef %1)
  %65 = call noundef zeroext i1 @_ZN11alglib_impl9ae_fp_neqEdd(double noundef %63, double noundef %64)
  call void @_ZN11alglib_impl17ae_set_error_flagEPbbPKciS2_(ptr noundef nonnull %0, i1 noundef zeroext %65, ptr noundef nonnull @.str.19, i32 noundef 15318, ptr noundef nonnull @.str.221)
  %66 = add nuw nsw i64 %.1113, 1
  %exitcond126.not = icmp eq i64 %66, %.0118
  br i1 %exitcond126.not, label %67, label %62, !llvm.loop !19

67:                                               ; preds = %62
  %68 = add nuw nsw i64 %.196114, 1
  %exitcond127.not = icmp eq i64 %68, %.0100117
  br i1 %exitcond127.not, label %69, label %.preheader, !llvm.loop !20

69:                                               ; preds = %67
  %70 = load i8, ptr %0, align 1, !tbaa !15, !range !17, !noundef !18
  %71 = trunc nuw i8 %70 to i1
  br i1 %71, label %.split121.us, label %72

72:                                               ; preds = %69
  %73 = icmp eq i64 %.098, 0
  br i1 %73, label %.loopexit.loopexit, label %74

74:                                               ; preds = %72
  %75 = fmul double %28, 0x3FEE666666666666
  %76 = call noundef i64 @_ZN11alglib_impl8ae_roundEdPNS_8ae_stateE(double noundef %75, ptr noundef %1)
  %77 = add nsw i64 %.098, -1
  %78 = call noundef i64 @_ZN11alglib_impl9ae_minintEllPNS_8ae_stateE(i64 noundef %76, i64 noundef %77, ptr noundef %1)
  br label %.preheader122, !llvm.loop !21

.loopexit.loopexit:                               ; preds = %72
  %.pre = load i64, ptr @_ZL22testsparseunit_maxtype, align 8, !tbaa !5
  br label %.loopexit

.loopexit:                                        ; preds = %.loopexit.loopexit, %25
  %79 = phi i64 [ %.pre, %.loopexit.loopexit ], [ %26, %25 ]
  %80 = add nuw nsw i64 %.099116, 1
  %.not.not = icmp slt i64 %.099116, %79
  br i1 %.not.not, label %25, label %._crit_edge, !llvm.loop !22

._crit_edge:                                      ; preds = %.loopexit, %.preheader109
  %81 = phi i64 [ %21, %.preheader109 ], [ %79, %.loopexit ]
  %82 = phi i64 [ %22, %.preheader109 ], [ %79, %.loopexit ]
  %83 = add nuw nsw i64 %.0100117, 1
  %exitcond128.not = icmp eq i64 %83, 11
  br i1 %exitcond128.not, label %.split.us, label %.preheader109, !llvm.loop !23

.split.us:                                        ; preds = %._crit_edge, %.preheader110
  %84 = phi i64 [ %16, %.preheader110 ], [ %81, %._crit_edge ]
  %85 = phi i64 [ %17, %.preheader110 ], [ %82, %._crit_edge ]
  %86 = phi i64 [ %18, %.preheader110 ], [ %82, %._crit_edge ]
  %87 = add nuw nsw i64 %.0118, 1
  %exitcond129.not = icmp eq i64 %87, 11
  br i1 %exitcond129.not, label %.split121.us, label %.preheader110, !llvm.loop !25

.split121.us:                                     ; preds = %.split.us, %69, %45, %2
  call void @_ZN11alglib_impl14ae_frame_leaveEPNS_8ae_stateE(ptr noundef %1)
  call void @llvm.lifetime.end.p0(i64 368, ptr nonnull %9) #4
  call void @llvm.lifetime.end.p0(i64 368, ptr nonnull %8) #4
  call void @llvm.lifetime.end.p0(i64 368, ptr nonnull %7) #4
  call void @llvm.lifetime.end.p0(i64 368, ptr nonnull %6) #4
  call void @llvm.lifetime.end.p0(i64 368, ptr nonnull %5) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #4
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %3) #4
  ret void
}

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

declare noundef double @_ZN11alglib_impl11hqrndnormalEPNS_10hqrndstateEPNS_8ae_stateE(ptr noundef, ptr noundef) local_unnamed_addr #1

declare noundef i64 @_ZN11alglib_impl9ae_minintEllPNS_8ae_stateE(i64 noundef, i64 noundef, ptr noundef) local_unnamed_addr #1

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

declare noundef zeroext i1 @_ZN11alglib_impl12sparseexistsEPKNS_12sparsematrixEllPNS_8ae_stateE(ptr noundef, i64 noundef, i64 noundef, ptr noundef) local_unnamed_addr #1

declare noundef i64 @_ZN11alglib_impl14sparsegetnrowsEPKNS_12sparsematrixEPNS_8ae_stateE(ptr noundef, ptr noundef) local_unnamed_addr #1

declare noundef i64 @_ZN11alglib_impl14sparsegetncolsEPKNS_12sparsematrixEPNS_8ae_stateE(ptr noundef, ptr noundef) local_unnamed_addr #1

declare noundef i64 @_ZN11alglib_impl19sparsegetmatrixtypeEPKNS_12sparsematrixEPNS_8ae_stateE(ptr noundef, ptr noundef) local_unnamed_addr #1

declare noundef double @_ZN11alglib_impl9sparsegetEPKNS_12sparsematrixEllPNS_8ae_stateE(ptr noundef, i64 noundef, i64 noundef, ptr noundef) local_unnamed_addr #1

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

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

declare void @_ZN11alglib_impl18ae_serializer_initEPNS_13ae_serializerE(ptr noundef) local_unnamed_addr #1

declare void @_ZN11alglib_impl25ae_serializer_alloc_startEPNS_13ae_serializerE(ptr noundef) local_unnamed_addr #1

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

declare noundef i64 @_ZN11alglib_impl28ae_serializer_get_alloc_sizeEPNS_13ae_serializerE(ptr noundef) local_unnamed_addr #1

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

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

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

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

declare void @_ZN11alglib_impl19ae_serializer_clearEPNS_13ae_serializerE(ptr noundef) local_unnamed_addr #1

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

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

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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #3 = { 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 = { 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 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = !{!13, !14, i64 16}
!13 = !{!"_ZTSN11alglib_impl12ae_dyn_blockE", !14, i64 0, !14, i64 8, !14, i64 16, !14, i64 24}
!14 = !{!"any pointer", !7, i64 0}
!15 = !{!16, !16, i64 0}
!16 = !{!"bool", !7, i64 0}
!17 = !{i8 0, i8 2}
!18 = !{}
!19 = distinct !{!19, !10}
!20 = distinct !{!20, !10}
!21 = distinct !{!21, !10}
!22 = distinct !{!22, !10}
!23 = distinct !{!23, !10, !24}
!24 = !{!"llvm.loop.unswitch.partial.disable"}
!25 = distinct !{!25, !10, !24}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimpleLoopUnswitchPass,SimplifyCFGPass