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

; 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.basisu::resample_filter" = type { ptr, ptr, float }
%"class.basisu::Resampler" = type <{ i32, i32, i32, i32, i32, i32, i32, [4 x i8], ptr, ptr, ptr, ptr, i8, i8, i8, [5 x i8], ptr, ptr, ptr, i32, i32, i32, float, float, [4 x i8] }>
%"struct.basisu::Resampler::Contrib_List" = type { i16, ptr }
%"struct.basisu::Resampler::Contrib" = type { float, i16 }
%"struct.basisu::Resampler::Scan_Buf" = type { [16384 x i32], [16384 x ptr] }

@.str.1 = external hidden unnamed_addr constant [116 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [10 x i8], align 1
@__PRETTY_FUNCTION__._ZN6basisu9ResamplerC2EiiiiNS0_11Boundary_OpEffPKcPNS0_12Contrib_ListES5_ffff = external hidden unnamed_addr constant [198 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [9 x i8], align 1
@_ZN6basisu22g_num_resample_filtersE = external constant i32, align 4
@_ZN6basisu18g_resample_filtersE = external global [0 x %"struct.basisu::resample_filter"], align 8

; 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: mustprogress uwtable
declare dso_local noundef ptr @_ZN6basisu9Resampler10make_clistEiiNS0_11Boundary_OpEPFffEfff(i32 noundef, i32 noundef, i32 noundef, ptr noundef, float noundef, float noundef, float noundef) #1 align 2

; Function Attrs: nounwind allocsize(0,1)
declare noalias ptr @calloc(i64 noundef, i64 noundef) #2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef i32 @_ZN6basisuL21resampler_range_checkEii(i32 noundef, i32 noundef) #4

; Function Attrs: nounwind allocsize(0)
declare noalias ptr @malloc(i64 noundef) #5

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6basisu9ResamplerC2EiiiiNS0_11Boundary_OpEffPKcPNS0_12Contrib_ListES5_ffff(ptr noundef nonnull align 8 dereferenceable(116) %0, i32 noundef %1, i32 noundef %2, i32 noundef %3, i32 noundef %4, i32 noundef %5, float noundef %6, float noundef %7, ptr noundef %8, ptr noundef %9, ptr noundef %10, float noundef %11, float noundef %12, float noundef %13, float noundef %14) unnamed_addr #1 align 2 {
  %16 = alloca ptr, align 8
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca float, align 4
  %23 = alloca float, align 4
  %24 = alloca ptr, align 8
  %25 = alloca ptr, align 8
  %26 = alloca ptr, align 8
  %27 = alloca float, align 4
  %28 = alloca float, align 4
  %29 = alloca float, align 4
  %30 = alloca float, align 4
  %31 = alloca i32, align 4
  %32 = alloca i32, align 4
  %33 = alloca float, align 4
  %34 = alloca ptr, align 8
  %35 = alloca i32, align 4
  %36 = alloca i32, align 4
  %37 = alloca i32, align 4
  %38 = alloca i32, align 4
  %39 = alloca i32, align 4
  store ptr %0, ptr %16, align 8, !tbaa !5
  store i32 %1, ptr %17, align 4, !tbaa !9
  store i32 %2, ptr %18, align 4, !tbaa !9
  store i32 %3, ptr %19, align 4, !tbaa !9
  store i32 %4, ptr %20, align 4, !tbaa !9
  store i32 %5, ptr %21, align 4, !tbaa !11
  store float %6, ptr %22, align 4, !tbaa !13
  store float %7, ptr %23, align 4, !tbaa !13
  store ptr %8, ptr %24, align 8, !tbaa !5
  store ptr %9, ptr %25, align 8, !tbaa !5
  store ptr %10, ptr %26, align 8, !tbaa !5
  store float %11, ptr %27, align 4, !tbaa !13
  store float %12, ptr %28, align 4, !tbaa !13
  store float %13, ptr %29, align 4, !tbaa !13
  store float %14, ptr %30, align 4, !tbaa !13
  %40 = load ptr, ptr %16, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %31) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %32) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %33) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %34) #7
  %41 = load i32, ptr %17, align 4, !tbaa !9
  %42 = icmp sgt i32 %41, 0
  br i1 %42, label %43, label %44

43:                                               ; preds = %15
  br label %46

44:                                               ; preds = %15
  call void @__assert_fail(ptr noundef @.str.10, ptr noundef @.str.1, i32 noundef 652, ptr noundef @__PRETTY_FUNCTION__._ZN6basisu9ResamplerC2EiiiiNS0_11Boundary_OpEffPKcPNS0_12Contrib_ListES5_ffff) #8
  unreachable

45:                                               ; No predecessors!
  br label %46

46:                                               ; preds = %45, %43
  %47 = load i32, ptr %18, align 4, !tbaa !9
  %48 = icmp sgt i32 %47, 0
  br i1 %48, label %49, label %50

49:                                               ; preds = %46
  br label %52

50:                                               ; preds = %46
  call void @__assert_fail(ptr noundef @.str.11, ptr noundef @.str.1, i32 noundef 653, ptr noundef @__PRETTY_FUNCTION__._ZN6basisu9ResamplerC2EiiiiNS0_11Boundary_OpEffPKcPNS0_12Contrib_ListES5_ffff) #8
  unreachable

51:                                               ; No predecessors!
  br label %52

52:                                               ; preds = %51, %49
  %53 = load i32, ptr %19, align 4, !tbaa !9
  %54 = icmp sgt i32 %53, 0
  br i1 %54, label %55, label %56

55:                                               ; preds = %52
  br label %58

56:                                               ; preds = %52
  call void @__assert_fail(ptr noundef @.str.12, ptr noundef @.str.1, i32 noundef 654, ptr noundef @__PRETTY_FUNCTION__._ZN6basisu9ResamplerC2EiiiiNS0_11Boundary_OpEffPKcPNS0_12Contrib_ListES5_ffff) #8
  unreachable

57:                                               ; No predecessors!
  br label %58

58:                                               ; preds = %57, %55
  %59 = load i32, ptr %20, align 4, !tbaa !9
  %60 = icmp sgt i32 %59, 0
  br i1 %60, label %61, label %62

61:                                               ; preds = %58
  br label %64

62:                                               ; preds = %58
  call void @__assert_fail(ptr noundef @.str.13, ptr noundef @.str.1, i32 noundef 655, ptr noundef @__PRETTY_FUNCTION__._ZN6basisu9ResamplerC2EiiiiNS0_11Boundary_OpEffPKcPNS0_12Contrib_ListES5_ffff) #8
  unreachable

63:                                               ; No predecessors!
  br label %64

