; LLVM IR from frozein/DoonEngine :: src/DoonEngine (voxelShapes)

; 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.DNvoxel = type { i8, %union.QMvec3, %struct.DNcolor }
%union.QMvec3 = type { [3 x float] }
%struct.DNcolor = type { i8, i8, i8 }
%struct.DNivec3 = type { i32, i32, i32 }
%struct.DNcompressedVoxel = type { i32, i32 }
%struct.DNvoxelModel = type { %struct.DNuvec3, ptr }
%struct.DNuvec3 = type { i32, i32, i32 }
%struct.anon = type { float, float, float }

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #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: inlinehint nounwind uwtable
declare hidden float @DN_vec3_dot(<2 x float>, float, <2 x float>, float) #2

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fabs.f64(double) #3

; Function Attrs: inlinehint nounwind uwtable
declare hidden { <2 x float>, float } @DN_vec3_scale(<2 x float>, float, float noundef) #2

; Function Attrs: inlinehint nounwind uwtable
declare hidden { <2 x float>, float } @DN_vec3_add(<2 x float>, float, <2 x float>, float) #2

declare i64 @DN_compress_voxel(ptr noundef byval(%struct.DNvoxel) align 8) #4

; Function Attrs: nounwind uwtable
define dso_local void @DN_calculate_model_normals(i32 noundef %0, ptr noundef %1) #5 {
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca %union.QMvec3, align 4
  %10 = alloca %struct.DNivec3, align 4
  %11 = alloca i32, align 4
  %12 = alloca %struct.DNvoxel, align 8
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca %struct.DNivec3, align 4
  %17 = alloca i32, align 4
  %18 = alloca %struct.DNvoxel, align 4
  %19 = alloca %union.QMvec3, align 4
  %20 = alloca float, align 4
  %21 = alloca { <2 x float>, float }, align 4
  %22 = alloca { <2 x float>, float }, align 4
  %23 = alloca %union.QMvec3, align 4
  %24 = alloca { <2 x float>, float }, align 4
  %25 = alloca { <2 x float>, float }, align 8
  %26 = alloca %union.QMvec3, align 4
  %27 = alloca { <2 x float>, float }, align 4
  %28 = alloca { <2 x float>, float }, align 4
  %29 = alloca { <2 x float>, float }, align 8
  %30 = alloca %union.QMvec3, align 4
  %31 = alloca float, align 4
  %32 = alloca %union.QMvec3, align 4
  %33 = alloca { <2 x float>, float }, align 4
  %34 = alloca { <2 x float>, float }, align 8
  %35 = alloca %struct.DNcompressedVoxel, align 4
  store i32 %0, ptr %3, align 4, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #7
  store i32 0, ptr %5, align 4, !tbaa !5
  br label %36

36:                                               ; preds = %341, %2
  %37 = load i32, ptr %5, align 4, !tbaa !5
  %38 = load ptr, ptr %4, align 8, !tbaa !9
  %39 = getelementptr inbounds %struct.DNvoxelModel, ptr %38, i32 0, i32 0
  %40 = getelementptr inbounds %struct.DNuvec3, ptr %39, i32 0, i32 2
  %41 = load i32, ptr %40, align 8, !tbaa !11
  %42 = icmp ult i32 %37, %41
  br i1 %42, label %44, label %43

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

44:                                               ; preds = %36
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #7
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %45

45:                                               ; preds = %337, %44
  %46 = load i32, ptr %7, align 4, !tbaa !5
  %47 = load ptr, ptr %4, align 8, !tbaa !9
  %48 = getelementptr inbounds %struct.DNvoxelModel, ptr %47, i32 0, i32 0
  %49 = getelementptr inbounds %struct.DNuvec3, ptr %48, i32 0, i32 1
  %50 = load i32, ptr %49, align 4, !tbaa !14
  %51 = icmp ult i32 %46, %50
  br i1 %51, label %53, label %52

52:                                               ; preds = %45
  store i32 5, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  br label %340

53:                                               ; preds = %45
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #7
  store i32 0, ptr %8, align 4, !tbaa !5
  br label %54

54:                                               ; preds = %333, %53
  %55 = load i32, ptr %8, align 4, !tbaa !5
  %56 = load ptr, ptr %4, align 8, !tbaa !9
  %57 = getelementptr inbounds %struct.DNvoxelModel, ptr %56, i32 0, i32 0
  %58 = getelementptr inbounds %struct.DNuvec3, ptr %57, i32 0, i32 2
  %59 = load i32, ptr %58, align 8, !tbaa !11
  %60 = icmp ult i32 %55, %59
  br i1 %60, label %62, label %61

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

