; LLVM IR from interpretml/interpret :: shared/libebm (dataset_shared)

; 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.NAMESPACE_MAIN::HeaderDataSetShared" = type { i64, i64, i64, i64, i64, [1 x i64] }
%"struct.NAMESPACE_MAIN::FeatureDataSetShared" = type { i64, i64 }

@g_traceLevel = external global i32, align 4
@.str = external hidden unnamed_addr constant [88 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [39 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [42 x i8], align 1
@.str.61 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.62 = external hidden unnamed_addr constant [43 x i8], align 1
@.str.63 = external hidden unnamed_addr constant [39 x i8], align 1
@.str.64 = external hidden unnamed_addr constant [42 x i8], align 1
@_ZZ16ExtractBinCountsE13LOG__sMessage = external hidden constant [42 x i8], align 16
@_ZZ16ExtractBinCountsE13LOG__sMessage_0 = external hidden constant [67 x i8], align 16
@_ZZ16ExtractBinCountsE13LOG__sMessage_1 = external hidden constant [75 x i8], align 16
@__func__.ExtractBinCounts = external hidden unnamed_addr constant [17 x i8], align 1
@__PRETTY_FUNCTION__.ExtractBinCounts = external hidden unnamed_addr constant [74 x i8], align 1
@_ZZ16ExtractBinCountsE13LOG__sMessage_2 = external hidden constant [52 x i8], align 16
@_ZZ16ExtractBinCountsE13LOG__sMessage_3 = external hidden constant [47 x i8], align 16
@_ZZ16ExtractBinCountsE13LOG__sMessage_4 = external hidden constant [57 x i8], align 16

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

declare void @InteralLogWithoutArguments(i32 noundef, ptr noundef) #1

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef zeroext i1 @_ZN14NAMESPACE_MAINL14IsConvertErrorImmEENSt9enable_ifIXaaaantsr3std9is_signedIT_EE5valuentsr3std9is_signedIT0_EE5valueleclsr3std14numeric_limitsIS3_EE3maxEclsr3std14numeric_limitsIS2_EE3maxEEbE4typeES3_(i64 noundef) #2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef ptr @_ZN14NAMESPACE_MAINL14ArrayToPointerImEEPKT_S3_(ptr noundef) #2

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare hidden noundef zeroext i1 @_ZN14NAMESPACE_MAINL9IsFeatureEm(i64 noundef) #3

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

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #4

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef zeroext i1 @_ZN14NAMESPACE_MAINL14IsConvertErrorImlEENSt9enable_ifIXaaaantsr3std9is_signedIT_EE5valuesr3std9is_signedIT0_EE5valueleclsr3std14numeric_limitsIS3_EE3maxEclsr3std14numeric_limitsIS2_EE3maxEEbE4typeES3_(i64 noundef) #2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef zeroext i1 @_ZN14NAMESPACE_MAINL14IsConvertErrorIlmEENSt9enable_ifIXaaaasr3std9is_signedIT_EE5valuentsr3std9is_signedIT0_EE5valueltclsr3std14numeric_limitsIS2_EE3maxEclsr3std14numeric_limitsIS3_EE3maxEEbE4typeES3_(i64 noundef) #2

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare hidden noundef zeroext i1 @_ZN14NAMESPACE_MAINL16IsMissingFeatureEm(i64 noundef) #3

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare hidden noundef zeroext i1 @_ZN14NAMESPACE_MAINL15IsUnseenFeatureEm(i64 noundef) #3

; Function Attrs: mustprogress uwtable
define dso_local i32 @ExtractBinCounts(ptr noundef %0, i64 noundef %1, ptr noundef %2) #5 {
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca i64, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i64, align 8
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i64, align 8
  %15 = alloca i64, align 8
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca ptr, align 8
  %19 = alloca ptr, align 8
  %20 = alloca ptr, align 8
  %21 = alloca i64, align 8
  %22 = alloca i64, align 8
  %23 = alloca ptr, align 8
  %24 = alloca i64, align 8
  %25 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store i64 %1, ptr %6, align 8, !tbaa !9
  store ptr %2, ptr %7, align 8, !tbaa !5
  %26 = load ptr, ptr %5, align 8, !tbaa !5
  %27 = icmp eq ptr null, %26
  br i1 %27, label %28, label %35

28:                                               ; preds = %3
  br label %29

29:                                               ; preds = %28
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  store i32 1, ptr %8, align 4, !tbaa !11
  %30 = load i32, ptr @g_traceLevel, align 4, !tbaa !11
  %31 = icmp sle i32 1, %30
  br i1 %31, label %32, label %33

32:                                               ; preds = %29
  call void @InteralLogWithoutArguments(i32 noundef 1, ptr noundef @_ZZ16ExtractBinCountsE13LOG__sMessage)
  br label %33

33:                                               ; preds = %32, %29
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  br label %34

34:                                               ; preds = %33
  store i32 -3, ptr %4, align 4
  br label %176

35:                                               ; preds = %3
  %36 = load i64, ptr %6, align 8, !tbaa !9
  %37 = call noundef zeroext i1 @_ZN14NAMESPACE_MAINL14IsConvertErrorImlEENSt9enable_ifIXaaaantsr3std9is_signedIT_EE5valuesr3std9is_signedIT0_EE5valueleclsr3std14numeric_limitsIS3_EE3maxEclsr3std14numeric_limitsIS2_EE3maxEEbE4typeES3_(i64 noundef %36) #6
  br i1 %37, label %38, label %45

38:                                               ; preds = %35
  br label %39

39:                                               ; preds = %38
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  store i32 1, ptr %9, align 4, !tbaa !11
  %40 = load i32, ptr @g_traceLevel, align 4, !tbaa !11
  %41 = icmp sle i32 1, %40
  br i1 %41, label %42, label %43

42:                                               ; preds = %39
  call void @InteralLogWithoutArguments(i32 noundef 1, ptr noundef @_ZZ16ExtractBinCountsE13LOG__sMessage_0)
  br label %43

43:                                               ; preds = %42, %39
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  br label %44

44:                                               ; preds = %43
  store i32 -3, ptr %4, align 4
  br label %176

45:                                               ; preds = %35
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #6
  %46 = load i64, ptr %6, align 8, !tbaa !9
  store i64 %46, ptr %10, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #6
  %47 = load ptr, ptr %5, align 8, !tbaa !5
  store ptr %47, ptr %11, align 8, !tbaa !5
  %48 = load ptr, ptr %11, align 8, !tbaa !5
  %49 = getelementptr inbounds %"struct.NAMESPACE_MAIN::HeaderDataSetShared", ptr %48, i32 0, i32 0
  %50 = load i64, ptr %49, align 8, !tbaa !13
  %51 = icmp ne i64 25059, %50
  br i1 %51, label %52, label %60

52:                                               ; preds = %45
  br label %53

53:                                               ; preds = %52
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  store i32 1, ptr %12, align 4, !tbaa !11
  %54 = load i32, ptr @g_traceLevel, align 4, !tbaa !11
  %55 = icmp sle i32 1, %54
  br i1 %55, label %56, label %57

56:                                               ; preds = %53
  call void @InteralLogWithoutArguments(i32 noundef 1, ptr noundef @_ZZ16ExtractBinCountsE13LOG__sMessage_1)
  br label %57

57:                                               ; preds = %56, %53
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  br label %58

58:                                               ; preds = %57
  br label %59

59:                                               ; preds = %58
  store i32 -3, ptr %4, align 4
  store i32 1, ptr %13, align 4
  br label %175

60:                                               ; preds = %45
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  %61 = load ptr, ptr %11, align 8, !tbaa !5
  %62 = getelementptr inbounds %"struct.NAMESPACE_MAIN::HeaderDataSetShared", ptr %61, i32 0, i32 2
  %63 = load i64, ptr %62, align 8, !tbaa !15
  store i64 %63, ptr %14, align 8, !tbaa !9
  %64 = load i64, ptr %14, align 8, !tbaa !9
  %65 = call noundef zeroext i1 @_ZN14NAMESPACE_MAINL14IsConvertErrorImmEENSt9enable_ifIXaaaantsr3std9is_signedIT_EE5valuentsr3std9is_signedIT0_EE5valueleclsr3std14numeric_limitsIS3_EE3maxEclsr3std14numeric_limitsIS2_EE3maxEEbE4typeES3_(i64 noundef %64) #6
  br i1 %65, label %66, label %68

66:                                               ; preds = %60
  call void @LogAssertFailure(i64 noundef 2101, ptr noundef @.str, ptr noundef @__func__.ExtractBinCounts, ptr noundef @.str.27)
  call void @__assert_fail(ptr noundef @.str.28, ptr noundef @.str, i32 noundef 2101, ptr noundef @__PRETTY_FUNCTION__.ExtractBinCounts) #7
  unreachable

67:                                               ; No predecessors!
  br label %68

68:                                               ; preds = %67, %60
  %69 = phi i1 [ true, %60 ], [ false, %67 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #6
  %70 = load i64, ptr %14, align 8, !tbaa !9
  store i64 %70, ptr %15, align 8, !tbaa !9
  %71 = load i64, ptr %15, align 8, !tbaa !9
  %72 = load i64, ptr %10, align 8, !tbaa !9
  %73 = icmp ne i64 %71, %72
  br i1 %73, label %74, label %82

74:                                               ; preds = %68
  br label %75

75:                                               ; preds = %74
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #6
  store i32 1, ptr %16, align 4, !tbaa !11
  %76 = load i32, ptr @g_traceLevel, align 4, !tbaa !11
  %77 = icmp sle i32 1, %76
  br i1 %77, label %78, label %79

78:                                               ; preds = %75
  call void @InteralLogWithoutArguments(i32 noundef 1, ptr noundef @_ZZ16ExtractBinCountsE13LOG__sMessage_2)
  br label %79

79:                                               ; preds = %78, %75
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  br label %80

80:                                               ; preds = %79
  br label %81

81:                                               ; preds = %80
  store i32 -3, ptr %4, align 4
  store i32 1, ptr %13, align 4
  br label %174

82:                                               ; preds = %68
  %83 = load i64, ptr %15, align 8, !tbaa !9
  %84 = icmp ne i64 0, %83
  br i1 %84, label %85, label %173

85:                                               ; preds = %82
  %86 = load ptr, ptr %7, align 8, !tbaa !5
  %87 = icmp eq ptr null, %86
  br i1 %87, label %88, label %96

88:                                               ; preds = %85
  br label %89

89:                                               ; preds = %88
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #6
  store i32 1, ptr %17, align 4, !tbaa !11
  %90 = load i32, ptr @g_traceLevel, align 4, !tbaa !11
  %91 = icmp sle i32 1, %90
  br i1 %91, label %92, label %93

92:                                               ; preds = %89
  call void @InteralLogWithoutArguments(i32 noundef 1, ptr noundef @_ZZ16ExtractBinCountsE13LOG__sMessage_3)
  br label %93

93:                                               ; preds = %92, %89
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  br label %94

94:                                               ; preds = %93
  br label %95

95:                                               ; preds = %94
  store i32 -3, ptr %4, align 4
  store i32 1, ptr %13, align 4
  br label %174

96:                                               ; preds = %85
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #6
  %97 = load ptr, ptr %11, align 8, !tbaa !5
  %98 = getelementptr inbounds %"struct.NAMESPACE_MAIN::HeaderDataSetShared", ptr %97, i32 0, i32 5
  %99 = getelementptr inbounds [1 x i64], ptr %98, i64 0, i64 0
  %100 = call noundef ptr @_ZN14NAMESPACE_MAINL14ArrayToPointerImEEPKT_S3_(ptr noundef %99) #6
  store ptr %100, ptr %18, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #6
  %101 = load ptr, ptr %7, align 8, !tbaa !5
  store ptr %101, ptr %19, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #6
  %102 = load ptr, ptr %7, align 8, !tbaa !5
  %103 = load i64, ptr %15, align 8, !tbaa !9
  %104 = getelementptr inbounds i64, ptr %102, i64 %103
  store ptr %104, ptr %20, align 8, !tbaa !5
  br label %105

105:                                              ; preds = %165, %96
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #6
  %106 = load ptr, ptr %18, align 8, !tbaa !5
  %107 = load i64, ptr %106, align 8, !tbaa !9
  store i64 %107, ptr %21, align 8, !tbaa !9
  %108 = load ptr, ptr %18, align 8, !tbaa !5
  %109 = getelementptr inbounds i64, ptr %108, i32 1
  store ptr %109, ptr %18, align 8, !tbaa !5
  %110 = load i64, ptr %21, align 8, !tbaa !9
  %111 = call noundef zeroext i1 @_ZN14NAMESPACE_MAINL14IsConvertErrorImmEENSt9enable_ifIXaaaantsr3std9is_signedIT_EE5valuentsr3std9is_signedIT0_EE5valueleclsr3std14numeric_limitsIS3_EE3maxEclsr3std14numeric_limitsIS2_EE3maxEEbE4typeES3_(i64 noundef %110) #6
  br i1 %111, label %112, label %114

112:                                              ; preds = %105
  call void @LogAssertFailure(i64 noundef 2121, ptr noundef @.str, ptr noundef @__func__.ExtractBinCounts, ptr noundef @.str.61)
  call void @__assert_fail(ptr noundef @.str.62, ptr noundef @.str, i32 noundef 2121, ptr noundef @__PRETTY_FUNCTION__.ExtractBinCounts) #7
  unreachable

113:                                              ; No predecessors!
  br label %114

114:                                              ; preds = %113, %105
  %115 = phi i1 [ true, %105 ], [ false, %113 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #6
  %116 = load i64, ptr %21, align 8, !tbaa !9
  store i64 %116, ptr %22, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #6
  %117 = load ptr, ptr %5, align 8, !tbaa !5
  %118 = load i64, ptr %22, align 8, !tbaa !9
  %119 = getelementptr inbounds i8, ptr %117, i64 %118
  store ptr %119, ptr %23, align 8, !tbaa !5
  %120 = load ptr, ptr %23, align 8, !tbaa !5
  %121 = getelementptr inbounds %"struct.NAMESPACE_MAIN::FeatureDataSetShared", ptr %120, i32 0, i32 0
  %122 = load i64, ptr %121, align 8, !tbaa !16
  %123 = call noundef zeroext i1 @_ZN14NAMESPACE_MAINL9IsFeatureEm(i64 noundef %122) #6
  br i1 %123, label %126, label %124

124:                                              ; preds = %114
  call void @LogAssertFailure(i64 noundef 2127, ptr noundef @.str, ptr noundef @__func__.ExtractBinCounts, ptr noundef @.str.63)
  call void @__assert_fail(ptr noundef @.str.64, ptr noundef @.str, i32 noundef 2127, ptr noundef @__PRETTY_FUNCTION__.ExtractBinCounts) #7
  unreachable

125:                                              ; No predecessors!
  br label %126

126:                                              ; preds = %125, %114
  %127 = phi i1 [ true, %114 ], [ false, %125 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #6
  %128 = load ptr, ptr %23, align 8, !tbaa !5
  %129 = getelementptr inbounds %"struct.NAMESPACE_MAIN::FeatureDataSetShared", ptr %128, i32 0, i32 1
  %130 = load i64, ptr %129, align 8, !tbaa !18
  store i64 %130, ptr %24, align 8, !tbaa !9
  %131 = load ptr, ptr %23, align 8, !tbaa !5
  %132 = getelementptr inbounds %"struct.NAMESPACE_MAIN::FeatureDataSetShared", ptr %131, i32 0, i32 0
  %133 = load i64, ptr %132, align 8, !tbaa !16
  %134 = call noundef zeroext i1 @_ZN14NAMESPACE_MAINL16IsMissingFeatureEm(i64 noundef %133) #6
  %135 = zext i1 %134 to i64
  %136 = select i1 %134, i64 0, i64 1
  %137 = load i64, ptr %24, align 8, !tbaa !9
  %138 = add i64 %137, %136
  store i64 %138, ptr %24, align 8, !tbaa !9
  %139 = load ptr, ptr %23, align 8, !tbaa !5
  %140 = getelementptr inbounds %"struct.NAMESPACE_MAIN::FeatureDataSetShared", ptr %139, i32 0, i32 0
  %141 = load i64, ptr %140, align 8, !tbaa !16
  %142 = call noundef zeroext i1 @_ZN14NAMESPACE_MAINL15IsUnseenFeatureEm(i64 noundef %141) #6
  %143 = zext i1 %142 to i64
  %144 = select i1 %142, i64 0, i64 1
  %145 = load i64, ptr %24, align 8, !tbaa !9
  %146 = add i64 %145, %144
  store i64 %146, ptr %24, align 8, !tbaa !9
  %147 = load i64, ptr %24, align 8, !tbaa !9
  %148 = call noundef zeroext i1 @_ZN14NAMESPACE_MAINL14IsConvertErrorIlmEENSt9enable_ifIXaaaasr3std9is_signedIT_EE5valuentsr3std9is_signedIT0_EE5valueltclsr3std14numeric_limitsIS2_EE3maxEclsr3std14numeric_limitsIS3_EE3maxEEbE4typeES3_(i64 noundef %147) #6
  br i1 %148, label %149, label %157

149:                                              ; preds = %126
  br label %150

150:                                              ; preds = %149
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #6
  store i32 1, ptr %25, align 4, !tbaa !11
  %151 = load i32, ptr @g_traceLevel, align 4, !tbaa !11
  %152 = icmp sle i32 1, %151
  br i1 %152, label %153, label %154

153:                                              ; preds = %150
  call void @InteralLogWithoutArguments(i32 noundef 1, ptr noundef @_ZZ16ExtractBinCountsE13LOG__sMessage_4)
  br label %154

154:                                              ; preds = %153, %150
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #6
  br label %155

155:                                              ; preds = %154
  br label %156

156:                                              ; preds = %155
  store i32 -3, ptr %4, align 4
  store i32 1, ptr %13, align 4
  br label %162

157:                                              ; preds = %126
  %158 = load i64, ptr %24, align 8, !tbaa !9
  %159 = load ptr, ptr %19, align 8, !tbaa !5
  store i64 %158, ptr %159, align 8, !tbaa !9
  %160 = load ptr, ptr %19, align 8, !tbaa !5
  %161 = getelementptr inbounds i64, ptr %160, i32 1
  store ptr %161, ptr %19, align 8, !tbaa !5
  store i32 0, ptr %13, align 4
  br label %162

162:                                              ; preds = %157, %156
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #6
  %163 = load i32, ptr %13, align 4
  switch i32 %163, label %170 [
    i32 0, label %164
  ]

164:                                              ; preds = %162
  br label %165

165:                                              ; preds = %164
  %166 = load ptr, ptr %20, align 8, !tbaa !5
  %167 = load ptr, ptr %19, align 8, !tbaa !5
  %168 = icmp ne ptr %166, %167
  br i1 %168, label %105, label %169, !llvm.loop !19

169:                                              ; preds = %165
  store i32 0, ptr %13, align 4
  br label %170

170:                                              ; preds = %169, %162
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #6
  %171 = load i32, ptr %13, align 4
  switch i32 %171, label %174 [
    i32 0, label %172
  ]

172:                                              ; preds = %170
  br label %173

173:                                              ; preds = %172, %82
  store i32 0, ptr %4, align 4
  store i32 1, ptr %13, align 4
  br label %174

174:                                              ; preds = %173, %170, %95, %81
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  br label %175

175:                                              ; preds = %174, %59
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #6
  br label %176

176:                                              ; preds = %175, %44, %34
  %177 = load i32, ptr %4, align 4
  ret i32 %177
}

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 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { alwaysinline 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 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #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 = { noreturn nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!14, !10, i64 0}
!14 = !{!"_ZTSN14NAMESPACE_MAIN19HeaderDataSetSharedE", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !7, i64 40}
!15 = !{!14, !10, i64 16}
!16 = !{!17, !10, i64 0}
!17 = !{!"_ZTSN14NAMESPACE_MAIN20FeatureDataSetSharedE", !10, i64 0, !10, i64 8}
!18 = !{!17, !10, i64 8}
!19 = distinct !{!19, !20}
!20 = !{!"llvm.loop.mustprogress"}


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

@g_traceLevel = external local_unnamed_addr global i32, align 4
@.str = external hidden unnamed_addr constant [88 x i8], align 1
@.str.27 = external hidden unnamed_addr constant [39 x i8], align 1
@.str.28 = external hidden unnamed_addr constant [42 x i8], align 1
@.str.61 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.62 = external hidden unnamed_addr constant [43 x i8], align 1
@.str.63 = external hidden unnamed_addr constant [39 x i8], align 1
@.str.64 = external hidden unnamed_addr constant [42 x i8], align 1
@_ZZ16ExtractBinCountsE13LOG__sMessage = external hidden constant [42 x i8], align 16
@_ZZ16ExtractBinCountsE13LOG__sMessage_0 = external hidden constant [67 x i8], align 16
@_ZZ16ExtractBinCountsE13LOG__sMessage_1 = external hidden constant [75 x i8], align 16
@__func__.ExtractBinCounts = external hidden unnamed_addr constant [17 x i8], align 1
@__PRETTY_FUNCTION__.ExtractBinCounts = external hidden unnamed_addr constant [74 x i8], align 1
@_ZZ16ExtractBinCountsE13LOG__sMessage_2 = external hidden constant [52 x i8], align 16
@_ZZ16ExtractBinCountsE13LOG__sMessage_3 = external hidden constant [47 x i8], align 16
@_ZZ16ExtractBinCountsE13LOG__sMessage_4 = external hidden constant [57 x i8], align 16

declare void @InteralLogWithoutArguments(i32 noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef zeroext i1 @_ZN14NAMESPACE_MAINL14IsConvertErrorImmEENSt9enable_ifIXaaaantsr3std9is_signedIT_EE5valuentsr3std9is_signedIT0_EE5valueleclsr3std14numeric_limitsIS3_EE3maxEclsr3std14numeric_limitsIS2_EE3maxEEbE4typeES3_(i64 noundef) local_unnamed_addr #1

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef ptr @_ZN14NAMESPACE_MAINL14ArrayToPointerImEEPKT_S3_(ptr noundef) local_unnamed_addr #1

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare hidden noundef zeroext i1 @_ZN14NAMESPACE_MAINL9IsFeatureEm(i64 noundef) local_unnamed_addr #2

declare void @LogAssertFailure(i64 noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef zeroext i1 @_ZN14NAMESPACE_MAINL14IsConvertErrorImlEENSt9enable_ifIXaaaantsr3std9is_signedIT_EE5valuesr3std9is_signedIT0_EE5valueleclsr3std14numeric_limitsIS3_EE3maxEclsr3std14numeric_limitsIS2_EE3maxEEbE4typeES3_(i64 noundef) local_unnamed_addr #1

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef zeroext i1 @_ZN14NAMESPACE_MAINL14IsConvertErrorIlmEENSt9enable_ifIXaaaasr3std9is_signedIT_EE5valuentsr3std9is_signedIT0_EE5valueltclsr3std14numeric_limitsIS2_EE3maxEclsr3std14numeric_limitsIS3_EE3maxEEbE4typeES3_(i64 noundef) local_unnamed_addr #1

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare hidden noundef zeroext i1 @_ZN14NAMESPACE_MAINL16IsMissingFeatureEm(i64 noundef) local_unnamed_addr #2

; Function Attrs: alwaysinline mustprogress nounwind uwtable
declare hidden noundef zeroext i1 @_ZN14NAMESPACE_MAINL15IsUnseenFeatureEm(i64 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @ExtractBinCounts(ptr noundef %0, i64 noundef %1, ptr noundef writeonly %2) local_unnamed_addr #4 {
  %4 = icmp eq ptr %0, null
  br i1 %4, label %5, label %8

5:                                                ; preds = %3
  %6 = load i32, ptr @g_traceLevel, align 4, !tbaa !5
  %7 = icmp sgt i32 %6, 0
  br i1 %7, label %.critedge.sink.split, label %.critedge

8:                                                ; preds = %3
  %9 = tail call noundef zeroext i1 @_ZN14NAMESPACE_MAINL14IsConvertErrorImlEENSt9enable_ifIXaaaantsr3std9is_signedIT_EE5valuesr3std9is_signedIT0_EE5valueleclsr3std14numeric_limitsIS3_EE3maxEclsr3std14numeric_limitsIS2_EE3maxEEbE4typeES3_(i64 noundef %1) #5
  br i1 %9, label %10, label %13

10:                                               ; preds = %8
  %11 = load i32, ptr @g_traceLevel, align 4, !tbaa !5
  %12 = icmp sgt i32 %11, 0
  br i1 %12, label %.critedge.sink.split, label %.critedge

13:                                               ; preds = %8
  %14 = load i64, ptr %0, align 8, !tbaa !9
  %.not = icmp eq i64 %14, 25059
  br i1 %.not, label %18, label %15

15:                                               ; preds = %13
  %16 = load i32, ptr @g_traceLevel, align 4, !tbaa !5
  %17 = icmp sgt i32 %16, 0
  br i1 %17, label %.critedge.sink.split, label %.critedge

18:                                               ; preds = %13
  %19 = getelementptr inbounds i8, ptr %0, i64 16
  %20 = load i64, ptr %19, align 8, !tbaa !12
  %21 = tail call noundef zeroext i1 @_ZN14NAMESPACE_MAINL14IsConvertErrorImmEENSt9enable_ifIXaaaantsr3std9is_signedIT_EE5valuentsr3std9is_signedIT0_EE5valueleclsr3std14numeric_limitsIS3_EE3maxEclsr3std14numeric_limitsIS2_EE3maxEEbE4typeES3_(i64 noundef %20) #5
  br i1 %21, label %22, label %23

22:                                               ; preds = %18
  tail call void @LogAssertFailure(i64 noundef 2101, ptr noundef nonnull @.str, ptr noundef nonnull @__func__.ExtractBinCounts, ptr noundef nonnull @.str.27)
  tail call void @__assert_fail(ptr noundef nonnull @.str.28, ptr noundef nonnull @.str, i32 noundef 2101, ptr noundef nonnull @__PRETTY_FUNCTION__.ExtractBinCounts) #6
  unreachable

23:                                               ; preds = %18
  %.not45 = icmp eq i64 %20, %1
  br i1 %.not45, label %27, label %24

24:                                               ; preds = %23
  %25 = load i32, ptr @g_traceLevel, align 4, !tbaa !5
  %26 = icmp sgt i32 %25, 0
  br i1 %26, label %.critedge.sink.split, label %.critedge

27:                                               ; preds = %23
  %.not46 = icmp eq i64 %1, 0
  br i1 %.not46, label %.critedge, label %28

28:                                               ; preds = %27
  %29 = icmp eq ptr %2, null
  br i1 %29, label %30, label %33

30:                                               ; preds = %28
  %31 = load i32, ptr @g_traceLevel, align 4, !tbaa !5
  %32 = icmp sgt i32 %31, 0
  br i1 %32, label %.critedge.sink.split, label %.critedge

33:                                               ; preds = %28
  %34 = getelementptr inbounds i8, ptr %0, i64 40
  %35 = tail call noundef ptr @_ZN14NAMESPACE_MAINL14ArrayToPointerImEEPKT_S3_(ptr noundef nonnull %34) #5
  %36 = getelementptr inbounds i64, ptr %2, i64 %1
  br label %37

37:                                               ; preds = %62, %33
  %.040 = phi ptr [ %2, %33 ], [ %63, %62 ]
  %.039 = phi ptr [ %35, %33 ], [ %39, %62 ]
  %38 = load i64, ptr %.039, align 8, !tbaa !13
  %39 = getelementptr inbounds i8, ptr %.039, i64 8
  %40 = tail call noundef zeroext i1 @_ZN14NAMESPACE_MAINL14IsConvertErrorImmEENSt9enable_ifIXaaaantsr3std9is_signedIT_EE5valuentsr3std9is_signedIT0_EE5valueleclsr3std14numeric_limitsIS3_EE3maxEclsr3std14numeric_limitsIS2_EE3maxEEbE4typeES3_(i64 noundef %38) #5
  br i1 %40, label %41, label %42

41:                                               ; preds = %37
  tail call void @LogAssertFailure(i64 noundef 2121, ptr noundef nonnull @.str, ptr noundef nonnull @__func__.ExtractBinCounts, ptr noundef nonnull @.str.61)
  tail call void @__assert_fail(ptr noundef nonnull @.str.62, ptr noundef nonnull @.str, i32 noundef 2121, ptr noundef nonnull @__PRETTY_FUNCTION__.ExtractBinCounts) #6
  unreachable

42:                                               ; preds = %37
  %43 = getelementptr inbounds i8, ptr %0, i64 %38
  %44 = load i64, ptr %43, align 8, !tbaa !14
  %45 = tail call noundef zeroext i1 @_ZN14NAMESPACE_MAINL9IsFeatureEm(i64 noundef %44) #5
  br i1 %45, label %47, label %46

46:                                               ; preds = %42
  tail call void @LogAssertFailure(i64 noundef 2127, ptr noundef nonnull @.str, ptr noundef nonnull @__func__.ExtractBinCounts, ptr noundef nonnull @.str.63)
  tail call void @__assert_fail(ptr noundef nonnull @.str.64, ptr noundef nonnull @.str, i32 noundef 2127, ptr noundef nonnull @__PRETTY_FUNCTION__.ExtractBinCounts) #6
  unreachable

47:                                               ; preds = %42
  %48 = getelementptr inbounds i8, ptr %43, i64 8
  %49 = load i64, ptr %48, align 8, !tbaa !16
  %50 = load i64, ptr %43, align 8, !tbaa !14
  %51 = tail call noundef zeroext i1 @_ZN14NAMESPACE_MAINL16IsMissingFeatureEm(i64 noundef %50) #5
  %not. = xor i1 %51, true
  %52 = zext i1 %not. to i64
  %53 = add i64 %49, %52
  %54 = load i64, ptr %43, align 8, !tbaa !14
  %55 = tail call noundef zeroext i1 @_ZN14NAMESPACE_MAINL15IsUnseenFeatureEm(i64 noundef %54) #5
  %not.47 = xor i1 %55, true
  %56 = zext i1 %not.47 to i64
  %57 = add i64 %53, %56
  %58 = tail call noundef zeroext i1 @_ZN14NAMESPACE_MAINL14IsConvertErrorIlmEENSt9enable_ifIXaaaasr3std9is_signedIT_EE5valuentsr3std9is_signedIT0_EE5valueltclsr3std14numeric_limitsIS2_EE3maxEclsr3std14numeric_limitsIS3_EE3maxEEbE4typeES3_(i64 noundef %57) #5
  br i1 %58, label %59, label %62

59:                                               ; preds = %47
  %60 = load i32, ptr @g_traceLevel, align 4, !tbaa !5
  %61 = icmp sgt i32 %60, 0
  br i1 %61, label %.critedge.sink.split, label %.critedge

62:                                               ; preds = %47
  store i64 %57, ptr %.040, align 8, !tbaa !13
  %63 = getelementptr inbounds i8, ptr %.040, i64 8
  %.not48 = icmp eq ptr %36, %63
  br i1 %.not48, label %.critedge, label %37, !llvm.loop !17

.critedge.sink.split:                             ; preds = %59, %30, %24, %15, %10, %5
  %_ZZ16ExtractBinCountsE13LOG__sMessage_4.sink = phi ptr [ @_ZZ16ExtractBinCountsE13LOG__sMessage, %5 ], [ @_ZZ16ExtractBinCountsE13LOG__sMessage_0, %10 ], [ @_ZZ16ExtractBinCountsE13LOG__sMessage_1, %15 ], [ @_ZZ16ExtractBinCountsE13LOG__sMessage_2, %24 ], [ @_ZZ16ExtractBinCountsE13LOG__sMessage_3, %30 ], [ @_ZZ16ExtractBinCountsE13LOG__sMessage_4, %59 ]
  tail call void @InteralLogWithoutArguments(i32 noundef 1, ptr noundef nonnull %_ZZ16ExtractBinCountsE13LOG__sMessage_4.sink)
  br label %.critedge

.critedge:                                        ; preds = %62, %.critedge.sink.split, %59, %27, %15, %30, %24, %10, %5
  %.4 = phi i32 [ -3, %5 ], [ -3, %10 ], [ -3, %15 ], [ -3, %24 ], [ -3, %30 ], [ 0, %27 ], [ -3, %59 ], [ -3, %.critedge.sink.split ], [ 0, %62 ]
  ret i32 %.4
}

attributes #0 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { 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 #2 = { alwaysinline mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { noreturn nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }
attributes #6 = { noreturn nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !11, i64 0}
!10 = !{!"_ZTSN14NAMESPACE_MAIN19HeaderDataSetSharedE", !11, i64 0, !11, i64 8, !11, i64 16, !11, i64 24, !11, i64 32, !7, i64 40}
!11 = !{!"long", !7, i64 0}
!12 = !{!10, !11, i64 16}
!13 = !{!11, !11, i64 0}
!14 = !{!15, !11, i64 0}
!15 = !{!"_ZTSN14NAMESPACE_MAIN20FeatureDataSetSharedE", !11, i64 0, !11, i64 8}
!16 = !{!15, !11, i64 8}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}


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