64:                                               ; preds = %63, %61
  %65 = load float, ptr %22, align 4, !tbaa !13
  %66 = getelementptr inbounds %"class.basisu::Resampler", ptr %40, i32 0, i32 22
  store float %65, ptr %66, align 4, !tbaa !15
  %67 = load float, ptr %23, align 4, !tbaa !13
  %68 = getelementptr inbounds %"class.basisu::Resampler", ptr %40, i32 0, i32 23
  store float %67, ptr %68, align 8, !tbaa !19
  %69 = getelementptr inbounds %"class.basisu::Resampler", ptr %40, i32 0, i32 14
  store i8 0, ptr %69, align 2, !tbaa !20
  %70 = getelementptr inbounds %"class.basisu::Resampler", ptr %40, i32 0, i32 1
  store i32 0, ptr %70, align 4, !tbaa !21
  %71 = getelementptr inbounds %"class.basisu::Resampler", ptr %40, i32 0, i32 8
  store ptr null, ptr %71, align 8, !tbaa !22
  %72 = getelementptr inbounds %"class.basisu::Resampler", ptr %40, i32 0, i32 9
  store ptr null, ptr %72, align 8, !tbaa !23
  %73 = getelementptr inbounds %"class.basisu::Resampler", ptr %40, i32 0, i32 12
  store i8 0, ptr %73, align 8, !tbaa !24
  %74 = getelementptr inbounds %"class.basisu::Resampler", ptr %40, i32 0, i32 10
  store ptr null, ptr %74, align 8, !tbaa !25
  %75 = getelementptr inbounds %"class.basisu::Resampler", ptr %40, i32 0, i32 13
  store i8 0, ptr %75, align 1, !tbaa !26
  %76 = getelementptr inbounds %"class.basisu::Resampler", ptr %40, i32 0, i32 11
  store ptr null, ptr %76, align 8, !tbaa !27
  %77 = getelementptr inbounds %"class.basisu::Resampler", ptr %40, i32 0, i32 16
  store ptr null, ptr %77, align 8, !tbaa !28
  %78 = getelementptr inbounds %"class.basisu::Resampler", ptr %40, i32 0, i32 17
  store ptr null, ptr %78, align 8, !tbaa !29
  %79 = getelementptr inbounds %"class.basisu::Resampler", ptr %40, i32 0, i32 18
  store ptr null, ptr %79, align 8, !tbaa !30
  %80 = getelementptr inbounds %"class.basisu::Resampler", ptr %40, i32 0, i32 21
  store i32 0, ptr %80, align 8, !tbaa !31
  %81 = load i32, ptr %17, align 4, !tbaa !9
  %82 = getelementptr inbounds %"class.basisu::Resampler", ptr %40, i32 0, i32 2
  store i32 %81, ptr %82, align 8, !tbaa !32
  %83 = load i32, ptr %18, align 4, !tbaa !9
  %84 = getelementptr inbounds %"class.basisu::Resampler", ptr %40, i32 0, i32 3
  store i32 %83, ptr %84, align 4, !tbaa !33
  %85 = load i32, ptr %19, align 4, !tbaa !9
  %86 = getelementptr inbounds %"class.basisu::Resampler", ptr %40, i32 0, i32 4
  store i32 %85, ptr %86, align 8, !tbaa !34
  %87 = load i32, ptr %20, align 4, !tbaa !9
  %88 = getelementptr inbounds %"class.basisu::Resampler", ptr %40, i32 0, i32 5
  store i32 %87, ptr %88, align 4, !tbaa !35
  %89 = load i32, ptr %21, align 4, !tbaa !11
  %90 = getelementptr inbounds %"class.basisu::Resampler", ptr %40, i32 0, i32 6
  store i32 %89, ptr %90, align 8, !tbaa !36
  %91 = getelementptr inbounds %"class.basisu::Resampler", ptr %40, i32 0, i32 4
  %92 = load i32, ptr %91, align 8, !tbaa !34
  %93 = sext i32 %92 to i64
  %94 = mul i64 %93, 4
  %95 = call noalias ptr @malloc(i64 noundef %94) #9
  %96 = getelementptr inbounds %"class.basisu::Resampler", ptr %40, i32 0, i32 8
  store ptr %95, ptr %96, align 8, !tbaa !22
  %97 = icmp eq ptr %95, null
  br i1 %97, label %98, label %100

98:                                               ; preds = %64
  %99 = getelementptr inbounds %"class.basisu::Resampler", ptr %40, i32 0, i32 21
  store i32 1, ptr %99, align 8, !tbaa !31
  store i32 1, ptr %35, align 4
  br label %357

100:                                              ; preds = %64
  %101 = load ptr, ptr %24, align 8, !tbaa !5
  %102 = icmp eq ptr %101, null
  br i1 %102, label %103, label %104

103:                                              ; preds = %100
  store ptr @.str.14, ptr %24, align 8, !tbaa !5
  br label %104

104:                                              ; preds = %103, %100
  store i32 0, ptr %31, align 4, !tbaa !9
  br label %105

105:                                              ; preds = %120, %104
  %106 = load i32, ptr %31, align 4, !tbaa !9
  %107 = load i32, ptr @_ZN6basisu22g_num_resample_filtersE, align 4, !tbaa !9
  %108 = icmp slt i32 %106, %107
  br i1 %108, label %109, label %123

109:                                              ; preds = %105
  %110 = load ptr, ptr %24, align 8, !tbaa !5
  %111 = load i32, ptr %31, align 4, !tbaa !9
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds [0 x %"struct.basisu::resample_filter"], ptr @_ZN6basisu18g_resample_filtersE, i64 0, i64 %112
  %114 = getelementptr inbounds %"struct.basisu::resample_filter", ptr %113, i32 0, i32 0
  %115 = load ptr, ptr %114, align 8, !tbaa !37
  %116 = call i32 @strcmp(ptr noundef %110, ptr noundef %115) #10
  %117 = icmp eq i32 %116, 0
  br i1 %117, label %118, label %119

118:                                              ; preds = %109
  br label %123

119:                                              ; preds = %109
  br label %120

120:                                              ; preds = %119
  %121 = load i32, ptr %31, align 4, !tbaa !9
  %122 = add nsw i32 %121, 1
  store i32 %122, ptr %31, align 4, !tbaa !9
  br label %105, !llvm.loop !39

123:                                              ; preds = %118, %105
  %124 = load i32, ptr %31, align 4, !tbaa !9
  %125 = load i32, ptr @_ZN6basisu22g_num_resample_filtersE, align 4, !tbaa !9
  %126 = icmp eq i32 %124, %125
  br i1 %126, label %127, label %129

127:                                              ; preds = %123
  %128 = getelementptr inbounds %"class.basisu::Resampler", ptr %40, i32 0, i32 21
  store i32 2, ptr %128, align 8, !tbaa !31
  store i32 1, ptr %35, align 4
  br label %357

129:                                              ; preds = %123
  %130 = load i32, ptr %31, align 4, !tbaa !9
  %131 = sext i32 %130 to i64
  %132 = getelementptr inbounds [0 x %"struct.basisu::resample_filter"], ptr @_ZN6basisu18g_resample_filtersE, i64 0, i64 %131
  %133 = getelementptr inbounds %"struct.basisu::resample_filter", ptr %132, i32 0, i32 1
  %134 = load ptr, ptr %133, align 8, !tbaa !41
  store ptr %134, ptr %34, align 8, !tbaa !5
  %135 = load i32, ptr %31, align 4, !tbaa !9
  %136 = sext i32 %135 to i64
  %137 = getelementptr inbounds [0 x %"struct.basisu::resample_filter"], ptr @_ZN6basisu18g_resample_filtersE, i64 0, i64 %136
  %138 = getelementptr inbounds %"struct.basisu::resample_filter", ptr %137, i32 0, i32 2
  %139 = load float, ptr %138, align 8, !tbaa !42
  store float %139, ptr %33, align 4, !tbaa !13
  %140 = load ptr, ptr %25, align 8, !tbaa !5
  %141 = icmp ne ptr %140, null
  br i1 %141, label %161, label %142

