; LLVM IR from jingweizhanghuai/Morn :: src/wave (morn_PSwave_filter)

; 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.TriangleFilter = type { i32, i32 }
%struct.MWave = type { i32, i32, [32 x ptr] }

@g_uniform_high_frequency = external hidden global i32, align 4
@g_uniform_low_frequency = external hidden global i32, align 4
@g_uniform_num = external hidden global i32, align 4
@g_uniform_para = external hidden global [128 x %struct.TriangleFilter], align 16
@.str = external hidden unnamed_addr constant [85 x i8], align 1
@__FUNCTION__.mUniformFilterBank = external hidden unnamed_addr constant [19 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [16 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local void @GetUniformPara() #0

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

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

; Function Attrs: nounwind uwtable
define dso_local void @mUniformFilterBank(ptr noundef %0, i32 noundef %1, i32 noundef %2, i32 noundef %3, ptr noundef %4) #0 {
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %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 i32, align 4
  %23 = alloca float, align 4
  store ptr %0, ptr %6, align 8, !tbaa !5
  store i32 %1, ptr %7, align 4, !tbaa !9
  store i32 %2, ptr %8, align 4, !tbaa !9
  store i32 %3, ptr %9, align 4, !tbaa !9
  store ptr %4, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #4
  br label %24

24:                                               ; preds = %5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #4
  %25 = load ptr, ptr %6, align 8, !tbaa !5
  %26 = icmp eq ptr %25, null
  br i1 %26, label %31, label %27

27:                                               ; preds = %24
  %28 = load ptr, ptr %6, align 8, !tbaa !5
  %29 = ptrtoint ptr %28 to i64
  %30 = icmp eq i64 %29, -1
  br i1 %30, label %31, label %32

31:                                               ; preds = %27, %24
  br label %56

32:                                               ; preds = %27
  %33 = load ptr, ptr %6, align 8, !tbaa !5
  %34 = getelementptr inbounds %struct.MWave, ptr %33, i32 0, i32 2
  %35 = getelementptr inbounds [32 x ptr], ptr %34, i64 0, i64 0
  %36 = icmp eq ptr %35, null
  br i1 %36, label %53, label %37

37:                                               ; preds = %32
  %38 = load ptr, ptr %6, align 8, !tbaa !5
  %39 = getelementptr inbounds %struct.MWave, ptr %38, i32 0, i32 2
  %40 = getelementptr inbounds [32 x ptr], ptr %39, i64 0, i64 0
  %41 = ptrtoint ptr %40 to i64
  %42 = icmp eq i64 %41, -1
  br i1 %42, label %53, label %43

43:                                               ; preds = %37
  %44 = load ptr, ptr %6, align 8, !tbaa !5
  %45 = getelementptr inbounds %struct.MWave, ptr %44, i32 0, i32 0
  %46 = load i32, ptr %45, align 8, !tbaa !11
  %47 = icmp sle i32 %46, 0
  br i1 %47, label %53, label %48

48:                                               ; preds = %43
  %49 = load ptr, ptr %6, align 8, !tbaa !5
  %50 = getelementptr inbounds %struct.MWave, ptr %49, i32 0, i32 1
  %51 = load i32, ptr %50, align 4, !tbaa !13
  %52 = icmp sle i32 %51, 0
  br label %53

53:                                               ; preds = %48, %43, %37, %32
  %54 = phi i1 [ true, %43 ], [ true, %37 ], [ true, %32 ], [ %52, %48 ]
  %55 = zext i1 %54 to i32
  br label %56

56:                                               ; preds = %53, %31
  %57 = phi i32 [ 1, %31 ], [ %55, %53 ]
  store i32 %57, ptr %13, align 4, !tbaa !9
  %58 = load i32, ptr %13, align 4, !tbaa !9
  %59 = icmp ne i32 %58, 0
  br i1 %59, label %60, label %62

60:                                               ; preds = %56
  %61 = load i32, ptr %13, align 4, !tbaa !9
  call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef %61, i32 noundef -1, ptr noundef @.str, i32 noundef 82, ptr noundef @__FUNCTION__.mUniformFilterBank, ptr noundef @.str.1)
  br label %62

62:                                               ; preds = %60, %56
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #4
  br label %63

63:                                               ; preds = %62
  br label %64

64:                                               ; preds = %63
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #4
  store i32 -1, ptr %14, align 4, !tbaa !9
  %65 = load ptr, ptr %6, align 8, !tbaa !5
  %66 = call ptr @m_PropertyRead(ptr noundef %65, ptr noundef @.str.2, ptr noundef %14, ptr noundef null)
  br label %67

67:                                               ; preds = %64
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #4
  %68 = load i32, ptr %14, align 4, !tbaa !9
  %69 = icmp ne i32 %68, 2
  %70 = zext i1 %69 to i32
  store i32 %70, ptr %15, align 4, !tbaa !9
  %71 = load i32, ptr %15, align 4, !tbaa !9
  %72 = icmp ne i32 %71, 0
  br i1 %72, label %73, label %75

73:                                               ; preds = %67
  %74 = load i32, ptr %15, align 4, !tbaa !9
  call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef %74, i32 noundef -1, ptr noundef @.str, i32 noundef 84, ptr noundef @__FUNCTION__.mUniformFilterBank, ptr noundef @.str.3)
  br label %75