62:                                               ; preds = %54
  call void @llvm.lifetime.start.p0(i64 12, ptr %9) #7
  call void @llvm.memset.p0.i64(ptr align 4 %9, i8 0, i64 12, i1 false)
  call void @llvm.lifetime.start.p0(i64 12, ptr %10) #7
  %63 = getelementptr inbounds %struct.DNivec3, ptr %10, i32 0, i32 0
  %64 = load i32, ptr %8, align 4, !tbaa !5
  store i32 %64, ptr %63, align 4, !tbaa !15
  %65 = getelementptr inbounds %struct.DNivec3, ptr %10, i32 0, i32 1
  %66 = load i32, ptr %7, align 4, !tbaa !5
  store i32 %66, ptr %65, align 4, !tbaa !17
  %67 = getelementptr inbounds %struct.DNivec3, ptr %10, i32 0, i32 2
  %68 = load i32, ptr %5, align 4, !tbaa !5
  store i32 %68, ptr %67, align 4, !tbaa !18
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #7
  %69 = getelementptr inbounds %struct.DNivec3, ptr %10, i32 0, i32 0
  %70 = load i32, ptr %69, align 4, !tbaa !15
  %71 = load ptr, ptr %4, align 8, !tbaa !9
  %72 = getelementptr inbounds %struct.DNvoxelModel, ptr %71, i32 0, i32 0
  %73 = getelementptr inbounds %struct.DNuvec3, ptr %72, i32 0, i32 0
  %74 = load i32, ptr %73, align 8, !tbaa !19
  %75 = getelementptr inbounds %struct.DNivec3, ptr %10, i32 0, i32 1
  %76 = load i32, ptr %75, align 4, !tbaa !17
  %77 = getelementptr inbounds %struct.DNivec3, ptr %10, i32 0, i32 2
  %78 = load i32, ptr %77, align 4, !tbaa !18
  %79 = load ptr, ptr %4, align 8, !tbaa !9
  %80 = getelementptr inbounds %struct.DNvoxelModel, ptr %79, i32 0, i32 0
  %81 = getelementptr inbounds %struct.DNuvec3, ptr %80, i32 0, i32 1
  %82 = load i32, ptr %81, align 4, !tbaa !14
  %83 = mul i32 %78, %82
  %84 = add i32 %76, %83
  %85 = mul i32 %74, %84
  %86 = add i32 %70, %85
  store i32 %86, ptr %11, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 20, ptr %12) #7
  %87 = load ptr, ptr %4, align 8, !tbaa !9
  %88 = getelementptr inbounds %struct.DNvoxelModel, ptr %87, i32 0, i32 1
  %89 = load ptr, ptr %88, align 8, !tbaa !20
  %90 = load i32, ptr %11, align 4, !tbaa !5
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds %struct.DNcompressedVoxel, ptr %89, i64 %91
  %93 = load i64, ptr %92, align 4
  call void @DN_decompress_voxel(ptr dead_on_unwind writable sret(%struct.DNvoxel) align 4 %12, i64 %93)
  %94 = getelementptr inbounds %struct.DNvoxel, ptr %12, i32 0, i32 0
  %95 = load i8, ptr %94, align 4, !tbaa !21
  %96 = zext i8 %95 to i32
  %97 = icmp eq i32 %96, 255
  br i1 %97, label %98, label %99

98:                                               ; preds = %62
  store i32 10, ptr %6, align 4
  br label %330

99:                                               ; preds = %62
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #7
  %100 = load i32, ptr %5, align 4, !tbaa !5
  %101 = load i32, ptr %3, align 4, !tbaa !5
  %102 = sub nsw i32 %100, %101
  store i32 %102, ptr %13, align 4, !tbaa !5
  br label %103

103:                                              ; preds = %262, %99
  %104 = load i32, ptr %13, align 4, !tbaa !5
  %105 = load i32, ptr %5, align 4, !tbaa !5
  %106 = load i32, ptr %3, align 4, !tbaa !5
  %107 = add nsw i32 %105, %106
  %108 = icmp sle i32 %104, %107
  br i1 %108, label %110, label %109

109:                                              ; preds = %103
  store i32 11, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  br label %265

110:                                              ; preds = %103
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #7
  %111 = load i32, ptr %7, align 4, !tbaa !5
  %112 = load i32, ptr %3, align 4, !tbaa !5
  %113 = sub nsw i32 %111, %112
  store i32 %113, ptr %14, align 4, !tbaa !5
  br label %114

114:                                              ; preds = %258, %110
  %115 = load i32, ptr %14, align 4, !tbaa !5
  %116 = load i32, ptr %7, align 4, !tbaa !5
  %117 = load i32, ptr %3, align 4, !tbaa !5
  %118 = add nsw i32 %116, %117
  %119 = icmp sle i32 %115, %118
  br i1 %119, label %121, label %120

120:                                              ; preds = %114
  store i32 14, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  br label %261

121:                                              ; preds = %114
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #7
  %122 = load i32, ptr %8, align 4, !tbaa !5
  %123 = load i32, ptr %3, align 4, !tbaa !5
  %124 = sub nsw i32 %122, %123
  store i32 %124, ptr %15, align 4, !tbaa !5
  br label %125

125:                                              ; preds = %254, %121
  %126 = load i32, ptr %15, align 4, !tbaa !5
  %127 = load i32, ptr %8, align 4, !tbaa !5
  %128 = load i32, ptr %3, align 4, !tbaa !5
  %129 = add nsw i32 %127, %128
  %130 = icmp sle i32 %126, %129
  br i1 %130, label %132, label %131

131:                                              ; preds = %125
  store i32 17, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  br label %257

132:                                              ; preds = %125
  %133 = load i32, ptr %15, align 4, !tbaa !5
  %134 = icmp slt i32 %133, 0
  br i1 %134, label %141, label %135

135:                                              ; preds = %132
  %136 = load i32, ptr %14, align 4, !tbaa !5
  %137 = icmp slt i32 %136, 0
  br i1 %137, label %141, label %138

138:                                              ; preds = %135
  %139 = load i32, ptr %13, align 4, !tbaa !5
  %140 = icmp slt i32 %139, 0
  br i1 %140, label %141, label %142

141:                                              ; preds = %138, %135, %132
  br label %254

142:                                              ; preds = %138
  %143 = load i32, ptr %15, align 4, !tbaa !5
  %144 = load ptr, ptr %4, align 8, !tbaa !9
  %145 = getelementptr inbounds %struct.DNvoxelModel, ptr %144, i32 0, i32 0
  %146 = getelementptr inbounds %struct.DNuvec3, ptr %145, i32 0, i32 0
  %147 = load i32, ptr %146, align 8, !tbaa !19
  %148 = icmp uge i32 %143, %147
  br i1 %148, label %163, label %149

149:                                              ; preds = %142
  %150 = load i32, ptr %14, align 4, !tbaa !5
  %151 = load ptr, ptr %4, align 8, !tbaa !9
  %152 = getelementptr inbounds %struct.DNvoxelModel, ptr %151, i32 0, i32 0
  %153 = getelementptr inbounds %struct.DNuvec3, ptr %152, i32 0, i32 1
  %154 = load i32, ptr %153, align 4, !tbaa !14
  %155 = icmp uge i32 %150, %154
  br i1 %155, label %163, label %156

156:                                              ; preds = %149
  %157 = load i32, ptr %13, align 4, !tbaa !5
  %158 = load ptr, ptr %4, align 8, !tbaa !9
  %159 = getelementptr inbounds %struct.DNvoxelModel, ptr %158, i32 0, i32 0
  %160 = getelementptr inbounds %struct.DNuvec3, ptr %159, i32 0, i32 2
  %161 = load i32, ptr %160, align 8, !tbaa !11
  %162 = icmp uge i32 %157, %161
  br i1 %162, label %163, label %164