142:                                              ; preds = %129
  %143 = getelementptr inbounds %"class.basisu::Resampler", ptr %40, i32 0, i32 2
  %144 = load i32, ptr %143, align 8, !tbaa !32
  %145 = getelementptr inbounds %"class.basisu::Resampler", ptr %40, i32 0, i32 4
  %146 = load i32, ptr %145, align 8, !tbaa !34
  %147 = getelementptr inbounds %"class.basisu::Resampler", ptr %40, i32 0, i32 6
  %148 = load i32, ptr %147, align 8, !tbaa !36
  %149 = load ptr, ptr %34, align 8, !tbaa !5
  %150 = load float, ptr %33, align 4, !tbaa !13
  %151 = load float, ptr %27, align 4, !tbaa !13
  %152 = load float, ptr %29, align 4, !tbaa !13
  %153 = call noundef ptr @_ZN6basisu9Resampler10make_clistEiiNS0_11Boundary_OpEPFffEfff(i32 noundef %144, i32 noundef %146, i32 noundef %148, ptr noundef %149, float noundef %150, float noundef %151, float noundef %152)
  %154 = getelementptr inbounds %"class.basisu::Resampler", ptr %40, i32 0, i32 10
  store ptr %153, ptr %154, align 8, !tbaa !25
  %155 = getelementptr inbounds %"class.basisu::Resampler", ptr %40, i32 0, i32 10
  %156 = load ptr, ptr %155, align 8, !tbaa !25
  %157 = icmp ne ptr %156, null
  br i1 %157, label %160, label %158

158:                                              ; preds = %142
  %159 = getelementptr inbounds %"class.basisu::Resampler", ptr %40, i32 0, i32 21
  store i32 1, ptr %159, align 8, !tbaa !31
  store i32 1, ptr %35, align 4
  br label %357

160:                                              ; preds = %142
  br label %165

161:                                              ; preds = %129
  %162 = load ptr, ptr %25, align 8, !tbaa !5
  %163 = getelementptr inbounds %"class.basisu::Resampler", ptr %40, i32 0, i32 10
  store ptr %162, ptr %163, align 8, !tbaa !25
  %164 = getelementptr inbounds %"class.basisu::Resampler", ptr %40, i32 0, i32 12
  store i8 1, ptr %164, align 8, !tbaa !24
  br label %165

165:                                              ; preds = %161, %160
  %166 = load ptr, ptr %26, align 8, !tbaa !5
  %167 = icmp ne ptr %166, null
  br i1 %167, label %187, label %168

168:                                              ; preds = %165
  %169 = getelementptr inbounds %"class.basisu::Resampler", ptr %40, i32 0, i32 3
  %170 = load i32, ptr %169, align 4, !tbaa !33
  %171 = getelementptr inbounds %"class.basisu::Resampler", ptr %40, i32 0, i32 5
  %172 = load i32, ptr %171, align 4, !tbaa !35
  %173 = getelementptr inbounds %"class.basisu::Resampler", ptr %40, i32 0, i32 6
  %174 = load i32, ptr %173, align 8, !tbaa !36
  %175 = load ptr, ptr %34, align 8, !tbaa !5
  %176 = load float, ptr %33, align 4, !tbaa !13
  %177 = load float, ptr %28, align 4, !tbaa !13
  %178 = load float, ptr %30, align 4, !tbaa !13
  %179 = call noundef ptr @_ZN6basisu9Resampler10make_clistEiiNS0_11Boundary_OpEPFffEfff(i32 noundef %170, i32 noundef %172, i32 noundef %174, ptr noundef %175, float noundef %176, float noundef %177, float noundef %178)
  %180 = getelementptr inbounds %"class.basisu::Resampler", ptr %40, i32 0, i32 11
  store ptr %179, ptr %180, align 8, !tbaa !27
  %181 = getelementptr inbounds %"class.basisu::Resampler", ptr %40, i32 0, i32 11
  %182 = load ptr, ptr %181, align 8, !tbaa !27
  %183 = icmp ne ptr %182, null
  br i1 %183, label %186, label %184

184:                                              ; preds = %168
  %185 = getelementptr inbounds %"class.basisu::Resampler", ptr %40, i32 0, i32 21
  store i32 1, ptr %185, align 8, !tbaa !31
  store i32 1, ptr %35, align 4
  br label %357

186:                                              ; preds = %168
  br label %191

187:                                              ; preds = %165
  %188 = load ptr, ptr %26, align 8, !tbaa !5
  %189 = getelementptr inbounds %"class.basisu::Resampler", ptr %40, i32 0, i32 11
  store ptr %188, ptr %189, align 8, !tbaa !27
  %190 = getelementptr inbounds %"class.basisu::Resampler", ptr %40, i32 0, i32 13
  store i8 1, ptr %190, align 1, !tbaa !26
  br label %191

191:                                              ; preds = %187, %186
  %192 = getelementptr inbounds %"class.basisu::Resampler", ptr %40, i32 0, i32 3
  %193 = load i32, ptr %192, align 4, !tbaa !33
  %194 = sext i32 %193 to i64
  %195 = call noalias ptr @calloc(i64 noundef %194, i64 noundef 4) #11
  %196 = getelementptr inbounds %"class.basisu::Resampler", ptr %40, i32 0, i32 16
  store ptr %195, ptr %196, align 8, !tbaa !28
  %197 = icmp eq ptr %195, null
  br i1 %197, label %198, label %200

198:                                              ; preds = %191
  %199 = getelementptr inbounds %"class.basisu::Resampler", ptr %40, i32 0, i32 21
  store i32 1, ptr %199, align 8, !tbaa !31
  store i32 1, ptr %35, align 4
  br label %357

200:                                              ; preds = %191
  %201 = getelementptr inbounds %"class.basisu::Resampler", ptr %40, i32 0, i32 3
  %202 = load i32, ptr %201, align 4, !tbaa !33
  %203 = sext i32 %202 to i64
  %204 = call noalias ptr @calloc(i64 noundef %203, i64 noundef 1) #11
  %205 = getelementptr inbounds %"class.basisu::Resampler", ptr %40, i32 0, i32 17
  store ptr %204, ptr %205, align 8, !tbaa !29
  %206 = icmp eq ptr %204, null
  br i1 %206, label %207, label %209

207:                                              ; preds = %200
  %208 = getelementptr inbounds %"class.basisu::Resampler", ptr %40, i32 0, i32 21
  store i32 1, ptr %208, align 8, !tbaa !31
  store i32 1, ptr %35, align 4
  br label %357

209:                                              ; preds = %200
  store i32 0, ptr %31, align 4, !tbaa !9
  br label %210

210:                                              ; preds = %254, %209
  %211 = load i32, ptr %31, align 4, !tbaa !9
  %212 = getelementptr inbounds %"class.basisu::Resampler", ptr %40, i32 0, i32 5
  %213 = load i32, ptr %212, align 4, !tbaa !35
  %214 = icmp slt i32 %211, %213
  br i1 %214, label %215, label %257

215:                                              ; preds = %210
  store i32 0, ptr %32, align 4, !tbaa !9
  br label %216

216:                                              ; preds = %250, %215
  %217 = load i32, ptr %32, align 4, !tbaa !9
  %218 = getelementptr inbounds %"class.basisu::Resampler", ptr %40, i32 0, i32 11
  %219 = load ptr, ptr %218, align 8, !tbaa !27
  %220 = load i32, ptr %31, align 4, !tbaa !9
  %221 = sext i32 %220 to i64
  %222 = getelementptr inbounds %"struct.basisu::Resampler::Contrib_List", ptr %219, i64 %221
  %223 = getelementptr inbounds %"struct.basisu::Resampler::Contrib_List", ptr %222, i32 0, i32 0
  %224 = load i16, ptr %223, align 8, !tbaa !43
  %225 = zext i16 %224 to i32
  %226 = icmp slt i32 %217, %225
  br i1 %226, label %227, label %253

