; LLVM IR from facebookresearch/habitat-sim :: src/deps/basis-universal/encoder (basisu_etc)

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

%"class.basisu::vec" = type { [3 x float] }
%"class.basisu::etc1_optimizer" = type { ptr, ptr, i32, %"class.basisu::vec", i32, i32, i32, i32, %"class.basisu::vector", %"class.basisu::vector.3", %"class.basisu::vector.3", ptr, ptr, %"class.basisu::vector.5", %"class.basisu::vector.5", %"struct.basisu::etc1_optimizer::potential_solution", %"struct.basisu::etc1_optimizer::potential_solution", %"class.basisu::vector.5", [128 x i8] }
%"class.basisu::vector" = type { ptr, i32, i32 }
%"class.basisu::vector.3" = type { ptr, i32, i32 }
%"struct.basisu::etc1_optimizer::potential_solution" = type <{ %"struct.basisu::etc1_solution_coordinates", [4 x i8], %"class.basisu::vector.5", i64, i8, [7 x i8] }>
%"struct.basisu::etc1_solution_coordinates" = type <{ %"class.basisu::color_rgba", i32, i8, [3 x i8] }>
%"class.basisu::color_rgba" = type { %union.anon }
%union.anon = type { [4 x i8] }
%"class.basisu::vector.5" = type { ptr, i32, i32 }
%"struct.basisu::etc1_optimizer::params" = type { %"struct.basisu::basis_etc1_pack_params", i32, ptr, i8, ptr, i32, %"class.basisu::color_rgba", i8, i8, ptr }
%"struct.basisu::basis_etc1_pack_params" = type { i32, i8, i8, i8, i8, float }
%struct.anon = type { i8, i8, i8, i8 }