163:                                              ; preds = %156, %149, %142
  br label %254

164:                                              ; preds = %156
  call void @llvm.lifetime.start.p0(i64 12, ptr %16) #7
  %165 = getelementptr inbounds %struct.DNivec3, ptr %16, i32 0, i32 0
  %166 = load i32, ptr %15, align 4, !tbaa !5
  store i32 %166, ptr %165, align 4, !tbaa !15
  %167 = getelementptr inbounds %struct.DNivec3, ptr %16, i32 0, i32 1
  %168 = load i32, ptr %14, align 4, !tbaa !5
  store i32 %168, ptr %167, align 4, !tbaa !17
  %169 = getelementptr inbounds %struct.DNivec3, ptr %16, i32 0, i32 2
  %170 = load i32, ptr %13, align 4, !tbaa !5
  store i32 %170, ptr %169, align 4, !tbaa !18
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #7
  %171 = getelementptr inbounds %struct.DNivec3, ptr %16, i32 0, i32 0
  %172 = load i32, ptr %171, align 4, !tbaa !15
  %173 = load ptr, ptr %4, align 8, !tbaa !9
  %174 = getelementptr inbounds %struct.DNvoxelModel, ptr %173, i32 0, i32 0
  %175 = getelementptr inbounds %struct.DNuvec3, ptr %174, i32 0, i32 0
  %176 = load i32, ptr %175, align 8, !tbaa !19
  %177 = getelementptr inbounds %struct.DNivec3, ptr %16, i32 0, i32 1
  %178 = load i32, ptr %177, align 4, !tbaa !17
  %179 = getelementptr inbounds %struct.DNivec3, ptr %16, i32 0, i32 2
  %180 = load i32, ptr %179, align 4, !tbaa !18
  %181 = load ptr, ptr %4, align 8, !tbaa !9
  %182 = getelementptr inbounds %struct.DNvoxelModel, ptr %181, i32 0, i32 0
  %183 = getelementptr inbounds %struct.DNuvec3, ptr %182, i32 0, i32 1
  %184 = load i32, ptr %183, align 4, !tbaa !14
  %185 = mul i32 %180, %184
  %186 = add i32 %178, %185
  %187 = mul i32 %176, %186
  %188 = add i32 %172, %187
  store i32 %188, ptr %17, align 4, !tbaa !5
  %189 = load i32, ptr %17, align 4, !tbaa !5
  %190 = load i32, ptr %11, align 4, !tbaa !5
  %191 = icmp eq i32 %189, %190
  br i1 %191, label %192, label %193

192:                                              ; preds = %164
  store i32 19, ptr %6, align 4
  br label %251

193:                                              ; preds = %164
  %194 = load ptr, ptr %4, align 8, !tbaa !9
  %195 = getelementptr inbounds %struct.DNvoxelModel, ptr %194, i32 0, i32 1
  %196 = load ptr, ptr %195, align 8, !tbaa !20
  %197 = load i32, ptr %17, align 4, !tbaa !5
  %198 = sext i32 %197 to i64
  %199 = getelementptr inbounds %struct.DNcompressedVoxel, ptr %196, i64 %198
  %200 = load i64, ptr %199, align 4
  call void @DN_decompress_voxel(ptr dead_on_unwind writable sret(%struct.DNvoxel) align 4 %18, i64 %200)
  %201 = getelementptr inbounds %struct.DNvoxel, ptr %18, i32 0, i32 0
  %202 = load i8, ptr %201, align 4, !tbaa !21
  %203 = zext i8 %202 to i32
  %204 = icmp ne i32 %203, 255
  br i1 %204, label %205, label %250

205:                                              ; preds = %193
  call void @llvm.lifetime.start.p0(i64 12, ptr %19) #7
  %206 = load i32, ptr %15, align 4, !tbaa !5
  %207 = load i32, ptr %8, align 4, !tbaa !5
  %208 = sub nsw i32 %206, %207
  %209 = sitofp i32 %208 to float
  store float %209, ptr %19, align 4, !tbaa !24
  %210 = getelementptr inbounds float, ptr %19, i64 1
  %211 = load i32, ptr %14, align 4, !tbaa !5
  %212 = load i32, ptr %7, align 4, !tbaa !5
  %213 = sub nsw i32 %211, %212
  %214 = sitofp i32 %213 to float
  store float %214, ptr %210, align 4, !tbaa !24
  %215 = getelementptr inbounds float, ptr %19, i64 2
  %216 = load i32, ptr %13, align 4, !tbaa !5
  %217 = load i32, ptr %5, align 4, !tbaa !5
  %218 = sub nsw i32 %216, %217
  %219 = sitofp i32 %218 to float
  store float %219, ptr %215, align 4, !tbaa !24
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #7
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %21, ptr align 4 %19, i64 12, i1 false)
  %220 = getelementptr inbounds { <2 x float>, float }, ptr %21, i32 0, i32 0
  %221 = load <2 x float>, ptr %220, align 4
  %222 = getelementptr inbounds { <2 x float>, float }, ptr %21, i32 0, i32 1
  %223 = load float, ptr %222, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %22, ptr align 4 %19, i64 12, i1 false)
  %224 = getelementptr inbounds { <2 x float>, float }, ptr %22, i32 0, i32 0
  %225 = load <2 x float>, ptr %224, align 4
  %226 = getelementptr inbounds { <2 x float>, float }, ptr %22, i32 0, i32 1
  %227 = load float, ptr %226, align 4
  %228 = call float @DN_vec3_dot(<2 x float> %221, float %223, <2 x float> %225, float %227)
  store float %228, ptr %20, align 4, !tbaa !24
  %229 = load float, ptr %20, align 4, !tbaa !24
  %230 = load float, ptr %20, align 4, !tbaa !24
  %231 = fmul float %230, %229
  store float %231, ptr %20, align 4, !tbaa !24
  call void @llvm.lifetime.start.p0(i64 12, ptr %23) #7
  %232 = load float, ptr %20, align 4, !tbaa !24
  %233 = fdiv float 1.000000e+00, %232
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %24, ptr align 4 %19, i64 12, i1 false)
  %234 = getelementptr inbounds { <2 x float>, float }, ptr %24, i32 0, i32 0
  %235 = load <2 x float>, ptr %234, align 4
  %236 = getelementptr inbounds { <2 x float>, float }, ptr %24, i32 0, i32 1
  %237 = load float, ptr %236, align 4
  %238 = call { <2 x float>, float } @DN_vec3_scale(<2 x float> %235, float %237, float noundef %233)
  %239 = getelementptr inbounds %union.QMvec3, ptr %23, i32 0, i32 0
  store { <2 x float>, float } %238, ptr %25, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %239, ptr align 8 %25, i64 12, i1 false)
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %19, ptr align 4 %23, i64 12, i1 false), !tbaa.struct !26
  call void @llvm.lifetime.end.p0(i64 12, ptr %23) #7
  call void @llvm.lifetime.start.p0(i64 12, ptr %26) #7
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %27, ptr align 4 %9, i64 12, i1 false)
  %240 = getelementptr inbounds { <2 x float>, float }, ptr %27, i32 0, i32 0
  %241 = load <2 x float>, ptr %240, align 4
  %242 = getelementptr inbounds { <2 x float>, float }, ptr %27, i32 0, i32 1
  %243 = load float, ptr %242, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %28, ptr align 4 %19, i64 12, i1 false)
  %244 = getelementptr inbounds { <2 x float>, float }, ptr %28, i32 0, i32 0
  %245 = load <2 x float>, ptr %244, align 4
  %246 = getelementptr inbounds { <2 x float>, float }, ptr %28, i32 0, i32 1
  %247 = load float, ptr %246, align 4
  %248 = call { <2 x float>, float } @DN_vec3_add(<2 x float> %241, float %243, <2 x float> %245, float %247)
  %249 = getelementptr inbounds %union.QMvec3, ptr %26, i32 0, i32 0
  store { <2 x float>, float } %248, ptr %29, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %249, ptr align 8 %29, i64 12, i1 false)
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %9, ptr align 4 %26, i64 12, i1 false), !tbaa.struct !26
  call void @llvm.lifetime.end.p0(i64 12, ptr %26) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr %19) #7
  br label %250