227:                                              ; preds = %216
  %228 = getelementptr inbounds %"class.basisu::Resampler", ptr %40, i32 0, i32 16
  %229 = load ptr, ptr %228, align 8, !tbaa !28
  %230 = getelementptr inbounds %"class.basisu::Resampler", ptr %40, i32 0, i32 11
  %231 = load ptr, ptr %230, align 8, !tbaa !27
  %232 = load i32, ptr %31, align 4, !tbaa !9
  %233 = sext i32 %232 to i64
  %234 = getelementptr inbounds %"struct.basisu::Resampler::Contrib_List", ptr %231, i64 %233
  %235 = getelementptr inbounds %"struct.basisu::Resampler::Contrib_List", ptr %234, i32 0, i32 1
  %236 = load ptr, ptr %235, align 8, !tbaa !46
  %237 = load i32, ptr %32, align 4, !tbaa !9
  %238 = sext i32 %237 to i64
  %239 = getelementptr inbounds %"struct.basisu::Resampler::Contrib", ptr %236, i64 %238
  %240 = getelementptr inbounds %"struct.basisu::Resampler::Contrib", ptr %239, i32 0, i32 1
  %241 = load i16, ptr %240, align 4, !tbaa !47
  %242 = zext i16 %241 to i32
  %243 = getelementptr inbounds %"class.basisu::Resampler", ptr %40, i32 0, i32 3
  %244 = load i32, ptr %243, align 4, !tbaa !33
  %245 = call noundef i32 @_ZN6basisuL21resampler_range_checkEii(i32 noundef %242, i32 noundef %244)
  %246 = sext i32 %245 to i64
  %247 = getelementptr inbounds i32, ptr %229, i64 %246
  %248 = load i32, ptr %247, align 4, !tbaa !9
  %249 = add nsw i32 %248, 1
  store i32 %249, ptr %247, align 4, !tbaa !9
  br label %250

250:                                              ; preds = %227
  %251 = load i32, ptr %32, align 4, !tbaa !9
  %252 = add nsw i32 %251, 1
  store i32 %252, ptr %32, align 4, !tbaa !9
  br label %216, !llvm.loop !49

253:                                              ; preds = %216
  br label %254

254:                                              ; preds = %253
  %255 = load i32, ptr %31, align 4, !tbaa !9
  %256 = add nsw i32 %255, 1
  store i32 %256, ptr %31, align 4, !tbaa !9
  br label %210, !llvm.loop !50

257:                                              ; preds = %210
  %258 = call noalias ptr @malloc(i64 noundef 196608) #9
  %259 = getelementptr inbounds %"class.basisu::Resampler", ptr %40, i32 0, i32 18
  store ptr %258, ptr %259, align 8, !tbaa !30
  %260 = icmp eq ptr %258, null
  br i1 %260, label %261, label %263

261:                                              ; preds = %257
  %262 = getelementptr inbounds %"class.basisu::Resampler", ptr %40, i32 0, i32 21
  store i32 1, ptr %262, align 8, !tbaa !31
  store i32 1, ptr %35, align 4
  br label %357

263:                                              ; preds = %257
  store i32 0, ptr %31, align 4, !tbaa !9
  br label %264

264:                                              ; preds = %280, %263
  %265 = load i32, ptr %31, align 4, !tbaa !9
  %266 = icmp slt i32 %265, 16384
  br i1 %266, label %267, label %283

267:                                              ; preds = %264
  %268 = getelementptr inbounds %"class.basisu::Resampler", ptr %40, i32 0, i32 18
  %269 = load ptr, ptr %268, align 8, !tbaa !30
  %270 = getelementptr inbounds %"struct.basisu::Resampler::Scan_Buf", ptr %269, i32 0, i32 0
  %271 = load i32, ptr %31, align 4, !tbaa !9
  %272 = sext i32 %271 to i64
  %273 = getelementptr inbounds [16384 x i32], ptr %270, i64 0, i64 %272
  store i32 -1, ptr %273, align 4, !tbaa !9
  %274 = getelementptr inbounds %"class.basisu::Resampler", ptr %40, i32 0, i32 18
  %275 = load ptr, ptr %274, align 8, !tbaa !30
  %276 = getelementptr inbounds %"struct.basisu::Resampler::Scan_Buf", ptr %275, i32 0, i32 1
  %277 = load i32, ptr %31, align 4, !tbaa !9
  %278 = sext i32 %277 to i64
  %279 = getelementptr inbounds [16384 x ptr], ptr %276, i64 0, i64 %278
  store ptr null, ptr %279, align 8, !tbaa !5
  br label %280

280:                                              ; preds = %267
  %281 = load i32, ptr %31, align 4, !tbaa !9
  %282 = add nsw i32 %281, 1
  store i32 %282, ptr %31, align 4, !tbaa !9
  br label %264, !llvm.loop !51

283:                                              ; preds = %264
  %284 = getelementptr inbounds %"class.basisu::Resampler", ptr %40, i32 0, i32 20
  store i32 0, ptr %284, align 4, !tbaa !52
  %285 = getelementptr inbounds %"class.basisu::Resampler", ptr %40, i32 0, i32 19
  store i32 0, ptr %285, align 8, !tbaa !53
  call void @llvm.lifetime.start.p0(i64 4, ptr %36) #7
  %286 = getelementptr inbounds %"class.basisu::Resampler", ptr %40, i32 0, i32 10
  %287 = load ptr, ptr %286, align 8, !tbaa !25
  %288 = getelementptr inbounds %"class.basisu::Resampler", ptr %40, i32 0, i32 4
  %289 = load i32, ptr %288, align 8, !tbaa !34
  %290 = call noundef i32 @_ZN6basisu9Resampler9count_opsEPNS0_12Contrib_ListEi(ptr noundef nonnull align 8 dereferenceable(116) %40, ptr noundef %287, i32 noundef %289)
  store i32 %290, ptr %36, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %37) #7
  %291 = getelementptr inbounds %"class.basisu::Resampler", ptr %40, i32 0, i32 11
  %292 = load ptr, ptr %291, align 8, !tbaa !27
  %293 = getelementptr inbounds %"class.basisu::Resampler", ptr %40, i32 0, i32 5
  %294 = load i32, ptr %293, align 4, !tbaa !35
  %295 = call noundef i32 @_ZN6basisu9Resampler9count_opsEPNS0_12Contrib_ListEi(ptr noundef nonnull align 8 dereferenceable(116) %40, ptr noundef %292, i32 noundef %294)
  store i32 %295, ptr %37, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %38) #7
  %296 = load i32, ptr %36, align 4, !tbaa !9
  %297 = getelementptr inbounds %"class.basisu::Resampler", ptr %40, i32 0, i32 3
  %298 = load i32, ptr %297, align 4, !tbaa !33
  %299 = mul nsw i32 %296, %298
  %300 = load i32, ptr %37, align 4, !tbaa !9
  %301 = mul nsw i32 4, %300
  %302 = getelementptr inbounds %"class.basisu::Resampler", ptr %40, i32 0, i32 4
  %303 = load i32, ptr %302, align 8, !tbaa !34
  %304 = mul nsw i32 %301, %303
  %305 = sdiv i32 %304, 3
  %306 = add nsw i32 %299, %305
  store i32 %306, ptr %38, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %39) #7
  %307 = load i32, ptr %37, align 4, !tbaa !9
  %308 = mul nsw i32 4, %307
  %309 = getelementptr inbounds %"class.basisu::Resampler", ptr %40, i32 0, i32 2
  %310 = load i32, ptr %309, align 8, !tbaa !32
  %311 = mul nsw i32 %308, %310
  %312 = sdiv i32 %311, 3
  %313 = load i32, ptr %36, align 4, !tbaa !9
  %314 = getelementptr inbounds %"class.basisu::Resampler", ptr %40, i32 0, i32 5
  %315 = load i32, ptr %314, align 4, !tbaa !35
  %316 = mul nsw i32 %313, %315
  %317 = add nsw i32 %312, %316
  store i32 %317, ptr %39, align 4, !tbaa !9
  %318 = load i32, ptr %38, align 4, !tbaa !9
  %319 = load i32, ptr %39, align 4, !tbaa !9
  %320 = icmp sgt i32 %318, %319
  br i1 %320, label %331, label %321