75:                                               ; preds = %73, %67
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #4
  br label %76

76:                                               ; preds = %75
  br label %77

77:                                               ; preds = %76
  br label %78

78:                                               ; preds = %77
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #4
  %79 = load ptr, ptr %10, align 8, !tbaa !5
  %80 = icmp eq ptr %79, null
  br i1 %80, label %85, label %81

81:                                               ; preds = %78
  %82 = load ptr, ptr %10, align 8, !tbaa !5
  %83 = ptrtoint ptr %82 to i64
  %84 = icmp eq i64 %83, -1
  br label %85

85:                                               ; preds = %81, %78
  %86 = phi i1 [ true, %78 ], [ %84, %81 ]
  %87 = zext i1 %86 to i32
  store i32 %87, ptr %16, align 4, !tbaa !9
  %88 = load i32, ptr %16, align 4, !tbaa !9
  %89 = icmp ne i32 %88, 0
  br i1 %89, label %90, label %92

90:                                               ; preds = %85
  %91 = load i32, ptr %16, align 4, !tbaa !9
  call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef %91, i32 noundef -1, ptr noundef @.str, i32 noundef 85, ptr noundef @__FUNCTION__.mUniformFilterBank, ptr noundef @.str.1)
  br label %92

92:                                               ; preds = %90, %85
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #4
  br label %93

93:                                               ; preds = %92
  br label %94

94:                                               ; preds = %93
  %95 = load i32, ptr %7, align 4, !tbaa !9
  %96 = icmp eq i32 %95, -1
  br i1 %96, label %97, label %98

97:                                               ; preds = %94
  store i32 0, ptr %7, align 4, !tbaa !9
  br label %98

98:                                               ; preds = %97, %94
  br label %99

99:                                               ; preds = %98
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #4
  %100 = load i32, ptr %7, align 4, !tbaa !9
  %101 = icmp slt i32 %100, 0
  %102 = zext i1 %101 to i32
  store i32 %102, ptr %17, align 4, !tbaa !9
  %103 = load i32, ptr %17, align 4, !tbaa !9
  %104 = icmp ne i32 %103, 0
  br i1 %104, label %105, label %107

105:                                              ; preds = %99
  %106 = load i32, ptr %17, align 4, !tbaa !9
  call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef %106, i32 noundef -1, ptr noundef @.str, i32 noundef 88, ptr noundef @__FUNCTION__.mUniformFilterBank, ptr noundef @.str.1)
  br label %107

107:                                              ; preds = %105, %99
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #4
  br label %108

108:                                              ; preds = %107
  br label %109

109:                                              ; preds = %108
  %110 = load i32, ptr %8, align 4, !tbaa !9
  %111 = icmp eq i32 %110, -1
  br i1 %111, label %112, label %116

112:                                              ; preds = %109
  %113 = load ptr, ptr %6, align 8, !tbaa !5
  %114 = getelementptr inbounds %struct.MWave, ptr %113, i32 0, i32 1
  %115 = load i32, ptr %114, align 4, !tbaa !13
  store i32 %115, ptr %8, align 4, !tbaa !9
  br label %116

116:                                              ; preds = %112, %109
  br label %117

117:                                              ; preds = %116
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #4
  %118 = load i32, ptr %8, align 4, !tbaa !9
  %119 = load ptr, ptr %6, align 8, !tbaa !5
  %120 = getelementptr inbounds %struct.MWave, ptr %119, i32 0, i32 1
  %121 = load i32, ptr %120, align 4, !tbaa !13
  %122 = icmp sgt i32 %118, %121
  %123 = zext i1 %122 to i32
  store i32 %123, ptr %18, align 4, !tbaa !9
  %124 = load i32, ptr %18, align 4, !tbaa !9
  %125 = icmp ne i32 %124, 0
  br i1 %125, label %126, label %128