250:                                              ; preds = %205, %193
  store i32 0, ptr %6, align 4
  br label %251

251:                                              ; preds = %250, %192
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr %16) #7
  %252 = load i32, ptr %6, align 4
  switch i32 %252, label %345 [
    i32 0, label %253
    i32 19, label %254
  ]

253:                                              ; preds = %251
  br label %254

254:                                              ; preds = %253, %251, %163, %141
  %255 = load i32, ptr %15, align 4, !tbaa !5
  %256 = add nsw i32 %255, 1
  store i32 %256, ptr %15, align 4, !tbaa !5
  br label %125, !llvm.loop !28

257:                                              ; preds = %131
  br label %258

258:                                              ; preds = %257
  %259 = load i32, ptr %14, align 4, !tbaa !5
  %260 = add nsw i32 %259, 1
  store i32 %260, ptr %14, align 4, !tbaa !5
  br label %114, !llvm.loop !30

261:                                              ; preds = %120
  br label %262

262:                                              ; preds = %261
  %263 = load i32, ptr %13, align 4, !tbaa !5
  %264 = add nsw i32 %263, 1
  store i32 %264, ptr %13, align 4, !tbaa !5
  br label %103, !llvm.loop !31

265:                                              ; preds = %109
  %266 = getelementptr inbounds %struct.anon, ptr %9, i32 0, i32 0
  %267 = load float, ptr %266, align 4, !tbaa !27
  %268 = fcmp oeq float %267, 0.000000e+00
  br i1 %268, label %269, label %280

269:                                              ; preds = %265
  %270 = getelementptr inbounds %struct.anon, ptr %9, i32 0, i32 1
  %271 = load float, ptr %270, align 4, !tbaa !27
  %272 = fcmp oeq float %271, 0.000000e+00
  br i1 %272, label %273, label %280

273:                                              ; preds = %269
  %274 = getelementptr inbounds %struct.anon, ptr %9, i32 0, i32 2
  %275 = load float, ptr %274, align 4, !tbaa !27
  %276 = fcmp oeq float %275, 0.000000e+00
  br i1 %276, label %277, label %280

277:                                              ; preds = %273
  store float 0.000000e+00, ptr %30, align 4, !tbaa !24
  %278 = getelementptr inbounds float, ptr %30, i64 1
  store float 1.000000e+00, ptr %278, align 4, !tbaa !24
  %279 = getelementptr inbounds float, ptr %30, i64 2
  store float 0.000000e+00, ptr %279, align 4, !tbaa !24
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %9, ptr align 4 %30, i64 12, i1 false), !tbaa.struct !26
  br label %280

280:                                              ; preds = %277, %273, %269, %265
  call void @llvm.lifetime.start.p0(i64 4, ptr %31) #7
  %281 = getelementptr inbounds %struct.anon, ptr %9, i32 0, i32 0
  %282 = load float, ptr %281, align 4, !tbaa !27
  %283 = fpext float %282 to double
  %284 = call double @llvm.fabs.f64(double %283)
  %285 = fptrunc double %284 to float
  store float %285, ptr %31, align 4, !tbaa !24
  %286 = getelementptr inbounds %struct.anon, ptr %9, i32 0, i32 1
  %287 = load float, ptr %286, align 4, !tbaa !27
  %288 = fpext float %287 to double
  %289 = call double @llvm.fabs.f64(double %288)
  %290 = load float, ptr %31, align 4, !tbaa !24
  %291 = fpext float %290 to double
  %292 = fcmp ogt double %289, %291
  br i1 %292, label %293, label %299

293:                                              ; preds = %280
  %294 = getelementptr inbounds %struct.anon, ptr %9, i32 0, i32 1
  %295 = load float, ptr %294, align 4, !tbaa !27
  %296 = fpext float %295 to double
  %297 = call double @llvm.fabs.f64(double %296)
  %298 = fptrunc double %297 to float
  store float %298, ptr %31, align 4, !tbaa !24
  br label %299

