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

; 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.DNuvec3 = type { i32, i32, i32 }
%union.QMvec3 = type { [3 x float] }
%struct.DNvolume = type { i32, i32, i32, %struct.DNuvec3, i64, i64, i64, i64, i64, i64, ptr, ptr, ptr, ptr, ptr, %union.QMvec3, %union.QMvec3, float, i32, %union.QMvec3, %union.QMvec3, %union.QMvec3, i32, i32, float, i8, i32, %union.QMvec3, %union.QMvec3, i32, float }
%struct.DNchunkHandle = type { i8, i32 }
%struct.DNvoxelNode = type { i32, i64, %struct.DNivec3 }
%struct.DNivec3 = type { i32, i32, i32 }

@g_DN_message_callback = external dso_local global ptr, align 8
@.str.6 = external hidden unnamed_addr constant [30 x i8], align 1
@glad_glBindBuffer = external global ptr, align 8
@glad_glClearBufferData = external global ptr, align 8
@.str.7 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [48 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [47 x i8], align 1

; Function Attrs: nounwind uwtable
declare hidden zeroext i1 @_DN_gen_shader_storage_buffer(ptr noundef, i64 noundef) #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 ptr @DN_create_volume(i64 %0, i32 %1, i32 noundef %2) #0 {
  %4 = alloca ptr, align 8
  %5 = alloca %struct.DNuvec3, align 4
  %6 = alloca { i64, i32 }, align 4
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i64, align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca %union.QMvec3, align 4
  %15 = alloca %union.QMvec3, align 4
  %16 = alloca %union.QMvec3, align 4
  %17 = alloca %union.QMvec3, align 4
  %18 = alloca %union.QMvec3, align 4
  %19 = alloca %union.QMvec3, align 4
  %20 = alloca %union.QMvec3, align 4
  %21 = getelementptr inbounds { i64, i32 }, ptr %6, i32 0, i32 0
  store i64 %0, ptr %21, align 4
  %22 = getelementptr inbounds { i64, i32 }, ptr %6, i32 0, i32 1
  store i32 %1, ptr %22, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %5, ptr align 4 %6, i64 12, i1 false)
  store i32 %2, ptr %7, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  %23 = call noalias ptr @malloc(i64 noundef 232) #6
  store ptr %23, ptr %8, align 8, !tbaa !9
  %24 = load ptr, ptr %8, align 8, !tbaa !9
  %25 = getelementptr inbounds %struct.DNvolume, ptr %24, i32 0, i32 0
  %26 = getelementptr inbounds %struct.DNuvec3, ptr %5, i32 0, i32 0
  %27 = load i32, ptr %26, align 4, !tbaa !11
  %28 = zext i32 %27 to i64
  %29 = mul i64 12, %28
  %30 = getelementptr inbounds %struct.DNuvec3, ptr %5, i32 0, i32 1
  %31 = load i32, ptr %30, align 4, !tbaa !13
  %32 = zext i32 %31 to i64
  %33 = mul i64 %29, %32
  %34 = getelementptr inbounds %struct.DNuvec3, ptr %5, i32 0, i32 0
  %35 = load i32, ptr %34, align 4, !tbaa !11
  %36 = zext i32 %35 to i64
  %37 = mul i64 %33, %36
  %38 = call zeroext i1 @_DN_gen_shader_storage_buffer(ptr noundef %25, i64 noundef %37)
  br i1 %38, label %41, label %39

39:                                               ; preds = %3
  %40 = load ptr, ptr @g_DN_message_callback, align 8, !tbaa !9
  call void %40(i32 noundef 1, i32 noundef 2, ptr noundef @.str.6)
  store ptr null, ptr %4, align 8
  store i32 1, ptr %9, align 4
  br label %304

41:                                               ; preds = %3
  %42 = load ptr, ptr @glad_glBindBuffer, align 8, !tbaa !9
  %43 = load ptr, ptr %8, align 8, !tbaa !9
  %44 = getelementptr inbounds %struct.DNvolume, ptr %43, i32 0, i32 0
  %45 = load i32, ptr %44, align 8, !tbaa !14
  call void %42(i32 noundef 37074, i32 noundef %45)
  %46 = load ptr, ptr @glad_glClearBufferData, align 8, !tbaa !9
  call void %46(i32 noundef 37074, i32 noundef 33321, i32 noundef 6403, i32 noundef 5121, ptr noundef null)
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  %47 = getelementptr inbounds %struct.DNuvec3, ptr %5, i32 0, i32 0
  %48 = load i32, ptr %47, align 4, !tbaa !11
  %49 = getelementptr inbounds %struct.DNuvec3, ptr %5, i32 0, i32 1
  %50 = load i32, ptr %49, align 4, !tbaa !13
  %51 = mul i32 %48, %50
  %52 = getelementptr inbounds %struct.DNuvec3, ptr %5, i32 0, i32 2
  %53 = load i32, ptr %52, align 4, !tbaa !19
  %54 = mul i32 %51, %53
  %55 = uitofp i32 %54 to double
  %56 = load i32, ptr %7, align 4, !tbaa !5
  %57 = uitofp i32 %56 to double
  %58 = call double @llvm.minnum.f64(double %55, double %57)
  %59 = fptoui double %58 to i64
  store i64 %59, ptr %10, align 8, !tbaa !20
  %60 = load ptr, ptr %8, align 8, !tbaa !9
  %61 = getelementptr inbounds %struct.DNvolume, ptr %60, i32 0, i32 1
  %62 = getelementptr inbounds %struct.DNuvec3, ptr %5, i32 0, i32 0
  %63 = load i32, ptr %62, align 4, !tbaa !11
  %64 = zext i32 %63 to i64
  %65 = mul i64 96, %64
  %66 = getelementptr inbounds %struct.DNuvec3, ptr %5, i32 0, i32 1
  %67 = load i32, ptr %66, align 4, !tbaa !13
  %68 = zext i32 %67 to i64
  %69 = mul i64 %65, %68
  %70 = getelementptr inbounds %struct.DNuvec3, ptr %5, i32 0, i32 0
  %71 = load i32, ptr %70, align 4, !tbaa !11
  %72 = zext i32 %71 to i64
  %73 = mul i64 %69, %72
  %74 = call zeroext i1 @_DN_gen_shader_storage_buffer(ptr noundef %61, i64 noundef %73)
  br i1 %74, label %77, label %75

75:                                               ; preds = %41
  %76 = load ptr, ptr @g_DN_message_callback, align 8, !tbaa !9
  call void %76(i32 noundef 1, i32 noundef 2, ptr noundef @.str.7)
  store ptr null, ptr %4, align 8
  store i32 1, ptr %9, align 4
  br label %303