; 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: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN6basisu5clampIiEET_S1_S1_S1_(i32 noundef, i32 noundef, i32 noundef) #1

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZN6basisu3vecILj3EfEixEj(ptr noundef nonnull align 4 dereferenceable(12), i32 noundef) #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6basisu14etc1_optimizer4initERKNS0_6paramsERNS0_7resultsE(ptr noundef nonnull align 8 dereferenceable(384) %0, ptr noundef nonnull align 8 dereferenceable(64) %1, ptr noundef nonnull align 8 dereferenceable(33) %2) #2 align 2 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca %"class.basisu::vec", align 4
  %9 = alloca i32, align 4
  %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 ptr, align 8
  %17 = alloca %"class.basisu::vec", align 4
  %18 = alloca i32, align 4
  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
  %19 = load ptr, ptr %4, align 8
  %20 = load ptr, ptr %5, align 8, !tbaa !5
  %21 = getelementptr inbounds %"class.basisu::etc1_optimizer", ptr %19, i32 0, i32 0
  store ptr %20, ptr %21, align 8, !tbaa !9
  %22 = load ptr, ptr %6, align 8, !tbaa !5
  %23 = getelementptr inbounds %"class.basisu::etc1_optimizer", ptr %19, i32 0, i32 1
  store ptr %22, ptr %23, align 8, !tbaa !21
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  %24 = getelementptr inbounds %"class.basisu::etc1_optimizer", ptr %19, i32 0, i32 0
  %25 = load ptr, ptr %24, align 8, !tbaa !9
  %26 = getelementptr inbounds %"struct.basisu::etc1_optimizer::params", ptr %25, i32 0, i32 1
  %27 = load i32, ptr %26, align 4, !tbaa !22
  store i32 %27, ptr %7, align 4, !tbaa !27
  %28 = getelementptr inbounds %"class.basisu::etc1_optimizer", ptr %19, i32 0, i32 13
  %29 = load i32, ptr %7, align 4, !tbaa !27
  %30 = zext i32 %29 to i64
  call void @_ZN6basisu6vectorIhE6resizeEmb(ptr noundef nonnull align 8 dereferenceable(16) %28, i64 noundef %30, i1 noundef zeroext false)
  %31 = getelementptr inbounds %"class.basisu::etc1_optimizer", ptr %19, i32 0, i32 14
  %32 = load i32, ptr %7, align 4, !tbaa !27
  %33 = zext i32 %32 to i64
  call void @_ZN6basisu6vectorIhE6resizeEmb(ptr noundef nonnull align 8 dereferenceable(16) %31, i64 noundef %33, i1 noundef zeroext false)
  %34 = getelementptr inbounds %"class.basisu::etc1_optimizer", ptr %19, i32 0, i32 17
  %35 = load i32, ptr %7, align 4, !tbaa !27
  %36 = zext i32 %35 to i64
  call void @_ZN6basisu6vectorIhE6resizeEmb(ptr noundef nonnull align 8 dereferenceable(16) %34, i64 noundef %36, i1 noundef zeroext false)
  %37 = getelementptr inbounds %"class.basisu::etc1_optimizer", ptr %19, i32 0, i32 16
  %38 = getelementptr inbounds %"struct.basisu::etc1_optimizer::potential_solution", ptr %37, i32 0, i32 2
  %39 = load i32, ptr %7, align 4, !tbaa !27
  %40 = zext i32 %39 to i64
  call void @_ZN6basisu6vectorIhE6resizeEmb(ptr noundef nonnull align 8 dereferenceable(16) %38, i64 noundef %40, i1 noundef zeroext false)
  %41 = getelementptr inbounds %"class.basisu::etc1_optimizer", ptr %19, i32 0, i32 15
  %42 = getelementptr inbounds %"struct.basisu::etc1_optimizer::potential_solution", ptr %41, i32 0, i32 2
  %43 = load i32, ptr %7, align 4, !tbaa !27
  %44 = zext i32 %43 to i64
  call void @_ZN6basisu6vectorIhE6resizeEmb(ptr noundef nonnull align 8 dereferenceable(16) %42, i64 noundef %44, i1 noundef zeroext false)
  %45 = getelementptr inbounds %"class.basisu::etc1_optimizer", ptr %19, i32 0, i32 0
  %46 = load ptr, ptr %45, align 8, !tbaa !9
  %47 = getelementptr inbounds %"struct.basisu::etc1_optimizer::params", ptr %46, i32 0, i32 3
  %48 = load i8, ptr %47, align 8, !tbaa !28, !range !29, !noundef !30
  %49 = trunc i8 %48 to i1
  %50 = zext i1 %49 to i64
  %51 = select i1 %49, i32 15, i32 31
  %52 = getelementptr inbounds %"class.basisu::etc1_optimizer", ptr %19, i32 0, i32 2
  store i32 %51, ptr %52, align 8, !tbaa !31
  call void @llvm.lifetime.start.p0(i64 12, ptr %8) #4
  call void @_ZN6basisu3vecILj3EfEC2Ef(ptr noundef nonnull align 4 dereferenceable(12) %8, float noundef 0.000000e+00)
  %53 = getelementptr inbounds %"class.basisu::etc1_optimizer", ptr %19, i32 0, i32 8
  %54 = load i32, ptr %7, align 4, !tbaa !27
  %55 = zext i32 %54 to i64
  call void @_ZN6basisu6vectorItE6resizeEmb(ptr noundef nonnull align 8 dereferenceable(16) %53, i64 noundef %55, i1 noundef zeroext false)
  %56 = getelementptr inbounds %"class.basisu::etc1_optimizer", ptr %19, i32 0, i32 10
  %57 = load i32, ptr %7, align 4, !tbaa !27
  %58 = zext i32 %57 to i64
  call void @_ZN6basisu6vectorIjE6resizeEmb(ptr noundef nonnull align 8 dereferenceable(16) %56, i64 noundef %58, i1 noundef zeroext false)
  %59 = getelementptr inbounds %"class.basisu::etc1_optimizer", ptr %19, i32 0, i32 9
  %60 = load i32, ptr %7, align 4, !tbaa !27
  %61 = zext i32 %60 to i64
  call void @_ZN6basisu6vectorIjE6resizeEmb(ptr noundef nonnull align 8 dereferenceable(16) %59, i64 noundef %61, i1 noundef zeroext false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  store i32 255, ptr %9, align 4, !tbaa !27
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  store i32 255, ptr %10, align 4, !tbaa !27
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  store i32 255, ptr %11, align 4, !tbaa !27
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #4
  store i32 0, ptr %12, align 4, !tbaa !27
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #4
  store i32 0, ptr %13, align 4, !tbaa !27
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #4
  store i32 0, ptr %14, align 4, !tbaa !27
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #4
  store i32 0, ptr %15, align 4, !tbaa !27
  br label %62

62:                                               ; preds = %160, %3
  %63 = load i32, ptr %15, align 4, !tbaa !27
  %64 = load i32, ptr %7, align 4, !tbaa !27
  %65 = icmp ult i32 %63, %64
  br i1 %65, label %67, label %66

66:                                               ; preds = %62
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #4
  br label %163

67:                                               ; preds = %62
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #4
  %68 = getelementptr inbounds %"class.basisu::etc1_optimizer", ptr %19, i32 0, i32 0
  %69 = load ptr, ptr %68, align 8, !tbaa !9
  %70 = getelementptr inbounds %"struct.basisu::etc1_optimizer::params", ptr %69, i32 0, i32 2
  %71 = load ptr, ptr %70, align 8, !tbaa !32
  %72 = load i32, ptr %15, align 4, !tbaa !27
  %73 = zext i32 %72 to i64
  %74 = getelementptr inbounds %"class.basisu::color_rgba", ptr %71, i64 %73
  store ptr %74, ptr %16, align 8, !tbaa !5
  %75 = load i32, ptr %9, align 4, !tbaa !27
  %76 = load ptr, ptr %16, align 8, !tbaa !5
  %77 = getelementptr inbounds %"class.basisu::color_rgba", ptr %76, i32 0, i32 0
  %78 = getelementptr inbounds %struct.anon, ptr %77, i32 0, i32 0
  %79 = load i8, ptr %78, align 1, !tbaa !33
  %80 = zext i8 %79 to i32
  %81 = call noundef i32 @_ZN6basisu7minimumIiEET_S1_S1_(i32 noundef %75, i32 noundef %80)
  store i32 %81, ptr %9, align 4, !tbaa !27
  %82 = load i32, ptr %10, align 4, !tbaa !27
  %83 = load ptr, ptr %16, align 8, !tbaa !5
  %84 = getelementptr inbounds %"class.basisu::color_rgba", ptr %83, i32 0, i32 0
  %85 = getelementptr inbounds %struct.anon, ptr %84, i32 0, i32 1
  %86 = load i8, ptr %85, align 1, !tbaa !33
  %87 = zext i8 %86 to i32
  %88 = call noundef i32 @_ZN6basisu7minimumIiEET_S1_S1_(i32 noundef %82, i32 noundef %87)
  store i32 %88, ptr %10, align 4, !tbaa !27
  %89 = load i32, ptr %11, align 4, !tbaa !27
  %90 = load ptr, ptr %16, align 8, !tbaa !5
  %91 = getelementptr inbounds %"class.basisu::color_rgba", ptr %90, i32 0, i32 0
  %92 = getelementptr inbounds %struct.anon, ptr %91, i32 0, i32 2
  %93 = load i8, ptr %92, align 1, !tbaa !33
  %94 = zext i8 %93 to i32
  %95 = call noundef i32 @_ZN6basisu7minimumIiEET_S1_S1_(i32 noundef %89, i32 noundef %94)
  store i32 %95, ptr %11, align 4, !tbaa !27
  %96 = load i32, ptr %12, align 4, !tbaa !27
  %97 = load ptr, ptr %16, align 8, !tbaa !5
  %98 = getelementptr inbounds %"class.basisu::color_rgba", ptr %97, i32 0, i32 0
  %99 = getelementptr inbounds %struct.anon, ptr %98, i32 0, i32 0
  %100 = load i8, ptr %99, align 1, !tbaa !33
  %101 = zext i8 %100 to i32
  %102 = call noundef i32 @_ZN6basisu7maximumIiEET_S1_S1_(i32 noundef %96, i32 noundef %101)
  store i32 %102, ptr %12, align 4, !tbaa !27
  %103 = load i32, ptr %13, align 4, !tbaa !27
  %104 = load ptr, ptr %16, align 8, !tbaa !5
  %105 = getelementptr inbounds %"class.basisu::color_rgba", ptr %104, i32 0, i32 0
  %106 = getelementptr inbounds %struct.anon, ptr %105, i32 0, i32 1
  %107 = load i8, ptr %106, align 1, !tbaa !33
  %108 = zext i8 %107 to i32
  %109 = call noundef i32 @_ZN6basisu7maximumIiEET_S1_S1_(i32 noundef %103, i32 noundef %108)
  store i32 %109, ptr %13, align 4, !tbaa !27
  %110 = load i32, ptr %14, align 4, !tbaa !27
  %111 = load ptr, ptr %16, align 8, !tbaa !5
  %112 = getelementptr inbounds %"class.basisu::color_rgba", ptr %111, i32 0, i32 0
  %113 = getelementptr inbounds %struct.anon, ptr %112, i32 0, i32 2
  %114 = load i8, ptr %113, align 1, !tbaa !33
  %115 = zext i8 %114 to i32
  %116 = call noundef i32 @_ZN6basisu7maximumIiEET_S1_S1_(i32 noundef %110, i32 noundef %115)
  store i32 %116, ptr %14, align 4, !tbaa !27
  call void @llvm.lifetime.start.p0(i64 12, ptr %17) #4
  %117 = load ptr, ptr %16, align 8, !tbaa !5
  %118 = getelementptr inbounds %"class.basisu::color_rgba", ptr %117, i32 0, i32 0
  %119 = getelementptr inbounds %struct.anon, ptr %118, i32 0, i32 0
  %120 = load i8, ptr %119, align 1, !tbaa !33
  %121 = uitofp i8 %120 to float
  %122 = load ptr, ptr %16, align 8, !tbaa !5
  %123 = getelementptr inbounds %"class.basisu::color_rgba", ptr %122, i32 0, i32 0
  %124 = getelementptr inbounds %struct.anon, ptr %123, i32 0, i32 1
  %125 = load i8, ptr %124, align 1, !tbaa !33
  %126 = uitofp i8 %125 to float
  %127 = load ptr, ptr %16, align 8, !tbaa !5
  %128 = getelementptr inbounds %"class.basisu::color_rgba", ptr %127, i32 0, i32 0
  %129 = getelementptr inbounds %struct.anon, ptr %128, i32 0, i32 2
  %130 = load i8, ptr %129, align 1, !tbaa !33
  %131 = uitofp i8 %130 to float
  call void @_ZN6basisu3vecILj3EfEC2Efff(ptr noundef nonnull align 4 dereferenceable(12) %17, float noundef %121, float noundef %126, float noundef %131)
  %132 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN6basisu3vecILj3EfEpLERKS1_(ptr noundef nonnull align 4 dereferenceable(12) %8, ptr noundef nonnull align 4 dereferenceable(12) %17)
  %133 = load ptr, ptr %16, align 8, !tbaa !5
  %134 = getelementptr inbounds %"class.basisu::color_rgba", ptr %133, i32 0, i32 0
  %135 = getelementptr inbounds %struct.anon, ptr %134, i32 0, i32 0
  %136 = load i8, ptr %135, align 1, !tbaa !33
  %137 = zext i8 %136 to i32
  %138 = load ptr, ptr %16, align 8, !tbaa !5
  %139 = getelementptr inbounds %"class.basisu::color_rgba", ptr %138, i32 0, i32 0
  %140 = getelementptr inbounds %struct.anon, ptr %139, i32 0, i32 1
  %141 = load i8, ptr %140, align 1, !tbaa !33
  %142 = zext i8 %141 to i32
  %143 = add nsw i32 %137, %142
  %144 = load ptr, ptr %16, align 8, !tbaa !5
  %145 = getelementptr inbounds %"class.basisu::color_rgba", ptr %144, i32 0, i32 0
  %146 = getelementptr inbounds %struct.anon, ptr %145, i32 0, i32 2
  %147 = load i8, ptr %146, align 1, !tbaa !33
  %148 = zext i8 %147 to i32
  %149 = add nsw i32 %143, %148
  %150 = trunc i32 %149 to i16
  %151 = getelementptr inbounds %"class.basisu::etc1_optimizer", ptr %19, i32 0, i32 8
  %152 = load i32, ptr %15, align 4, !tbaa !27
  %153 = zext i32 %152 to i64
  %154 = call noundef nonnull align 2 dereferenceable(2) ptr @_ZN6basisu6vectorItEixEm(ptr noundef nonnull align 8 dereferenceable(16) %151, i64 noundef %153)
  store i16 %150, ptr %154, align 2, !tbaa !34
  %155 = load i32, ptr %15, align 4, !tbaa !27
  %156 = getelementptr inbounds %"class.basisu::etc1_optimizer", ptr %19, i32 0, i32 10
  %157 = load i32, ptr %15, align 4, !tbaa !27
  %158 = zext i32 %157 to i64
  %159 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN6basisu6vectorIjEixEm(ptr noundef nonnull align 8 dereferenceable(16) %156, i64 noundef %158)
  store i32 %155, ptr %159, align 4, !tbaa !27
  call void @llvm.lifetime.end.p0(i64 12, ptr %17) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #4
  br label %160

160:                                              ; preds = %67
  %161 = load i32, ptr %15, align 4, !tbaa !27
  %162 = add i32 %161, 1
  store i32 %162, ptr %15, align 4, !tbaa !27
  br label %62, !llvm.loop !36

163:                                              ; preds = %66
  %164 = load i32, ptr %7, align 4, !tbaa !27
  %165 = uitofp i32 %164 to float
  %166 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN6basisu3vecILj3EfEdVEf(ptr noundef nonnull align 4 dereferenceable(12) %8, float noundef %165)
  %167 = getelementptr inbounds %"class.basisu::etc1_optimizer", ptr %19, i32 0, i32 3
  %168 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN6basisu3vecILj3EfEaSERKS1_(ptr noundef nonnull align 4 dereferenceable(12) %167, ptr noundef nonnull align 4 dereferenceable(12) %8)
  %169 = load i32, ptr %12, align 4, !tbaa !27
  %170 = load i32, ptr %9, align 4, !tbaa !27
  %171 = sub nsw i32 %169, %170
  %172 = load i32, ptr %13, align 4, !tbaa !27
  %173 = load i32, ptr %10, align 4, !tbaa !27
  %174 = sub nsw i32 %172, %173
  %175 = call noundef i32 @_ZN6basisu7maximumIiEET_S1_S1_(i32 noundef %171, i32 noundef %174)
  %176 = load i32, ptr %14, align 4, !tbaa !27
  %177 = load i32, ptr %11, align 4, !tbaa !27
  %178 = sub nsw i32 %176, %177
  %179 = call noundef i32 @_ZN6basisu7maximumIiEET_S1_S1_(i32 noundef %175, i32 noundef %178)
  %180 = getelementptr inbounds %"class.basisu::etc1_optimizer", ptr %19, i32 0, i32 7
  store i32 %179, ptr %180, align 4, !tbaa !38
  %181 = getelementptr inbounds %"class.basisu::etc1_optimizer", ptr %19, i32 0, i32 3
  %182 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN6basisu3vecILj3EfEixEj(ptr noundef nonnull align 4 dereferenceable(12) %181, i32 noundef 0)
  %183 = load float, ptr %182, align 4, !tbaa !39
  %184 = getelementptr inbounds %"class.basisu::etc1_optimizer", ptr %19, i32 0, i32 2
  %185 = load i32, ptr %184, align 8, !tbaa !31
  %186 = sitofp i32 %185 to float
  %187 = fmul float %183, %186
  %188 = fdiv float %187, 2.550000e+02
  %189 = fadd float %188, 5.000000e-01
  %190 = fptoui float %189 to i32
  %191 = getelementptr inbounds %"class.basisu::etc1_optimizer", ptr %19, i32 0, i32 2
  %192 = load i32, ptr %191, align 8, !tbaa !31
  %193 = call noundef i32 @_ZN6basisu5clampIiEET_S1_S1_S1_(i32 noundef %190, i32 noundef 0, i32 noundef %192)
  %194 = getelementptr inbounds %"class.basisu::etc1_optimizer", ptr %19, i32 0, i32 4
  store i32 %193, ptr %194, align 8, !tbaa !40
  %195 = getelementptr inbounds %"class.basisu::etc1_optimizer", ptr %19, i32 0, i32 3
  %196 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN6basisu3vecILj3EfEixEj(ptr noundef nonnull align 4 dereferenceable(12) %195, i32 noundef 1)
  %197 = load float, ptr %196, align 4, !tbaa !39
  %198 = getelementptr inbounds %"class.basisu::etc1_optimizer", ptr %19, i32 0, i32 2
  %199 = load i32, ptr %198, align 8, !tbaa !31
  %200 = sitofp i32 %199 to float
  %201 = fmul float %197, %200
  %202 = fdiv float %201, 2.550000e+02
  %203 = fadd float %202, 5.000000e-01
  %204 = fptoui float %203 to i32
  %205 = getelementptr inbounds %"class.basisu::etc1_optimizer", ptr %19, i32 0, i32 2
  %206 = load i32, ptr %205, align 8, !tbaa !31
  %207 = call noundef i32 @_ZN6basisu5clampIiEET_S1_S1_S1_(i32 noundef %204, i32 noundef 0, i32 noundef %206)
  %208 = getelementptr inbounds %"class.basisu::etc1_optimizer", ptr %19, i32 0, i32 5
  store i32 %207, ptr %208, align 4, !tbaa !41
  %209 = getelementptr inbounds %"class.basisu::etc1_optimizer", ptr %19, i32 0, i32 3
  %210 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN6basisu3vecILj3EfEixEj(ptr noundef nonnull align 4 dereferenceable(12) %209, i32 noundef 2)
  %211 = load float, ptr %210, align 4, !tbaa !39
  %212 = getelementptr inbounds %"class.basisu::etc1_optimizer", ptr %19, i32 0, i32 2
  %213 = load i32, ptr %212, align 8, !tbaa !31
  %214 = sitofp i32 %213 to float
  %215 = fmul float %211, %214
  %216 = fdiv float %215, 2.550000e+02
  %217 = fadd float %216, 5.000000e-01
  %218 = fptoui float %217 to i32
  %219 = getelementptr inbounds %"class.basisu::etc1_optimizer", ptr %19, i32 0, i32 2
  %220 = load i32, ptr %219, align 8, !tbaa !31
  %221 = call noundef i32 @_ZN6basisu5clampIiEET_S1_S1_S1_(i32 noundef %218, i32 noundef 0, i32 noundef %220)
  %222 = getelementptr inbounds %"class.basisu::etc1_optimizer", ptr %19, i32 0, i32 6
  store i32 %221, ptr %222, align 8, !tbaa !42
  %223 = getelementptr inbounds %"class.basisu::etc1_optimizer", ptr %19, i32 0, i32 0
  %224 = load ptr, ptr %223, align 8, !tbaa !9
  %225 = getelementptr inbounds %"struct.basisu::basis_etc1_pack_params", ptr %224, i32 0, i32 0
  %226 = load i32, ptr %225, align 8, !tbaa !43
  %227 = icmp eq i32 %226, 0
  br i1 %227, label %228, label %266

228:                                              ; preds = %163
  %229 = load i32, ptr %7, align 4, !tbaa !27
  %230 = getelementptr inbounds %"class.basisu::etc1_optimizer", ptr %19, i32 0, i32 10
  %231 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN6basisu6vectorIjEixEm(ptr noundef nonnull align 8 dereferenceable(16) %230, i64 noundef 0)
  %232 = getelementptr inbounds %"class.basisu::etc1_optimizer", ptr %19, i32 0, i32 8
  %233 = call noundef nonnull align 2 dereferenceable(2) ptr @_ZN6basisu6vectorItEixEm(ptr noundef nonnull align 8 dereferenceable(16) %232, i64 noundef 0)
  call void @_ZN6basisu13indirect_sortItEEvjPjPKT_(i32 noundef %229, ptr noundef %231, ptr noundef %233)
  %234 = getelementptr inbounds %"class.basisu::etc1_optimizer", ptr %19, i32 0, i32 9
  %235 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN6basisu6vectorIjEixEm(ptr noundef nonnull align 8 dereferenceable(16) %234, i64 noundef 0)
  %236 = getelementptr inbounds %"class.basisu::etc1_optimizer", ptr %19, i32 0, i32 12
  store ptr %235, ptr %236, align 8, !tbaa !44
  %237 = getelementptr inbounds %"class.basisu::etc1_optimizer", ptr %19, i32 0, i32 10
  %238 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN6basisu6vectorIjEixEm(ptr noundef nonnull align 8 dereferenceable(16) %237, i64 noundef 0)
  %239 = getelementptr inbounds %"class.basisu::etc1_optimizer", ptr %19, i32 0, i32 11
  store ptr %238, ptr %239, align 8, !tbaa !45
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #4
  store i32 0, ptr %18, align 4, !tbaa !27
  br label %240

240:                                              ; preds = %262, %228
  %241 = load i32, ptr %18, align 4, !tbaa !27
  %242 = load i32, ptr %7, align 4, !tbaa !27
  %243 = icmp ult i32 %241, %242
  br i1 %243, label %245, label %244

244:                                              ; preds = %240
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #4
  br label %265

245:                                              ; preds = %240
  %246 = getelementptr inbounds %"class.basisu::etc1_optimizer", ptr %19, i32 0, i32 8
  %247 = getelementptr inbounds %"class.basisu::etc1_optimizer", ptr %19, i32 0, i32 11
  %248 = load ptr, ptr %247, align 8, !tbaa !45
  %249 = load i32, ptr %18, align 4, !tbaa !27
  %250 = zext i32 %249 to i64
  %251 = getelementptr inbounds i32, ptr %248, i64 %250
  %252 = load i32, ptr %251, align 4, !tbaa !27
  %253 = zext i32 %252 to i64
  %254 = call noundef nonnull align 2 dereferenceable(2) ptr @_ZN6basisu6vectorItEixEm(ptr noundef nonnull align 8 dereferenceable(16) %246, i64 noundef %253)
  %255 = load i16, ptr %254, align 2, !tbaa !34
  %256 = zext i16 %255 to i32
  %257 = getelementptr inbounds %"class.basisu::etc1_optimizer", ptr %19, i32 0, i32 12
  %258 = load ptr, ptr %257, align 8, !tbaa !44
  %259 = load i32, ptr %18, align 4, !tbaa !27
  %260 = zext i32 %259 to i64
  %261 = getelementptr inbounds i32, ptr %258, i64 %260
  store i32 %256, ptr %261, align 4, !tbaa !27
  br label %262

262:                                              ; preds = %245
  %263 = load i32, ptr %18, align 4, !tbaa !27
  %264 = add i32 %263, 1
  store i32 %264, ptr %18, align 4, !tbaa !27
  br label %240, !llvm.loop !46

265:                                              ; preds = %244
  br label %266

266:                                              ; preds = %265, %163
  %267 = getelementptr inbounds %"class.basisu::etc1_optimizer", ptr %19, i32 0, i32 15
  %268 = getelementptr inbounds %"struct.basisu::etc1_optimizer::potential_solution", ptr %267, i32 0, i32 0
  call void @_ZN6basisu25etc1_solution_coordinates5clearEv(ptr noundef nonnull align 4 dereferenceable(9) %268)
  %269 = getelementptr inbounds %"class.basisu::etc1_optimizer", ptr %19, i32 0, i32 15
  %270 = getelementptr inbounds %"struct.basisu::etc1_optimizer::potential_solution", ptr %269, i32 0, i32 4
  store i8 0, ptr %270, align 8, !tbaa !47
  %271 = getelementptr inbounds %"class.basisu::etc1_optimizer", ptr %19, i32 0, i32 15
  %272 = getelementptr inbounds %"struct.basisu::etc1_optimizer::potential_solution", ptr %271, i32 0, i32 3
  store i64 -1, ptr %272, align 8, !tbaa !48
  %273 = getelementptr inbounds %"class.basisu::etc1_optimizer", ptr %19, i32 0, i32 18
  call void @_ZN6basisu9clear_objIA128_hEEvRT_(ptr noundef nonnull align 1 dereferenceable(128) %273)
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  call void @llvm.lifetime.end.p0(i64 12, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  ret void
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN6basisu6vectorIhE6resizeEmb(ptr noundef nonnull align 8 dereferenceable(16), i64 noundef, i1 noundef zeroext) #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN6basisu3vecILj3EfEC2Ef(ptr noundef nonnull align 4 dereferenceable(12), float noundef) unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN6basisu6vectorItE6resizeEmb(ptr noundef nonnull align 8 dereferenceable(16), i64 noundef, i1 noundef zeroext) #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN6basisu6vectorIjE6resizeEmb(ptr noundef nonnull align 8 dereferenceable(16), i64 noundef, i1 noundef zeroext) #3 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN6basisu7minimumIiEET_S1_S1_(i32 noundef, i32 noundef) #1

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN6basisu7maximumIiEET_S1_S1_(i32 noundef, i32 noundef) #1

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN6basisu3vecILj3EfEC2Efff(ptr noundef nonnull align 4 dereferenceable(12), float noundef, float noundef, float noundef) unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(12) ptr @_ZN6basisu3vecILj3EfEpLERKS1_(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 2 dereferenceable(2) ptr @_ZN6basisu6vectorItEixEm(ptr noundef nonnull align 8 dereferenceable(16), i64 noundef) #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZN6basisu6vectorIjEixEm(ptr noundef nonnull align 8 dereferenceable(16), i64 noundef) #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(12) ptr @_ZN6basisu3vecILj3EfEdVEf(ptr noundef nonnull align 4 dereferenceable(12), float noundef) #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(12) ptr @_ZN6basisu3vecILj3EfEaSERKS1_(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN6basisu13indirect_sortItEEvjPjPKT_(i32 noundef, ptr noundef, ptr noundef) #3

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN6basisu25etc1_solution_coordinates5clearEv(ptr noundef nonnull align 4 dereferenceable(9)) #3 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN6basisu9clear_objIA128_hEEvRT_(ptr noundef nonnull align 1 dereferenceable(128)) #1

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !6, i64 0}
!10 = !{!"_ZTSN6basisu14etc1_optimizerE", !6, i64 0, !6, i64 8, !11, i64 16, !12, i64 20, !11, i64 32, !11, i64 36, !11, i64 40, !11, i64 44, !13, i64 48, !14, i64 64, !14, i64 80, !6, i64 96, !6, i64 104, !15, i64 112, !15, i64 128, !16, i64 144, !16, i64 192, !15, i64 240, !7, i64 256}
!11 = !{!"int", !7, i64 0}
!12 = !{!"_ZTSN6basisu3vecILj3EfEE", !7, i64 0}
!13 = !{!"_ZTSN6basisu6vectorItEE", !6, i64 0, !11, i64 8, !11, i64 12}
!14 = !{!"_ZTSN6basisu6vectorIjEE", !6, i64 0, !11, i64 8, !11, i64 12}
!15 = !{!"_ZTSN6basisu6vectorIhEE", !6, i64 0, !11, i64 8, !11, i64 12}
!16 = !{!"_ZTSN6basisu14etc1_optimizer18potential_solutionE", !17, i64 0, !15, i64 16, !20, i64 32, !19, i64 40}
!17 = !{!"_ZTSN6basisu25etc1_solution_coordinatesE", !18, i64 0, !11, i64 4, !19, i64 8}
!18 = !{!"_ZTSN6basisu10color_rgbaE", !7, i64 0}
!19 = !{!"bool", !7, i64 0}
!20 = !{!"long", !7, i64 0}
!21 = !{!10, !6, i64 8}
!22 = !{!23, !11, i64 12}
!23 = !{!"_ZTSN6basisu14etc1_optimizer6paramsE", !24, i64 0, !11, i64 12, !6, i64 16, !19, i64 24, !6, i64 32, !11, i64 40, !18, i64 44, !19, i64 48, !19, i64 49, !6, i64 56}
!24 = !{!"_ZTSN6basisu22basis_etc1_pack_paramsE", !25, i64 0, !19, i64 4, !19, i64 5, !19, i64 6, !19, i64 7, !26, i64 8}
!25 = !{!"_ZTSN6basisu17basis_etc_qualityE", !7, i64 0}
!26 = !{!"float", !7, i64 0}
!27 = !{!11, !11, i64 0}
!28 = !{!23, !19, i64 24}
!29 = !{i8 0, i8 2}
!30 = !{}
!31 = !{!10, !11, i64 16}
!32 = !{!23, !6, i64 16}
!33 = !{!7, !7, i64 0}
!34 = !{!35, !35, i64 0}
!35 = !{!"short", !7, i64 0}
!36 = distinct !{!36, !37}
!37 = !{!"llvm.loop.mustprogress"}
!38 = !{!10, !11, i64 44}
!39 = !{!26, !26, i64 0}
!40 = !{!10, !11, i64 32}
!41 = !{!10, !11, i64 36}
!42 = !{!10, !11, i64 40}
!43 = !{!24, !25, i64 0}
!44 = !{!10, !6, i64 104}
!45 = !{!10, !6, i64 96}
!46 = distinct !{!46, !37}
!47 = !{!10, !19, i64 184}
!48 = !{!10, !20, i64 176}


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

%"class.basisu::vec" = type { [3 x float] }
%"class.basisu::color_rgba" = type { %union.anon }
%union.anon = type { [4 x i8] }

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN6basisu5clampIiEET_S1_S1_S1_(i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZN6basisu3vecILj3EfEixEj(ptr noundef nonnull align 4 dereferenceable(12), i32 noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6basisu14etc1_optimizer4initERKNS0_6paramsERNS0_7resultsE(ptr noundef nonnull align 8 dereferenceable(384) %0, ptr noundef nonnull align 8 dereferenceable(64) %1, ptr noundef nonnull align 8 dereferenceable(33) %2) local_unnamed_addr #2 align 2 {
  %4 = alloca %"class.basisu::vec", align 4
  %5 = alloca %"class.basisu::vec", align 4
  store ptr %1, ptr %0, align 8, !tbaa !5
  %6 = getelementptr inbounds i8, ptr %0, i64 8
  store ptr %2, ptr %6, align 8, !tbaa !20
  %7 = getelementptr inbounds i8, ptr %1, i64 12
  %8 = load i32, ptr %7, align 4, !tbaa !21
  %9 = getelementptr inbounds i8, ptr %0, i64 112
  %10 = zext i32 %8 to i64
  tail call void @_ZN6basisu6vectorIhE6resizeEmb(ptr noundef nonnull align 8 dereferenceable(16) %9, i64 noundef %10, i1 noundef zeroext false)
  %11 = getelementptr inbounds i8, ptr %0, i64 128
  tail call void @_ZN6basisu6vectorIhE6resizeEmb(ptr noundef nonnull align 8 dereferenceable(16) %11, i64 noundef %10, i1 noundef zeroext false)
  %12 = getelementptr inbounds i8, ptr %0, i64 240
  tail call void @_ZN6basisu6vectorIhE6resizeEmb(ptr noundef nonnull align 8 dereferenceable(16) %12, i64 noundef %10, i1 noundef zeroext false)
  %13 = getelementptr inbounds i8, ptr %0, i64 208
  tail call void @_ZN6basisu6vectorIhE6resizeEmb(ptr noundef nonnull align 8 dereferenceable(16) %13, i64 noundef %10, i1 noundef zeroext false)
  %14 = getelementptr inbounds i8, ptr %0, i64 160
  tail call void @_ZN6basisu6vectorIhE6resizeEmb(ptr noundef nonnull align 8 dereferenceable(16) %14, i64 noundef %10, i1 noundef zeroext false)
  %15 = load ptr, ptr %0, align 8, !tbaa !5
  %16 = getelementptr inbounds i8, ptr %15, i64 24
  %17 = load i8, ptr %16, align 8, !tbaa !26, !range !27, !noundef !28
  %18 = trunc nuw i8 %17 to i1
  %19 = select i1 %18, i32 15, i32 31
  %20 = getelementptr inbounds i8, ptr %0, i64 16
  store i32 %19, ptr %20, align 8, !tbaa !29
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %4) #4
  call void @_ZN6basisu3vecILj3EfEC2Ef(ptr noundef nonnull align 4 dereferenceable(12) %4, float noundef 0.000000e+00)
  %21 = getelementptr inbounds i8, ptr %0, i64 48
  call void @_ZN6basisu6vectorItE6resizeEmb(ptr noundef nonnull align 8 dereferenceable(16) %21, i64 noundef %10, i1 noundef zeroext false)
  %22 = getelementptr inbounds i8, ptr %0, i64 80
  call void @_ZN6basisu6vectorIjE6resizeEmb(ptr noundef nonnull align 8 dereferenceable(16) %22, i64 noundef %10, i1 noundef zeroext false)
  %23 = getelementptr inbounds i8, ptr %0, i64 64
  call void @_ZN6basisu6vectorIjE6resizeEmb(ptr noundef nonnull align 8 dereferenceable(16) %23, i64 noundef %10, i1 noundef zeroext false)
  %.not = icmp eq i32 %8, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %.lr.ph, %3
  %.054.lcssa = phi i32 [ 255, %3 ], [ %77, %.lr.ph ]
  %.053.lcssa = phi i32 [ 255, %3 ], [ %81, %.lr.ph ]
  %.052.lcssa = phi i32 [ 0, %3 ], [ %84, %.lr.ph ]
  %.051.lcssa = phi i32 [ 0, %3 ], [ %87, %.lr.ph ]
  %.050.lcssa = phi i32 [ 0, %3 ], [ %90, %.lr.ph ]
  %.048.lcssa = phi i32 [ 255, %3 ], [ %73, %.lr.ph ]
  %24 = uitofp i32 %8 to float
  %25 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN6basisu3vecILj3EfEdVEf(ptr noundef nonnull align 4 dereferenceable(12) %4, float noundef %24)
  %26 = getelementptr inbounds i8, ptr %0, i64 20
  %27 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN6basisu3vecILj3EfEaSERKS1_(ptr noundef nonnull align 4 dereferenceable(12) %26, ptr noundef nonnull align 4 dereferenceable(12) %4)
  %28 = sub nsw i32 %.052.lcssa, %.048.lcssa
  %29 = sub nsw i32 %.051.lcssa, %.054.lcssa
  %30 = call noundef i32 @_ZN6basisu7maximumIiEET_S1_S1_(i32 noundef %28, i32 noundef %29)
  %31 = sub nsw i32 %.050.lcssa, %.053.lcssa
  %32 = call noundef i32 @_ZN6basisu7maximumIiEET_S1_S1_(i32 noundef %30, i32 noundef %31)
  %33 = getelementptr inbounds i8, ptr %0, i64 44
  store i32 %32, ptr %33, align 4, !tbaa !30
  %34 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN6basisu3vecILj3EfEixEj(ptr noundef nonnull align 4 dereferenceable(12) %26, i32 noundef 0)
  %35 = load float, ptr %34, align 4, !tbaa !31
  %36 = load i32, ptr %20, align 8, !tbaa !29
  %37 = sitofp i32 %36 to float
  %38 = fmul float %35, %37
  %39 = fdiv float %38, 2.550000e+02
  %40 = fadd float %39, 5.000000e-01
  %41 = fptoui float %40 to i32
  %42 = call noundef i32 @_ZN6basisu5clampIiEET_S1_S1_S1_(i32 noundef %41, i32 noundef 0, i32 noundef %36)
  %43 = getelementptr inbounds i8, ptr %0, i64 32
  store i32 %42, ptr %43, align 8, !tbaa !32
  %44 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN6basisu3vecILj3EfEixEj(ptr noundef nonnull align 4 dereferenceable(12) %26, i32 noundef 1)
  %45 = load float, ptr %44, align 4, !tbaa !31
  %46 = load i32, ptr %20, align 8, !tbaa !29
  %47 = sitofp i32 %46 to float
  %48 = fmul float %45, %47
  %49 = fdiv float %48, 2.550000e+02
  %50 = fadd float %49, 5.000000e-01
  %51 = fptoui float %50 to i32
  %52 = call noundef i32 @_ZN6basisu5clampIiEET_S1_S1_S1_(i32 noundef %51, i32 noundef 0, i32 noundef %46)
  %53 = getelementptr inbounds i8, ptr %0, i64 36
  store i32 %52, ptr %53, align 4, !tbaa !33
  %54 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN6basisu3vecILj3EfEixEj(ptr noundef nonnull align 4 dereferenceable(12) %26, i32 noundef 2)
  %55 = load float, ptr %54, align 4, !tbaa !31
  %56 = load i32, ptr %20, align 8, !tbaa !29
  %57 = sitofp i32 %56 to float
  %58 = fmul float %55, %57
  %59 = fdiv float %58, 2.550000e+02
  %60 = fadd float %59, 5.000000e-01
  %61 = fptoui float %60 to i32
  %62 = call noundef i32 @_ZN6basisu5clampIiEET_S1_S1_S1_(i32 noundef %61, i32 noundef 0, i32 noundef %56)
  %63 = getelementptr inbounds i8, ptr %0, i64 40
  store i32 %62, ptr %63, align 8, !tbaa !34
  %64 = load ptr, ptr %0, align 8, !tbaa !5
  %65 = load i32, ptr %64, align 8, !tbaa !35
  %66 = icmp eq i32 %65, 0
  br i1 %66, label %109, label %.loopexit

.lr.ph:                                           ; preds = %3, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %3 ]
  %.04862 = phi i32 [ %73, %.lr.ph ], [ 255, %3 ]
  %.05060 = phi i32 [ %90, %.lr.ph ], [ 0, %3 ]
  %.05159 = phi i32 [ %87, %.lr.ph ], [ 0, %3 ]
  %.05258 = phi i32 [ %84, %.lr.ph ], [ 0, %3 ]
  %.05357 = phi i32 [ %81, %.lr.ph ], [ 255, %3 ]
  %.05456 = phi i32 [ %77, %.lr.ph ], [ 255, %3 ]
  %67 = load ptr, ptr %0, align 8, !tbaa !5
  %68 = getelementptr inbounds i8, ptr %67, i64 16
  %69 = load ptr, ptr %68, align 8, !tbaa !36
  %70 = getelementptr inbounds %"class.basisu::color_rgba", ptr %69, i64 %indvars.iv
  %71 = load i8, ptr %70, align 1, !tbaa !37
  %72 = zext i8 %71 to i32
  %73 = call noundef i32 @_ZN6basisu7minimumIiEET_S1_S1_(i32 noundef %.04862, i32 noundef %72)
  %74 = getelementptr inbounds i8, ptr %70, i64 1
  %75 = load i8, ptr %74, align 1, !tbaa !37
  %76 = zext i8 %75 to i32
  %77 = call noundef i32 @_ZN6basisu7minimumIiEET_S1_S1_(i32 noundef %.05456, i32 noundef %76)
  %78 = getelementptr inbounds i8, ptr %70, i64 2
  %79 = load i8, ptr %78, align 1, !tbaa !37
  %80 = zext i8 %79 to i32
  %81 = call noundef i32 @_ZN6basisu7minimumIiEET_S1_S1_(i32 noundef %.05357, i32 noundef %80)
  %82 = load i8, ptr %70, align 1, !tbaa !37
  %83 = zext i8 %82 to i32
  %84 = call noundef i32 @_ZN6basisu7maximumIiEET_S1_S1_(i32 noundef %.05258, i32 noundef %83)
  %85 = load i8, ptr %74, align 1, !tbaa !37
  %86 = zext i8 %85 to i32
  %87 = call noundef i32 @_ZN6basisu7maximumIiEET_S1_S1_(i32 noundef %.05159, i32 noundef %86)
  %88 = load i8, ptr %78, align 1, !tbaa !37
  %89 = zext i8 %88 to i32
  %90 = call noundef i32 @_ZN6basisu7maximumIiEET_S1_S1_(i32 noundef %.05060, i32 noundef %89)
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %5) #4
  %91 = load i8, ptr %70, align 1, !tbaa !37
  %92 = uitofp i8 %91 to float
  %93 = load i8, ptr %74, align 1, !tbaa !37
  %94 = uitofp i8 %93 to float
  %95 = load i8, ptr %78, align 1, !tbaa !37
  %96 = uitofp i8 %95 to float
  call void @_ZN6basisu3vecILj3EfEC2Efff(ptr noundef nonnull align 4 dereferenceable(12) %5, float noundef %92, float noundef %94, float noundef %96)
  %97 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZN6basisu3vecILj3EfEpLERKS1_(ptr noundef nonnull align 4 dereferenceable(12) %4, ptr noundef nonnull align 4 dereferenceable(12) %5)
  %98 = load i8, ptr %70, align 1, !tbaa !37
  %99 = zext i8 %98 to i16
  %100 = load i8, ptr %74, align 1, !tbaa !37
  %101 = zext i8 %100 to i16
  %102 = add nuw nsw i16 %101, %99
  %103 = load i8, ptr %78, align 1, !tbaa !37
  %104 = zext i8 %103 to i16
  %105 = add nuw nsw i16 %102, %104
  %106 = call noundef nonnull align 2 dereferenceable(2) ptr @_ZN6basisu6vectorItEixEm(ptr noundef nonnull align 8 dereferenceable(16) %21, i64 noundef %indvars.iv)
  store i16 %105, ptr %106, align 2, !tbaa !38
  %107 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN6basisu6vectorIjEixEm(ptr noundef nonnull align 8 dereferenceable(16) %22, i64 noundef %indvars.iv)
  %108 = trunc nuw i64 %indvars.iv to i32
  store i32 %108, ptr %107, align 4, !tbaa !40
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %5) #4
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %10
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !41