126:                                              ; preds = %117
  %127 = load i32, ptr %18, align 4, !tbaa !9
  call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef %127, i32 noundef -1, ptr noundef @.str, i32 noundef 91, ptr noundef @__FUNCTION__.mUniformFilterBank, ptr noundef @.str.1)
  br label %128

128:                                              ; preds = %126, %117
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #4
  br label %129

129:                                              ; preds = %128
  br label %130

130:                                              ; preds = %129
  br label %131

131:                                              ; preds = %130
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #4
  %132 = load i32, ptr %9, align 4, !tbaa !9
  %133 = icmp sgt i32 %132, 128
  br i1 %133, label %137, label %134

134:                                              ; preds = %131
  %135 = load i32, ptr %9, align 4, !tbaa !9
  %136 = icmp slt i32 %135, 0
  br label %137

137:                                              ; preds = %134, %131
  %138 = phi i1 [ true, %131 ], [ %136, %134 ]
  %139 = zext i1 %138 to i32
  store i32 %139, ptr %19, align 4, !tbaa !9
  %140 = load i32, ptr %19, align 4, !tbaa !9
  %141 = icmp ne i32 %140, 0
  br i1 %141, label %142, label %144

142:                                              ; preds = %137
  %143 = load i32, ptr %19, align 4, !tbaa !9
  call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef %143, i32 noundef -1, ptr noundef @.str, i32 noundef 92, ptr noundef @__FUNCTION__.mUniformFilterBank, ptr noundef @.str.4)
  br label %144

144:                                              ; preds = %142, %137
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #4
  br label %145

145:                                              ; preds = %144
  br label %146

146:                                              ; preds = %145
  %147 = load i32, ptr @g_uniform_low_frequency, align 4, !tbaa !9
  %148 = load i32, ptr %7, align 4, !tbaa !9
  %149 = icmp ne i32 %147, %148
  br i1 %149, label %158, label %150

150:                                              ; preds = %146
  %151 = load i32, ptr @g_uniform_high_frequency, align 4, !tbaa !9
  %152 = load i32, ptr %8, align 4, !tbaa !9
  %153 = icmp ne i32 %151, %152
  br i1 %153, label %158, label %154

154:                                              ; preds = %150
  %155 = load i32, ptr @g_uniform_num, align 4, !tbaa !9
  %156 = load i32, ptr %9, align 4, !tbaa !9
  %157 = icmp ne i32 %155, %156
  br i1 %157, label %158, label %162

158:                                              ; preds = %154, %150, %146
  %159 = load i32, ptr %7, align 4, !tbaa !9
  store i32 %159, ptr @g_uniform_low_frequency, align 4, !tbaa !9
  %160 = load i32, ptr %8, align 4, !tbaa !9
  store i32 %160, ptr @g_uniform_high_frequency, align 4, !tbaa !9
  %161 = load i32, ptr %9, align 4, !tbaa !9
  store i32 %161, ptr @g_uniform_num, align 4, !tbaa !9
  call void @GetUniformPara()
  br label %162

162:                                              ; preds = %158, %154
  store i32 0, ptr %12, align 4, !tbaa !9
  br label %163

163:                                              ; preds = %277, %162
  %164 = load i32, ptr %12, align 4, !tbaa !9
  %165 = load ptr, ptr %6, align 8, !tbaa !5
  %166 = getelementptr inbounds %struct.MWave, ptr %165, i32 0, i32 0
  %167 = load i32, ptr %166, align 8, !tbaa !11
  %168 = icmp slt i32 %164, %167
  br i1 %168, label %169, label %280

169:                                              ; preds = %163
  store i32 0, ptr %11, align 4, !tbaa !9
  br label %170

170:                                              ; preds = %273, %169
  %171 = load i32, ptr %11, align 4, !tbaa !9
  %172 = load i32, ptr %9, align 4, !tbaa !9
  %173 = icmp slt i32 %171, %172
  br i1 %173, label %174, label %276

