; LLVM IR from qc-tum/chemtensor :: src/tensor (su2_tree)

; 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.charge_sectors = type { ptr, i64, i32 }
%struct.su2_fuse_split_tree = type { ptr, ptr, i32 }
%struct.su2_tree_node = type { i32, [2 x ptr] }
%struct.su2_irreducible_list = type { ptr, i32 }

@.str.1 = external hidden unnamed_addr constant [73 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [48 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [15 x i8], align 1
@__PRETTY_FUNCTION__.su2_fuse_split_tree_enumerate_charge_sectors = external hidden unnamed_addr constant [148 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [33 x i8], align 1

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden ptr @ct_malloc(i64 noundef) #1

; Function Attrs: inlinehint nounwind uwtable
declare hidden void @ct_free(ptr noundef) #1

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

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

; Function Attrs: nounwind uwtable
declare dso_local void @su2_tree_axes_indicator(ptr noundef, ptr noundef) #3

; Function Attrs: nounwind uwtable
declare dso_local void @su2_tree_enumerate_charge_sectors(ptr noundef, i32 noundef, ptr noundef, ptr noundef) #3

; Function Attrs: inlinehint nounwind uwtable
declare hidden ptr @ct_calloc(i64 noundef, i64 noundef) #1

declare void @allocate_charge_sectors(i64 noundef, i32 noundef, ptr noundef) #4

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #5

; Function Attrs: nounwind uwtable
define dso_local void @su2_fuse_split_tree_enumerate_charge_sectors(ptr noundef %0, ptr noundef %1, ptr noundef %2) #3 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca %struct.charge_sectors, align 8
  %12 = alloca %struct.charge_sectors, align 8
  %13 = alloca ptr, align 8
  %14 = alloca i64, align 8
  %15 = alloca i64, align 8
  %16 = alloca i32, align 4
  %17 = alloca i64, align 8
  %18 = alloca i32, align 4
  %19 = alloca i64, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  store ptr %2, ptr %6, align 8, !tbaa !5
  %20 = load ptr, ptr %4, align 8, !tbaa !5
  %21 = getelementptr inbounds %struct.su2_fuse_split_tree, ptr %20, i32 0, i32 2
  %22 = load i32, ptr %21, align 8, !tbaa !9
  %23 = icmp sgt i32 %22, 0
  br i1 %23, label %24, label %25

24:                                               ; preds = %3
  br label %26

25:                                               ; preds = %3
  call void @__assert_fail(ptr noundef @.str.14, ptr noundef @.str.1, i32 noundef 761, ptr noundef @__PRETTY_FUNCTION__.su2_fuse_split_tree_enumerate_charge_sectors) #6
  unreachable

26:                                               ; preds = %24
  %27 = load ptr, ptr %4, align 8, !tbaa !5
  %28 = getelementptr inbounds %struct.su2_fuse_split_tree, ptr %27, i32 0, i32 0
  %29 = load ptr, ptr %28, align 8, !tbaa !12
  %30 = getelementptr inbounds %struct.su2_tree_node, ptr %29, i32 0, i32 0
  %31 = load i32, ptr %30, align 8, !tbaa !13
  %32 = load ptr, ptr %4, align 8, !tbaa !5
  %33 = getelementptr inbounds %struct.su2_fuse_split_tree, ptr %32, i32 0, i32 1
  %34 = load ptr, ptr %33, align 8, !tbaa !15
  %35 = getelementptr inbounds %struct.su2_tree_node, ptr %34, i32 0, i32 0
  %36 = load i32, ptr %35, align 8, !tbaa !13
  %37 = icmp eq i32 %31, %36
  br i1 %37, label %38, label %39

38:                                               ; preds = %26
  br label %40

39:                                               ; preds = %26
  call void @__assert_fail(ptr noundef @.str.13, ptr noundef @.str.1, i32 noundef 762, ptr noundef @__PRETTY_FUNCTION__.su2_fuse_split_tree_enumerate_charge_sectors) #6
  unreachable

40:                                               ; preds = %38
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #7
  %41 = load ptr, ptr %4, align 8, !tbaa !5
  %42 = getelementptr inbounds %struct.su2_fuse_split_tree, ptr %41, i32 0, i32 0
  %43 = load ptr, ptr %42, align 8, !tbaa !12
  %44 = getelementptr inbounds %struct.su2_tree_node, ptr %43, i32 0, i32 0
  %45 = load i32, ptr %44, align 8, !tbaa !13
  store i32 %45, ptr %7, align 4, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #7
  %46 = load ptr, ptr %4, align 8, !tbaa !5
  %47 = getelementptr inbounds %struct.su2_fuse_split_tree, ptr %46, i32 0, i32 2
  %48 = load i32, ptr %47, align 8, !tbaa !9
  %49 = sext i32 %48 to i64
  %50 = call ptr @ct_calloc(i64 noundef %49, i64 noundef 1)
  store ptr %50, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #7
  %51 = load ptr, ptr %4, align 8, !tbaa !5
  %52 = getelementptr inbounds %struct.su2_fuse_split_tree, ptr %51, i32 0, i32 2
  %53 = load i32, ptr %52, align 8, !tbaa !9
  %54 = sext i32 %53 to i64
  %55 = call ptr @ct_calloc(i64 noundef %54, i64 noundef 1)
  store ptr %55, ptr %9, align 8, !tbaa !5
  %56 = load ptr, ptr %4, align 8, !tbaa !5
  %57 = getelementptr inbounds %struct.su2_fuse_split_tree, ptr %56, i32 0, i32 0
  %58 = load ptr, ptr %57, align 8, !tbaa !12
  %59 = load ptr, ptr %8, align 8, !tbaa !5
  call void @su2_tree_axes_indicator(ptr noundef %58, ptr noundef %59)
  %60 = load ptr, ptr %4, align 8, !tbaa !5
  %61 = getelementptr inbounds %struct.su2_fuse_split_tree, ptr %60, i32 0, i32 1
  %62 = load ptr, ptr %61, align 8, !tbaa !15
  %63 = load ptr, ptr %9, align 8, !tbaa !5
  call void @su2_tree_axes_indicator(ptr noundef %62, ptr noundef %63)
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  store i32 0, ptr %10, align 4, !tbaa !16
  br label %64

64:                                               ; preds = %112, %40
  %65 = load i32, ptr %10, align 4, !tbaa !16
  %66 = load ptr, ptr %4, align 8, !tbaa !5
  %67 = getelementptr inbounds %struct.su2_fuse_split_tree, ptr %66, i32 0, i32 2
  %68 = load i32, ptr %67, align 8, !tbaa !9
  %69 = icmp slt i32 %65, %68
  br i1 %69, label %71, label %70

70:                                               ; preds = %64
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  br label %115

71:                                               ; preds = %64
  %72 = load i32, ptr %10, align 4, !tbaa !16
  %73 = load i32, ptr %7, align 4, !tbaa !16
  %74 = icmp eq i32 %72, %73
  br i1 %74, label %75, label %92

75:                                               ; preds = %71
  %76 = load ptr, ptr %8, align 8, !tbaa !5
  %77 = load i32, ptr %10, align 4, !tbaa !16
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds i8, ptr %76, i64 %78
  %80 = load i8, ptr %79, align 1, !tbaa !17, !range !19, !noundef !20
  %81 = trunc i8 %80 to i1
  br i1 %81, label %82, label %90

82:                                               ; preds = %75
  %83 = load ptr, ptr %9, align 8, !tbaa !5
  %84 = load i32, ptr %10, align 4, !tbaa !16
  %85 = sext i32 %84 to i64
  %86 = getelementptr inbounds i8, ptr %83, i64 %85
  %87 = load i8, ptr %86, align 1, !tbaa !17, !range !19, !noundef !20
  %88 = trunc i8 %87 to i1
  br i1 %88, label %89, label %90

89:                                               ; preds = %82
  br label %91

90:                                               ; preds = %82, %75
  call void @__assert_fail(ptr noundef @.str.15, ptr noundef @.str.1, i32 noundef 772, ptr noundef @__PRETTY_FUNCTION__.su2_fuse_split_tree_enumerate_charge_sectors) #6
  unreachable

91:                                               ; preds = %89
  br label %111

92:                                               ; preds = %71
  %93 = load ptr, ptr %8, align 8, !tbaa !5
  %94 = load i32, ptr %10, align 4, !tbaa !16
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds i8, ptr %93, i64 %95
  %97 = load i8, ptr %96, align 1, !tbaa !17, !range !19, !noundef !20
  %98 = trunc i8 %97 to i1
  %99 = zext i1 %98 to i32
  %100 = load ptr, ptr %9, align 8, !tbaa !5
  %101 = load i32, ptr %10, align 4, !tbaa !16
  %102 = sext i32 %101 to i64
  %103 = getelementptr inbounds i8, ptr %100, i64 %102
  %104 = load i8, ptr %103, align 1, !tbaa !17, !range !19, !noundef !20
  %105 = trunc i8 %104 to i1
  %106 = zext i1 %105 to i32
  %107 = icmp ne i32 %99, %106
  br i1 %107, label %108, label %109

108:                                              ; preds = %92
  br label %110

109:                                              ; preds = %92
  call void @__assert_fail(ptr noundef @.str.16, ptr noundef @.str.1, i32 noundef 775, ptr noundef @__PRETTY_FUNCTION__.su2_fuse_split_tree_enumerate_charge_sectors) #6
  unreachable

110:                                              ; preds = %108
  br label %111

111:                                              ; preds = %110, %91
  br label %112

112:                                              ; preds = %111
  %113 = load i32, ptr %10, align 4, !tbaa !16
  %114 = add nsw i32 %113, 1
  store i32 %114, ptr %10, align 4, !tbaa !16
  br label %64, !llvm.loop !21

115:                                              ; preds = %70
  call void @llvm.lifetime.start.p0(i64 24, ptr %11) #7
  call void @llvm.lifetime.start.p0(i64 24, ptr %12) #7
  %116 = load ptr, ptr %4, align 8, !tbaa !5
  %117 = getelementptr inbounds %struct.su2_fuse_split_tree, ptr %116, i32 0, i32 0
  %118 = load ptr, ptr %117, align 8, !tbaa !12
  %119 = load ptr, ptr %4, align 8, !tbaa !5
  %120 = getelementptr inbounds %struct.su2_fuse_split_tree, ptr %119, i32 0, i32 2
  %121 = load i32, ptr %120, align 8, !tbaa !9
  %122 = load ptr, ptr %5, align 8, !tbaa !5
  call void @su2_tree_enumerate_charge_sectors(ptr noundef %118, i32 noundef %121, ptr noundef %122, ptr noundef %11)
  %123 = load ptr, ptr %4, align 8, !tbaa !5
  %124 = getelementptr inbounds %struct.su2_fuse_split_tree, ptr %123, i32 0, i32 1
  %125 = load ptr, ptr %124, align 8, !tbaa !15
  %126 = load ptr, ptr %4, align 8, !tbaa !5
  %127 = getelementptr inbounds %struct.su2_fuse_split_tree, ptr %126, i32 0, i32 2
  %128 = load i32, ptr %127, align 8, !tbaa !9
  %129 = load ptr, ptr %5, align 8, !tbaa !5
  call void @su2_tree_enumerate_charge_sectors(ptr noundef %125, i32 noundef %128, ptr noundef %129, ptr noundef %12)
  %130 = getelementptr inbounds %struct.charge_sectors, ptr %11, i32 0, i32 2
  %131 = load i32, ptr %130, align 8, !tbaa !23
  %132 = load ptr, ptr %4, align 8, !tbaa !5
  %133 = getelementptr inbounds %struct.su2_fuse_split_tree, ptr %132, i32 0, i32 2
  %134 = load i32, ptr %133, align 8, !tbaa !9
  %135 = icmp eq i32 %131, %134
  br i1 %135, label %136, label %137

136:                                              ; preds = %115
  br label %138

137:                                              ; preds = %115
  call void @__assert_fail(ptr noundef @.str.17, ptr noundef @.str.1, i32 noundef 783, ptr noundef @__PRETTY_FUNCTION__.su2_fuse_split_tree_enumerate_charge_sectors) #6
  unreachable

138:                                              ; preds = %136
  %139 = getelementptr inbounds %struct.charge_sectors, ptr %12, i32 0, i32 2
  %140 = load i32, ptr %139, align 8, !tbaa !23
  %141 = load ptr, ptr %4, align 8, !tbaa !5
  %142 = getelementptr inbounds %struct.su2_fuse_split_tree, ptr %141, i32 0, i32 2
  %143 = load i32, ptr %142, align 8, !tbaa !9
  %144 = icmp eq i32 %140, %143
  br i1 %144, label %145, label %146

145:                                              ; preds = %138
  br label %147

146:                                              ; preds = %138
  call void @__assert_fail(ptr noundef @.str.18, ptr noundef @.str.1, i32 noundef 784, ptr noundef @__PRETTY_FUNCTION__.su2_fuse_split_tree_enumerate_charge_sectors) #6
  unreachable

147:                                              ; preds = %145
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #7
  %148 = getelementptr inbounds %struct.charge_sectors, ptr %11, i32 0, i32 1
  %149 = load i64, ptr %148, align 8, !tbaa !26
  %150 = getelementptr inbounds %struct.charge_sectors, ptr %12, i32 0, i32 1
  %151 = load i64, ptr %150, align 8, !tbaa !26
  %152 = mul nsw i64 %149, %151
  %153 = mul i64 %152, 16
  %154 = call ptr @ct_malloc(i64 noundef %153)
  store ptr %154, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #7
  store i64 0, ptr %14, align 8, !tbaa !27
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #7
  store i64 0, ptr %15, align 8, !tbaa !27
  br label %155

155:                                              ; preds = %277, %147
  %156 = load i64, ptr %15, align 8, !tbaa !27
  %157 = getelementptr inbounds %struct.charge_sectors, ptr %11, i32 0, i32 1
  %158 = load i64, ptr %157, align 8, !tbaa !26
  %159 = icmp slt i64 %156, %158
  br i1 %159, label %161, label %160

160:                                              ; preds = %155
  store i32 5, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  br label %280

161:                                              ; preds = %155
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #7
  store i64 0, ptr %17, align 8, !tbaa !27
  br label %162

162:                                              ; preds = %273, %161
  %163 = load i64, ptr %17, align 8, !tbaa !27
  %164 = getelementptr inbounds %struct.charge_sectors, ptr %12, i32 0, i32 1
  %165 = load i64, ptr %164, align 8, !tbaa !26
  %166 = icmp slt i64 %163, %165
  br i1 %166, label %168, label %167

167:                                              ; preds = %162
  store i32 8, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  br label %276

168:                                              ; preds = %162
  %169 = getelementptr inbounds %struct.charge_sectors, ptr %11, i32 0, i32 0
  %170 = load ptr, ptr %169, align 8, !tbaa !28
  %171 = load i64, ptr %15, align 8, !tbaa !27
  %172 = load ptr, ptr %4, align 8, !tbaa !5
  %173 = getelementptr inbounds %struct.su2_fuse_split_tree, ptr %172, i32 0, i32 2
  %174 = load i32, ptr %173, align 8, !tbaa !9
  %175 = sext i32 %174 to i64
  %176 = mul nsw i64 %171, %175
  %177 = load i32, ptr %7, align 4, !tbaa !16
  %178 = sext i32 %177 to i64
  %179 = add nsw i64 %176, %178
  %180 = getelementptr inbounds i32, ptr %170, i64 %179
  %181 = load i32, ptr %180, align 4, !tbaa !16
  %182 = getelementptr inbounds %struct.charge_sectors, ptr %12, i32 0, i32 0
  %183 = load ptr, ptr %182, align 8, !tbaa !28
  %184 = load i64, ptr %17, align 8, !tbaa !27
  %185 = load ptr, ptr %4, align 8, !tbaa !5
  %186 = getelementptr inbounds %struct.su2_fuse_split_tree, ptr %185, i32 0, i32 2
  %187 = load i32, ptr %186, align 8, !tbaa !9
  %188 = sext i32 %187 to i64
  %189 = mul nsw i64 %184, %188
  %190 = load i32, ptr %7, align 4, !tbaa !16
  %191 = sext i32 %190 to i64
  %192 = add nsw i64 %189, %191
  %193 = getelementptr inbounds i32, ptr %183, i64 %192
  %194 = load i32, ptr %193, align 4, !tbaa !16
  %195 = icmp eq i32 %181, %194
  br i1 %195, label %196, label %272

196:                                              ; preds = %168
  %197 = load ptr, ptr %4, align 8, !tbaa !5
  %198 = getelementptr inbounds %struct.su2_fuse_split_tree, ptr %197, i32 0, i32 2
  %199 = load i32, ptr %198, align 8, !tbaa !9
  %200 = load ptr, ptr %13, align 8, !tbaa !5
  %201 = load i64, ptr %14, align 8, !tbaa !27
  %202 = getelementptr inbounds %struct.su2_irreducible_list, ptr %200, i64 %201
  %203 = getelementptr inbounds %struct.su2_irreducible_list, ptr %202, i32 0, i32 1
  store i32 %199, ptr %203, align 8, !tbaa !29
  %204 = load ptr, ptr %4, align 8, !tbaa !5
  %205 = getelementptr inbounds %struct.su2_fuse_split_tree, ptr %204, i32 0, i32 2
  %206 = load i32, ptr %205, align 8, !tbaa !9
  %207 = sext i32 %206 to i64
  %208 = mul i64 %207, 4
  %209 = call ptr @ct_malloc(i64 noundef %208)
  %210 = load ptr, ptr %13, align 8, !tbaa !5
  %211 = load i64, ptr %14, align 8, !tbaa !27
  %212 = getelementptr inbounds %struct.su2_irreducible_list, ptr %210, i64 %211
  %213 = getelementptr inbounds %struct.su2_irreducible_list, ptr %212, i32 0, i32 0
  store ptr %209, ptr %213, align 8, !tbaa !31
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #7
  store i32 0, ptr %18, align 4, !tbaa !16
  br label %214

214:                                              ; preds = %266, %196
  %215 = load i32, ptr %18, align 4, !tbaa !16
  %216 = load ptr, ptr %4, align 8, !tbaa !5
  %217 = getelementptr inbounds %struct.su2_fuse_split_tree, ptr %216, i32 0, i32 2
  %218 = load i32, ptr %217, align 8, !tbaa !9
  %219 = icmp slt i32 %215, %218
  br i1 %219, label %221, label %220

220:                                              ; preds = %214
  store i32 11, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #7
  br label %269

221:                                              ; preds = %214
  %222 = load ptr, ptr %8, align 8, !tbaa !5
  %223 = load i32, ptr %18, align 4, !tbaa !16
  %224 = sext i32 %223 to i64
  %225 = getelementptr inbounds i8, ptr %222, i64 %224
  %226 = load i8, ptr %225, align 1, !tbaa !17, !range !19, !noundef !20
  %227 = trunc i8 %226 to i1
  br i1 %227, label %228, label %242

228:                                              ; preds = %221
  %229 = getelementptr inbounds %struct.charge_sectors, ptr %11, i32 0, i32 0
  %230 = load ptr, ptr %229, align 8, !tbaa !28
  %231 = load i64, ptr %15, align 8, !tbaa !27
  %232 = load ptr, ptr %4, align 8, !tbaa !5
  %233 = getelementptr inbounds %struct.su2_fuse_split_tree, ptr %232, i32 0, i32 2
  %234 = load i32, ptr %233, align 8, !tbaa !9
  %235 = sext i32 %234 to i64
  %236 = mul nsw i64 %231, %235
  %237 = load i32, ptr %18, align 4, !tbaa !16
  %238 = sext i32 %237 to i64
  %239 = add nsw i64 %236, %238
  %240 = getelementptr inbounds i32, ptr %230, i64 %239
  %241 = load i32, ptr %240, align 4, !tbaa !16
  br label %256

242:                                              ; preds = %221
  %243 = getelementptr inbounds %struct.charge_sectors, ptr %12, i32 0, i32 0
  %244 = load ptr, ptr %243, align 8, !tbaa !28
  %245 = load i64, ptr %17, align 8, !tbaa !27
  %246 = load ptr, ptr %4, align 8, !tbaa !5
  %247 = getelementptr inbounds %struct.su2_fuse_split_tree, ptr %246, i32 0, i32 2
  %248 = load i32, ptr %247, align 8, !tbaa !9
  %249 = sext i32 %248 to i64
  %250 = mul nsw i64 %245, %249
  %251 = load i32, ptr %18, align 4, !tbaa !16
  %252 = sext i32 %251 to i64
  %253 = add nsw i64 %250, %252
  %254 = getelementptr inbounds i32, ptr %244, i64 %253
  %255 = load i32, ptr %254, align 4, !tbaa !16
  br label %256

256:                                              ; preds = %242, %228
  %257 = phi i32 [ %241, %228 ], [ %255, %242 ]
  %258 = load ptr, ptr %13, align 8, !tbaa !5
  %259 = load i64, ptr %14, align 8, !tbaa !27
  %260 = getelementptr inbounds %struct.su2_irreducible_list, ptr %258, i64 %259
  %261 = getelementptr inbounds %struct.su2_irreducible_list, ptr %260, i32 0, i32 0
  %262 = load ptr, ptr %261, align 8, !tbaa !31
  %263 = load i32, ptr %18, align 4, !tbaa !16
  %264 = sext i32 %263 to i64
  %265 = getelementptr inbounds i32, ptr %262, i64 %264
  store i32 %257, ptr %265, align 4, !tbaa !16
  br label %266

266:                                              ; preds = %256
  %267 = load i32, ptr %18, align 4, !tbaa !16
  %268 = add nsw i32 %267, 1
  store i32 %268, ptr %18, align 4, !tbaa !16
  br label %214, !llvm.loop !32

269:                                              ; preds = %220
  %270 = load i64, ptr %14, align 8, !tbaa !27
  %271 = add nsw i64 %270, 1
  store i64 %271, ptr %14, align 8, !tbaa !27
  br label %272

272:                                              ; preds = %269, %168
  br label %273

273:                                              ; preds = %272
  %274 = load i64, ptr %17, align 8, !tbaa !27
  %275 = add nsw i64 %274, 1
  store i64 %275, ptr %17, align 8, !tbaa !27
  br label %162, !llvm.loop !33

276:                                              ; preds = %167
  br label %277

277:                                              ; preds = %276
  %278 = load i64, ptr %15, align 8, !tbaa !27
  %279 = add nsw i64 %278, 1
  store i64 %279, ptr %15, align 8, !tbaa !27
  br label %155, !llvm.loop !34

280:                                              ; preds = %160
  %281 = load ptr, ptr %13, align 8, !tbaa !5
  %282 = load i64, ptr %14, align 8, !tbaa !27
  call void @qsort(ptr noundef %281, i64 noundef %282, i64 noundef 16, ptr noundef @compare_su2_irreducible_lists_wrapper)
  %283 = load i64, ptr %14, align 8, !tbaa !27
  %284 = load ptr, ptr %4, align 8, !tbaa !5
  %285 = getelementptr inbounds %struct.su2_fuse_split_tree, ptr %284, i32 0, i32 2
  %286 = load i32, ptr %285, align 8, !tbaa !9
  %287 = load ptr, ptr %6, align 8, !tbaa !5
  call void @allocate_charge_sectors(i64 noundef %283, i32 noundef %286, ptr noundef %287)
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #7
  store i64 0, ptr %19, align 8, !tbaa !27
  br label %288

288:                                              ; preds = %319, %280
  %289 = load i64, ptr %19, align 8, !tbaa !27
  %290 = load i64, ptr %14, align 8, !tbaa !27
  %291 = icmp slt i64 %289, %290
  br i1 %291, label %293, label %292

292:                                              ; preds = %288
  store i32 14, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #7
  br label %322

293:                                              ; preds = %288
  %294 = load ptr, ptr %6, align 8, !tbaa !5
  %295 = getelementptr inbounds %struct.charge_sectors, ptr %294, i32 0, i32 0
  %296 = load ptr, ptr %295, align 8, !tbaa !28
  %297 = load i64, ptr %19, align 8, !tbaa !27
  %298 = load ptr, ptr %4, align 8, !tbaa !5
  %299 = getelementptr inbounds %struct.su2_fuse_split_tree, ptr %298, i32 0, i32 2
  %300 = load i32, ptr %299, align 8, !tbaa !9
  %301 = sext i32 %300 to i64
  %302 = mul nsw i64 %297, %301
  %303 = getelementptr inbounds i32, ptr %296, i64 %302
  %304 = load ptr, ptr %13, align 8, !tbaa !5
  %305 = load i64, ptr %19, align 8, !tbaa !27
  %306 = getelementptr inbounds %struct.su2_irreducible_list, ptr %304, i64 %305
  %307 = getelementptr inbounds %struct.su2_irreducible_list, ptr %306, i32 0, i32 0
  %308 = load ptr, ptr %307, align 8, !tbaa !31
  %309 = load ptr, ptr %4, align 8, !tbaa !5
  %310 = getelementptr inbounds %struct.su2_fuse_split_tree, ptr %309, i32 0, i32 2
  %311 = load i32, ptr %310, align 8, !tbaa !9
  %312 = sext i32 %311 to i64
  %313 = mul i64 %312, 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %303, ptr align 4 %308, i64 %313, i1 false)
  %314 = load ptr, ptr %13, align 8, !tbaa !5
  %315 = load i64, ptr %19, align 8, !tbaa !27
  %316 = getelementptr inbounds %struct.su2_irreducible_list, ptr %314, i64 %315
  %317 = getelementptr inbounds %struct.su2_irreducible_list, ptr %316, i32 0, i32 0
  %318 = load ptr, ptr %317, align 8, !tbaa !31
  call void @ct_free(ptr noundef %318)
  br label %319

319:                                              ; preds = %293
  %320 = load i64, ptr %19, align 8, !tbaa !27
  %321 = add nsw i64 %320, 1
  store i64 %321, ptr %19, align 8, !tbaa !27
  br label %288, !llvm.loop !35

322:                                              ; preds = %292
  %323 = load ptr, ptr %13, align 8, !tbaa !5
  call void @ct_free(ptr noundef %323)
  %324 = load ptr, ptr %9, align 8, !tbaa !5
  call void @ct_free(ptr noundef %324)
  %325 = load ptr, ptr %8, align 8, !tbaa !5
  call void @ct_free(ptr noundef %325)
  call void @delete_charge_sectors(ptr noundef %12)
  call void @delete_charge_sectors(ptr noundef %11)
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  ret void
}

declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr noundef) #4