109:                                              ; preds = %._crit_edge
  %110 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN6basisu6vectorIjEixEm(ptr noundef nonnull align 8 dereferenceable(16) %22, i64 noundef 0)
  %111 = call noundef nonnull align 2 dereferenceable(2) ptr @_ZN6basisu6vectorItEixEm(ptr noundef nonnull align 8 dereferenceable(16) %21, i64 noundef 0)
  call void @_ZN6basisu13indirect_sortItEEvjPjPKT_(i32 noundef %8, ptr noundef nonnull %110, ptr noundef nonnull %111)
  %112 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN6basisu6vectorIjEixEm(ptr noundef nonnull align 8 dereferenceable(16) %23, i64 noundef 0)
  %113 = getelementptr inbounds i8, ptr %0, i64 104
  store ptr %112, ptr %113, align 8, !tbaa !43
  %114 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN6basisu6vectorIjEixEm(ptr noundef nonnull align 8 dereferenceable(16) %22, i64 noundef 0)
  %115 = getelementptr inbounds i8, ptr %0, i64 96
  store ptr %114, ptr %115, align 8, !tbaa !44
  br i1 %.not, label %.loopexit, label %.lr.ph70

.lr.ph70:                                         ; preds = %109, %.lr.ph70
  %indvars.iv78 = phi i64 [ %indvars.iv.next79, %.lr.ph70 ], [ 0, %109 ]
  %116 = load ptr, ptr %115, align 8, !tbaa !44
  %117 = getelementptr inbounds i32, ptr %116, i64 %indvars.iv78
  %118 = load i32, ptr %117, align 4, !tbaa !40
  %119 = zext i32 %118 to i64
  %120 = call noundef nonnull align 2 dereferenceable(2) ptr @_ZN6basisu6vectorItEixEm(ptr noundef nonnull align 8 dereferenceable(16) %21, i64 noundef %119)
  %121 = load i16, ptr %120, align 2, !tbaa !38
  %122 = zext i16 %121 to i32
  %123 = load ptr, ptr %113, align 8, !tbaa !43
  %124 = getelementptr inbounds i32, ptr %123, i64 %indvars.iv78
  store i32 %122, ptr %124, align 4, !tbaa !40
  %indvars.iv.next79 = add nuw nsw i64 %indvars.iv78, 1
  %exitcond82.not = icmp eq i64 %indvars.iv.next79, %10
  br i1 %exitcond82.not, label %.loopexit, label %.lr.ph70, !llvm.loop !45