174:                                              ; preds = %170
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #4
  %175 = load i32, ptr %11, align 4, !tbaa !9
  %176 = sext i32 %175 to i64
  %177 = getelementptr inbounds [128 x %struct.TriangleFilter], ptr @g_uniform_para, i64 0, i64 %176
  %178 = getelementptr inbounds %struct.TriangleFilter, ptr %177, i32 0, i32 0
  %179 = load i32, ptr %178, align 8, !tbaa !14
  store i32 %179, ptr %20, align 4, !tbaa !9
  %180 = load i32, ptr %11, align 4, !tbaa !9
  %181 = sext i32 %180 to i64
  %182 = getelementptr inbounds [128 x %struct.TriangleFilter], ptr @g_uniform_para, i64 0, i64 %181
  %183 = getelementptr inbounds %struct.TriangleFilter, ptr %182, i32 0, i32 1
  %184 = load i32, ptr %183, align 4, !tbaa !16
  %185 = sub nsw i32 %184, 1
  store i32 %185, ptr %21, align 4, !tbaa !9
  store float 0.000000e+00, ptr %23, align 4, !tbaa !17
  store i32 1, ptr %22, align 4, !tbaa !9
  br label %186

186:                                              ; preds = %220, %174
  %187 = load i32, ptr %21, align 4, !tbaa !9
  %188 = load i32, ptr %20, align 4, !tbaa !9
  %189 = icmp sgt i32 %187, %188
  br i1 %189, label %190, label %223

190:                                              ; preds = %186
  %191 = load float, ptr %23, align 4, !tbaa !17
  %192 = load ptr, ptr %6, align 8, !tbaa !5
  %193 = getelementptr inbounds %struct.MWave, ptr %192, i32 0, i32 2
  %194 = load i32, ptr %12, align 4, !tbaa !9
  %195 = sext i32 %194 to i64
  %196 = getelementptr inbounds [32 x ptr], ptr %193, i64 0, i64 %195
  %197 = load ptr, ptr %196, align 8, !tbaa !5
  %198 = load i32, ptr %20, align 4, !tbaa !9
  %199 = sext i32 %198 to i64
  %200 = getelementptr inbounds float, ptr %197, i64 %199
  %201 = load float, ptr %200, align 4, !tbaa !17
  %202 = load ptr, ptr %6, align 8, !tbaa !5
  %203 = getelementptr inbounds %struct.MWave, ptr %202, i32 0, i32 2
  %204 = load i32, ptr %12, align 4, !tbaa !9
  %205 = sext i32 %204 to i64
  %206 = getelementptr inbounds [32 x ptr], ptr %203, i64 0, i64 %205
  %207 = load ptr, ptr %206, align 8, !tbaa !5
  %208 = load i32, ptr %21, align 4, !tbaa !9
  %209 = sext i32 %208 to i64
  %210 = getelementptr inbounds float, ptr %207, i64 %209
  %211 = load float, ptr %210, align 4, !tbaa !17
  %212 = fadd float %201, %211
  %213 = load i32, ptr %22, align 4, !tbaa !9
  %214 = sitofp i32 %213 to float
  %215 = call float @llvm.fmuladd.f32(float %212, float %214, float %191)
  store float %215, ptr %23, align 4, !tbaa !17
  %216 = load i32, ptr %20, align 4, !tbaa !9
  %217 = add nsw i32 %216, 1
  store i32 %217, ptr %20, align 4, !tbaa !9
  %218 = load i32, ptr %21, align 4, !tbaa !9
  %219 = sub nsw i32 %218, 1
  store i32 %219, ptr %21, align 4, !tbaa !9
  br label %220

220:                                              ; preds = %190
  %221 = load i32, ptr %22, align 4, !tbaa !9
  %222 = add nsw i32 %221, 1
  store i32 %222, ptr %22, align 4, !tbaa !9
  br label %186, !llvm.loop !19

223:                                              ; preds = %186
  %224 = load i32, ptr %20, align 4, !tbaa !9
  %225 = load i32, ptr %21, align 4, !tbaa !9
  %226 = icmp eq i32 %224, %225
  br i1 %226, label %227, label %256

