; LLVM IR from xhub/reshop :: gui/external/imgui (imgui_widgets)

; 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.ImGuiMultiSelectIO = type { %struct.ImVector.41, i64, i64, i8, i8, i32 }
%struct.ImVector.41 = type { i32, i32, ptr }
%struct.ImGuiSelectionBasicStorage = type { i32, i8, ptr, ptr, i32, %struct.ImGuiStorage }
%struct.ImGuiStorage = type { %struct.ImVector.2 }
%struct.ImVector.2 = type { i32, i32, ptr }
%struct.ImGuiSelectionRequest = type { i32, i8, i8, i64, i64 }

@.str.2 = external hidden unnamed_addr constant [82 x i8], align 1
@.str.185 = external hidden unnamed_addr constant [87 x i8], align 1
@__PRETTY_FUNCTION__._ZN26ImGuiSelectionBasicStorage13ApplyRequestsEP18ImGuiMultiSelectIO = external hidden unnamed_addr constant [69 x i8], align 1
@.str.186 = external hidden unnamed_addr constant [34 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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN26ImGuiSelectionBasicStorage5ClearEv(ptr noundef nonnull align 8 dereferenceable(48)) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN26ImGuiSelectionBasicStorage15SetItemSelectedEjb(ptr noundef nonnull align 8 dereferenceable(48), i32 noundef, i1 noundef zeroext) #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN26ImGuiSelectionBasicStorage13ApplyRequestsEP18ImGuiMultiSelectIO(ptr noundef nonnull align 8 dereferenceable(48) %0, ptr noundef %1) #2 align 2 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %17 = load ptr, ptr %3, align 8
  %18 = load ptr, ptr %4, align 8, !tbaa !5
  %19 = getelementptr inbounds %struct.ImGuiMultiSelectIO, ptr %18, i32 0, i32 5
  %20 = load i32, ptr %19, align 4, !tbaa !9
  %21 = icmp ne i32 %20, -1
  br i1 %21, label %22, label %23

22:                                               ; preds = %2
  br label %23

23:                                               ; preds = %22, %2
  %24 = phi i1 [ false, %2 ], [ true, %22 ]
  br i1 %24, label %25, label %26

25:                                               ; preds = %23
  br label %28

26:                                               ; preds = %23
  call void @__assert_fail(ptr noundef @.str.185, ptr noundef @.str.2, i32 noundef 8156, ptr noundef @__PRETTY_FUNCTION__._ZN26ImGuiSelectionBasicStorage13ApplyRequestsEP18ImGuiMultiSelectIO) #5
  unreachable

27:                                               ; No predecessors!
  br label %28

28:                                               ; preds = %27, %25
  %29 = getelementptr inbounds %struct.ImGuiSelectionBasicStorage, ptr %17, i32 0, i32 3
  %30 = load ptr, ptr %29, align 8, !tbaa !15
  %31 = icmp ne ptr %30, null
  br i1 %31, label %32, label %33

32:                                               ; preds = %28
  br label %35

33:                                               ; preds = %28
  call void @__assert_fail(ptr noundef @.str.186, ptr noundef @.str.2, i32 noundef 8157, ptr noundef @__PRETTY_FUNCTION__._ZN26ImGuiSelectionBasicStorage13ApplyRequestsEP18ImGuiMultiSelectIO) #5
  unreachable

34:                                               ; No predecessors!
  br label %35

35:                                               ; preds = %34, %32
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #6
  %36 = load ptr, ptr %4, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct.ImGuiMultiSelectIO, ptr %36, i32 0, i32 0
  store ptr %37, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #6
  %38 = load ptr, ptr %5, align 8, !tbaa !5
  %39 = call noundef ptr @_ZN8ImVectorI21ImGuiSelectionRequestE5beginEv(ptr noundef nonnull align 8 dereferenceable(16) %38)
  store ptr %39, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  %40 = load ptr, ptr %5, align 8, !tbaa !5
  %41 = call noundef ptr @_ZN8ImVectorI21ImGuiSelectionRequestE3endEv(ptr noundef nonnull align 8 dereferenceable(16) %40)
  store ptr %41, ptr %7, align 8, !tbaa !5
  br label %42

42:                                               ; preds = %214, %35
  %43 = load ptr, ptr %6, align 8, !tbaa !5
  %44 = load ptr, ptr %7, align 8, !tbaa !5
  %45 = icmp ne ptr %43, %44
  br i1 %45, label %47, label %46

46:                                               ; preds = %42
  store i32 2, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #6
  br label %217

47:                                               ; preds = %42
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  %48 = load ptr, ptr %6, align 8, !tbaa !5
  store ptr %48, ptr %9, align 8, !tbaa !5
  %49 = load ptr, ptr %9, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct.ImGuiSelectionRequest, ptr %49, i32 0, i32 0
  %51 = load i32, ptr %50, align 8, !tbaa !19
  %52 = icmp eq i32 %51, 1
  br i1 %52, label %53, label %98

53:                                               ; preds = %47
  call void @_ZN26ImGuiSelectionBasicStorage5ClearEv(ptr noundef nonnull align 8 dereferenceable(48) %17)
  %54 = load ptr, ptr %9, align 8, !tbaa !5
  %55 = getelementptr inbounds %struct.ImGuiSelectionRequest, ptr %54, i32 0, i32 1
  %56 = load i8, ptr %55, align 4, !tbaa !22, !range !23, !noundef !24
  %57 = trunc i8 %56 to i1
  br i1 %57, label %58, label %97

58:                                               ; preds = %53
  %59 = getelementptr inbounds %struct.ImGuiSelectionBasicStorage, ptr %17, i32 0, i32 5
  %60 = getelementptr inbounds %struct.ImGuiStorage, ptr %59, i32 0, i32 0
  %61 = load ptr, ptr %4, align 8, !tbaa !5
  %62 = getelementptr inbounds %struct.ImGuiMultiSelectIO, ptr %61, i32 0, i32 5
  %63 = load i32, ptr %62, align 4, !tbaa !9
  call void @_ZN8ImVectorI16ImGuiStoragePairE7reserveEi(ptr noundef nonnull align 8 dereferenceable(16) %60, i32 noundef %63)
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  %64 = getelementptr inbounds %struct.ImGuiSelectionBasicStorage, ptr %17, i32 0, i32 5
  %65 = getelementptr inbounds %struct.ImGuiStorage, ptr %64, i32 0, i32 0
  %66 = getelementptr inbounds %struct.ImVector.2, ptr %65, i32 0, i32 0
  %67 = load i32, ptr %66, align 8, !tbaa !25
  store i32 %67, ptr %10, align 4, !tbaa !26
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  store i32 0, ptr %11, align 4, !tbaa !26
  br label %68

68:                                               ; preds = %85, %58
  %69 = load i32, ptr %11, align 4, !tbaa !26
  %70 = load ptr, ptr %4, align 8, !tbaa !5
  %71 = getelementptr inbounds %struct.ImGuiMultiSelectIO, ptr %70, i32 0, i32 5
  %72 = load i32, ptr %71, align 4, !tbaa !9
  %73 = icmp slt i32 %69, %72
  br i1 %73, label %75, label %74

74:                                               ; preds = %68
  store i32 4, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  br label %91

75:                                               ; preds = %68
  %76 = load i32, ptr %11, align 4, !tbaa !26
  %77 = call noundef i32 @_ZN26ImGuiSelectionBasicStorage21GetStorageIdFromIndexEi(ptr noundef nonnull align 8 dereferenceable(48) %17, i32 noundef %76)
  %78 = load ptr, ptr %9, align 8, !tbaa !5
  %79 = getelementptr inbounds %struct.ImGuiSelectionRequest, ptr %78, i32 0, i32 1
  %80 = load i8, ptr %79, align 4, !tbaa !22, !range !23, !noundef !24
  %81 = trunc i8 %80 to i1
  %82 = load i32, ptr %10, align 4, !tbaa !26
  %83 = getelementptr inbounds %struct.ImGuiSelectionBasicStorage, ptr %17, i32 0, i32 4
  %84 = load i32, ptr %83, align 8, !tbaa !27
  call void @_ZL47ImGuiSelectionBasicStorage_BatchSetItemSelectedP26ImGuiSelectionBasicStoragejbii(ptr noundef %17, i32 noundef %77, i1 noundef zeroext %81, i32 noundef %82, i32 noundef %84)
  br label %85

85:                                               ; preds = %75
  %86 = load i32, ptr %11, align 4, !tbaa !26
  %87 = add nsw i32 %86, 1
  store i32 %87, ptr %11, align 4, !tbaa !26
  %88 = getelementptr inbounds %struct.ImGuiSelectionBasicStorage, ptr %17, i32 0, i32 4
  %89 = load i32, ptr %88, align 8, !tbaa !27
  %90 = add nsw i32 %89, 1
  store i32 %90, ptr %88, align 8, !tbaa !27
  br label %68, !llvm.loop !28

91:                                               ; preds = %74
  %92 = load ptr, ptr %9, align 8, !tbaa !5
  %93 = getelementptr inbounds %struct.ImGuiSelectionRequest, ptr %92, i32 0, i32 1
  %94 = load i8, ptr %93, align 4, !tbaa !22, !range !23, !noundef !24
  %95 = trunc i8 %94 to i1
  %96 = load i32, ptr %10, align 4, !tbaa !26
  call void @_ZL38ImGuiSelectionBasicStorage_BatchFinishP26ImGuiSelectionBasicStoragebi(ptr noundef %17, i1 noundef zeroext %95, i32 noundef %96)
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  br label %97

97:                                               ; preds = %91, %53
  br label %213

98:                                               ; preds = %47
  %99 = load ptr, ptr %9, align 8, !tbaa !5
  %100 = getelementptr inbounds %struct.ImGuiSelectionRequest, ptr %99, i32 0, i32 0
  %101 = load i32, ptr %100, align 8, !tbaa !19
  %102 = icmp eq i32 %101, 2
  br i1 %102, label %103, label %212

103:                                              ; preds = %98
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  %104 = load ptr, ptr %9, align 8, !tbaa !5
  %105 = getelementptr inbounds %struct.ImGuiSelectionRequest, ptr %104, i32 0, i32 4
  %106 = load i64, ptr %105, align 8, !tbaa !30
  %107 = trunc i64 %106 to i32
  %108 = load ptr, ptr %9, align 8, !tbaa !5
  %109 = getelementptr inbounds %struct.ImGuiSelectionRequest, ptr %108, i32 0, i32 3
  %110 = load i64, ptr %109, align 8, !tbaa !31
  %111 = trunc i64 %110 to i32
  %112 = sub nsw i32 %107, %111
  %113 = add nsw i32 %112, 1
  store i32 %113, ptr %12, align 4, !tbaa !26
  %114 = load i32, ptr %12, align 4, !tbaa !26
  %115 = icmp eq i32 %114, 1
  br i1 %115, label %122, label %116

116:                                              ; preds = %103
  %117 = load i32, ptr %12, align 4, !tbaa !26
  %118 = getelementptr inbounds %struct.ImGuiSelectionBasicStorage, ptr %17, i32 0, i32 0
  %119 = load i32, ptr %118, align 8, !tbaa !32
  %120 = sdiv i32 %119, 100
  %121 = icmp slt i32 %117, %120
  br i1 %121, label %122, label %146

122:                                              ; preds = %116, %103
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  %123 = load ptr, ptr %9, align 8, !tbaa !5
  %124 = getelementptr inbounds %struct.ImGuiSelectionRequest, ptr %123, i32 0, i32 3
  %125 = load i64, ptr %124, align 8, !tbaa !31
  %126 = trunc i64 %125 to i32
  store i32 %126, ptr %13, align 4, !tbaa !26
  br label %127

127:                                              ; preds = %142, %122
  %128 = load i32, ptr %13, align 4, !tbaa !26
  %129 = load ptr, ptr %9, align 8, !tbaa !5
  %130 = getelementptr inbounds %struct.ImGuiSelectionRequest, ptr %129, i32 0, i32 4
  %131 = load i64, ptr %130, align 8, !tbaa !30
  %132 = trunc i64 %131 to i32
  %133 = icmp sle i32 %128, %132
  br i1 %133, label %135, label %134

134:                                              ; preds = %127
  store i32 7, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  br label %145

135:                                              ; preds = %127
  %136 = load i32, ptr %13, align 4, !tbaa !26
  %137 = call noundef i32 @_ZN26ImGuiSelectionBasicStorage21GetStorageIdFromIndexEi(ptr noundef nonnull align 8 dereferenceable(48) %17, i32 noundef %136)
  %138 = load ptr, ptr %9, align 8, !tbaa !5
  %139 = getelementptr inbounds %struct.ImGuiSelectionRequest, ptr %138, i32 0, i32 1
  %140 = load i8, ptr %139, align 4, !tbaa !22, !range !23, !noundef !24
  %141 = trunc i8 %140 to i1
  call void @_ZN26ImGuiSelectionBasicStorage15SetItemSelectedEjb(ptr noundef nonnull align 8 dereferenceable(48) %17, i32 noundef %137, i1 noundef zeroext %141)
  br label %142

142:                                              ; preds = %135
  %143 = load i32, ptr %13, align 4, !tbaa !26
  %144 = add nsw i32 %143, 1
  store i32 %144, ptr %13, align 4, !tbaa !26
  br label %127, !llvm.loop !33

145:                                              ; preds = %134
  br label %211

146:                                              ; preds = %116
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  %147 = getelementptr inbounds %struct.ImGuiSelectionBasicStorage, ptr %17, i32 0, i32 5
  %148 = getelementptr inbounds %struct.ImGuiStorage, ptr %147, i32 0, i32 0
  %149 = getelementptr inbounds %struct.ImVector.2, ptr %148, i32 0, i32 0
  %150 = load i32, ptr %149, align 8, !tbaa !25
  store i32 %150, ptr %14, align 4, !tbaa !26
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  %151 = getelementptr inbounds %struct.ImGuiSelectionBasicStorage, ptr %17, i32 0, i32 4
  %152 = load i32, ptr %151, align 8, !tbaa !27
  %153 = load ptr, ptr %9, align 8, !tbaa !5
  %154 = getelementptr inbounds %struct.ImGuiSelectionRequest, ptr %153, i32 0, i32 2
  %155 = load i8, ptr %154, align 1, !tbaa !34
  %156 = sext i8 %155 to i32
  %157 = icmp slt i32 %156, 0
  br i1 %157, label %158, label %161

158:                                              ; preds = %146
  %159 = load i32, ptr %12, align 4, !tbaa !26
  %160 = sub nsw i32 %159, 1
  br label %162

161:                                              ; preds = %146
  br label %162

162:                                              ; preds = %161, %158
  %163 = phi i32 [ %160, %158 ], [ 0, %161 ]
  %164 = add nsw i32 %152, %163
  store i32 %164, ptr %15, align 4, !tbaa !26
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #6
  %165 = load ptr, ptr %9, align 8, !tbaa !5
  %166 = getelementptr inbounds %struct.ImGuiSelectionRequest, ptr %165, i32 0, i32 3
  %167 = load i64, ptr %166, align 8, !tbaa !31
  %168 = trunc i64 %167 to i32
  store i32 %168, ptr %16, align 4, !tbaa !26
  br label %169

169:                                              ; preds = %186, %162
  %170 = load i32, ptr %16, align 4, !tbaa !26
  %171 = load ptr, ptr %9, align 8, !tbaa !5
  %172 = getelementptr inbounds %struct.ImGuiSelectionRequest, ptr %171, i32 0, i32 4
  %173 = load i64, ptr %172, align 8, !tbaa !30
  %174 = trunc i64 %173 to i32
  %175 = icmp sle i32 %170, %174
  br i1 %175, label %177, label %176

176:                                              ; preds = %169
  store i32 10, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  br label %195

177:                                              ; preds = %169
  %178 = load i32, ptr %16, align 4, !tbaa !26
  %179 = call noundef i32 @_ZN26ImGuiSelectionBasicStorage21GetStorageIdFromIndexEi(ptr noundef nonnull align 8 dereferenceable(48) %17, i32 noundef %178)
  %180 = load ptr, ptr %9, align 8, !tbaa !5
  %181 = getelementptr inbounds %struct.ImGuiSelectionRequest, ptr %180, i32 0, i32 1
  %182 = load i8, ptr %181, align 4, !tbaa !22, !range !23, !noundef !24
  %183 = trunc i8 %182 to i1
  %184 = load i32, ptr %14, align 4, !tbaa !26
  %185 = load i32, ptr %15, align 4, !tbaa !26
  call void @_ZL47ImGuiSelectionBasicStorage_BatchSetItemSelectedP26ImGuiSelectionBasicStoragejbii(ptr noundef %17, i32 noundef %179, i1 noundef zeroext %183, i32 noundef %184, i32 noundef %185)
  br label %186

186:                                              ; preds = %177
  %187 = load i32, ptr %16, align 4, !tbaa !26
  %188 = add nsw i32 %187, 1
  store i32 %188, ptr %16, align 4, !tbaa !26
  %189 = load ptr, ptr %9, align 8, !tbaa !5
  %190 = getelementptr inbounds %struct.ImGuiSelectionRequest, ptr %189, i32 0, i32 2
  %191 = load i8, ptr %190, align 1, !tbaa !34
  %192 = sext i8 %191 to i32
  %193 = load i32, ptr %15, align 4, !tbaa !26
  %194 = add nsw i32 %193, %192
  store i32 %194, ptr %15, align 4, !tbaa !26
  br label %169, !llvm.loop !35

195:                                              ; preds = %176
  %196 = load ptr, ptr %9, align 8, !tbaa !5
  %197 = getelementptr inbounds %struct.ImGuiSelectionRequest, ptr %196, i32 0, i32 1
  %198 = load i8, ptr %197, align 4, !tbaa !22, !range !23, !noundef !24
  %199 = trunc i8 %198 to i1
  br i1 %199, label %200, label %205

200:                                              ; preds = %195
  %201 = load i32, ptr %12, align 4, !tbaa !26
  %202 = getelementptr inbounds %struct.ImGuiSelectionBasicStorage, ptr %17, i32 0, i32 4
  %203 = load i32, ptr %202, align 8, !tbaa !27
  %204 = add nsw i32 %203, %201
  store i32 %204, ptr %202, align 8, !tbaa !27
  br label %205

205:                                              ; preds = %200, %195
  %206 = load ptr, ptr %9, align 8, !tbaa !5
  %207 = getelementptr inbounds %struct.ImGuiSelectionRequest, ptr %206, i32 0, i32 1
  %208 = load i8, ptr %207, align 4, !tbaa !22, !range !23, !noundef !24
  %209 = trunc i8 %208 to i1
  %210 = load i32, ptr %14, align 4, !tbaa !26
  call void @_ZL38ImGuiSelectionBasicStorage_BatchFinishP26ImGuiSelectionBasicStoragebi(ptr noundef %17, i1 noundef zeroext %209, i32 noundef %210)
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  br label %211

211:                                              ; preds = %205, %145
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  br label %212

212:                                              ; preds = %211, %98
  br label %213

213:                                              ; preds = %212, %97
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  br label %214

214:                                              ; preds = %213
  %215 = load ptr, ptr %6, align 8, !tbaa !5
  %216 = getelementptr inbounds %struct.ImGuiSelectionRequest, ptr %215, i32 1
  store ptr %216, ptr %6, align 8, !tbaa !5
  br label %42

217:                                              ; preds = %46
  ret void
}

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN8ImVectorI16ImGuiStoragePairE7reserveEi(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef) #4 align 2