.loopexit:                                        ; preds = %.lr.ph70, %109, %._crit_edge
  %125 = getelementptr inbounds i8, ptr %0, i64 144
  call void @_ZN6basisu25etc1_solution_coordinates5clearEv(ptr noundef nonnull align 4 dereferenceable(9) %125)
  %126 = getelementptr inbounds i8, ptr %0, i64 184
  store i8 0, ptr %126, align 8, !tbaa !46
  %127 = getelementptr inbounds i8, ptr %0, i64 176
  store i64 -1, ptr %127, align 8, !tbaa !47
  %128 = getelementptr inbounds i8, ptr %0, i64 256
  call void @_ZN6basisu9clear_objIA128_hEEvRT_(ptr noundef nonnull align 1 dereferenceable(128) %128)
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %4) #4
  ret void
}

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN6basisu3vecILj3EfEC2Ef(ptr noundef nonnull align 4 dereferenceable(12), float noundef) unnamed_addr #3 align 2

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN6basisu7minimumIiEET_S1_S1_(i32 noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN6basisu7maximumIiEET_S1_S1_(i32 noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN6basisu3vecILj3EfEC2Efff(ptr noundef nonnull align 4 dereferenceable(12), float noundef, float noundef, float noundef) unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(12) ptr @_ZN6basisu3vecILj3EfEpLERKS1_(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #1 align 2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZN6basisu6vectorIjEixEm(ptr noundef nonnull align 8 dereferenceable(16), i64 noundef) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(12) ptr @_ZN6basisu3vecILj3EfEdVEf(ptr noundef nonnull align 4 dereferenceable(12), float noundef) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(12) ptr @_ZN6basisu3vecILj3EfEaSERKS1_(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN6basisu13indirect_sortItEEvjPjPKT_(i32 noundef, ptr noundef, ptr noundef) local_unnamed_addr #3

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN6basisu25etc1_solution_coordinates5clearEv(ptr noundef nonnull align 4 dereferenceable(9)) local_unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN6basisu9clear_objIA128_hEEvRT_(ptr noundef nonnull align 1 dereferenceable(128)) local_unnamed_addr #1

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !7, i64 0}
!6 = !{!"_ZTSN6basisu14etc1_optimizerE", !7, i64 0, !7, i64 8, !10, i64 16, !11, i64 20, !10, i64 32, !10, i64 36, !10, i64 40, !10, i64 44, !12, i64 48, !13, i64 64, !13, i64 80, !7, i64 96, !7, i64 104, !14, i64 112, !14, i64 128, !15, i64 144, !15, i64 192, !14, i64 240, !8, i64 256}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!"_ZTSN6basisu3vecILj3EfEE", !8, i64 0}
!12 = !{!"_ZTSN6basisu6vectorItEE", !7, i64 0, !10, i64 8, !10, i64 12}
!13 = !{!"_ZTSN6basisu6vectorIjEE", !7, i64 0, !10, i64 8, !10, i64 12}
!14 = !{!"_ZTSN6basisu6vectorIhEE", !7, i64 0, !10, i64 8, !10, i64 12}
!15 = !{!"_ZTSN6basisu14etc1_optimizer18potential_solutionE", !16, i64 0, !14, i64 16, !19, i64 32, !18, i64 40}
!16 = !{!"_ZTSN6basisu25etc1_solution_coordinatesE", !17, i64 0, !10, i64 4, !18, i64 8}
!17 = !{!"_ZTSN6basisu10color_rgbaE", !8, i64 0}
!18 = !{!"bool", !8, i64 0}
!19 = !{!"long", !8, i64 0}
!20 = !{!6, !7, i64 8}
!21 = !{!22, !10, i64 12}
!22 = !{!"_ZTSN6basisu14etc1_optimizer6paramsE", !23, i64 0, !10, i64 12, !7, i64 16, !18, i64 24, !7, i64 32, !10, i64 40, !17, i64 44, !18, i64 48, !18, i64 49, !7, i64 56}
!23 = !{!"_ZTSN6basisu22basis_etc1_pack_paramsE", !24, i64 0, !18, i64 4, !18, i64 5, !18, i64 6, !18, i64 7, !25, i64 8}
!24 = !{!"_ZTSN6basisu17basis_etc_qualityE", !8, i64 0}
!25 = !{!"float", !8, i64 0}
!26 = !{!22, !18, i64 24}
!27 = !{i8 0, i8 2}
!28 = !{}
!29 = !{!6, !10, i64 16}
!30 = !{!6, !10, i64 44}
!31 = !{!25, !25, i64 0}
!32 = !{!6, !10, i64 32}
!33 = !{!6, !10, i64 36}
!34 = !{!6, !10, i64 40}
!35 = !{!23, !24, i64 0}
!36 = !{!22, !7, i64 16}
!37 = !{!8, !8, i64 0}
!38 = !{!39, !39, i64 0}
!39 = !{!"short", !8, i64 0}
!40 = !{!10, !10, i64 0}
!41 = distinct !{!41, !42}
!42 = !{!"llvm.loop.mustprogress"}
!43 = !{!6, !7, i64 104}
!44 = !{!6, !7, i64 96}
!45 = distinct !{!45, !42}
!46 = !{!6, !18, i64 184}
!47 = !{!6, !19, i64 176}


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