227:                                              ; preds = %223
  %228 = load float, ptr %23, align 4, !tbaa !17
  %229 = load ptr, ptr %6, align 8, !tbaa !5
  %230 = getelementptr inbounds %struct.MWave, ptr %229, i32 0, i32 2
  %231 = load i32, ptr %12, align 4, !tbaa !9
  %232 = sext i32 %231 to i64
  %233 = getelementptr inbounds [32 x ptr], ptr %230, i64 0, i64 %232
  %234 = load ptr, ptr %233, align 8, !tbaa !5
  %235 = load i32, ptr %20, align 4, !tbaa !9
  %236 = sext i32 %235 to i64
  %237 = getelementptr inbounds float, ptr %234, i64 %236
  %238 = load float, ptr %237, align 4, !tbaa !17
  %239 = load i32, ptr %22, align 4, !tbaa !9
  %240 = sitofp i32 %239 to float
  %241 = call float @llvm.fmuladd.f32(float %238, float %240, float %228)
  store float %241, ptr %23, align 4, !tbaa !17
  %242 = load float, ptr %23, align 4, !tbaa !17
  %243 = load i32, ptr %22, align 4, !tbaa !9
  %244 = load i32, ptr %22, align 4, !tbaa !9
  %245 = mul nsw i32 %243, %244
  %246 = sitofp i32 %245 to float
  %247 = fdiv float %242, %246
  %248 = load ptr, ptr %10, align 8, !tbaa !5
  %249 = load i32, ptr %12, align 4, !tbaa !9
  %250 = sext i32 %249 to i64
  %251 = getelementptr inbounds ptr, ptr %248, i64 %250
  %252 = load ptr, ptr %251, align 8, !tbaa !5
  %253 = load i32, ptr %11, align 4, !tbaa !9
  %254 = sext i32 %253 to i64
  %255 = getelementptr inbounds float, ptr %252, i64 %254
  store float %247, ptr %255, align 4, !tbaa !17
  br label %272

256:                                              ; preds = %223
  %257 = load float, ptr %23, align 4, !tbaa !17
  %258 = load i32, ptr %22, align 4, !tbaa !9
  %259 = load i32, ptr %22, align 4, !tbaa !9
  %260 = sub nsw i32 %259, 1
  %261 = mul nsw i32 %258, %260
  %262 = sitofp i32 %261 to float
  %263 = fdiv float %257, %262
  %264 = load ptr, ptr %10, align 8, !tbaa !5
  %265 = load i32, ptr %12, align 4, !tbaa !9
  %266 = sext i32 %265 to i64
  %267 = getelementptr inbounds ptr, ptr %264, i64 %266
  %268 = load ptr, ptr %267, align 8, !tbaa !5
  %269 = load i32, ptr %11, align 4, !tbaa !9
  %270 = sext i32 %269 to i64
  %271 = getelementptr inbounds float, ptr %268, i64 %270
  store float %263, ptr %271, align 4, !tbaa !17
  br label %272

272:                                              ; preds = %256, %227
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #4
  br label %273

273:                                              ; preds = %272
  %274 = load i32, ptr %11, align 4, !tbaa !9
  %275 = add nsw i32 %274, 1
  store i32 %275, ptr %11, align 4, !tbaa !9
  br label %170, !llvm.loop !21

276:                                              ; preds = %170
  br label %277

277:                                              ; preds = %276
  %278 = load i32, ptr %12, align 4, !tbaa !9
  %279 = add nsw i32 %278, 1
  store i32 %279, ptr %12, align 4, !tbaa !9
  br label %163, !llvm.loop !22

280:                                              ; preds = %163
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  ret void
}

declare void @m_Exception(i32 noundef, i32 noundef, ptr noundef, i32 noundef, ptr noundef, ptr noundef, ...) #2

declare ptr @m_PropertyRead(ptr noundef, ptr noundef, ptr noundef, ptr noundef) #2

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare float @llvm.fmuladd.f32(float, float, float) #3

attributes #0 = { 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !10, i64 0}
!12 = !{!"MWave", !10, i64 0, !10, i64 4, !7, i64 8}
!13 = !{!12, !10, i64 4}
!14 = !{!15, !10, i64 0}
!15 = !{!"TriangleFilter", !10, i64 0, !10, i64 4}
!16 = !{!15, !10, i64 4}
!17 = !{!18, !18, i64 0}
!18 = !{!"float", !7, i64 0}
!19 = distinct !{!19, !20}
!20 = !{!"llvm.loop.mustprogress"}
!21 = distinct !{!21, !20}
!22 = distinct !{!22, !20}


; 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.TriangleFilter = type { i32, i32 }