321:                                              ; preds = %283
  %322 = load i32, ptr %38, align 4, !tbaa !9
  %323 = load i32, ptr %39, align 4, !tbaa !9
  %324 = icmp eq i32 %322, %323
  br i1 %324, label %325, label %336

325:                                              ; preds = %321
  %326 = getelementptr inbounds %"class.basisu::Resampler", ptr %40, i32 0, i32 2
  %327 = load i32, ptr %326, align 8, !tbaa !32
  %328 = getelementptr inbounds %"class.basisu::Resampler", ptr %40, i32 0, i32 4
  %329 = load i32, ptr %328, align 8, !tbaa !34
  %330 = icmp slt i32 %327, %329
  br i1 %330, label %331, label %336

331:                                              ; preds = %325, %283
  %332 = getelementptr inbounds %"class.basisu::Resampler", ptr %40, i32 0, i32 14
  store i8 1, ptr %332, align 2, !tbaa !20
  %333 = getelementptr inbounds %"class.basisu::Resampler", ptr %40, i32 0, i32 2
  %334 = load i32, ptr %333, align 8, !tbaa !32
  %335 = getelementptr inbounds %"class.basisu::Resampler", ptr %40, i32 0, i32 1
  store i32 %334, ptr %335, align 4, !tbaa !21
  br label %341

336:                                              ; preds = %325, %321
  %337 = getelementptr inbounds %"class.basisu::Resampler", ptr %40, i32 0, i32 14
  store i8 0, ptr %337, align 2, !tbaa !20
  %338 = getelementptr inbounds %"class.basisu::Resampler", ptr %40, i32 0, i32 4
  %339 = load i32, ptr %338, align 8, !tbaa !34
  %340 = getelementptr inbounds %"class.basisu::Resampler", ptr %40, i32 0, i32 1
  store i32 %339, ptr %340, align 4, !tbaa !21
  br label %341

341:                                              ; preds = %336, %331
  call void @llvm.lifetime.end.p0(i64 4, ptr %39) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %38) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %37) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %36) #7
  %342 = getelementptr inbounds %"class.basisu::Resampler", ptr %40, i32 0, i32 14
  %343 = load i8, ptr %342, align 2, !tbaa !20, !range !54, !noundef !55
  %344 = trunc i8 %343 to i1
  br i1 %344, label %345, label %356

345:                                              ; preds = %341
  %346 = getelementptr inbounds %"class.basisu::Resampler", ptr %40, i32 0, i32 1
  %347 = load i32, ptr %346, align 4, !tbaa !21
  %348 = sext i32 %347 to i64
  %349 = mul i64 %348, 4
  %350 = call noalias ptr @malloc(i64 noundef %349) #9
  %351 = getelementptr inbounds %"class.basisu::Resampler", ptr %40, i32 0, i32 9
  store ptr %350, ptr %351, align 8, !tbaa !23
  %352 = icmp eq ptr %350, null
  br i1 %352, label %353, label %355

353:                                              ; preds = %345
  %354 = getelementptr inbounds %"class.basisu::Resampler", ptr %40, i32 0, i32 21
  store i32 1, ptr %354, align 8, !tbaa !31
  store i32 1, ptr %35, align 4
  br label %357

355:                                              ; preds = %345
  br label %356

356:                                              ; preds = %355, %341
  store i32 0, ptr %35, align 4
  br label %357

357:                                              ; preds = %356, %353, %261, %207, %198, %184, %158, %127, %98
  call void @llvm.lifetime.end.p0(i64 8, ptr %34) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %33) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %32) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %31) #7
  %358 = load i32, ptr %35, align 4
  switch i32 %358, label %360 [
    i32 0, label %359
    i32 1, label %359
  ]

359:                                              ; preds = %357, %357
  ret void

360:                                              ; preds = %357
  unreachable
}

; Function Attrs: nounwind willreturn memory(read)
declare i32 @strcmp(ptr noundef, ptr noundef) #6

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"_ZTSN6basisu9Resampler11Boundary_OpE", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"float", !7, i64 0}
!15 = !{!16, !14, i64 108}
!16 = !{!"_ZTSN6basisu9ResamplerE", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !12, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !17, i64 64, !17, i64 65, !17, i64 66, !6, i64 72, !6, i64 80, !6, i64 88, !10, i64 96, !10, i64 100, !18, i64 104, !14, i64 108, !14, i64 112}
!17 = !{!"bool", !7, i64 0}
!18 = !{!"_ZTSN6basisu9Resampler6StatusE", !7, i64 0}
!19 = !{!16, !14, i64 112}
!20 = !{!16, !17, i64 66}
!21 = !{!16, !10, i64 4}
!22 = !{!16, !6, i64 32}
!23 = !{!16, !6, i64 40}
!24 = !{!16, !17, i64 64}
!25 = !{!16, !6, i64 48}
!26 = !{!16, !17, i64 65}
!27 = !{!16, !6, i64 56}
!28 = !{!16, !6, i64 72}
!29 = !{!16, !6, i64 80}
!30 = !{!16, !6, i64 88}
!31 = !{!16, !18, i64 104}
!32 = !{!16, !10, i64 8}
!33 = !{!16, !10, i64 12}
!34 = !{!16, !10, i64 16}
!35 = !{!16, !10, i64 20}
!36 = !{!16, !12, i64 24}
!37 = !{!38, !6, i64 0}
!38 = !{!"_ZTSN6basisu15resample_filterE", !6, i64 0, !6, i64 8, !14, i64 16}
!39 = distinct !{!39, !40}
!40 = !{!"llvm.loop.mustprogress"}
!41 = !{!38, !6, i64 8}
!42 = !{!38, !14, i64 16}
!43 = !{!44, !45, i64 0}
!44 = !{!"_ZTSN6basisu9Resampler12Contrib_ListE", !45, i64 0, !6, i64 8}
!45 = !{!"short", !7, i64 0}
!46 = !{!44, !6, i64 8}
!47 = !{!48, !45, i64 4}
!48 = !{!"_ZTSN6basisu9Resampler7ContribE", !14, i64 0, !45, i64 4}
!49 = distinct !{!49, !40}
!50 = distinct !{!50, !40}
!51 = distinct !{!51, !40}
!52 = !{!16, !10, i64 100}
!53 = !{!16, !10, i64 96}
!54 = !{i8 0, i8 2}
!55 = !{}


; 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.basisu::resample_filter" = type { ptr, ptr, float }
%"struct.basisu::Resampler::Contrib_List" = type { i16, ptr }
%"struct.basisu::Resampler::Contrib" = type { float, i16 }