77:                                               ; preds = %41
  %78 = load i64, ptr %10, align 8, !tbaa !20
  %79 = mul i64 512, %78
  %80 = udiv i64 %79, 2
  %81 = load ptr, ptr %8, align 8, !tbaa !9
  %82 = getelementptr inbounds %struct.DNvolume, ptr %81, i32 0, i32 6
  store i64 %80, ptr %82, align 8, !tbaa !21
  %83 = load ptr, ptr %8, align 8, !tbaa !9
  %84 = getelementptr inbounds %struct.DNvolume, ptr %83, i32 0, i32 2
  %85 = load ptr, ptr %8, align 8, !tbaa !9
  %86 = getelementptr inbounds %struct.DNvolume, ptr %85, i32 0, i32 6
  %87 = load i64, ptr %86, align 8, !tbaa !21
  %88 = add i64 %87, 512
  %89 = mul i64 16, %88
  %90 = call zeroext i1 @_DN_gen_shader_storage_buffer(ptr noundef %84, i64 noundef %89)
  br i1 %90, label %93, label %91

91:                                               ; preds = %77
  %92 = load ptr, ptr @g_DN_message_callback, align 8, !tbaa !9
  call void %92(i32 noundef 1, i32 noundef 2, ptr noundef @.str.8)
  store ptr null, ptr %4, align 8
  store i32 1, ptr %9, align 4
  br label %303

93:                                               ; preds = %77
  %94 = getelementptr inbounds %struct.DNuvec3, ptr %5, i32 0, i32 0
  %95 = load i32, ptr %94, align 4, !tbaa !11
  %96 = zext i32 %95 to i64
  %97 = mul i64 8, %96
  %98 = getelementptr inbounds %struct.DNuvec3, ptr %5, i32 0, i32 1
  %99 = load i32, ptr %98, align 4, !tbaa !13
  %100 = zext i32 %99 to i64
  %101 = mul i64 %97, %100
  %102 = getelementptr inbounds %struct.DNuvec3, ptr %5, i32 0, i32 2
  %103 = load i32, ptr %102, align 4, !tbaa !19
  %104 = zext i32 %103 to i64
  %105 = mul i64 %101, %104
  %106 = call noalias ptr @malloc(i64 noundef %105) #6
  %107 = load ptr, ptr %8, align 8, !tbaa !9
  %108 = getelementptr inbounds %struct.DNvolume, ptr %107, i32 0, i32 10
  store ptr %106, ptr %108, align 8, !tbaa !22
  %109 = load ptr, ptr %8, align 8, !tbaa !9
  %110 = getelementptr inbounds %struct.DNvolume, ptr %109, i32 0, i32 10
  %111 = load ptr, ptr %110, align 8, !tbaa !22
  %112 = icmp ne ptr %111, null
  br i1 %112, label %115, label %113

113:                                              ; preds = %93
  %114 = load ptr, ptr @g_DN_message_callback, align 8, !tbaa !9
  call void %114(i32 noundef 0, i32 noundef 2, ptr noundef @.str.9)
  store ptr null, ptr %4, align 8
  store i32 1, ptr %9, align 4
  br label %303

115:                                              ; preds = %93
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  store i32 0, ptr %11, align 4, !tbaa !5
  br label %116

116:                                              ; preds = %136, %115
  %117 = load i32, ptr %11, align 4, !tbaa !5
  %118 = getelementptr inbounds %struct.DNuvec3, ptr %5, i32 0, i32 0
  %119 = load i32, ptr %118, align 4, !tbaa !11
  %120 = getelementptr inbounds %struct.DNuvec3, ptr %5, i32 0, i32 1
  %121 = load i32, ptr %120, align 4, !tbaa !13
  %122 = mul i32 %119, %121
  %123 = getelementptr inbounds %struct.DNuvec3, ptr %5, i32 0, i32 2
  %124 = load i32, ptr %123, align 4, !tbaa !19
  %125 = mul i32 %122, %124
  %126 = icmp ult i32 %117, %125
  br i1 %126, label %128, label %127

127:                                              ; preds = %116
  store i32 2, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  br label %139

128:                                              ; preds = %116
  %129 = load ptr, ptr %8, align 8, !tbaa !9
  %130 = getelementptr inbounds %struct.DNvolume, ptr %129, i32 0, i32 10
  %131 = load ptr, ptr %130, align 8, !tbaa !22
  %132 = load i32, ptr %11, align 4, !tbaa !5
  %133 = sext i32 %132 to i64
  %134 = getelementptr inbounds %struct.DNchunkHandle, ptr %131, i64 %133
  %135 = getelementptr inbounds %struct.DNchunkHandle, ptr %134, i32 0, i32 0
  store i8 0, ptr %135, align 4, !tbaa !23
  br label %136

136:                                              ; preds = %128
  %137 = load i32, ptr %11, align 4, !tbaa !5
  %138 = add nsw i32 %137, 1
  store i32 %138, ptr %11, align 4, !tbaa !5
  br label %116, !llvm.loop !25

139:                                              ; preds = %127
  %140 = load i64, ptr %10, align 8, !tbaa !20
  %141 = mul i64 4120, %140
  %142 = call noalias ptr @malloc(i64 noundef %141) #6
  %143 = load ptr, ptr %8, align 8, !tbaa !9
  %144 = getelementptr inbounds %struct.DNvolume, ptr %143, i32 0, i32 11
  store ptr %142, ptr %144, align 8, !tbaa !27
  %145 = load ptr, ptr %8, align 8, !tbaa !9
  %146 = getelementptr inbounds %struct.DNvolume, ptr %145, i32 0, i32 11
  %147 = load ptr, ptr %146, align 8, !tbaa !27
  %148 = icmp ne ptr %147, null
  br i1 %148, label %151, label %149

149:                                              ; preds = %139
  %150 = load ptr, ptr @g_DN_message_callback, align 8, !tbaa !9
  call void %150(i32 noundef 0, i32 noundef 2, ptr noundef @.str.10)
  store ptr null, ptr %4, align 8
  store i32 1, ptr %9, align 4
  br label %303

151:                                              ; preds = %139
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  store i32 0, ptr %12, align 4, !tbaa !5
  br label %152

152:                                              ; preds = %161, %151
  %153 = load i32, ptr %12, align 4, !tbaa !5
  %154 = sext i32 %153 to i64
  %155 = load i64, ptr %10, align 8, !tbaa !20
  %156 = icmp ult i64 %154, %155
  br i1 %156, label %158, label %157

157:                                              ; preds = %152
  store i32 5, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  br label %164

158:                                              ; preds = %152
  %159 = load ptr, ptr %8, align 8, !tbaa !9
  %160 = load i32, ptr %12, align 4, !tbaa !5
  call void @_DN_clear_chunk(ptr noundef %159, i32 noundef %160)
  br label %161

161:                                              ; preds = %158
  %162 = load i32, ptr %12, align 4, !tbaa !5
  %163 = add nsw i32 %162, 1
  store i32 %163, ptr %12, align 4, !tbaa !5
  br label %152, !llvm.loop !28