@g_uniform_high_frequency = external hidden local_unnamed_addr global i32, align 4
@g_uniform_low_frequency = external hidden local_unnamed_addr global i32, align 4
@g_uniform_num = external hidden local_unnamed_addr global i32, align 4
@g_uniform_para = external hidden local_unnamed_addr global [128 x %struct.TriangleFilter], align 16
@.str = external hidden unnamed_addr constant [85 x i8], align 1
@__FUNCTION__.mUniformFilterBank = external hidden unnamed_addr constant [19 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [14 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [10 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [16 x i8], align 1

; Function Attrs: nounwind uwtable
declare dso_local void @GetUniformPara() local_unnamed_addr #0

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

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

; Function Attrs: nounwind uwtable
define dso_local void @mUniformFilterBank(ptr noundef %0, i32 noundef %1, i32 noundef %2, i32 noundef %3, ptr noundef %4) local_unnamed_addr #0 {
  %6 = alloca i32, align 4
  %magicptr = ptrtoint ptr %0 to i64
  switch i64 %magicptr, label %7 [
    i64 -1, label %.critedge
    i64 0, label %.critedge
  ]

7:                                                ; preds = %5
  %8 = getelementptr inbounds i8, ptr %0, i64 8
  %9 = icmp eq ptr %8, inttoptr (i64 -1 to ptr)
  br i1 %9, label %.critedge, label %10

10:                                               ; preds = %7
  %11 = load i32, ptr %0, align 8, !tbaa !5
  %12 = icmp slt i32 %11, 1
  br i1 %12, label %.critedge, label %13

13:                                               ; preds = %10
  %14 = getelementptr inbounds i8, ptr %0, i64 4
  %15 = load i32, ptr %14, align 4, !tbaa !10
  %16 = icmp sgt i32 %15, 0
  br i1 %16, label %17, label %.critedge

.critedge:                                        ; preds = %7, %10, %5, %5, %13
  tail call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef 1, i32 noundef -1, ptr noundef nonnull @.str, i32 noundef 82, ptr noundef nonnull @__FUNCTION__.mUniformFilterBank, ptr noundef nonnull @.str.1) #4
  br label %17

17:                                               ; preds = %.critedge, %13
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #4
  store i32 -1, ptr %6, align 4, !tbaa !11
  %18 = call ptr @m_PropertyRead(ptr noundef %0, ptr noundef nonnull @.str.2, ptr noundef nonnull %6, ptr noundef null) #4
  %19 = load i32, ptr %6, align 4, !tbaa !11
  %.not = icmp eq i32 %19, 2
  br i1 %.not, label %21, label %20

20:                                               ; preds = %17
  call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef 1, i32 noundef -1, ptr noundef nonnull @.str, i32 noundef 84, ptr noundef nonnull @__FUNCTION__.mUniformFilterBank, ptr noundef nonnull @.str.3) #4
  br label %21

21:                                               ; preds = %20, %17
  %magicptr93 = ptrtoint ptr %4 to i64
  switch i64 %magicptr93, label %27 [
    i64 -1, label %22
    i64 0, label %22
  ]

22:                                               ; preds = %21, %21
  %23 = icmp eq ptr %4, null
  %24 = icmp eq ptr %4, inttoptr (i64 -1 to ptr)
  %25 = or i1 %23, %24
  %26 = zext i1 %25 to i32
  call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef %26, i32 noundef -1, ptr noundef nonnull @.str, i32 noundef 85, ptr noundef nonnull @__FUNCTION__.mUniformFilterBank, ptr noundef nonnull @.str.1) #4
  br label %27

27:                                               ; preds = %21, %22
  %28 = icmp eq i32 %1, -1
  %spec.store.select = select i1 %28, i32 0, i32 %1
  %29 = icmp slt i32 %spec.store.select, 0
  br i1 %29, label %30, label %31

30:                                               ; preds = %27
  call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef 1, i32 noundef -1, ptr noundef nonnull @.str, i32 noundef 88, ptr noundef nonnull @__FUNCTION__.mUniformFilterBank, ptr noundef nonnull @.str.1) #4
  br label %31

31:                                               ; preds = %30, %27
  %32 = icmp eq i32 %2, -1
  %33 = getelementptr inbounds i8, ptr %0, i64 4
  %34 = load i32, ptr %33, align 4, !tbaa !10
  br i1 %32, label %.thread, label %35

35:                                               ; preds = %31
  %36 = icmp slt i32 %34, %2
  br i1 %36, label %37, label %.thread

37:                                               ; preds = %35
  call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef 1, i32 noundef -1, ptr noundef nonnull @.str, i32 noundef 91, ptr noundef nonnull @__FUNCTION__.mUniformFilterBank, ptr noundef nonnull @.str.1) #4
  br label %.thread

.thread:                                          ; preds = %31, %37, %35
  %.084125 = phi i32 [ %2, %37 ], [ %2, %35 ], [ %34, %31 ]
  %38 = icmp ugt i32 %3, 128
  br i1 %38, label %39, label %40