299:                                              ; preds = %293, %280
  %300 = getelementptr inbounds %struct.anon, ptr %9, i32 0, i32 2
  %301 = load float, ptr %300, align 4, !tbaa !27
  %302 = fpext float %301 to double
  %303 = call double @llvm.fabs.f64(double %302)
  %304 = load float, ptr %31, align 4, !tbaa !24
  %305 = fpext float %304 to double
  %306 = fcmp ogt double %303, %305
  br i1 %306, label %307, label %313

307:                                              ; preds = %299
  %308 = getelementptr inbounds %struct.anon, ptr %9, i32 0, i32 2
  %309 = load float, ptr %308, align 4, !tbaa !27
  %310 = fpext float %309 to double
  %311 = call double @llvm.fabs.f64(double %310)
  %312 = fptrunc double %311 to float
  store float %312, ptr %31, align 4, !tbaa !24
  br label %313

313:                                              ; preds = %307, %299
  call void @llvm.lifetime.start.p0(i64 12, ptr %32) #7
  %314 = load float, ptr %31, align 4, !tbaa !24
  %315 = fdiv float -1.000000e+00, %314
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %33, ptr align 4 %9, i64 12, i1 false)
  %316 = getelementptr inbounds { <2 x float>, float }, ptr %33, i32 0, i32 0
  %317 = load <2 x float>, ptr %316, align 4
  %318 = getelementptr inbounds { <2 x float>, float }, ptr %33, i32 0, i32 1
  %319 = load float, ptr %318, align 4
  %320 = call { <2 x float>, float } @DN_vec3_scale(<2 x float> %317, float %319, float noundef %315)
  %321 = getelementptr inbounds %union.QMvec3, ptr %32, i32 0, i32 0
  store { <2 x float>, float } %320, ptr %34, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %321, ptr align 8 %34, i64 12, i1 false)
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %9, ptr align 4 %32, i64 12, i1 false), !tbaa.struct !26
  call void @llvm.lifetime.end.p0(i64 12, ptr %32) #7
  %322 = getelementptr inbounds %struct.DNvoxel, ptr %12, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %322, ptr align 4 %9, i64 12, i1 false), !tbaa.struct !26
  %323 = load ptr, ptr %4, align 8, !tbaa !9
  %324 = getelementptr inbounds %struct.DNvoxelModel, ptr %323, i32 0, i32 1
  %325 = load ptr, ptr %324, align 8, !tbaa !20
  %326 = load i32, ptr %11, align 4, !tbaa !5
  %327 = sext i32 %326 to i64
  %328 = getelementptr inbounds %struct.DNcompressedVoxel, ptr %325, i64 %327
  call void @llvm.lifetime.start.p0(i64 8, ptr %35) #7
  %329 = call i64 @DN_compress_voxel(ptr noundef byval(%struct.DNvoxel) align 8 %12)
  store i64 %329, ptr %35, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %328, ptr align 4 %35, i64 8, i1 false), !tbaa.struct !32
  call void @llvm.lifetime.end.p0(i64 8, ptr %35) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %31) #7
  store i32 0, ptr %6, align 4
  br label %330

330:                                              ; preds = %313, %98
  call void @llvm.lifetime.end.p0(i64 20, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 12, ptr %9) #7
  %331 = load i32, ptr %6, align 4
  switch i32 %331, label %345 [
    i32 0, label %332
    i32 10, label %333
  ]

332:                                              ; preds = %330
  br label %333

333:                                              ; preds = %332, %330
  %334 = load i32, ptr %8, align 4, !tbaa !5
  %335 = add nsw i32 %334, 1
  store i32 %335, ptr %8, align 4, !tbaa !5
  br label %54, !llvm.loop !33

336:                                              ; preds = %61
  br label %337

337:                                              ; preds = %336
  %338 = load i32, ptr %7, align 4, !tbaa !5
  %339 = add nsw i32 %338, 1
  store i32 %339, ptr %7, align 4, !tbaa !5
  br label %45, !llvm.loop !34

340:                                              ; preds = %52
  br label %341

341:                                              ; preds = %340
  %342 = load i32, ptr %5, align 4, !tbaa !5
  %343 = add nsw i32 %342, 1
  store i32 %343, ptr %5, align 4, !tbaa !5
  br label %36, !llvm.loop !35

344:                                              ; preds = %43
  ret void

345:                                              ; preds = %330, %251
  unreachable
}

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

declare void @DN_decompress_voxel(ptr dead_on_unwind writable sret(%struct.DNvoxel) align 4, i64) #4

attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { inlinehint nounwind uwtable "min-legal-vector-width"="64" "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 = { "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 uwtable "min-legal-vector-width"="64" "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 = { 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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !6, i64 8}
!12 = !{!"DNvoxelModel", !13, i64 0, !10, i64 16}
!13 = !{!"DNuvec3", !6, i64 0, !6, i64 4, !6, i64 8}
!14 = !{!12, !6, i64 4}
!15 = !{!16, !6, i64 0}
!16 = !{!"DNivec3", !6, i64 0, !6, i64 4, !6, i64 8}
!17 = !{!16, !6, i64 4}
!18 = !{!16, !6, i64 8}
!19 = !{!12, !6, i64 0}
!20 = !{!12, !10, i64 16}
!21 = !{!22, !7, i64 0}
!22 = !{!"DNvoxel", !7, i64 0, !7, i64 4, !23, i64 16}
!23 = !{!"DNcolor", !7, i64 0, !7, i64 1, !7, i64 2}
!24 = !{!25, !25, i64 0}
!25 = !{!"float", !7, i64 0}
!26 = !{i64 0, i64 12, !27}
!27 = !{!7, !7, i64 0}
!28 = distinct !{!28, !29}
!29 = !{!"llvm.loop.mustprogress"}
!30 = distinct !{!30, !29}
!31 = distinct !{!31, !29}
!32 = !{i64 0, i64 4, !5, i64 4, i64 4, !5}
!33 = distinct !{!33, !29}
!34 = distinct !{!34, !29}
!35 = distinct !{!35, !29}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.DNvoxel = type { i8, %union.QMvec3, %struct.DNcolor }
%union.QMvec3 = type { [3 x float] }
%struct.DNcolor = type { i8, i8, i8 }
%struct.DNcompressedVoxel = type { i32, i32 }

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

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

; Function Attrs: inlinehint nounwind uwtable
declare hidden float @DN_vec3_dot(<2 x float>, float, <2 x float>, float) local_unnamed_addr #1

; Function Attrs: inlinehint nounwind uwtable
declare hidden { <2 x float>, float } @DN_vec3_scale(<2 x float>, float, float noundef) local_unnamed_addr #1

; Function Attrs: inlinehint nounwind uwtable
declare hidden { <2 x float>, float } @DN_vec3_add(<2 x float>, float, <2 x float>, float) local_unnamed_addr #1

declare i64 @DN_compress_voxel(ptr noundef byval(%struct.DNvoxel) align 8) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
define dso_local void @DN_calculate_model_normals(i32 noundef %0, ptr nocapture noundef readonly %1) local_unnamed_addr #3 {
  %3 = alloca %struct.DNvoxel, align 8
  %4 = alloca %struct.DNvoxel, align 4
  %5 = getelementptr inbounds i8, ptr %1, i64 8
  %6 = load i32, ptr %5, align 8, !tbaa !5
  %.not212 = icmp eq i32 %6, 0
  br i1 %.not212, label %._crit_edge211, label %.preheader142.lr.ph

.preheader142.lr.ph:                              ; preds = %2
  %7 = getelementptr inbounds i8, ptr %1, i64 4
  %8 = getelementptr inbounds i8, ptr %1, i64 16
  %9 = getelementptr inbounds i8, ptr %3, i64 4
  %.sroa.15.0..sroa_idx = getelementptr inbounds i8, ptr %3, i64 12
  %10 = load i32, ptr %7, align 4, !tbaa !12
  %.not213 = icmp eq i32 %10, 0
  br i1 %.not213, label %._crit_edge211, label %.preheader142.preheader

.preheader142.preheader:                          ; preds = %.preheader142.lr.ph
  %11 = add i32 %0, 1
  br label %.preheader142

.preheader142:                                    ; preds = %.preheader142.preheader, %._crit_edge200
  %12 = phi i32 [ %6, %.preheader142.preheader ], [ %22, %._crit_edge200 ]
  %13 = phi i32 [ %10, %.preheader142.preheader ], [ %23, %._crit_edge200 ]
  %14 = phi i32 [ 1, %.preheader142.preheader ], [ %24, %._crit_edge200 ]
  %indvars.iv224 = phi i32 [ %11, %.preheader142.preheader ], [ %indvars.iv.next225, %._crit_edge200 ]
  %.0209 = phi i32 [ 0, %.preheader142.preheader ], [ %25, %._crit_edge200 ]
  %.not214 = icmp eq i32 %14, 0
  br i1 %.not214, label %._crit_edge200, label %.preheader.preheader

.preheader.preheader:                             ; preds = %.preheader142
  %15 = sub nsw i32 %.0209, %0
  %16 = add nsw i32 %.0209, %0
  %.not163 = icmp sgt i32 %15, %16
  br label %.preheader

._crit_edge211:                                   ; preds = %._crit_edge200, %.preheader142.lr.ph, %2
  ret void

.preheader:                                       ; preds = %.preheader.preheader, %._crit_edge192
  %17 = phi i32 [ %12, %.preheader.preheader ], [ %27, %._crit_edge192 ]
  %18 = phi i32 [ %13, %.preheader.preheader ], [ %28, %._crit_edge192 ]
  %19 = phi i32 [ 1, %.preheader.preheader ], [ %29, %._crit_edge192 ]
  %indvars.iv221 = phi i32 [ %11, %.preheader.preheader ], [ %indvars.iv.next222, %._crit_edge192 ]
  %.0125199 = phi i32 [ 0, %.preheader.preheader ], [ %30, %._crit_edge192 ]
  %.not216 = icmp eq i32 %19, 0
  br i1 %.not216, label %._crit_edge192, label %.lr.ph191

.lr.ph191:                                        ; preds = %.preheader
  %20 = sub nsw i32 %.0125199, %0
  %21 = add nsw i32 %.0125199, %0
  %.not136150 = icmp sgt i32 %20, %21
  br label %32

._crit_edge200:                                   ; preds = %._crit_edge192, %.preheader142
  %22 = phi i32 [ %12, %.preheader142 ], [ %27, %._crit_edge192 ]
  %23 = phi i32 [ %13, %.preheader142 ], [ %28, %._crit_edge192 ]
  %24 = phi i32 [ 0, %.preheader142 ], [ %28, %._crit_edge192 ]
  %25 = add nuw nsw i32 %.0209, 1
  %26 = icmp ult i32 %25, %22
  %indvars.iv.next225 = add i32 %indvars.iv224, 1
  br i1 %26, label %.preheader142, label %._crit_edge211, !llvm.loop !13

._crit_edge192.loopexit:                          ; preds = %101
  %.pre = load i32, ptr %7, align 4, !tbaa !12
  br label %._crit_edge192

._crit_edge192:                                   ; preds = %._crit_edge192.loopexit, %.preheader
  %27 = phi i32 [ %17, %.preheader ], [ %103, %._crit_edge192.loopexit ]
  %28 = phi i32 [ %18, %.preheader ], [ %.pre, %._crit_edge192.loopexit ]
  %29 = phi i32 [ 0, %.preheader ], [ %103, %._crit_edge192.loopexit ]
  %30 = add nuw nsw i32 %.0125199, 1
  %31 = icmp ult i32 %30, %28
  %indvars.iv.next222 = add i32 %indvars.iv221, 1
  br i1 %31, label %.preheader, label %._crit_edge200, !llvm.loop !16

32:                                               ; preds = %.lr.ph191, %101
  %indvars.iv = phi i32 [ %11, %.lr.ph191 ], [ %indvars.iv.next, %101 ]
  %.0126190 = phi i32 [ 0, %.lr.ph191 ], [ %102, %101 ]
  %33 = load i32, ptr %1, align 8, !tbaa !17
  %34 = load i32, ptr %7, align 4, !tbaa !12
  %35 = mul i32 %34, %.0209
  %36 = add i32 %35, %.0125199
  %37 = mul i32 %36, %33
  %38 = add i32 %37, %.0126190
  call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %3) #5
  %39 = load ptr, ptr %8, align 8, !tbaa !18
  %40 = sext i32 %38 to i64
  %41 = getelementptr inbounds %struct.DNcompressedVoxel, ptr %39, i64 %40
  %42 = load i64, ptr %41, align 4
  call void @DN_decompress_voxel(ptr dead_on_unwind nonnull writable sret(%struct.DNvoxel) align 4 %3, i64 %42) #5
  %43 = load i8, ptr %3, align 8, !tbaa !19
  %44 = icmp eq i8 %43, -1
  br i1 %44, label %101, label %45