164:                                              ; preds = %157
  %165 = call noalias ptr @malloc(i64 noundef 8192) #6
  %166 = load ptr, ptr %8, align 8, !tbaa !9
  %167 = getelementptr inbounds %struct.DNvolume, ptr %166, i32 0, i32 12
  store ptr %165, ptr %167, align 8, !tbaa !29
  %168 = load ptr, ptr %8, align 8, !tbaa !9
  %169 = getelementptr inbounds %struct.DNvolume, ptr %168, i32 0, i32 12
  %170 = load ptr, ptr %169, align 8, !tbaa !29
  %171 = icmp ne ptr %170, null
  br i1 %171, label %174, label %172

172:                                              ; preds = %164
  %173 = load ptr, ptr @g_DN_message_callback, align 8, !tbaa !9
  call void %173(i32 noundef 0, i32 noundef 2, ptr noundef @.str.11)
  store ptr null, ptr %4, align 8
  store i32 1, ptr %9, align 4
  br label %303

174:                                              ; preds = %164
  %175 = load i64, ptr %10, align 8, !tbaa !20
  %176 = mul i64 4, %175
  %177 = call noalias ptr @malloc(i64 noundef %176) #6
  %178 = load ptr, ptr %8, align 8, !tbaa !9
  %179 = getelementptr inbounds %struct.DNvolume, ptr %178, i32 0, i32 13
  store ptr %177, ptr %179, align 8, !tbaa !30
  %180 = load ptr, ptr %8, align 8, !tbaa !9
  %181 = getelementptr inbounds %struct.DNvolume, ptr %180, i32 0, i32 13
  %182 = load ptr, ptr %181, align 8, !tbaa !30
  %183 = icmp ne ptr %182, null
  br i1 %183, label %186, label %184

184:                                              ; preds = %174
  %185 = load ptr, ptr @g_DN_message_callback, align 8, !tbaa !9
  call void %185(i32 noundef 0, i32 noundef 2, ptr noundef @.str.12)
  store ptr null, ptr %4, align 8
  store i32 1, ptr %9, align 4
  br label %303

186:                                              ; preds = %174
  %187 = load ptr, ptr %8, align 8, !tbaa !9
  %188 = getelementptr inbounds %struct.DNvolume, ptr %187, i32 0, i32 6
  %189 = load i64, ptr %188, align 8, !tbaa !21
  %190 = udiv i64 %189, 512
  %191 = load ptr, ptr %8, align 8, !tbaa !9
  %192 = getelementptr inbounds %struct.DNvolume, ptr %191, i32 0, i32 7
  store i64 %190, ptr %192, align 8, !tbaa !31
  %193 = load ptr, ptr %8, align 8, !tbaa !9
  %194 = getelementptr inbounds %struct.DNvolume, ptr %193, i32 0, i32 6
  %195 = load i64, ptr %194, align 8, !tbaa !21
  %196 = udiv i64 %195, 16
  %197 = mul i64 32, %196
  %198 = call noalias ptr @malloc(i64 noundef %197) #6
  %199 = load ptr, ptr %8, align 8, !tbaa !9
  %200 = getelementptr inbounds %struct.DNvolume, ptr %199, i32 0, i32 14
  store ptr %198, ptr %200, align 8, !tbaa !32
  %201 = load ptr, ptr %8, align 8, !tbaa !9
  %202 = getelementptr inbounds %struct.DNvolume, ptr %201, i32 0, i32 14
  %203 = load ptr, ptr %202, align 8, !tbaa !32
  %204 = icmp ne ptr %203, null
  br i1 %204, label %207, label %205

205:                                              ; preds = %186
  %206 = load ptr, ptr @g_DN_message_callback, align 8, !tbaa !9
  call void %206(i32 noundef 0, i32 noundef 2, ptr noundef @.str.13)
  store ptr null, ptr %4, align 8
  store i32 1, ptr %9, align 4
  br label %303

207:                                              ; preds = %186
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  store i32 0, ptr %13, align 4, !tbaa !5
  br label %208

208:                                              ; preds = %242, %207
  %209 = load i32, ptr %13, align 4, !tbaa !5
  %210 = sext i32 %209 to i64
  %211 = load ptr, ptr %8, align 8, !tbaa !9
  %212 = getelementptr inbounds %struct.DNvolume, ptr %211, i32 0, i32 7
  %213 = load i64, ptr %212, align 8, !tbaa !31
  %214 = icmp ult i64 %210, %213
  br i1 %214, label %216, label %215

215:                                              ; preds = %208
  store i32 8, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  br label %245

216:                                              ; preds = %208
  %217 = load ptr, ptr %8, align 8, !tbaa !9
  %218 = getelementptr inbounds %struct.DNvolume, ptr %217, i32 0, i32 14
  %219 = load ptr, ptr %218, align 8, !tbaa !32
  %220 = load i32, ptr %13, align 4, !tbaa !5
  %221 = sext i32 %220 to i64
  %222 = getelementptr inbounds %struct.DNvoxelNode, ptr %219, i64 %221
  %223 = getelementptr inbounds %struct.DNvoxelNode, ptr %222, i32 0, i32 2
  %224 = getelementptr inbounds %struct.DNivec3, ptr %223, i32 0, i32 0
  store i32 -1, ptr %224, align 8, !tbaa !33
  %225 = load ptr, ptr %8, align 8, !tbaa !9
  %226 = getelementptr inbounds %struct.DNvolume, ptr %225, i32 0, i32 14
  %227 = load ptr, ptr %226, align 8, !tbaa !32
  %228 = load i32, ptr %13, align 4, !tbaa !5
  %229 = sext i32 %228 to i64
  %230 = getelementptr inbounds %struct.DNvoxelNode, ptr %227, i64 %229
  %231 = getelementptr inbounds %struct.DNvoxelNode, ptr %230, i32 0, i32 0
  store i32 512, ptr %231, align 8, !tbaa !36
  %232 = load i32, ptr %13, align 4, !tbaa !5
  %233 = mul nsw i32 %232, 512
  %234 = sext i32 %233 to i64
  %235 = load ptr, ptr %8, align 8, !tbaa !9
  %236 = getelementptr inbounds %struct.DNvolume, ptr %235, i32 0, i32 14
  %237 = load ptr, ptr %236, align 8, !tbaa !32
  %238 = load i32, ptr %13, align 4, !tbaa !5
  %239 = sext i32 %238 to i64
  %240 = getelementptr inbounds %struct.DNvoxelNode, ptr %237, i64 %239
  %241 = getelementptr inbounds %struct.DNvoxelNode, ptr %240, i32 0, i32 1
  store i64 %234, ptr %241, align 8, !tbaa !37
  br label %242

242:                                              ; preds = %216
  %243 = load i32, ptr %13, align 4, !tbaa !5
  %244 = add nsw i32 %243, 1
  store i32 %244, ptr %13, align 4, !tbaa !5
  br label %208, !llvm.loop !38