@.str.1 = external hidden unnamed_addr constant [116 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [10 x i8], align 1
@__PRETTY_FUNCTION__._ZN6basisu9ResamplerC2EiiiiNS0_11Boundary_OpEffPKcPNS0_12Contrib_ListES5_ffff = external hidden unnamed_addr constant [198 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [9 x i8], align 1
@_ZN6basisu22g_num_resample_filtersE = external local_unnamed_addr constant i32, align 4
@_ZN6basisu18g_resample_filtersE = external local_unnamed_addr global [0 x %"struct.basisu::resample_filter"], align 8

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN6basisu9Resampler10make_clistEiiNS0_11Boundary_OpEPFffEfff(i32 noundef, i32 noundef, i32 noundef, ptr noundef, float noundef, float noundef, float noundef) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @calloc(i64 noundef, i64 noundef) local_unnamed_addr #1

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef i32 @_ZN6basisuL21resampler_range_checkEii(i32 noundef, i32 noundef) local_unnamed_addr #3

; Function Attrs: mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite)
declare noalias noundef ptr @malloc(i64 noundef) local_unnamed_addr #4

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN6basisu9ResamplerC2EiiiiNS0_11Boundary_OpEffPKcPNS0_12Contrib_ListES5_ffff(ptr noundef nonnull align 8 dereferenceable(116) %0, i32 noundef %1, i32 noundef %2, i32 noundef %3, i32 noundef %4, i32 noundef %5, float noundef %6, float noundef %7, ptr noundef readonly %8, ptr noundef %9, ptr noundef %10, float noundef %11, float noundef %12, float noundef %13, float noundef %14) unnamed_addr #0 align 2 {
  %16 = icmp sgt i32 %1, 0
  br i1 %16, label %18, label %17

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

18:                                               ; preds = %15
  %19 = icmp sgt i32 %2, 0
  br i1 %19, label %21, label %20

20:                                               ; preds = %18
  tail call void @__assert_fail(ptr noundef nonnull @.str.11, ptr noundef nonnull @.str.1, i32 noundef 653, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN6basisu9ResamplerC2EiiiiNS0_11Boundary_OpEffPKcPNS0_12Contrib_ListES5_ffff) #7
  unreachable

21:                                               ; preds = %18
  %22 = icmp sgt i32 %3, 0
  br i1 %22, label %24, label %23

23:                                               ; preds = %21
  tail call void @__assert_fail(ptr noundef nonnull @.str.12, ptr noundef nonnull @.str.1, i32 noundef 654, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN6basisu9ResamplerC2EiiiiNS0_11Boundary_OpEffPKcPNS0_12Contrib_ListES5_ffff) #7
  unreachable

24:                                               ; preds = %21
  %25 = icmp sgt i32 %4, 0
  br i1 %25, label %27, label %26

26:                                               ; preds = %24
  tail call void @__assert_fail(ptr noundef nonnull @.str.13, ptr noundef nonnull @.str.1, i32 noundef 655, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN6basisu9ResamplerC2EiiiiNS0_11Boundary_OpEffPKcPNS0_12Contrib_ListES5_ffff) #7
  unreachable

27:                                               ; preds = %24
  %28 = getelementptr inbounds i8, ptr %0, i64 108
  store float %6, ptr %28, align 4, !tbaa !5
  %29 = getelementptr inbounds i8, ptr %0, i64 112
  store float %7, ptr %29, align 8, !tbaa !15
  %30 = getelementptr inbounds i8, ptr %0, i64 66
  %31 = getelementptr inbounds i8, ptr %0, i64 4
  store i32 0, ptr %31, align 4, !tbaa !16
  %32 = getelementptr inbounds i8, ptr %0, i64 32
  %33 = getelementptr inbounds i8, ptr %0, i64 40
  %34 = getelementptr inbounds i8, ptr %0, i64 64
  %35 = getelementptr inbounds i8, ptr %0, i64 48
  %36 = getelementptr inbounds i8, ptr %0, i64 65
  %37 = getelementptr inbounds i8, ptr %0, i64 56
  %38 = getelementptr inbounds i8, ptr %0, i64 72
  %39 = getelementptr inbounds i8, ptr %0, i64 80
  %40 = getelementptr inbounds i8, ptr %0, i64 88
  %41 = getelementptr inbounds i8, ptr %0, i64 104
  store i32 0, ptr %41, align 8, !tbaa !17
  %42 = getelementptr inbounds i8, ptr %0, i64 8
  %43 = getelementptr inbounds i8, ptr %0, i64 40
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(27) %43, i8 0, i64 27, i1 false)
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %38, i8 0, i64 24, i1 false)
  store i32 %1, ptr %42, align 8, !tbaa !18
  %44 = getelementptr inbounds i8, ptr %0, i64 12
  store i32 %2, ptr %44, align 4, !tbaa !19
  %45 = getelementptr inbounds i8, ptr %0, i64 16
  store i32 %3, ptr %45, align 8, !tbaa !20
  %46 = getelementptr inbounds i8, ptr %0, i64 20
  store i32 %4, ptr %46, align 4, !tbaa !21
  %47 = getelementptr inbounds i8, ptr %0, i64 24
  store i32 %5, ptr %47, align 8, !tbaa !22
  %48 = zext nneg i32 %3 to i64
  %49 = shl nuw nsw i64 %48, 2
  %50 = tail call noalias ptr @malloc(i64 noundef %49) #8
  store ptr %50, ptr %32, align 8, !tbaa !23
  %51 = icmp eq ptr %50, null
  br i1 %51, label %.sink.split, label %52

52:                                               ; preds = %27
  %53 = icmp eq ptr %8, null
  %spec.store.select = select i1 %53, ptr @.str.14, ptr %8
  %54 = load i32, ptr @_ZN6basisu22g_num_resample_filtersE, align 4, !tbaa !24
  %55 = icmp sgt i32 %54, 0
  br i1 %55, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %52
  %wide.trip.count = zext nneg i32 %54 to i64
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader, %60
  %indvars.iv = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next, %60 ]
  %56 = getelementptr inbounds [0 x %"struct.basisu::resample_filter"], ptr @_ZN6basisu18g_resample_filtersE, i64 0, i64 %indvars.iv
  %57 = load ptr, ptr %56, align 8, !tbaa !25
  %58 = tail call i32 @strcmp(ptr noundef nonnull dereferenceable(1) %spec.store.select, ptr noundef nonnull dereferenceable(1) %57) #9
  %59 = icmp eq i32 %58, 0
  br i1 %59, label %._crit_edge.loopexit, label %60

60:                                               ; preds = %.lr.ph
  %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 %.sink.split, label %.lr.ph, !llvm.loop !27

._crit_edge.loopexit:                             ; preds = %.lr.ph
  %61 = trunc nuw nsw i64 %indvars.iv to i32
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %52
  %.0.lcssa = phi i32 [ 0, %52 ], [ %61, %._crit_edge.loopexit ]
  %62 = icmp eq i32 %.0.lcssa, %54
  br i1 %62, label %.sink.split, label %63

63:                                               ; preds = %._crit_edge
  %64 = zext nneg i32 %.0.lcssa to i64
  %65 = getelementptr inbounds [0 x %"struct.basisu::resample_filter"], ptr @_ZN6basisu18g_resample_filtersE, i64 0, i64 %64
  %66 = getelementptr inbounds i8, ptr %65, i64 8
  %67 = load ptr, ptr %66, align 8, !tbaa !29
  %68 = getelementptr inbounds i8, ptr %65, i64 16
  %69 = load float, ptr %68, align 8, !tbaa !30
  %.not = icmp eq ptr %9, null
  br i1 %.not, label %70, label %72

70:                                               ; preds = %63
  %71 = tail call noundef ptr @_ZN6basisu9Resampler10make_clistEiiNS0_11Boundary_OpEPFffEfff(i32 noundef %1, i32 noundef %3, i32 noundef %5, ptr noundef %67, float noundef %69, float noundef %11, float noundef %13)
  store ptr %71, ptr %35, align 8, !tbaa !31
  %.not59 = icmp eq ptr %71, null
  br i1 %.not59, label %.sink.split, label %73

72:                                               ; preds = %63
  store ptr %9, ptr %35, align 8, !tbaa !31
  store i8 1, ptr %34, align 8, !tbaa !32
  br label %73