45:                                               ; preds = %32
  br i1 %.not163, label %._crit_edge171, label %.lr.ph170

.lr.ph170:                                        ; preds = %45
  %46 = sub nsw i32 %.0126190, %0
  %47 = add nsw i32 %.0126190, %0
  %.not137143 = icmp sgt i32 %46, %47
  %or.cond = select i1 %.not136150, i1 true, i1 %.not137143
  br i1 %or.cond, label %._crit_edge171, label %.lr.ph156

._crit_edge171:                                   ; preds = %._crit_edge157.split, %.lr.ph170, %45
  %.sroa.075.3.lcssa = phi <2 x float> [ zeroinitializer, %45 ], [ zeroinitializer, %.lr.ph170 ], [ %.sroa.075.8, %._crit_edge157.split ]
  %.sroa.15.3.lcssa = phi float [ 0.000000e+00, %45 ], [ 0.000000e+00, %.lr.ph170 ], [ %.sroa.15.8, %._crit_edge157.split ]
  %.sroa.075.0.vec.extract = extractelement <2 x float> %.sroa.075.3.lcssa, i64 0
  %48 = fcmp oeq float %.sroa.075.0.vec.extract, 0.000000e+00
  %.sroa.075.4.vec.extract84 = extractelement <2 x float> %.sroa.075.3.lcssa, i64 1
  %49 = fcmp oeq float %.sroa.075.4.vec.extract84, 0.000000e+00
  %or.cond6 = select i1 %48, i1 %49, i1 false
  %50 = fcmp oeq float %.sroa.15.3.lcssa, 0.000000e+00
  %or.cond9 = select i1 %or.cond6, i1 %50, i1 false
  %.sroa.075.9 = select i1 %or.cond9, <2 x float> <float 0.000000e+00, float 1.000000e+00>, <2 x float> %.sroa.075.3.lcssa
  %.sroa.15.9 = select i1 %or.cond9, float 0.000000e+00, float %.sroa.15.3.lcssa
  %51 = call <2 x float> @llvm.fabs.v2f32(<2 x float> %.sroa.075.3.lcssa)
  %52 = select i1 %or.cond9, <2 x float> <float 0.000000e+00, float 1.000000e+00>, <2 x float> %51
  %53 = extractelement <2 x float> %52, i64 0
  %54 = extractelement <2 x float> %52, i64 1
  %55 = fcmp ogt float %54, %53
  %.0128 = select i1 %55, float %54, float %53
  %56 = call float @llvm.fabs.f32(float %.sroa.15.3.lcssa)
  %57 = select i1 %or.cond9, float 0.000000e+00, float %56
  %58 = fcmp ogt float %57, %.0128
  %.1 = select i1 %58, float %57, float %.0128
  %59 = fdiv float -1.000000e+00, %.1
  %60 = call { <2 x float>, float } @DN_vec3_scale(<2 x float> %.sroa.075.9, float %.sroa.15.9, float noundef %59)
  %.fca.0.extract = extractvalue { <2 x float>, float } %60, 0
  %.fca.1.extract = extractvalue { <2 x float>, float } %60, 1
  store <2 x float> %.fca.0.extract, ptr %9, align 4
  store float %.fca.1.extract, ptr %.sroa.15.0..sroa_idx, align 4, !tbaa !22
  %61 = load ptr, ptr %8, align 8, !tbaa !18
  %62 = getelementptr inbounds %struct.DNcompressedVoxel, ptr %61, i64 %40
  %63 = call i64 @DN_compress_voxel(ptr noundef nonnull byval(%struct.DNvoxel) align 8 %3) #5
  store i64 %63, ptr %62, align 4
  br label %101

.lr.ph156:                                        ; preds = %.lr.ph170, %._crit_edge157.split
  %.sroa.15.3168 = phi float [ %.sroa.15.8, %._crit_edge157.split ], [ 0.000000e+00, %.lr.ph170 ]
  %.sroa.075.3167 = phi <2 x float> [ %.sroa.075.8, %._crit_edge157.split ], [ zeroinitializer, %.lr.ph170 ]
  %.0127165 = phi i32 [ %66, %._crit_edge157.split ], [ %15, %.lr.ph170 ]
  %64 = sub nsw i32 %.0127165, %.0209
  %65 = sitofp i32 %64 to float
  br label %.lr.ph

._crit_edge157.split:                             ; preds = %._crit_edge
  %66 = add i32 %.0127165, 1
  %exitcond226.not = icmp eq i32 %66, %indvars.iv224
  br i1 %exitcond226.not, label %._crit_edge171, label %.lr.ph156, !llvm.loop !23

.lr.ph:                                           ; preds = %.lr.ph156, %._crit_edge
  %.sroa.15.4154 = phi float [ %.sroa.15.3168, %.lr.ph156 ], [ %.sroa.15.8, %._crit_edge ]
  %.sroa.075.4153 = phi <2 x float> [ %.sroa.075.3167, %.lr.ph156 ], [ %.sroa.075.8, %._crit_edge ]
  %.0129152 = phi i32 [ %20, %.lr.ph156 ], [ %70, %._crit_edge ]
  %67 = or i32 %.0129152, %.0127165
  %68 = sub nsw i32 %.0129152, %.0125199
  %69 = sitofp i32 %68 to float
  br label %71

._crit_edge:                                      ; preds = %99
  %70 = add i32 %.0129152, 1
  %exitcond223.not = icmp eq i32 %70, %indvars.iv221
  br i1 %exitcond223.not, label %._crit_edge157.split, label %.lr.ph, !llvm.loop !24