245:                                              ; preds = %215
  %246 = load ptr, ptr %8, align 8, !tbaa !9
  %247 = getelementptr inbounds %struct.DNvolume, ptr %246, i32 0, i32 3
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %247, ptr align 4 %5, i64 12, i1 false), !tbaa.struct !39
  %248 = load i64, ptr %10, align 8, !tbaa !20
  %249 = load ptr, ptr %8, align 8, !tbaa !9
  %250 = getelementptr inbounds %struct.DNvolume, ptr %249, i32 0, i32 4
  store i64 %248, ptr %250, align 8, !tbaa !40
  %251 = load ptr, ptr %8, align 8, !tbaa !9
  %252 = getelementptr inbounds %struct.DNvolume, ptr %251, i32 0, i32 5
  store i64 0, ptr %252, align 8, !tbaa !41
  %253 = load ptr, ptr %8, align 8, !tbaa !9
  %254 = getelementptr inbounds %struct.DNvolume, ptr %253, i32 0, i32 8
  store i64 0, ptr %254, align 8, !tbaa !42
  %255 = load i64, ptr %10, align 8, !tbaa !20
  %256 = load ptr, ptr %8, align 8, !tbaa !9
  %257 = getelementptr inbounds %struct.DNvolume, ptr %256, i32 0, i32 9
  store i64 %255, ptr %257, align 8, !tbaa !43
  %258 = load ptr, ptr %8, align 8, !tbaa !9
  %259 = getelementptr inbounds %struct.DNvolume, ptr %258, i32 0, i32 15
  store float 0.000000e+00, ptr %14, align 4, !tbaa !44
  %260 = getelementptr inbounds float, ptr %14, i64 1
  store float 0.000000e+00, ptr %260, align 4, !tbaa !44
  %261 = getelementptr inbounds float, ptr %14, i64 2
  store float 0.000000e+00, ptr %261, align 4, !tbaa !44
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %259, ptr align 4 %14, i64 12, i1 false), !tbaa.struct !45
  %262 = load ptr, ptr %8, align 8, !tbaa !9
  %263 = getelementptr inbounds %struct.DNvolume, ptr %262, i32 0, i32 16
  store float 0.000000e+00, ptr %15, align 4, !tbaa !44
  %264 = getelementptr inbounds float, ptr %15, i64 1
  store float 0.000000e+00, ptr %264, align 4, !tbaa !44
  %265 = getelementptr inbounds float, ptr %15, i64 2
  store float 0.000000e+00, ptr %265, align 4, !tbaa !44
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %263, ptr align 4 %15, i64 12, i1 false), !tbaa.struct !45
  %266 = load ptr, ptr %8, align 8, !tbaa !9
  %267 = getelementptr inbounds %struct.DNvolume, ptr %266, i32 0, i32 17
  store float 9.000000e+01, ptr %267, align 8, !tbaa !47
  %268 = load ptr, ptr %8, align 8, !tbaa !9
  %269 = getelementptr inbounds %struct.DNvolume, ptr %268, i32 0, i32 18
  store i32 0, ptr %269, align 4, !tbaa !48
  %270 = load ptr, ptr %8, align 8, !tbaa !9
  %271 = getelementptr inbounds %struct.DNvolume, ptr %270, i32 0, i32 19
  store float 1.000000e+00, ptr %16, align 4, !tbaa !44
  %272 = getelementptr inbounds float, ptr %16, i64 1
  store float 1.000000e+00, ptr %272, align 4, !tbaa !44
  %273 = getelementptr inbounds float, ptr %16, i64 2
  store float 1.000000e+00, ptr %273, align 4, !tbaa !44
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %271, ptr align 4 %16, i64 12, i1 false), !tbaa.struct !45
  %274 = load ptr, ptr %8, align 8, !tbaa !9
  %275 = getelementptr inbounds %struct.DNvolume, ptr %274, i32 0, i32 20
  store float 0x3FE3333340000000, ptr %17, align 4, !tbaa !44
  %276 = getelementptr inbounds float, ptr %17, i64 1
  store float 0x3FE3333340000000, ptr %276, align 4, !tbaa !44
  %277 = getelementptr inbounds float, ptr %17, i64 2
  store float 0x3FE3333340000000, ptr %277, align 4, !tbaa !44
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %275, ptr align 4 %17, i64 12, i1 false), !tbaa.struct !45
  %278 = load ptr, ptr %8, align 8, !tbaa !9
  %279 = getelementptr inbounds %struct.DNvolume, ptr %278, i32 0, i32 21
  store float 0x3F847AE140000000, ptr %18, align 4, !tbaa !44
  %280 = getelementptr inbounds float, ptr %18, i64 1
  store float 0x3F847AE140000000, ptr %280, align 4, !tbaa !44
  %281 = getelementptr inbounds float, ptr %18, i64 2
  store float 0x3F847AE140000000, ptr %281, align 4, !tbaa !44
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %279, ptr align 4 %18, i64 12, i1 false), !tbaa.struct !45
  %282 = load ptr, ptr %8, align 8, !tbaa !9
  %283 = getelementptr inbounds %struct.DNvolume, ptr %282, i32 0, i32 22
  store i32 5, ptr %283, align 4, !tbaa !49
  %284 = load ptr, ptr %8, align 8, !tbaa !9
  %285 = getelementptr inbounds %struct.DNvolume, ptr %284, i32 0, i32 23
  store i32 2, ptr %285, align 8, !tbaa !50
  %286 = load ptr, ptr %8, align 8, !tbaa !9
  %287 = getelementptr inbounds %struct.DNvolume, ptr %286, i32 0, i32 24
  store float 1.000000e+01, ptr %287, align 4, !tbaa !51
  %288 = load ptr, ptr %8, align 8, !tbaa !9
  %289 = getelementptr inbounds %struct.DNvolume, ptr %288, i32 0, i32 25
  store i8 0, ptr %289, align 8, !tbaa !52
  %290 = load ptr, ptr %8, align 8, !tbaa !9
  %291 = getelementptr inbounds %struct.DNvolume, ptr %290, i32 0, i32 27
  store float 0x3FE6B851E0000000, ptr %19, align 4, !tbaa !44
  %292 = getelementptr inbounds float, ptr %19, i64 1
  store float 0x3FEB333340000000, ptr %292, align 4, !tbaa !44
  %293 = getelementptr inbounds float, ptr %19, i64 2
  store float 0x3FECCCCCC0000000, ptr %293, align 4, !tbaa !44
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %291, ptr align 4 %19, i64 12, i1 false), !tbaa.struct !45
  %294 = load ptr, ptr %8, align 8, !tbaa !9
  %295 = getelementptr inbounds %struct.DNvolume, ptr %294, i32 0, i32 28
  store float 0.000000e+00, ptr %20, align 4, !tbaa !44
  %296 = getelementptr inbounds float, ptr %20, i64 1
  store float 0x3FDCCCCCC0000000, ptr %296, align 4, !tbaa !44
  %297 = getelementptr inbounds float, ptr %20, i64 2
  store float 0x3FE7AE1480000000, ptr %297, align 4, !tbaa !44
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %295, ptr align 4 %20, i64 12, i1 false), !tbaa.struct !45
  %298 = load ptr, ptr %8, align 8, !tbaa !9
  %299 = getelementptr inbounds %struct.DNvolume, ptr %298, i32 0, i32 29
  store i32 0, ptr %299, align 8, !tbaa !53
  %300 = load ptr, ptr %8, align 8, !tbaa !9
  %301 = getelementptr inbounds %struct.DNvolume, ptr %300, i32 0, i32 30
  store float 0x405EDD2F20000000, ptr %301, align 4, !tbaa !54
  %302 = load ptr, ptr %8, align 8, !tbaa !9
  store ptr %302, ptr %4, align 8
  store i32 1, ptr %9, align 4
  br label %303