73:                                               ; preds = %70, %72
  %.not60 = icmp eq ptr %10, null
  br i1 %.not60, label %74, label %79

74:                                               ; preds = %73
  %75 = load i32, ptr %44, align 4, !tbaa !19
  %76 = load i32, ptr %46, align 4, !tbaa !21
  %77 = load i32, ptr %47, align 8, !tbaa !22
  %78 = tail call noundef ptr @_ZN6basisu9Resampler10make_clistEiiNS0_11Boundary_OpEPFffEfff(i32 noundef %75, i32 noundef %76, i32 noundef %77, ptr noundef %67, float noundef %69, float noundef %12, float noundef %14)
  store ptr %78, ptr %37, align 8, !tbaa !33
  %.not61 = icmp eq ptr %78, null
  br i1 %.not61, label %.sink.split, label %80

79:                                               ; preds = %73
  store ptr %10, ptr %37, align 8, !tbaa !33
  store i8 1, ptr %36, align 1, !tbaa !34
  br label %80

80:                                               ; preds = %74, %79
  %81 = phi ptr [ %78, %74 ], [ %10, %79 ]
  %82 = load i32, ptr %44, align 4, !tbaa !19
  %83 = sext i32 %82 to i64
  %84 = tail call noalias ptr @calloc(i64 noundef %83, i64 noundef 4) #10
  store ptr %84, ptr %38, align 8, !tbaa !35
  %85 = icmp eq ptr %84, null
  br i1 %85, label %.sink.split, label %86

86:                                               ; preds = %80
  %87 = tail call noalias ptr @calloc(i64 noundef %83, i64 noundef 1) #10
  store ptr %87, ptr %39, align 8, !tbaa !36
  %88 = icmp eq ptr %87, null
  br i1 %88, label %.sink.split, label %.preheader70

.preheader70:                                     ; preds = %86
  %89 = load i32, ptr %46, align 4, !tbaa !21
  %90 = icmp sgt i32 %89, 0
  br i1 %90, label %.preheader69, label %._crit_edge80

.preheader69:                                     ; preds = %.preheader70, %._crit_edge78
  %91 = phi i32 [ %113, %._crit_edge78 ], [ %89, %.preheader70 ]
  %92 = phi ptr [ %114, %._crit_edge78 ], [ %81, %.preheader70 ]
  %indvars.iv87 = phi i64 [ %indvars.iv.next88, %._crit_edge78 ], [ 0, %.preheader70 ]
  %93 = getelementptr inbounds %"struct.basisu::Resampler::Contrib_List", ptr %92, i64 %indvars.iv87
  %94 = load i16, ptr %93, align 8, !tbaa !37
  %.not82 = icmp eq i16 %94, 0
  br i1 %.not82, label %._crit_edge78, label %.lr.ph77

.lr.ph77:                                         ; preds = %.preheader69, %.lr.ph77
  %indvars.iv84 = phi i64 [ %indvars.iv.next85, %.lr.ph77 ], [ 0, %.preheader69 ]
  %95 = phi ptr [ %108, %.lr.ph77 ], [ %92, %.preheader69 ]
  %96 = load ptr, ptr %38, align 8, !tbaa !35
  %97 = getelementptr inbounds %"struct.basisu::Resampler::Contrib_List", ptr %95, i64 %indvars.iv87, i32 1
  %98 = load ptr, ptr %97, align 8, !tbaa !40
  %99 = getelementptr inbounds %"struct.basisu::Resampler::Contrib", ptr %98, i64 %indvars.iv84, i32 1
  %100 = load i16, ptr %99, align 4, !tbaa !41
  %101 = zext i16 %100 to i32
  %102 = load i32, ptr %44, align 4, !tbaa !19
  %103 = tail call noundef i32 @_ZN6basisuL21resampler_range_checkEii(i32 noundef %101, i32 noundef %102)
  %104 = sext i32 %103 to i64
  %105 = getelementptr inbounds i32, ptr %96, i64 %104
  %106 = load i32, ptr %105, align 4, !tbaa !24
  %107 = add nsw i32 %106, 1
  store i32 %107, ptr %105, align 4, !tbaa !24
  %indvars.iv.next85 = add nuw nsw i64 %indvars.iv84, 1
  %108 = load ptr, ptr %37, align 8, !tbaa !33
  %109 = getelementptr inbounds %"struct.basisu::Resampler::Contrib_List", ptr %108, i64 %indvars.iv87
  %110 = load i16, ptr %109, align 8, !tbaa !37
  %111 = zext i16 %110 to i64
  %112 = icmp ult i64 %indvars.iv.next85, %111
  br i1 %112, label %.lr.ph77, label %._crit_edge78.loopexit, !llvm.loop !43

._crit_edge78.loopexit:                           ; preds = %.lr.ph77
  %.pre = load i32, ptr %46, align 4, !tbaa !21
  br label %._crit_edge78

._crit_edge78:                                    ; preds = %._crit_edge78.loopexit, %.preheader69
  %113 = phi i32 [ %.pre, %._crit_edge78.loopexit ], [ %91, %.preheader69 ]
  %114 = phi ptr [ %108, %._crit_edge78.loopexit ], [ %92, %.preheader69 ]
  %indvars.iv.next88 = add nuw nsw i64 %indvars.iv87, 1
  %115 = sext i32 %113 to i64
  %116 = icmp slt i64 %indvars.iv.next88, %115
  br i1 %116, label %.preheader69, label %._crit_edge80, !llvm.loop !44

._crit_edge80:                                    ; preds = %._crit_edge78, %.preheader70
  %117 = tail call noalias dereferenceable_or_null(196608) ptr @malloc(i64 noundef 196608) #8
  store ptr %117, ptr %40, align 8, !tbaa !45
  %118 = icmp eq ptr %117, null
  br i1 %118, label %.sink.split, label %.preheader

.preheader:                                       ; preds = %._crit_edge80, %.preheader
  %indvars.iv90 = phi i64 [ %indvars.iv.next91.3, %.preheader ], [ 0, %._crit_edge80 ]
  %119 = load ptr, ptr %40, align 8, !tbaa !45
  %120 = getelementptr inbounds [16384 x i32], ptr %119, i64 0, i64 %indvars.iv90
  store i32 -1, ptr %120, align 4, !tbaa !24
  %121 = getelementptr inbounds i8, ptr %119, i64 65536
  %122 = getelementptr inbounds [16384 x ptr], ptr %121, i64 0, i64 %indvars.iv90
  store ptr null, ptr %122, align 8, !tbaa !46
  %indvars.iv.next91 = or disjoint i64 %indvars.iv90, 1
  %123 = load ptr, ptr %40, align 8, !tbaa !45
  %124 = getelementptr inbounds [16384 x i32], ptr %123, i64 0, i64 %indvars.iv.next91
  store i32 -1, ptr %124, align 4, !tbaa !24
  %125 = getelementptr inbounds i8, ptr %123, i64 65536
  %126 = getelementptr inbounds [16384 x ptr], ptr %125, i64 0, i64 %indvars.iv.next91
  store ptr null, ptr %126, align 8, !tbaa !46
  %indvars.iv.next91.1 = or disjoint i64 %indvars.iv90, 2
  %127 = load ptr, ptr %40, align 8, !tbaa !45
  %128 = getelementptr inbounds [16384 x i32], ptr %127, i64 0, i64 %indvars.iv.next91.1
  store i32 -1, ptr %128, align 4, !tbaa !24
  %129 = getelementptr inbounds i8, ptr %127, i64 65536
  %130 = getelementptr inbounds [16384 x ptr], ptr %129, i64 0, i64 %indvars.iv.next91.1
  store ptr null, ptr %130, align 8, !tbaa !46
  %indvars.iv.next91.2 = or disjoint i64 %indvars.iv90, 3
  %131 = load ptr, ptr %40, align 8, !tbaa !45
  %132 = getelementptr inbounds [16384 x i32], ptr %131, i64 0, i64 %indvars.iv.next91.2
  store i32 -1, ptr %132, align 4, !tbaa !24
  %133 = getelementptr inbounds i8, ptr %131, i64 65536
  %134 = getelementptr inbounds [16384 x ptr], ptr %133, i64 0, i64 %indvars.iv.next91.2
  store ptr null, ptr %134, align 8, !tbaa !46
  %indvars.iv.next91.3 = add nuw nsw i64 %indvars.iv90, 4
  %exitcond93.not.3 = icmp eq i64 %indvars.iv.next91.3, 16384
  br i1 %exitcond93.not.3, label %135, label %.preheader, !llvm.loop !47