71:                                               ; preds = %.lr.ph, %99
  %.sroa.15.5147 = phi float [ %.sroa.15.4154, %.lr.ph ], [ %.sroa.15.8, %99 ]
  %.sroa.075.5146 = phi <2 x float> [ %.sroa.075.4153, %.lr.ph ], [ %.sroa.075.8, %99 ]
  %.0130145 = phi i32 [ %46, %.lr.ph ], [ %100, %99 ]
  %72 = or i32 %67, %.0130145
  %or.cond3.not = icmp sgt i32 %72, -1
  br i1 %or.cond3.not, label %73, label %99

73:                                               ; preds = %71
  %74 = load i32, ptr %1, align 8, !tbaa !17
  %.not138 = icmp ult i32 %.0130145, %74
  br i1 %.not138, label %75, label %99

75:                                               ; preds = %73
  %76 = load i32, ptr %7, align 4, !tbaa !12
  %.not139 = icmp ult i32 %.0129152, %76
  br i1 %.not139, label %77, label %99

77:                                               ; preds = %75
  %78 = load i32, ptr %5, align 8, !tbaa !5
  %.not140 = icmp ult i32 %.0127165, %78
  br i1 %.not140, label %79, label %99

79:                                               ; preds = %77
  %80 = mul i32 %76, %.0127165
  %81 = add i32 %80, %.0129152
  %82 = mul i32 %81, %74
  %83 = add i32 %82, %.0130145
  %84 = icmp eq i32 %83, %38
  br i1 %84, label %99, label %85

85:                                               ; preds = %79
  %86 = load ptr, ptr %8, align 8, !tbaa !18
  %87 = sext i32 %83 to i64
  %88 = getelementptr inbounds %struct.DNcompressedVoxel, ptr %86, i64 %87
  %89 = load i64, ptr %88, align 4
  call void @DN_decompress_voxel(ptr dead_on_unwind nonnull writable sret(%struct.DNvoxel) align 4 %4, i64 %89) #5
  %90 = load i8, ptr %4, align 4, !tbaa !19
  %.not141 = icmp eq i8 %90, -1
  br i1 %.not141, label %99, label %91

91:                                               ; preds = %85
  %92 = sub nsw i32 %.0130145, %.0126190
  %93 = sitofp i32 %92 to float
  %.sroa.043.0.vec.insert = insertelement <2 x float> poison, float %93, i64 0
  %.sroa.043.4.vec.insert = insertelement <2 x float> %.sroa.043.0.vec.insert, float %69, i64 1
  %94 = call float @DN_vec3_dot(<2 x float> %.sroa.043.4.vec.insert, float %65, <2 x float> %.sroa.043.4.vec.insert, float %65)
  %95 = fmul float %94, %94
  %96 = fdiv float 1.000000e+00, %95
  %97 = call { <2 x float>, float } @DN_vec3_scale(<2 x float> %.sroa.043.4.vec.insert, float %65, float noundef %96)
  %.fca.0.extract28 = extractvalue { <2 x float>, float } %97, 0
  %.fca.1.extract29 = extractvalue { <2 x float>, float } %97, 1
  %98 = call { <2 x float>, float } @DN_vec3_add(<2 x float> %.sroa.075.5146, float %.sroa.15.5147, <2 x float> %.fca.0.extract28, float %.fca.1.extract29)
  %.fca.0.extract18 = extractvalue { <2 x float>, float } %98, 0
  %.fca.1.extract19 = extractvalue { <2 x float>, float } %98, 1
  br label %99

99:                                               ; preds = %79, %91, %85, %73, %75, %77, %71
  %.sroa.075.8 = phi <2 x float> [ %.sroa.075.5146, %71 ], [ %.sroa.075.5146, %73 ], [ %.sroa.075.5146, %75 ], [ %.sroa.075.5146, %77 ], [ %.sroa.075.5146, %79 ], [ %.fca.0.extract18, %91 ], [ %.sroa.075.5146, %85 ]
  %.sroa.15.8 = phi float [ %.sroa.15.5147, %71 ], [ %.sroa.15.5147, %73 ], [ %.sroa.15.5147, %75 ], [ %.sroa.15.5147, %77 ], [ %.sroa.15.5147, %79 ], [ %.fca.1.extract19, %91 ], [ %.sroa.15.5147, %85 ]
  %100 = add i32 %.0130145, 1
  %exitcond.not = icmp eq i32 %100, %indvars.iv
  br i1 %exitcond.not, label %._crit_edge, label %71, !llvm.loop !25

101:                                              ; preds = %32, %._crit_edge171
  call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %3) #5
  %102 = add nuw nsw i32 %.0126190, 1
  %103 = load i32, ptr %5, align 8, !tbaa !5
  %104 = icmp ult i32 %102, %103
  %indvars.iv.next = add i32 %indvars.iv, 1
  br i1 %104, label %32, label %._crit_edge192.loopexit, !llvm.loop !26
}

declare void @DN_decompress_voxel(ptr dead_on_unwind writable sret(%struct.DNvoxel) align 4, i64) local_unnamed_addr #2

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare <2 x float> @llvm.fabs.v2f32(<2 x float>) #4

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { inlinehint nounwind uwtable "min-legal-vector-width"="64" "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 = { "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 = { nounwind uwtable "min-legal-vector-width"="64" "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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !8, i64 8}
!6 = !{!"DNvoxelModel", !7, i64 0, !11, i64 16}
!7 = !{!"DNuvec3", !8, i64 0, !8, i64 4, !8, i64 8}
!8 = !{!"int", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C/C++ TBAA"}
!11 = !{!"any pointer", !9, i64 0}
!12 = !{!6, !8, i64 4}
!13 = distinct !{!13, !14, !15}
!14 = !{!"llvm.loop.mustprogress"}
!15 = !{!"llvm.loop.unswitch.partial.disable"}
!16 = distinct !{!16, !14, !15}
!17 = !{!6, !8, i64 0}
!18 = !{!6, !11, i64 16}
!19 = !{!20, !9, i64 0}
!20 = !{!"DNvoxel", !9, i64 0, !9, i64 4, !21, i64 16}
!21 = !{!"DNcolor", !9, i64 0, !9, i64 1, !9, i64 2}
!22 = !{!9, !9, i64 0}
!23 = distinct !{!23, !14}
!24 = distinct !{!24, !14}
!25 = distinct !{!25, !14}
!26 = distinct !{!26, !14}


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