303:                                              ; preds = %245, %205, %184, %172, %149, %113, %91, %75
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  br label %304

304:                                              ; preds = %303, %39
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  %305 = load ptr, ptr %4, align 8
  ret ptr %305
}

; 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) #2

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

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

; Function Attrs: nounwind uwtable
declare hidden void @_DN_clear_chunk(ptr noundef, i32 noundef) #0

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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 #4 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
attributes #6 = { nounwind allocsize(0) }

!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 0}
!12 = !{!"DNuvec3", !6, i64 0, !6, i64 4, !6, i64 8}
!13 = !{!12, !6, i64 4}
!14 = !{!15, !6, i64 0}
!15 = !{!"DNvolume", !6, i64 0, !6, i64 4, !6, i64 8, !12, i64 12, !16, i64 24, !16, i64 32, !16, i64 40, !16, i64 48, !16, i64 56, !16, i64 64, !10, i64 72, !10, i64 80, !10, i64 88, !10, i64 96, !10, i64 104, !7, i64 112, !7, i64 124, !17, i64 136, !6, i64 140, !7, i64 144, !7, i64 156, !7, i64 168, !6, i64 180, !6, i64 184, !17, i64 188, !18, i64 192, !6, i64 196, !7, i64 200, !7, i64 212, !6, i64 224, !17, i64 228}
!16 = !{!"long", !7, i64 0}
!17 = !{!"float", !7, i64 0}
!18 = !{!"_Bool", !7, i64 0}
!19 = !{!12, !6, i64 8}
!20 = !{!16, !16, i64 0}
!21 = !{!15, !16, i64 40}
!22 = !{!15, !10, i64 72}
!23 = !{!24, !7, i64 0}
!24 = !{!"DNchunkHandle", !7, i64 0, !6, i64 4}
!25 = distinct !{!25, !26}
!26 = !{!"llvm.loop.mustprogress"}
!27 = !{!15, !10, i64 80}
!28 = distinct !{!28, !26}
!29 = !{!15, !10, i64 88}
!30 = !{!15, !10, i64 96}
!31 = !{!15, !16, i64 48}
!32 = !{!15, !10, i64 104}
!33 = !{!34, !6, i64 16}
!34 = !{!"DNvoxelNode", !6, i64 0, !16, i64 8, !35, i64 16}
!35 = !{!"DNivec3", !6, i64 0, !6, i64 4, !6, i64 8}
!36 = !{!34, !6, i64 0}
!37 = !{!34, !16, i64 8}
!38 = distinct !{!38, !26}
!39 = !{i64 0, i64 4, !5, i64 4, i64 4, !5, i64 8, i64 4, !5}
!40 = !{!15, !16, i64 24}
!41 = !{!15, !16, i64 32}
!42 = !{!15, !16, i64 56}
!43 = !{!15, !16, i64 64}
!44 = !{!17, !17, i64 0}
!45 = !{i64 0, i64 12, !46}
!46 = !{!7, !7, i64 0}
!47 = !{!15, !17, i64 136}
!48 = !{!15, !6, i64 140}
!49 = !{!15, !6, i64 180}
!50 = !{!15, !6, i64 184}
!51 = !{!15, !17, i64 188}
!52 = !{!15, !18, i64 192}
!53 = !{!15, !6, i64 224}
!54 = !{!15, !17, i64 228}


; 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.DNchunkHandle = type { i8, i32 }
%struct.DNvoxelNode = type { i32, i64, %struct.DNivec3 }
%struct.DNivec3 = type { i32, i32, i32 }