; Function Attrs: nounwind uwtable
declare hidden i32 @compare_su2_irreducible_lists_wrapper(ptr noundef, ptr noundef) #3

declare void @delete_charge_sectors(ptr noundef) #4

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 = { inlinehint 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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 = { "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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #6 = { noreturn nounwind }
attributes #7 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !11, i64 16}
!10 = !{!"su2_fuse_split_tree", !6, i64 0, !6, i64 8, !11, i64 16}
!11 = !{!"int", !7, i64 0}
!12 = !{!10, !6, i64 0}
!13 = !{!14, !11, i64 0}
!14 = !{!"su2_tree_node", !11, i64 0, !7, i64 8}
!15 = !{!10, !6, i64 8}
!16 = !{!11, !11, i64 0}
!17 = !{!18, !18, i64 0}
!18 = !{!"_Bool", !7, i64 0}
!19 = !{i8 0, i8 2}
!20 = !{}
!21 = distinct !{!21, !22}
!22 = !{!"llvm.loop.mustprogress"}
!23 = !{!24, !11, i64 16}
!24 = !{!"charge_sectors", !6, i64 0, !25, i64 8, !11, i64 16}
!25 = !{!"long", !7, i64 0}
!26 = !{!24, !25, i64 8}
!27 = !{!25, !25, i64 0}
!28 = !{!24, !6, i64 0}
!29 = !{!30, !11, i64 8}
!30 = !{!"su2_irreducible_list", !6, i64 0, !11, i64 8}
!31 = !{!30, !6, i64 0}
!32 = distinct !{!32, !22}
!33 = distinct !{!33, !22}
!34 = distinct !{!34, !22}
!35 = distinct !{!35, !22}


; 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.charge_sectors = type { ptr, i64, i32 }
%struct.su2_irreducible_list = type { ptr, i32 }

@.str.1 = external hidden unnamed_addr constant [73 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [48 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [15 x i8], align 1
@__PRETTY_FUNCTION__.su2_fuse_split_tree_enumerate_charge_sectors = external hidden unnamed_addr constant [148 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [33 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: inlinehint nounwind uwtable
declare hidden ptr @ct_malloc(i64 noundef) local_unnamed_addr #1

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

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

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

; Function Attrs: nounwind uwtable
declare dso_local void @su2_tree_axes_indicator(ptr noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
declare dso_local void @su2_tree_enumerate_charge_sectors(ptr noundef, i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: inlinehint nounwind uwtable
declare hidden ptr @ct_calloc(i64 noundef, i64 noundef) local_unnamed_addr #1

declare void @allocate_charge_sectors(i64 noundef, i32 noundef, ptr noundef) local_unnamed_addr #4

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #5

; Function Attrs: nounwind uwtable
define dso_local void @su2_fuse_split_tree_enumerate_charge_sectors(ptr nocapture noundef readonly %0, ptr noundef %1, ptr noundef %2) local_unnamed_addr #3 {
  %4 = alloca %struct.charge_sectors, align 8
  %5 = alloca %struct.charge_sectors, align 8
  %6 = getelementptr inbounds i8, ptr %0, i64 16
  %7 = load i32, ptr %6, align 8, !tbaa !5
  %8 = icmp sgt i32 %7, 0
  br i1 %8, label %10, label %9

9:                                                ; preds = %3
  tail call void @__assert_fail(ptr noundef nonnull @.str.14, ptr noundef nonnull @.str.1, i32 noundef 761, ptr noundef nonnull @__PRETTY_FUNCTION__.su2_fuse_split_tree_enumerate_charge_sectors) #7
  unreachable

10:                                               ; preds = %3
  %11 = load ptr, ptr %0, align 8, !tbaa !11
  %12 = load i32, ptr %11, align 8, !tbaa !12
  %13 = getelementptr inbounds i8, ptr %0, i64 8
  %14 = load ptr, ptr %13, align 8, !tbaa !14
  %15 = load i32, ptr %14, align 8, !tbaa !12
  %16 = icmp eq i32 %12, %15
  br i1 %16, label %18, label %17

17:                                               ; preds = %10
  tail call void @__assert_fail(ptr noundef nonnull @.str.13, ptr noundef nonnull @.str.1, i32 noundef 762, ptr noundef nonnull @__PRETTY_FUNCTION__.su2_fuse_split_tree_enumerate_charge_sectors) #7
  unreachable

18:                                               ; preds = %10
  %19 = zext nneg i32 %7 to i64
  %20 = tail call ptr @ct_calloc(i64 noundef %19, i64 noundef 1)
  %21 = load i32, ptr %6, align 8, !tbaa !5
  %22 = sext i32 %21 to i64
  %23 = tail call ptr @ct_calloc(i64 noundef %22, i64 noundef 1)
  %24 = load ptr, ptr %0, align 8, !tbaa !11
  tail call void @su2_tree_axes_indicator(ptr noundef %24, ptr noundef %20)
  %25 = load ptr, ptr %13, align 8, !tbaa !14
  tail call void @su2_tree_axes_indicator(ptr noundef %25, ptr noundef %23)
  %26 = load i32, ptr %6, align 8, !tbaa !5
  %27 = icmp sgt i32 %26, 0
  br i1 %27, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %18
  %28 = zext i32 %12 to i64
  %wide.trip.count = zext nneg i32 %26 to i64
  %29 = getelementptr inbounds i8, ptr %20, i64 %28
  %30 = getelementptr inbounds i8, ptr %23, i64 %28
  br label %.lr.ph

._crit_edge:                                      ; preds = %52, %18
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %4) #8
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %5) #8
  %31 = load ptr, ptr %0, align 8, !tbaa !11
  call void @su2_tree_enumerate_charge_sectors(ptr noundef %31, i32 noundef %26, ptr noundef %1, ptr noundef nonnull %4)
  %32 = load ptr, ptr %13, align 8, !tbaa !14
  %33 = load i32, ptr %6, align 8, !tbaa !5
  call void @su2_tree_enumerate_charge_sectors(ptr noundef %32, i32 noundef %33, ptr noundef %1, ptr noundef nonnull %5)
  %34 = getelementptr inbounds i8, ptr %4, i64 16
  %35 = load i32, ptr %34, align 8, !tbaa !15
  %36 = load i32, ptr %6, align 8, !tbaa !5
  %37 = icmp eq i32 %35, %36
  br i1 %37, label %54, label %53

.lr.ph:                                           ; preds = %.lr.ph.preheader, %52
  %indvars.iv = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next, %52 ]
  %38 = icmp eq i64 %indvars.iv, %28
  br i1 %38, label %39, label %46

39:                                               ; preds = %.lr.ph
  %40 = load i8, ptr %29, align 1, !tbaa !18, !range !20, !noundef !21
  %41 = trunc nuw i8 %40 to i1
  br i1 %41, label %42, label %45

42:                                               ; preds = %39
  %43 = load i8, ptr %30, align 1, !tbaa !18, !range !20, !noundef !21
  %44 = trunc nuw i8 %43 to i1
  br i1 %44, label %52, label %45

45:                                               ; preds = %42, %39
  tail call void @__assert_fail(ptr noundef nonnull @.str.15, ptr noundef nonnull @.str.1, i32 noundef 772, ptr noundef nonnull @__PRETTY_FUNCTION__.su2_fuse_split_tree_enumerate_charge_sectors) #7
  unreachable

46:                                               ; preds = %.lr.ph
  %47 = getelementptr inbounds i8, ptr %20, i64 %indvars.iv
  %48 = load i8, ptr %47, align 1, !tbaa !18, !range !20, !noundef !21
  %49 = getelementptr inbounds i8, ptr %23, i64 %indvars.iv
  %50 = load i8, ptr %49, align 1, !tbaa !18, !range !20, !noundef !21
  %.not = icmp eq i8 %48, %50
  br i1 %.not, label %51, label %52

51:                                               ; preds = %46
  tail call void @__assert_fail(ptr noundef nonnull @.str.16, ptr noundef nonnull @.str.1, i32 noundef 775, ptr noundef nonnull @__PRETTY_FUNCTION__.su2_fuse_split_tree_enumerate_charge_sectors) #7
  unreachable

52:                                               ; preds = %42, %46
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !22

53:                                               ; preds = %._crit_edge
  call void @__assert_fail(ptr noundef nonnull @.str.17, ptr noundef nonnull @.str.1, i32 noundef 783, ptr noundef nonnull @__PRETTY_FUNCTION__.su2_fuse_split_tree_enumerate_charge_sectors) #7
  unreachable

54:                                               ; preds = %._crit_edge
  %55 = getelementptr inbounds i8, ptr %5, i64 16
  %56 = load i32, ptr %55, align 8, !tbaa !15
  %57 = icmp eq i32 %56, %35
  br i1 %57, label %59, label %58

58:                                               ; preds = %54
  call void @__assert_fail(ptr noundef nonnull @.str.18, ptr noundef nonnull @.str.1, i32 noundef 784, ptr noundef nonnull @__PRETTY_FUNCTION__.su2_fuse_split_tree_enumerate_charge_sectors) #7
  unreachable

59:                                               ; preds = %54
  %60 = getelementptr inbounds i8, ptr %4, i64 8
  %61 = load i64, ptr %60, align 8, !tbaa !24
  %62 = getelementptr inbounds i8, ptr %5, i64 8
  %63 = load i64, ptr %62, align 8, !tbaa !24
  %64 = shl i64 %61, 4
  %65 = mul i64 %64, %63
  %66 = call ptr @ct_malloc(i64 noundef %65)
  %67 = load i64, ptr %60, align 8, !tbaa !24
  %68 = icmp sgt i64 %67, 0
  br i1 %68, label %.preheader.lr.ph, label %._crit_edge104

.preheader.lr.ph:                                 ; preds = %59
  %69 = sext i32 %12 to i64
  %70 = load i64, ptr %62, align 8, !tbaa !24
  %71 = icmp sgt i64 %70, 0
  br i1 %71, label %.preheader, label %._crit_edge104

.preheader:                                       ; preds = %.preheader.lr.ph, %._crit_edge100
  %72 = phi i64 [ %78, %._crit_edge100 ], [ %67, %.preheader.lr.ph ]
  %73 = phi i64 [ %79, %._crit_edge100 ], [ %70, %.preheader.lr.ph ]
  %74 = phi i64 [ %80, %._crit_edge100 ], [ %70, %.preheader.lr.ph ]
  %.082103 = phi i64 [ %81, %._crit_edge100 ], [ 0, %.preheader.lr.ph ]
  %.083102 = phi i64 [ %.1.lcssa, %._crit_edge100 ], [ 0, %.preheader.lr.ph ]
  %75 = icmp sgt i64 %74, 0
  br i1 %75, label %.lr.ph99.preheader, label %._crit_edge100

.lr.ph99.preheader:                               ; preds = %.preheader
  %.pre = load i32, ptr %6, align 8, !tbaa !5
  br label %.lr.ph99

._crit_edge104:                                   ; preds = %._crit_edge100, %.preheader.lr.ph, %59
  %.083.lcssa = phi i64 [ 0, %59 ], [ 0, %.preheader.lr.ph ], [ %.1.lcssa, %._crit_edge100 ]
  call void @qsort(ptr noundef %66, i64 noundef %.083.lcssa, i64 noundef 16, ptr noundef nonnull @compare_su2_irreducible_lists_wrapper) #8
  %76 = load i32, ptr %6, align 8, !tbaa !5
  call void @allocate_charge_sectors(i64 noundef %.083.lcssa, i32 noundef %76, ptr noundef %2) #8
  %77 = icmp sgt i64 %.083.lcssa, 0
  br i1 %77, label %.lr.ph108, label %._crit_edge109

._crit_edge100.loopexit:                          ; preds = %121
  %.pre117 = load i64, ptr %60, align 8, !tbaa !24
  br label %._crit_edge100

._crit_edge100:                                   ; preds = %._crit_edge100.loopexit, %.preheader
  %78 = phi i64 [ %72, %.preheader ], [ %.pre117, %._crit_edge100.loopexit ]
  %79 = phi i64 [ %73, %.preheader ], [ %122, %._crit_edge100.loopexit ]
  %80 = phi i64 [ %74, %.preheader ], [ %122, %._crit_edge100.loopexit ]
  %.1.lcssa = phi i64 [ %.083102, %.preheader ], [ %.2, %._crit_edge100.loopexit ]
  %81 = add nuw nsw i64 %.082103, 1
  %82 = icmp slt i64 %81, %78
  br i1 %82, label %.preheader, label %._crit_edge104, !llvm.loop !25

.lr.ph99:                                         ; preds = %.lr.ph99.preheader, %121
  %83 = phi i64 [ %122, %121 ], [ %73, %.lr.ph99.preheader ]
  %84 = phi i32 [ %123, %121 ], [ %.pre, %.lr.ph99.preheader ]
  %.08197 = phi i64 [ %124, %121 ], [ 0, %.lr.ph99.preheader ]
  %.196 = phi i64 [ %.2, %121 ], [ %.083102, %.lr.ph99.preheader ]
  %85 = load ptr, ptr %4, align 8, !tbaa !27
  %86 = sext i32 %84 to i64
  %87 = mul nsw i64 %.082103, %86
  %88 = getelementptr i32, ptr %85, i64 %87
  %89 = getelementptr i32, ptr %88, i64 %69
  %90 = load i32, ptr %89, align 4, !tbaa !28
  %91 = load ptr, ptr %5, align 8, !tbaa !27
  %92 = mul nsw i64 %.08197, %86
  %93 = getelementptr i32, ptr %91, i64 %92
  %94 = getelementptr i32, ptr %93, i64 %69
  %95 = load i32, ptr %94, align 4, !tbaa !28
  %96 = icmp eq i32 %90, %95
  br i1 %96, label %97, label %121

97:                                               ; preds = %.lr.ph99
  %98 = getelementptr inbounds %struct.su2_irreducible_list, ptr %66, i64 %.196
  %99 = getelementptr inbounds i8, ptr %98, i64 8
  store i32 %84, ptr %99, align 8, !tbaa !29
  %100 = shl nsw i64 %86, 2
  %101 = call ptr @ct_malloc(i64 noundef %100)
  store ptr %101, ptr %98, align 8, !tbaa !31
  %102 = load i32, ptr %6, align 8, !tbaa !5
  %103 = icmp sgt i32 %102, 0
  br i1 %103, label %.lr.ph94, label %._crit_edge95

.lr.ph94:                                         ; preds = %97
  %104 = load ptr, ptr %5, align 8
  %105 = load ptr, ptr %4, align 8
  br label %108

._crit_edge95:                                    ; preds = %108, %97
  %106 = phi i32 [ %102, %97 ], [ %118, %108 ]
  %107 = add nsw i64 %.196, 1
  %.pre116 = load i64, ptr %62, align 8, !tbaa !24
  br label %121

108:                                              ; preds = %.lr.ph94, %108
  %indvars.iv112 = phi i64 [ 0, %.lr.ph94 ], [ %indvars.iv.next113, %108 ]
  %109 = phi i32 [ %102, %.lr.ph94 ], [ %118, %108 ]
  %110 = getelementptr inbounds i8, ptr %20, i64 %indvars.iv112
  %111 = load i8, ptr %110, align 1, !tbaa !18, !range !20, !noundef !21
  %112 = trunc nuw i8 %111 to i1
  %113 = sext i32 %109 to i64
  %.082103..08197 = select i1 %112, i64 %.082103, i64 %.08197
  %. = select i1 %112, ptr %105, ptr %104
  %114 = mul nsw i64 %.082103..08197, %113
  %115 = getelementptr i32, ptr %., i64 %114
  %.in = getelementptr i32, ptr %115, i64 %indvars.iv112
  %116 = load i32, ptr %.in, align 4, !tbaa !28
  %117 = getelementptr inbounds i32, ptr %101, i64 %indvars.iv112
  store i32 %116, ptr %117, align 4, !tbaa !28
  %indvars.iv.next113 = add nuw nsw i64 %indvars.iv112, 1
  %118 = load i32, ptr %6, align 8, !tbaa !5
  %119 = sext i32 %118 to i64
  %120 = icmp slt i64 %indvars.iv.next113, %119
  br i1 %120, label %108, label %._crit_edge95, !llvm.loop !32

121:                                              ; preds = %.lr.ph99, %._crit_edge95
  %122 = phi i64 [ %.pre116, %._crit_edge95 ], [ %83, %.lr.ph99 ]
  %123 = phi i32 [ %106, %._crit_edge95 ], [ %84, %.lr.ph99 ]
  %.2 = phi i64 [ %107, %._crit_edge95 ], [ %.196, %.lr.ph99 ]
  %124 = add nuw nsw i64 %.08197, 1
  %125 = icmp slt i64 %124, %122
  br i1 %125, label %.lr.ph99, label %._crit_edge100.loopexit, !llvm.loop !33

._crit_edge109:                                   ; preds = %.lr.ph108, %._crit_edge104
  call void @ct_free(ptr noundef %66)
  call void @ct_free(ptr noundef %23)
  call void @ct_free(ptr noundef %20)
  call void @delete_charge_sectors(ptr noundef nonnull %5) #8
  call void @delete_charge_sectors(ptr noundef nonnull %4) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %4) #8
  ret void

.lr.ph108:                                        ; preds = %._crit_edge104, %.lr.ph108
  %.0106 = phi i64 [ %135, %.lr.ph108 ], [ 0, %._crit_edge104 ]
  %126 = load ptr, ptr %2, align 8, !tbaa !27
  %127 = load i32, ptr %6, align 8, !tbaa !5
  %128 = sext i32 %127 to i64
  %129 = mul nsw i64 %.0106, %128
  %130 = getelementptr inbounds i32, ptr %126, i64 %129
  %131 = getelementptr inbounds %struct.su2_irreducible_list, ptr %66, i64 %.0106
  %132 = load ptr, ptr %131, align 8, !tbaa !31
  %133 = shl nsw i64 %128, 2
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %130, ptr align 4 %132, i64 %133, i1 false)
  %134 = load ptr, ptr %131, align 8, !tbaa !31
  call void @ct_free(ptr noundef %134)
  %135 = add nuw nsw i64 %.0106, 1
  %exitcond115.not = icmp eq i64 %135, %.083.lcssa
  br i1 %exitcond115.not, label %._crit_edge109, label %.lr.ph108, !llvm.loop !34
}

; Function Attrs: nofree
declare void @qsort(ptr noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #6

; Function Attrs: nounwind uwtable
declare hidden i32 @compare_su2_irreducible_lists_wrapper(ptr noundef, ptr noundef) #3

declare void @delete_charge_sectors(ptr noundef) local_unnamed_addr #4

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 = { inlinehint 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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 = { "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 nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #6 = { nofree "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 #7 = { noreturn nounwind }
attributes #8 = { 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, !10, i64 16}
!6 = !{!"su2_fuse_split_tree", !7, i64 0, !7, i64 8, !10, i64 16}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!6, !7, i64 0}
!12 = !{!13, !10, i64 0}
!13 = !{!"su2_tree_node", !10, i64 0, !8, i64 8}
!14 = !{!6, !7, i64 8}
!15 = !{!16, !10, i64 16}
!16 = !{!"charge_sectors", !7, i64 0, !17, i64 8, !10, i64 16}
!17 = !{!"long", !8, i64 0}
!18 = !{!19, !19, i64 0}
!19 = !{!"_Bool", !8, i64 0}
!20 = !{i8 0, i8 2}
!21 = !{}
!22 = distinct !{!22, !23}
!23 = !{!"llvm.loop.mustprogress"}
!24 = !{!16, !17, i64 8}
!25 = distinct !{!25, !23, !26}
!26 = !{!"llvm.loop.unswitch.partial.disable"}
!27 = !{!16, !7, i64 0}
!28 = !{!10, !10, i64 0}
!29 = !{!30, !10, i64 8}
!30 = !{!"su2_irreducible_list", !7, i64 0, !10, i64 8}
!31 = !{!30, !7, i64 0}
!32 = distinct !{!32, !23}
!33 = distinct !{!33, !23}
!34 = distinct !{!34, !23}


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