; Function Attrs: mustprogress uwtable
declare hidden void @_ZL47ImGuiSelectionBasicStorage_BatchSetItemSelectedP26ImGuiSelectionBasicStoragejbii(ptr noundef, i32 noundef, i1 noundef zeroext, i32 noundef, i32 noundef) #2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_ZN26ImGuiSelectionBasicStorage21GetStorageIdFromIndexEi(ptr noundef nonnull align 8 dereferenceable(48), i32 noundef) #4 align 2

; Function Attrs: mustprogress uwtable
declare hidden void @_ZL38ImGuiSelectionBasicStorage_BatchFinishP26ImGuiSelectionBasicStoragebi(ptr noundef, i1 noundef zeroext, i32 noundef) #2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 #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 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { noreturn nounwind }
attributes #6 = { 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, !12, i64 36}
!10 = !{!"_ZTS18ImGuiMultiSelectIO", !11, i64 0, !13, i64 16, !13, i64 24, !14, i64 32, !14, i64 33, !12, i64 36}
!11 = !{!"_ZTS8ImVectorI21ImGuiSelectionRequestE", !12, i64 0, !12, i64 4, !6, i64 8}
!12 = !{!"int", !7, i64 0}
!13 = !{!"long long", !7, i64 0}
!14 = !{!"bool", !7, i64 0}
!15 = !{!16, !6, i64 16}
!16 = !{!"_ZTS26ImGuiSelectionBasicStorage", !12, i64 0, !14, i64 4, !6, i64 8, !6, i64 16, !12, i64 24, !17, i64 32}
!17 = !{!"_ZTS12ImGuiStorage", !18, i64 0}
!18 = !{!"_ZTS8ImVectorI16ImGuiStoragePairE", !12, i64 0, !12, i64 4, !6, i64 8}
!19 = !{!20, !21, i64 0}
!20 = !{!"_ZTS21ImGuiSelectionRequest", !21, i64 0, !14, i64 4, !7, i64 5, !13, i64 8, !13, i64 16}
!21 = !{!"_ZTS25ImGuiSelectionRequestType", !7, i64 0}
!22 = !{!20, !14, i64 4}
!23 = !{i8 0, i8 2}
!24 = !{}
!25 = !{!16, !12, i64 32}
!26 = !{!12, !12, i64 0}
!27 = !{!16, !12, i64 24}
!28 = distinct !{!28, !29}
!29 = !{!"llvm.loop.mustprogress"}
!30 = !{!20, !13, i64 16}
!31 = !{!20, !13, i64 8}
!32 = !{!16, !12, i64 0}
!33 = distinct !{!33, !29}
!34 = !{!20, !7, i64 5}
!35 = distinct !{!35, !29}


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