135:                                              ; preds = %.preheader
  %136 = getelementptr inbounds i8, ptr %0, i64 100
  store i32 0, ptr %136, align 4, !tbaa !48
  %137 = getelementptr inbounds i8, ptr %0, i64 96
  store i32 0, ptr %137, align 8, !tbaa !49
  %138 = load ptr, ptr %35, align 8, !tbaa !31
  %139 = load i32, ptr %45, align 8, !tbaa !20
  %140 = tail call noundef i32 @_ZN6basisu9Resampler9count_opsEPNS0_12Contrib_ListEi(ptr noundef nonnull align 8 dereferenceable(116) %0, ptr noundef %138, i32 noundef %139)
  %141 = load ptr, ptr %37, align 8, !tbaa !33
  %142 = load i32, ptr %46, align 4, !tbaa !21
  %143 = tail call noundef i32 @_ZN6basisu9Resampler9count_opsEPNS0_12Contrib_ListEi(ptr noundef nonnull align 8 dereferenceable(116) %0, ptr noundef %141, i32 noundef %142)
  %144 = load i32, ptr %44, align 4, !tbaa !19
  %145 = mul nsw i32 %144, %140
  %146 = shl nsw i32 %143, 2
  %147 = load i32, ptr %45, align 8
  %148 = mul nsw i32 %147, %146
  %149 = sdiv i32 %148, 3
  %150 = add nsw i32 %149, %145
  %151 = load i32, ptr %42, align 8
  %152 = mul nsw i32 %151, %146
  %153 = sdiv i32 %152, 3
  %154 = load i32, ptr %46, align 4, !tbaa !21
  %155 = mul nsw i32 %154, %140
  %156 = add nsw i32 %153, %155
  %157 = icmp sgt i32 %150, %156
  br i1 %157, label %.thread, label %158

.thread:                                          ; preds = %135
  store i8 1, ptr %30, align 2, !tbaa !50
  store i32 %151, ptr %31, align 4, !tbaa !16
  br label %161

158:                                              ; preds = %135
  %159 = icmp eq i32 %150, %156
  %160 = icmp slt i32 %151, %147
  %or.cond = and i1 %160, %159
  %spec.select = zext i1 %or.cond to i8
  store i8 %spec.select, ptr %30, align 2, !tbaa !50
  %storemerge = select i1 %or.cond, i32 %151, i32 %147
  store i32 %storemerge, ptr %31, align 4, !tbaa !16
  br i1 %or.cond, label %161, label %166

161:                                              ; preds = %.thread, %158
  %162 = sext i32 %151 to i64
  %163 = shl nsw i64 %162, 2
  %164 = tail call noalias ptr @malloc(i64 noundef %163) #8
  store ptr %164, ptr %33, align 8, !tbaa !51
  %165 = icmp eq ptr %164, null
  br i1 %165, label %.sink.split, label %166

.sink.split:                                      ; preds = %60, %161, %._crit_edge80, %86, %80, %74, %70, %._crit_edge, %27
  %.sink = phi i32 [ 1, %27 ], [ 2, %._crit_edge ], [ 1, %70 ], [ 1, %74 ], [ 1, %80 ], [ 1, %86 ], [ 1, %._crit_edge80 ], [ 1, %161 ], [ 2, %60 ]
  store i32 %.sink, ptr %41, align 8, !tbaa !17
  br label %166

166:                                              ; preds = %.sink.split, %158, %161
  ret void
}

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i32 @strcmp(ptr nocapture noundef, ptr nocapture noundef) local_unnamed_addr #5

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

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

attributes #0 = { 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 #1 = { mustprogress nofree nounwind willreturn allockind("alloc,zeroed") allocsize(0,1) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "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 = { 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 #3 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nofree nounwind willreturn allockind("alloc,uninitialized") allocsize(0) memory(inaccessiblemem: readwrite) "alloc-family"="malloc" "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 nofree nounwind willreturn memory(argmem: read) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #7 = { noreturn nounwind }
attributes #8 = { nounwind allocsize(0) }
attributes #9 = { nounwind willreturn memory(read) }
attributes #10 = { nounwind allocsize(0,1) }

!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, !14, i64 108}
!6 = !{!"_ZTSN6basisu9ResamplerE", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !7, i64 16, !7, i64 20, !10, i64 24, !11, i64 32, !11, i64 40, !11, i64 48, !11, i64 56, !12, i64 64, !12, i64 65, !12, i64 66, !11, i64 72, !11, i64 80, !11, i64 88, !7, i64 96, !7, i64 100, !13, i64 104, !14, i64 108, !14, i64 112}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"_ZTSN6basisu9Resampler11Boundary_OpE", !8, i64 0}
!11 = !{!"any pointer", !8, i64 0}
!12 = !{!"bool", !8, i64 0}
!13 = !{!"_ZTSN6basisu9Resampler6StatusE", !8, i64 0}
!14 = !{!"float", !8, i64 0}
!15 = !{!6, !14, i64 112}
!16 = !{!6, !7, i64 4}
!17 = !{!6, !13, i64 104}
!18 = !{!6, !7, i64 8}
!19 = !{!6, !7, i64 12}
!20 = !{!6, !7, i64 16}
!21 = !{!6, !7, i64 20}
!22 = !{!6, !10, i64 24}
!23 = !{!6, !11, i64 32}
!24 = !{!7, !7, i64 0}
!25 = !{!26, !11, i64 0}
!26 = !{!"_ZTSN6basisu15resample_filterE", !11, i64 0, !11, i64 8, !14, i64 16}
!27 = distinct !{!27, !28}
!28 = !{!"llvm.loop.mustprogress"}
!29 = !{!26, !11, i64 8}
!30 = !{!26, !14, i64 16}
!31 = !{!6, !11, i64 48}
!32 = !{!6, !12, i64 64}
!33 = !{!6, !11, i64 56}
!34 = !{!6, !12, i64 65}
!35 = !{!6, !11, i64 72}
!36 = !{!6, !11, i64 80}
!37 = !{!38, !39, i64 0}
!38 = !{!"_ZTSN6basisu9Resampler12Contrib_ListE", !39, i64 0, !11, i64 8}
!39 = !{!"short", !8, i64 0}
!40 = !{!38, !11, i64 8}
!41 = !{!42, !39, i64 4}
!42 = !{!"_ZTSN6basisu9Resampler7ContribE", !14, i64 0, !39, i64 4}
!43 = distinct !{!43, !28}
!44 = distinct !{!44, !28}
!45 = !{!6, !11, i64 88}
!46 = !{!11, !11, i64 0}
!47 = distinct !{!47, !28}
!48 = !{!6, !7, i64 100}
!49 = !{!6, !7, i64 96}
!50 = !{!6, !12, i64 66}
!51 = !{!6, !11, i64 40}


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