39:                                               ; preds = %.thread
  call void (i32, i32, ptr, i32, ptr, ptr, ...) @m_Exception(i32 noundef 1, i32 noundef -1, ptr noundef nonnull @.str, i32 noundef 92, ptr noundef nonnull @__FUNCTION__.mUniformFilterBank, ptr noundef nonnull @.str.4) #4
  br label %40

40:                                               ; preds = %39, %.thread
  %41 = load i32, ptr @g_uniform_low_frequency, align 4, !tbaa !11
  %.not90 = icmp eq i32 %41, %spec.store.select
  %42 = load i32, ptr @g_uniform_high_frequency, align 4
  %.not91 = icmp eq i32 %42, %.084125
  %or.cond = select i1 %.not90, i1 %.not91, i1 false
  %43 = load i32, ptr @g_uniform_num, align 4
  %.not92 = icmp eq i32 %43, %3
  %or.cond94 = select i1 %or.cond, i1 %.not92, i1 false
  br i1 %or.cond94, label %45, label %44

44:                                               ; preds = %40
  store i32 %spec.store.select, ptr @g_uniform_low_frequency, align 4, !tbaa !11
  store i32 %.084125, ptr @g_uniform_high_frequency, align 4, !tbaa !11
  store i32 %3, ptr @g_uniform_num, align 4, !tbaa !11
  call void @GetUniformPara()
  br label %45

45:                                               ; preds = %40, %44
  %46 = load i32, ptr %0, align 8, !tbaa !5
  %47 = icmp sgt i32 %46, 0
  br i1 %47, label %.preheader.lr.ph, label %._crit_edge107

.preheader.lr.ph:                                 ; preds = %45
  %48 = icmp sgt i32 %3, 0
  %49 = getelementptr inbounds i8, ptr %0, i64 8
  br i1 %48, label %.preheader.us.preheader, label %._crit_edge107

.preheader.us.preheader:                          ; preds = %.preheader.lr.ph
  %wide.trip.count122 = zext nneg i32 %46 to i64
  %wide.trip.count = zext nneg i32 %3 to i64
  br label %.preheader.us

.preheader.us:                                    ; preds = %.preheader.us.preheader, %._crit_edge105.us
  %indvars.iv119 = phi i64 [ 0, %.preheader.us.preheader ], [ %indvars.iv.next120, %._crit_edge105.us ]
  %50 = getelementptr inbounds [32 x ptr], ptr %49, i64 0, i64 %indvars.iv119
  %51 = getelementptr inbounds ptr, ptr %4, i64 %indvars.iv119
  %52 = load ptr, ptr %51, align 8, !tbaa !12
  br label %53

53:                                               ; preds = %.preheader.us, %77
  %indvars.iv116 = phi i64 [ 0, %.preheader.us ], [ %indvars.iv.next117, %77 ]
  %54 = getelementptr inbounds [128 x %struct.TriangleFilter], ptr @g_uniform_para, i64 0, i64 %indvars.iv116
  %55 = load i32, ptr %54, align 8, !tbaa !14
  %56 = getelementptr inbounds i8, ptr %54, i64 4
  %57 = load i32, ptr %56, align 4, !tbaa !16
  %.08295.us = add nsw i32 %57, -1
  %58 = icmp sgt i32 %.08295.us, %55
  br i1 %58, label %.lr.ph.us, label %._crit_edge.us

._crit_edge.us.loopexit:                          ; preds = %79
  %59 = trunc nsw i64 %indvars.iv.next112 to i32
  %60 = trunc nsw i64 %indvars.iv.next to i32
  br label %._crit_edge.us

._crit_edge.us:                                   ; preds = %._crit_edge.us.loopexit, %53
  %.083.lcssa.us = phi i32 [ %55, %53 ], [ %59, %._crit_edge.us.loopexit ]
  %.081.lcssa.us = phi i32 [ 1, %53 ], [ %87, %._crit_edge.us.loopexit ]
  %.0.lcssa.us = phi float [ 0.000000e+00, %53 ], [ %86, %._crit_edge.us.loopexit ]
  %.082.lcssa.us = phi i32 [ %.08295.us, %53 ], [ %60, %._crit_edge.us.loopexit ]
  %61 = icmp eq i32 %.083.lcssa.us, %.082.lcssa.us
  br i1 %61, label %67, label %62