@g_DN_message_callback = external dso_local local_unnamed_addr global ptr, align 8
@.str.6 = external hidden unnamed_addr constant [30 x i8], align 1
@glad_glBindBuffer = external local_unnamed_addr global ptr, align 8
@glad_glClearBufferData = external local_unnamed_addr global ptr, align 8
@.str.7 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [37 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [40 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [48 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [47 x i8], align 1

; Function Attrs: nounwind uwtable
declare hidden zeroext i1 @_DN_gen_shader_storage_buffer(ptr noundef, i64 noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local noundef ptr @DN_create_volume(i64 %0, i32 %1, i32 noundef %2) local_unnamed_addr #0 {
  %.sroa.084.sroa.9.0.extract.shift = lshr i64 %0, 32
  %4 = tail call noalias dereferenceable_or_null(232) ptr @malloc(i64 noundef 232) #4
  %5 = and i64 %0, 4294967295
  %6 = mul nuw i64 %5, %.sroa.084.sroa.9.0.extract.shift
  %7 = mul i64 %6, 12
  %8 = mul i64 %7, %5
  %9 = tail call zeroext i1 @_DN_gen_shader_storage_buffer(ptr noundef %4, i64 noundef %8)
  br i1 %9, label %12, label %10

10:                                               ; preds = %3
  %11 = load ptr, ptr @g_DN_message_callback, align 8, !tbaa !5
  tail call void %11(i32 noundef 1, i32 noundef 2, ptr noundef nonnull @.str.6) #5
  br label %112

12:                                               ; preds = %3
  %.sroa.084.sroa.9.0.extract.trunc = trunc nuw i64 %.sroa.084.sroa.9.0.extract.shift to i32
  %.sroa.084.sroa.0.0.extract.trunc = trunc i64 %0 to i32
  %13 = load ptr, ptr @glad_glBindBuffer, align 8, !tbaa !5
  %14 = load i32, ptr %4, align 8, !tbaa !9
  tail call void %13(i32 noundef 37074, i32 noundef %14) #5
  %15 = load ptr, ptr @glad_glClearBufferData, align 8, !tbaa !5
  tail call void %15(i32 noundef 37074, i32 noundef 33321, i32 noundef 6403, i32 noundef 5121, ptr noundef null) #5
  %16 = mul i32 %.sroa.084.sroa.0.0.extract.trunc, %1
  %17 = mul i32 %16, %.sroa.084.sroa.9.0.extract.trunc
  %18 = uitofp i32 %17 to double
  %19 = uitofp i32 %2 to double
  %20 = tail call double @llvm.minnum.f64(double %18, double %19)
  %21 = fptoui double %20 to i64
  %22 = getelementptr inbounds i8, ptr %4, i64 4
  %23 = mul i64 %6, 96
  %24 = mul i64 %23, %5
  %25 = tail call zeroext i1 @_DN_gen_shader_storage_buffer(ptr noundef nonnull %22, i64 noundef %24)
  br i1 %25, label %28, label %26

26:                                               ; preds = %12
  %27 = load ptr, ptr @g_DN_message_callback, align 8, !tbaa !5
  tail call void %27(i32 noundef 1, i32 noundef 2, ptr noundef nonnull @.str.7) #5
  br label %112

28:                                               ; preds = %12
  %29 = shl i64 %21, 8
  %30 = and i64 %29, 9223372036854775552
  %31 = getelementptr inbounds i8, ptr %4, i64 40
  store i64 %30, ptr %31, align 8, !tbaa !16
  %32 = getelementptr inbounds i8, ptr %4, i64 8
  %33 = shl i64 %21, 12
  %34 = add i64 %33, 8192
  %35 = tail call zeroext i1 @_DN_gen_shader_storage_buffer(ptr noundef nonnull %32, i64 noundef %34)
  br i1 %35, label %38, label %36

36:                                               ; preds = %28
  %37 = load ptr, ptr @g_DN_message_callback, align 8, !tbaa !5
  tail call void %37(i32 noundef 1, i32 noundef 2, ptr noundef nonnull @.str.8) #5
  br label %112

38:                                               ; preds = %28
  %39 = zext i32 %1 to i64
  %40 = shl i64 %6, 3
  %41 = mul i64 %40, %39
  %42 = tail call noalias ptr @malloc(i64 noundef %41) #4
  %43 = getelementptr inbounds i8, ptr %4, i64 72
  store ptr %42, ptr %43, align 8, !tbaa !17
  %.not = icmp eq ptr %42, null
  br i1 %.not, label %45, label %.preheader112

.preheader112:                                    ; preds = %38
  %.not120 = icmp eq i32 %17, 0
  br i1 %.not120, label %._crit_edge, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %.preheader112
  %wide.trip.count = zext i32 %17 to i64
  %xtraiter = and i64 %wide.trip.count, 7
  %44 = icmp ult i32 %17, 8
  br i1 %44, label %._crit_edge.loopexit.unr-lcssa, label %.lr.ph.preheader.new

.lr.ph.preheader.new:                             ; preds = %.lr.ph.preheader
  %unroll_iter = and i64 %wide.trip.count, 4294967288
  br label %.lr.ph

45:                                               ; preds = %38
  %46 = load ptr, ptr @g_DN_message_callback, align 8, !tbaa !5
  tail call void %46(i32 noundef 0, i32 noundef 2, ptr noundef nonnull @.str.9) #5
  br label %112

._crit_edge.loopexit.unr-lcssa:                   ; preds = %.lr.ph, %.lr.ph.preheader
  %indvars.iv.unr = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next.7, %.lr.ph ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge, label %.lr.ph.epil

.lr.ph.epil:                                      ; preds = %._crit_edge.loopexit.unr-lcssa, %.lr.ph.epil
  %indvars.iv.epil = phi i64 [ %indvars.iv.next.epil, %.lr.ph.epil ], [ %indvars.iv.unr, %._crit_edge.loopexit.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.lr.ph.epil ], [ 0, %._crit_edge.loopexit.unr-lcssa ]
  %47 = getelementptr inbounds %struct.DNchunkHandle, ptr %42, i64 %indvars.iv.epil
  store i8 0, ptr %47, align 4, !tbaa !18
  %indvars.iv.next.epil = add nuw nsw i64 %indvars.iv.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
  br i1 %epil.iter.cmp.not, label %._crit_edge, label %.lr.ph.epil, !llvm.loop !20

._crit_edge:                                      ; preds = %._crit_edge.loopexit.unr-lcssa, %.lr.ph.epil, %.preheader112
  %48 = mul i64 %21, 4120
  %49 = tail call noalias ptr @malloc(i64 noundef %48) #4
  %50 = getelementptr inbounds i8, ptr %4, i64 80
  store ptr %49, ptr %50, align 8, !tbaa !22
  %.not107 = icmp eq ptr %49, null
  br i1 %.not107, label %59, label %.preheader111

.preheader111:                                    ; preds = %._crit_edge
  %.not121 = icmp eq i64 %21, 0
  br i1 %.not121, label %._crit_edge116, label %.lr.ph115

.lr.ph:                                           ; preds = %.lr.ph, %.lr.ph.preheader.new
  %indvars.iv = phi i64 [ 0, %.lr.ph.preheader.new ], [ %indvars.iv.next.7, %.lr.ph ]
  %niter = phi i64 [ 0, %.lr.ph.preheader.new ], [ %niter.next.7, %.lr.ph ]
  %51 = getelementptr inbounds %struct.DNchunkHandle, ptr %42, i64 %indvars.iv
  store i8 0, ptr %51, align 4, !tbaa !18
  %indvars.iv.next = or disjoint i64 %indvars.iv, 1
  %52 = getelementptr inbounds %struct.DNchunkHandle, ptr %42, i64 %indvars.iv.next
  store i8 0, ptr %52, align 4, !tbaa !18
  %indvars.iv.next.1 = or disjoint i64 %indvars.iv, 2
  %53 = getelementptr inbounds %struct.DNchunkHandle, ptr %42, i64 %indvars.iv.next.1
  store i8 0, ptr %53, align 4, !tbaa !18
  %indvars.iv.next.2 = or disjoint i64 %indvars.iv, 3
  %54 = getelementptr inbounds %struct.DNchunkHandle, ptr %42, i64 %indvars.iv.next.2
  store i8 0, ptr %54, align 4, !tbaa !18
  %indvars.iv.next.3 = or disjoint i64 %indvars.iv, 4
  %55 = getelementptr inbounds %struct.DNchunkHandle, ptr %42, i64 %indvars.iv.next.3
  store i8 0, ptr %55, align 4, !tbaa !18
  %indvars.iv.next.4 = or disjoint i64 %indvars.iv, 5
  %56 = getelementptr inbounds %struct.DNchunkHandle, ptr %42, i64 %indvars.iv.next.4
  store i8 0, ptr %56, align 4, !tbaa !18
  %indvars.iv.next.5 = or disjoint i64 %indvars.iv, 6
  %57 = getelementptr inbounds %struct.DNchunkHandle, ptr %42, i64 %indvars.iv.next.5
  store i8 0, ptr %57, align 4, !tbaa !18
  %indvars.iv.next.6 = or disjoint i64 %indvars.iv, 7
  %58 = getelementptr inbounds %struct.DNchunkHandle, ptr %42, i64 %indvars.iv.next.6
  store i8 0, ptr %58, align 4, !tbaa !18
  %indvars.iv.next.7 = add nuw nsw i64 %indvars.iv, 8
  %niter.next.7 = add i64 %niter, 8
  %niter.ncmp.7 = icmp eq i64 %niter.next.7, %unroll_iter
  br i1 %niter.ncmp.7, label %._crit_edge.loopexit.unr-lcssa, label %.lr.ph, !llvm.loop !23

59:                                               ; preds = %._crit_edge
  %60 = load ptr, ptr @g_DN_message_callback, align 8, !tbaa !5
  tail call void %60(i32 noundef 0, i32 noundef 2, ptr noundef nonnull @.str.10) #5
  br label %112

._crit_edge116:                                   ; preds = %.lr.ph115, %.preheader111
  %61 = tail call noalias dereferenceable_or_null(8192) ptr @malloc(i64 noundef 8192) #4
  %62 = getelementptr inbounds i8, ptr %4, i64 88
  store ptr %61, ptr %62, align 8, !tbaa !25
  %.not108 = icmp eq ptr %61, null
  br i1 %.not108, label %64, label %66

.lr.ph115:                                        ; preds = %.preheader111, %.lr.ph115
  %indvars.iv124 = phi i64 [ %indvars.iv.next125, %.lr.ph115 ], [ 0, %.preheader111 ]
  %63 = trunc nuw nsw i64 %indvars.iv124 to i32
  tail call void @_DN_clear_chunk(ptr noundef %4, i32 noundef %63)
  %indvars.iv.next125 = add nuw i64 %indvars.iv124, 1
  %exitcond127.not = icmp eq i64 %indvars.iv.next125, %21
  br i1 %exitcond127.not, label %._crit_edge116, label %.lr.ph115, !llvm.loop !26

64:                                               ; preds = %._crit_edge116
  %65 = load ptr, ptr @g_DN_message_callback, align 8, !tbaa !5
  tail call void %65(i32 noundef 0, i32 noundef 2, ptr noundef nonnull @.str.11) #5
  br label %112

66:                                               ; preds = %._crit_edge116
  %67 = shl nuw nsw i64 %21, 2
  %68 = tail call noalias ptr @malloc(i64 noundef %67) #4
  %69 = getelementptr inbounds i8, ptr %4, i64 96
  store ptr %68, ptr %69, align 8, !tbaa !27
  %.not109 = icmp eq ptr %68, null
  br i1 %.not109, label %70, label %72

70:                                               ; preds = %66
  %71 = load ptr, ptr @g_DN_message_callback, align 8, !tbaa !5
  tail call void %71(i32 noundef 0, i32 noundef 2, ptr noundef nonnull @.str.12) #5
  br label %112

72:                                               ; preds = %66
  %73 = load i64, ptr %31, align 8, !tbaa !16
  %74 = lshr i64 %73, 9
  %75 = getelementptr inbounds i8, ptr %4, i64 48
  store i64 %74, ptr %75, align 8, !tbaa !28
  %76 = shl i64 %73, 1
  %77 = and i64 %76, -32
  %78 = tail call noalias ptr @malloc(i64 noundef %77) #4
  %79 = getelementptr inbounds i8, ptr %4, i64 104
  store ptr %78, ptr %79, align 8, !tbaa !29
  %.not110 = icmp eq ptr %78, null
  br i1 %.not110, label %81, label %.preheader

.preheader:                                       ; preds = %72
  %.not122 = icmp ult i64 %73, 512
  br i1 %.not122, label %._crit_edge119, label %.lr.ph118.preheader

.lr.ph118.preheader:                              ; preds = %.preheader
  %80 = icmp eq i64 %74, 1
  br i1 %80, label %._crit_edge119.loopexit.unr-lcssa, label %.lr.ph118.preheader.new

.lr.ph118.preheader.new:                          ; preds = %.lr.ph118.preheader
  %unroll_iter135 = and i64 %74, 36028797018963966
  br label %.lr.ph118

81:                                               ; preds = %72
  %82 = load ptr, ptr @g_DN_message_callback, align 8, !tbaa !5
  tail call void %82(i32 noundef 0, i32 noundef 2, ptr noundef nonnull @.str.13) #5
  br label %112

._crit_edge119.loopexit.unr-lcssa:                ; preds = %.lr.ph118, %.lr.ph118.preheader
  %indvars.iv128.unr = phi i64 [ 0, %.lr.ph118.preheader ], [ %indvars.iv.next129.1, %.lr.ph118 ]
  %83 = and i64 %73, 512
  %lcmp.mod134.not = icmp eq i64 %83, 0
  br i1 %lcmp.mod134.not, label %._crit_edge119, label %.lr.ph118.epil

.lr.ph118.epil:                                   ; preds = %._crit_edge119.loopexit.unr-lcssa
  %84 = getelementptr inbounds %struct.DNvoxelNode, ptr %78, i64 %indvars.iv128.unr, i32 2
  store i32 -1, ptr %84, align 8, !tbaa !30
  %85 = getelementptr inbounds %struct.DNvoxelNode, ptr %78, i64 %indvars.iv128.unr
  store i32 512, ptr %85, align 8, !tbaa !33
  %86 = shl nsw i64 %indvars.iv128.unr, 9
  %87 = getelementptr inbounds %struct.DNvoxelNode, ptr %78, i64 %indvars.iv128.unr, i32 1
  store i64 %86, ptr %87, align 8, !tbaa !34
  br label %._crit_edge119

._crit_edge119:                                   ; preds = %.lr.ph118.epil, %._crit_edge119.loopexit.unr-lcssa, %.preheader
  %88 = getelementptr inbounds i8, ptr %4, i64 12
  store i64 %0, ptr %88, align 4
  %.sroa.14.0..sroa_idx = getelementptr inbounds i8, ptr %4, i64 20
  store i32 %1, ptr %.sroa.14.0..sroa_idx, align 4, !tbaa !35
  %89 = getelementptr inbounds i8, ptr %4, i64 24
  store i64 %21, ptr %89, align 8, !tbaa !36
  %90 = getelementptr inbounds i8, ptr %4, i64 32
  store i64 0, ptr %90, align 8, !tbaa !37
  %91 = getelementptr inbounds i8, ptr %4, i64 56
  store i64 0, ptr %91, align 8, !tbaa !38
  %92 = getelementptr inbounds i8, ptr %4, i64 64
  store i64 %21, ptr %92, align 8, !tbaa !39
  %93 = getelementptr inbounds i8, ptr %4, i64 112
  %94 = getelementptr inbounds i8, ptr %4, i64 136
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %93, i8 0, i64 24, i1 false)
  store float 9.000000e+01, ptr %94, align 8, !tbaa !40
  %95 = getelementptr inbounds i8, ptr %4, i64 140
  store i32 0, ptr %95, align 4, !tbaa !41
  %96 = getelementptr inbounds i8, ptr %4, i64 144
  store <4 x float> <float 1.000000e+00, float 1.000000e+00, float 1.000000e+00, float 0x3FE3333340000000>, ptr %96, align 8
  %.sroa.28.0..sroa_idx = getelementptr inbounds i8, ptr %4, i64 160
  store <4 x float> <float 0x3FE3333340000000, float 0x3FE3333340000000, float 0x3F847AE140000000, float 0x3F847AE140000000>, ptr %.sroa.28.0..sroa_idx, align 4
  %.sroa.36.0..sroa_idx = getelementptr inbounds i8, ptr %4, i64 176
  store float 0x3F847AE140000000, ptr %.sroa.36.0..sroa_idx, align 8, !tbaa !42
  %97 = getelementptr inbounds i8, ptr %4, i64 180
  store i32 5, ptr %97, align 4, !tbaa !43
  %98 = getelementptr inbounds i8, ptr %4, i64 184
  store i32 2, ptr %98, align 8, !tbaa !44
  %99 = getelementptr inbounds i8, ptr %4, i64 188
  store float 1.000000e+01, ptr %99, align 4, !tbaa !45
  %100 = getelementptr inbounds i8, ptr %4, i64 192
  store i8 0, ptr %100, align 8, !tbaa !46
  %101 = getelementptr inbounds i8, ptr %4, i64 200
  store <4 x float> <float 0x3FE6B851E0000000, float 0x3FEB333340000000, float 0x3FECCCCCC0000000, float 0.000000e+00>, ptr %101, align 8
  %.sroa.2.0..sroa_idx = getelementptr inbounds i8, ptr %4, i64 216
  store <2 x float> <float 0x3FDCCCCCC0000000, float 0x3FE7AE1480000000>, ptr %.sroa.2.0..sroa_idx, align 4
  %102 = getelementptr inbounds i8, ptr %4, i64 224
  store i32 0, ptr %102, align 8, !tbaa !47
  %103 = getelementptr inbounds i8, ptr %4, i64 228
  store float 0x405EDD2F20000000, ptr %103, align 4, !tbaa !48
  br label %112

.lr.ph118:                                        ; preds = %.lr.ph118, %.lr.ph118.preheader.new
  %indvars.iv128 = phi i64 [ 0, %.lr.ph118.preheader.new ], [ %indvars.iv.next129.1, %.lr.ph118 ]
  %niter136 = phi i64 [ 0, %.lr.ph118.preheader.new ], [ %niter136.next.1, %.lr.ph118 ]
  %104 = getelementptr inbounds %struct.DNvoxelNode, ptr %78, i64 %indvars.iv128, i32 2
  store i32 -1, ptr %104, align 8, !tbaa !30
  %105 = getelementptr inbounds %struct.DNvoxelNode, ptr %78, i64 %indvars.iv128
  store i32 512, ptr %105, align 8, !tbaa !33
  %106 = shl nsw i64 %indvars.iv128, 9
  %107 = getelementptr inbounds %struct.DNvoxelNode, ptr %78, i64 %indvars.iv128, i32 1
  store i64 %106, ptr %107, align 8, !tbaa !34
  %indvars.iv.next129 = or disjoint i64 %indvars.iv128, 1
  %108 = getelementptr inbounds %struct.DNvoxelNode, ptr %78, i64 %indvars.iv.next129, i32 2
  store i32 -1, ptr %108, align 8, !tbaa !30
  %109 = getelementptr inbounds %struct.DNvoxelNode, ptr %78, i64 %indvars.iv.next129
  store i32 512, ptr %109, align 8, !tbaa !33
  %110 = shl nsw i64 %indvars.iv.next129, 9
  %111 = getelementptr inbounds %struct.DNvoxelNode, ptr %78, i64 %indvars.iv.next129, i32 1
  store i64 %110, ptr %111, align 8, !tbaa !34
  %indvars.iv.next129.1 = add nuw nsw i64 %indvars.iv128, 2
  %niter136.next.1 = add i64 %niter136, 2
  %niter136.ncmp.1 = icmp eq i64 %niter136.next.1, %unroll_iter135
  br i1 %niter136.ncmp.1, label %._crit_edge119.loopexit.unr-lcssa, label %.lr.ph118, !llvm.loop !49

112:                                              ; preds = %26, %36, %45, %59, %64, %70, %81, %._crit_edge119, %10
  %.1 = phi ptr [ null, %10 ], [ %4, %._crit_edge119 ], [ null, %81 ], [ null, %70 ], [ null, %64 ], [ null, %59 ], [ null, %45 ], [ null, %36 ], [ null, %26 ]
  ret ptr %.1
}

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.minnum.f64(double, double) #2

; Function Attrs: nounwind uwtable
declare hidden void @_DN_clear_chunk(ptr noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #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 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 #2 = { mustprogress nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #3 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { nounwind allocsize(0) }
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, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !11, i64 0}
!10 = !{!"DNvolume", !11, i64 0, !11, i64 4, !11, i64 8, !12, i64 12, !13, i64 24, !13, i64 32, !13, i64 40, !13, i64 48, !13, i64 56, !13, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !7, i64 112, !7, i64 124, !14, i64 136, !11, i64 140, !7, i64 144, !7, i64 156, !7, i64 168, !11, i64 180, !11, i64 184, !14, i64 188, !15, i64 192, !11, i64 196, !7, i64 200, !7, i64 212, !11, i64 224, !14, i64 228}
!11 = !{!"int", !7, i64 0}
!12 = !{!"DNuvec3", !11, i64 0, !11, i64 4, !11, i64 8}
!13 = !{!"long", !7, i64 0}
!14 = !{!"float", !7, i64 0}
!15 = !{!"_Bool", !7, i64 0}
!16 = !{!10, !13, i64 40}
!17 = !{!10, !6, i64 72}
!18 = !{!19, !7, i64 0}
!19 = !{!"DNchunkHandle", !7, i64 0, !11, i64 4}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.unroll.disable"}
!22 = !{!10, !6, i64 80}
!23 = distinct !{!23, !24}
!24 = !{!"llvm.loop.mustprogress"}
!25 = !{!10, !6, i64 88}
!26 = distinct !{!26, !24}
!27 = !{!10, !6, i64 96}
!28 = !{!10, !13, i64 48}
!29 = !{!10, !6, i64 104}
!30 = !{!31, !11, i64 16}
!31 = !{!"DNvoxelNode", !11, i64 0, !13, i64 8, !32, i64 16}
!32 = !{!"DNivec3", !11, i64 0, !11, i64 4, !11, i64 8}
!33 = !{!31, !11, i64 0}
!34 = !{!31, !13, i64 8}
!35 = !{!11, !11, i64 0}
!36 = !{!10, !13, i64 24}
!37 = !{!10, !13, i64 32}
!38 = !{!10, !13, i64 56}
!39 = !{!10, !13, i64 64}
!40 = !{!10, !14, i64 136}
!41 = !{!10, !11, i64 140}
!42 = !{!7, !7, i64 0}
!43 = !{!10, !11, i64 180}
!44 = !{!10, !11, i64 184}
!45 = !{!10, !14, i64 188}
!46 = !{!10, !15, i64 192}
!47 = !{!10, !11, i64 224}
!48 = !{!10, !14, i64 228}
!49 = distinct !{!49, !24}


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