@.str.2 = external hidden unnamed_addr constant [82 x i8], align 1
@.str.185 = external hidden unnamed_addr constant [87 x i8], align 1
@__PRETTY_FUNCTION__._ZN26ImGuiSelectionBasicStorage13ApplyRequestsEP18ImGuiMultiSelectIO = external hidden unnamed_addr constant [69 x i8], align 1
@.str.186 = external hidden unnamed_addr constant [34 x i8], align 1

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN26ImGuiSelectionBasicStorage5ClearEv(ptr noundef nonnull align 8 dereferenceable(48)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN26ImGuiSelectionBasicStorage15SetItemSelectedEjb(ptr noundef nonnull align 8 dereferenceable(48), i32 noundef, i1 noundef zeroext) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN26ImGuiSelectionBasicStorage13ApplyRequestsEP18ImGuiMultiSelectIO(ptr noundef nonnull align 8 dereferenceable(48) %0, ptr noundef %1) local_unnamed_addr #1 align 2 {
  %3 = getelementptr inbounds i8, ptr %1, i64 36
  %4 = load i32, ptr %3, align 4, !tbaa !5
  %.not = icmp eq i32 %4, -1
  br i1 %.not, label %5, label %6

5:                                                ; preds = %2
  tail call void @__assert_fail(ptr noundef nonnull @.str.185, ptr noundef nonnull @.str.2, i32 noundef 8156, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN26ImGuiSelectionBasicStorage13ApplyRequestsEP18ImGuiMultiSelectIO) #4
  unreachable

6:                                                ; preds = %2
  %7 = getelementptr inbounds i8, ptr %0, i64 16
  %8 = load ptr, ptr %7, align 8, !tbaa !14
  %.not52 = icmp eq ptr %8, null
  br i1 %.not52, label %9, label %10

9:                                                ; preds = %6
  tail call void @__assert_fail(ptr noundef nonnull @.str.186, ptr noundef nonnull @.str.2, i32 noundef 8157, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN26ImGuiSelectionBasicStorage13ApplyRequestsEP18ImGuiMultiSelectIO) #4
  unreachable

10:                                               ; preds = %6
  %11 = tail call noundef ptr @_ZN8ImVectorI21ImGuiSelectionRequestE5beginEv(ptr noundef nonnull align 8 dereferenceable(16) %1)
  %12 = tail call noundef ptr @_ZN8ImVectorI21ImGuiSelectionRequestE3endEv(ptr noundef nonnull align 8 dereferenceable(16) %1)
  %.not5367 = icmp eq ptr %11, %12
  br i1 %.not5367, label %._crit_edge71, label %.lr.ph70

.lr.ph70:                                         ; preds = %10
  %13 = getelementptr inbounds i8, ptr %0, i64 32
  %14 = getelementptr inbounds i8, ptr %0, i64 24
  br label %15

._crit_edge71:                                    ; preds = %.loopexit, %10
  ret void

15:                                               ; preds = %.lr.ph70, %.loopexit
  %.04768 = phi ptr [ %11, %.lr.ph70 ], [ %86, %.loopexit ]
  %16 = load i32, ptr %.04768, align 8, !tbaa !18
  switch i32 %16, label %.loopexit [
    i32 1, label %17
    i32 2, label %37
  ]

17:                                               ; preds = %15
  tail call void @_ZN26ImGuiSelectionBasicStorage5ClearEv(ptr noundef nonnull align 8 dereferenceable(48) %0)
  %18 = getelementptr inbounds i8, ptr %.04768, i64 4
  %19 = load i8, ptr %18, align 4, !tbaa !21, !range !22, !noundef !23
  %20 = trunc nuw i8 %19 to i1
  br i1 %20, label %21, label %.loopexit

21:                                               ; preds = %17
  %22 = load i32, ptr %3, align 4, !tbaa !5
  tail call void @_ZN8ImVectorI16ImGuiStoragePairE7reserveEi(ptr noundef nonnull align 8 dereferenceable(16) %13, i32 noundef %22)
  %23 = load i32, ptr %13, align 8, !tbaa !24
  %24 = load i32, ptr %3, align 4, !tbaa !5
  %25 = icmp sgt i32 %24, 0
  br i1 %25, label %.lr.ph65, label %._crit_edge66

._crit_edge66:                                    ; preds = %.lr.ph65, %21
  %26 = load i8, ptr %18, align 4, !tbaa !21, !range !22, !noundef !23
  %27 = trunc nuw i8 %26 to i1
  tail call void @_ZL38ImGuiSelectionBasicStorage_BatchFinishP26ImGuiSelectionBasicStoragebi(ptr noundef nonnull %0, i1 noundef zeroext %27, i32 noundef %23)
  br label %.loopexit

.lr.ph65:                                         ; preds = %21, %.lr.ph65
  %.04963 = phi i32 [ %32, %.lr.ph65 ], [ 0, %21 ]
  %28 = tail call noundef i32 @_ZN26ImGuiSelectionBasicStorage21GetStorageIdFromIndexEi(ptr noundef nonnull align 8 dereferenceable(48) %0, i32 noundef %.04963)
  %29 = load i8, ptr %18, align 4, !tbaa !21, !range !22, !noundef !23
  %30 = trunc nuw i8 %29 to i1
  %31 = load i32, ptr %14, align 8, !tbaa !25
  tail call void @_ZL47ImGuiSelectionBasicStorage_BatchSetItemSelectedP26ImGuiSelectionBasicStoragejbii(ptr noundef nonnull %0, i32 noundef %28, i1 noundef zeroext %30, i32 noundef %23, i32 noundef %31)
  %32 = add nuw nsw i32 %.04963, 1
  %33 = load i32, ptr %14, align 8, !tbaa !25
  %34 = add nsw i32 %33, 1
  store i32 %34, ptr %14, align 8, !tbaa !25
  %35 = load i32, ptr %3, align 4, !tbaa !5
  %36 = icmp slt i32 %32, %35
  br i1 %36, label %.lr.ph65, label %._crit_edge66, !llvm.loop !26

37:                                               ; preds = %15
  %38 = getelementptr inbounds i8, ptr %.04768, i64 16
  %39 = load i64, ptr %38, align 8, !tbaa !28
  %40 = trunc i64 %39 to i32
  %41 = getelementptr inbounds i8, ptr %.04768, i64 8
  %42 = load i64, ptr %41, align 8, !tbaa !29
  %43 = trunc i64 %42 to i32
  %44 = sub nsw i32 %40, %43
  %45 = add nsw i32 %44, 1
  %46 = icmp eq i32 %40, %43
  br i1 %46, label %51, label %47

47:                                               ; preds = %37
  %48 = load i32, ptr %0, align 8, !tbaa !30
  %49 = sdiv i32 %48, 100
  %50 = icmp slt i32 %45, %49
  br i1 %50, label %51, label %60

51:                                               ; preds = %47, %37
  %.not5559 = icmp sgt i32 %43, %40
  br i1 %.not5559, label %.loopexit, label %.lr.ph62

.lr.ph62:                                         ; preds = %51
  %52 = getelementptr inbounds i8, ptr %.04768, i64 4
  br label %53

53:                                               ; preds = %.lr.ph62, %53
  %.04860 = phi i32 [ %43, %.lr.ph62 ], [ %57, %53 ]
  %54 = tail call noundef i32 @_ZN26ImGuiSelectionBasicStorage21GetStorageIdFromIndexEi(ptr noundef nonnull align 8 dereferenceable(48) %0, i32 noundef %.04860)
  %55 = load i8, ptr %52, align 4, !tbaa !21, !range !22, !noundef !23
  %56 = trunc nuw i8 %55 to i1
  tail call void @_ZN26ImGuiSelectionBasicStorage15SetItemSelectedEjb(ptr noundef nonnull align 8 dereferenceable(48) %0, i32 noundef %54, i1 noundef zeroext %56)
  %57 = add nsw i32 %.04860, 1
  %58 = load i64, ptr %38, align 8, !tbaa !28
  %59 = trunc i64 %58 to i32
  %.not55.not = icmp slt i32 %.04860, %59
  br i1 %.not55.not, label %53, label %.loopexit, !llvm.loop !31

60:                                               ; preds = %47
  %61 = load i32, ptr %13, align 8, !tbaa !24
  %62 = getelementptr inbounds i8, ptr %.04768, i64 5
  %.not5456 = icmp sgt i32 %43, %40
  br i1 %.not5456, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %60
  %63 = load i8, ptr %62, align 1, !tbaa !32
  %64 = icmp slt i8 %63, 0
  %65 = select i1 %64, i32 %44, i32 0
  %66 = load i32, ptr %14, align 8, !tbaa !25
  %67 = add nsw i32 %65, %66
  %68 = getelementptr inbounds i8, ptr %.04768, i64 4
  br label %72

._crit_edge:                                      ; preds = %72, %60
  %69 = getelementptr inbounds i8, ptr %.04768, i64 4
  %70 = load i8, ptr %69, align 4, !tbaa !21, !range !22, !noundef !23
  %71 = trunc nuw i8 %70 to i1
  br i1 %71, label %82, label %85

72:                                               ; preds = %.lr.ph, %72
  %.058 = phi i32 [ %43, %.lr.ph ], [ %76, %72 ]
  %.04657 = phi i32 [ %67, %.lr.ph ], [ %79, %72 ]
  %73 = tail call noundef i32 @_ZN26ImGuiSelectionBasicStorage21GetStorageIdFromIndexEi(ptr noundef nonnull align 8 dereferenceable(48) %0, i32 noundef %.058)
  %74 = load i8, ptr %68, align 4, !tbaa !21, !range !22, !noundef !23
  %75 = trunc nuw i8 %74 to i1
  tail call void @_ZL47ImGuiSelectionBasicStorage_BatchSetItemSelectedP26ImGuiSelectionBasicStoragejbii(ptr noundef nonnull %0, i32 noundef %73, i1 noundef zeroext %75, i32 noundef %61, i32 noundef %.04657)
  %76 = add nsw i32 %.058, 1
  %77 = load i8, ptr %62, align 1, !tbaa !32
  %78 = sext i8 %77 to i32
  %79 = add nsw i32 %.04657, %78
  %80 = load i64, ptr %38, align 8, !tbaa !28
  %81 = trunc i64 %80 to i32
  %.not54.not = icmp slt i32 %.058, %81
  br i1 %.not54.not, label %72, label %._crit_edge, !llvm.loop !33

82:                                               ; preds = %._crit_edge
  %83 = load i32, ptr %14, align 8, !tbaa !25
  %84 = add nsw i32 %83, %45
  store i32 %84, ptr %14, align 8, !tbaa !25
  br label %85

85:                                               ; preds = %82, %._crit_edge
  tail call void @_ZL38ImGuiSelectionBasicStorage_BatchFinishP26ImGuiSelectionBasicStoragebi(ptr noundef nonnull %0, i1 noundef zeroext %71, i32 noundef %61)
  br label %.loopexit

.loopexit:                                        ; preds = %53, %51, %85, %15, %17, %._crit_edge66
  %86 = getelementptr inbounds i8, ptr %.04768, i64 24
  %.not53 = icmp eq ptr %86, %12
  br i1 %.not53, label %._crit_edge71, label %15
}

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN8ImVectorI16ImGuiStoragePairE7reserveEi(ptr noundef nonnull align 8 dereferenceable(16), i32 noundef) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare hidden void @_ZL47ImGuiSelectionBasicStorage_BatchSetItemSelectedP26ImGuiSelectionBasicStoragejbii(ptr noundef, i32 noundef, i1 noundef zeroext, i32 noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_ZN26ImGuiSelectionBasicStorage21GetStorageIdFromIndexEi(ptr noundef nonnull align 8 dereferenceable(48), i32 noundef) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare hidden void @_ZL38ImGuiSelectionBasicStorage_BatchFinishP26ImGuiSelectionBasicStoragebi(ptr noundef, i1 noundef zeroext, i32 noundef) local_unnamed_addr #1

attributes #0 = { 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 #1 = { 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 #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 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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, !8, i64 36}
!6 = !{!"_ZTS18ImGuiMultiSelectIO", !7, i64 0, !12, i64 16, !12, i64 24, !13, i64 32, !13, i64 33, !8, i64 36}
!7 = !{!"_ZTS8ImVectorI21ImGuiSelectionRequestE", !8, i64 0, !8, i64 4, !11, i64 8}
!8 = !{!"int", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = !{!"any pointer", !9, i64 0}
!12 = !{!"long long", !9, i64 0}
!13 = !{!"bool", !9, i64 0}
!14 = !{!15, !11, i64 16}
!15 = !{!"_ZTS26ImGuiSelectionBasicStorage", !8, i64 0, !13, i64 4, !11, i64 8, !11, i64 16, !8, i64 24, !16, i64 32}
!16 = !{!"_ZTS12ImGuiStorage", !17, i64 0}
!17 = !{!"_ZTS8ImVectorI16ImGuiStoragePairE", !8, i64 0, !8, i64 4, !11, i64 8}
!18 = !{!19, !20, i64 0}
!19 = !{!"_ZTS21ImGuiSelectionRequest", !20, i64 0, !13, i64 4, !9, i64 5, !12, i64 8, !12, i64 16}
!20 = !{!"_ZTS25ImGuiSelectionRequestType", !9, i64 0}
!21 = !{!19, !13, i64 4}
!22 = !{i8 0, i8 2}
!23 = !{}
!24 = !{!15, !8, i64 32}
!25 = !{!15, !8, i64 24}
!26 = distinct !{!26, !27}
!27 = !{!"llvm.loop.mustprogress"}
!28 = !{!19, !12, i64 16}
!29 = !{!19, !12, i64 8}
!30 = !{!15, !8, i64 0}
!31 = distinct !{!31, !27}
!32 = !{!19, !9, i64 5}
!33 = distinct !{!33, !27}


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