62:                                               ; preds = %._crit_edge.us
  %63 = add nsw i32 %.081.lcssa.us, -1
  %64 = mul nsw i32 %63, %.081.lcssa.us
  %65 = sitofp i32 %64 to float
  %66 = fdiv float %.0.lcssa.us, %65
  br label %77

67:                                               ; preds = %._crit_edge.us
  %68 = load ptr, ptr %50, align 8, !tbaa !12
  %69 = sext i32 %.083.lcssa.us to i64
  %70 = getelementptr inbounds float, ptr %68, i64 %69
  %71 = load float, ptr %70, align 4, !tbaa !17
  %72 = uitofp nneg i32 %.081.lcssa.us to float
  %73 = call float @llvm.fmuladd.f32(float %71, float %72, float %.0.lcssa.us)
  %74 = mul nuw nsw i32 %.081.lcssa.us, %.081.lcssa.us
  %75 = uitofp nneg i32 %74 to float
  %76 = fdiv float %73, %75
  br label %77

77:                                               ; preds = %67, %62
  %.sink = phi float [ %76, %67 ], [ %66, %62 ]
  %78 = getelementptr inbounds float, ptr %52, i64 %indvars.iv116
  store float %.sink, ptr %78, align 4, !tbaa !17
  %indvars.iv.next117 = add nuw nsw i64 %indvars.iv116, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next117, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge105.us, label %53, !llvm.loop !19

79:                                               ; preds = %.lr.ph.us, %79
  %indvars.iv111 = phi i64 [ %92, %.lr.ph.us ], [ %indvars.iv.next112, %79 ]
  %indvars.iv = phi i64 [ %91, %.lr.ph.us ], [ %indvars.iv.next, %79 ]
  %.098.us = phi float [ 0.000000e+00, %.lr.ph.us ], [ %86, %79 ]
  %.08197.us = phi i32 [ 1, %.lr.ph.us ], [ %87, %79 ]
  %80 = getelementptr inbounds float, ptr %89, i64 %indvars.iv111
  %81 = load float, ptr %80, align 4, !tbaa !17
  %82 = getelementptr inbounds float, ptr %89, i64 %indvars.iv
  %83 = load float, ptr %82, align 4, !tbaa !17
  %84 = fadd float %81, %83
  %85 = uitofp nneg i32 %.08197.us to float
  %86 = call float @llvm.fmuladd.f32(float %84, float %85, float %.098.us)
  %indvars.iv.next112 = add nsw i64 %indvars.iv111, 1
  %87 = add nuw nsw i32 %.08197.us, 1
  %indvars.iv.next = add nsw i64 %indvars.iv, -1
  %88 = icmp sgt i64 %indvars.iv.next, %indvars.iv.next112
  br i1 %88, label %79, label %._crit_edge.us.loopexit, !llvm.loop !21

.lr.ph.us:                                        ; preds = %53
  %89 = load ptr, ptr %50, align 8, !tbaa !12
  %90 = sext i32 %57 to i64
  %91 = add nsw i64 %90, -1
  %92 = sext i32 %55 to i64
  br label %79

._crit_edge105.us:                                ; preds = %77
  %indvars.iv.next120 = add nuw nsw i64 %indvars.iv119, 1
  %exitcond123.not = icmp eq i64 %indvars.iv.next120, %wide.trip.count122
  br i1 %exitcond123.not, label %._crit_edge107, label %.preheader.us, !llvm.loop !22

._crit_edge107:                                   ; preds = %._crit_edge105.us, %.preheader.lr.ph, %45
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #4
  ret void
}

declare void @m_Exception(i32 noundef, i32 noundef, ptr noundef, i32 noundef, ptr noundef, ptr noundef, ...) local_unnamed_addr #2

declare ptr @m_PropertyRead(ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare float @llvm.fmuladd.f32(float, float, float) #3

attributes #0 = { 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "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 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = !{!"MWave", !7, i64 0, !7, i64 4, !8, i64 8}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!6, !7, i64 4}
!11 = !{!7, !7, i64 0}
!12 = !{!13, !13, i64 0}
!13 = !{!"any pointer", !8, i64 0}
!14 = !{!15, !7, i64 0}
!15 = !{!"TriangleFilter", !7, i64 0, !7, i64 4}
!16 = !{!15, !7, i64 4}
!17 = !{!18, !18, i64 0}
!18 = !{!"float", !8, i64 0}
!19 = distinct !{!19, !20}
!20 = !{!"llvm.loop.mustprogress"}
!21 = distinct !{!21, !20}
!22 = distinct !{!22, !20}


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