; 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.VoxFileVoxel = type { i8, i8, i8, i8 }
%struct.VoxFileChunk = type { i32, i32, i32, i64 }
%struct.DNuvec3 = type { i32, i32, i32 }
%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 }

@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [37 x i8], align 1
@g_DN_message_callback = external global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [35 x i8], align 1

; 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: nounwind uwtable
declare dso_local void @_DN_read_chunk_info(ptr noundef, ptr noundef) #2

declare i64 @fread(ptr noundef, i64 noundef, i64 noundef, ptr noundef) #3

declare i64 @ftell(ptr noundef) #3

; Function Attrs: nounwind uwtable
define dso_local zeroext i1 @DN_load_vox_file(ptr noundef %0, i32 noundef %1, ptr noundef %2) #2 {
  %4 = alloca i1, align 1
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca [256 x i8], align 16
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca ptr, align 8
  %13 = alloca [256 x %struct.VoxFileVoxel], align 16
  %14 = alloca i32, align 4
  %15 = alloca [256 x i8], align 16
  %16 = alloca %struct.VoxFileChunk, align 8
  %17 = alloca %struct.VoxFileChunk, align 8
  %18 = alloca %struct.DNuvec3, align 4
  %19 = alloca i64, align 8
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca %struct.DNvoxel, align 8
  %23 = alloca %struct.VoxFileVoxel, align 1
  %24 = alloca %union.QMvec3, align 4
  %25 = alloca %struct.DNcolor, align 1
  %26 = alloca %struct.DNivec3, align 4
  %27 = alloca %struct.DNcompressedVoxel, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store i32 %1, ptr %6, align 4, !tbaa !9
  store ptr %2, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  %28 = load ptr, ptr %5, align 8, !tbaa !5
  %29 = call noalias ptr @fopen(ptr noundef %28, ptr noundef @.str)
  store ptr %29, ptr %8, align 8, !tbaa !5
  %30 = load ptr, ptr %8, align 8, !tbaa !5
  %31 = icmp eq ptr %30, null
  br i1 %31, label %32, label %38

32:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 256, ptr %9) #6
  %33 = getelementptr inbounds [256 x i8], ptr %9, i64 0, i64 0
  %34 = load ptr, ptr %5, align 8, !tbaa !5
  %35 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef %33, ptr noundef @.str.1, ptr noundef %34) #6
  %36 = load ptr, ptr @g_DN_message_callback, align 8, !tbaa !5
  %37 = getelementptr inbounds [256 x i8], ptr %9, i64 0, i64 0
  call void %36(i32 noundef 3, i32 noundef 1, ptr noundef %37)
  store i1 false, ptr %4, align 1
  store i32 1, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 256, ptr %9) #6
  br label %230

38:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  store ptr null, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1024, ptr %13) #6
  %39 = load ptr, ptr %7, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct.DNvoxelModel, ptr %39, i32 0, i32 1
  store ptr null, ptr %40, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  %41 = load ptr, ptr %8, align 8, !tbaa !5
  %42 = call i64 @fread(ptr noundef %14, i64 noundef 4, i64 noundef 1, ptr noundef %41)
  %43 = load i32, ptr %14, align 4, !tbaa !9
  %44 = icmp ne i32 %43, 542658390
  br i1 %44, label %45, label %51

45:                                               ; preds = %38
  call void @llvm.lifetime.start.p0(i64 256, ptr %15) #6
  %46 = getelementptr inbounds [256 x i8], ptr %15, i64 0, i64 0
  %47 = load ptr, ptr %5, align 8, !tbaa !5
  %48 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef %46, ptr noundef @.str.2, ptr noundef %47) #6
  %49 = load ptr, ptr @g_DN_message_callback, align 8, !tbaa !5
  %50 = getelementptr inbounds [256 x i8], ptr %15, i64 0, i64 0
  call void %49(i32 noundef 3, i32 noundef 1, ptr noundef %50)
  store i1 false, ptr %4, align 1
  store i32 1, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 256, ptr %15) #6
  br label %229

51:                                               ; preds = %38
  %52 = load ptr, ptr %8, align 8, !tbaa !5
  %53 = call i32 @fseek(ptr noundef %52, i64 noundef 4, i32 noundef 1)
  call void @llvm.lifetime.start.p0(i64 24, ptr %16) #6
  %54 = load ptr, ptr %8, align 8, !tbaa !5
  call void @_DN_read_chunk_info(ptr noundef %54, ptr noundef %16)
  br label %55

55:                                               ; preds = %98, %51
  %56 = load ptr, ptr %8, align 8, !tbaa !5
  %57 = call i64 @ftell(ptr noundef %56)
  %58 = getelementptr inbounds %struct.VoxFileChunk, ptr %16, i32 0, i32 3
  %59 = load i64, ptr %58, align 8, !tbaa !14
  %60 = icmp ult i64 %57, %59
  br i1 %60, label %61, label %103

61:                                               ; preds = %55
  call void @llvm.lifetime.start.p0(i64 24, ptr %17) #6
  %62 = load ptr, ptr %8, align 8, !tbaa !5
  call void @_DN_read_chunk_info(ptr noundef %62, ptr noundef %17)
  %63 = getelementptr inbounds %struct.VoxFileChunk, ptr %17, i32 0, i32 0
  %64 = load i32, ptr %63, align 8, !tbaa !17
  switch i32 %64, label %98 [
    i32 1163544915, label %65
    i32 1230657880, label %77
    i32 1094862674, label %94
  ]

65:                                               ; preds = %61
  call void @llvm.lifetime.start.p0(i64 12, ptr %18) #6
  %66 = getelementptr inbounds %struct.DNuvec3, ptr %18, i32 0, i32 0
  %67 = load ptr, ptr %8, align 8, !tbaa !5
  %68 = call i64 @fread(ptr noundef %66, i64 noundef 4, i64 noundef 1, ptr noundef %67)
  %69 = getelementptr inbounds %struct.DNuvec3, ptr %18, i32 0, i32 1
  %70 = load ptr, ptr %8, align 8, !tbaa !5
  %71 = call i64 @fread(ptr noundef %69, i64 noundef 4, i64 noundef 1, ptr noundef %70)
  %72 = getelementptr inbounds %struct.DNuvec3, ptr %18, i32 0, i32 2
  %73 = load ptr, ptr %8, align 8, !tbaa !5
  %74 = call i64 @fread(ptr noundef %72, i64 noundef 4, i64 noundef 1, ptr noundef %73)
  %75 = load ptr, ptr %7, align 8, !tbaa !5
  %76 = getelementptr inbounds %struct.DNvoxelModel, ptr %75, i32 0, i32 0
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %76, ptr align 4 %18, i64 12, i1 false), !tbaa.struct !18
  store i32 4, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 12, ptr %18) #6
  br label %98

77:                                               ; preds = %61
  %78 = load ptr, ptr %12, align 8, !tbaa !5
  %79 = icmp ne ptr %78, null
  br i1 %79, label %80, label %82

80:                                               ; preds = %77
  %81 = load ptr, ptr %12, align 8, !tbaa !5
  call void @free(ptr noundef %81) #6
  br label %82

82:                                               ; preds = %80, %77
  %83 = load ptr, ptr %8, align 8, !tbaa !5
  %84 = call i64 @fread(ptr noundef %11, i64 noundef 4, i64 noundef 1, ptr noundef %83)
  %85 = load i32, ptr %11, align 4, !tbaa !9
  %86 = zext i32 %85 to i64
  %87 = mul i64 %86, 4
  %88 = call noalias ptr @malloc(i64 noundef %87) #7
  store ptr %88, ptr %12, align 8, !tbaa !5
  %89 = load ptr, ptr %12, align 8, !tbaa !5
  %90 = load i32, ptr %11, align 4, !tbaa !9
  %91 = zext i32 %90 to i64
  %92 = load ptr, ptr %8, align 8, !tbaa !5
  %93 = call i64 @fread(ptr noundef %89, i64 noundef 4, i64 noundef %91, ptr noundef %92)
  br label %98

94:                                               ; preds = %61
  %95 = getelementptr inbounds [256 x %struct.VoxFileVoxel], ptr %13, i64 0, i64 1
  %96 = load ptr, ptr %8, align 8, !tbaa !5
  %97 = call i64 @fread(ptr noundef %95, i64 noundef 4, i64 noundef 255, ptr noundef %96)
  br label %98

98:                                               ; preds = %94, %82, %65, %61
  %99 = load ptr, ptr %8, align 8, !tbaa !5
  %100 = getelementptr inbounds %struct.VoxFileChunk, ptr %17, i32 0, i32 3
  %101 = load i64, ptr %100, align 8, !tbaa !14
  %102 = call i32 @fseek(ptr noundef %99, i64 noundef %101, i32 noundef 0)
  call void @llvm.lifetime.end.p0(i64 24, ptr %17) #6
  br label %55, !llvm.loop !19

103:                                              ; preds = %55
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #6
  %104 = load ptr, ptr %7, align 8, !tbaa !5
  %105 = getelementptr inbounds %struct.DNvoxelModel, ptr %104, i32 0, i32 0
  %106 = getelementptr inbounds %struct.DNuvec3, ptr %105, i32 0, i32 0
  %107 = load i32, ptr %106, align 8, !tbaa !21
  %108 = load ptr, ptr %7, align 8, !tbaa !5
  %109 = getelementptr inbounds %struct.DNvoxelModel, ptr %108, i32 0, i32 0
  %110 = getelementptr inbounds %struct.DNuvec3, ptr %109, i32 0, i32 1
  %111 = load i32, ptr %110, align 4, !tbaa !22
  %112 = mul i32 %107, %111
  %113 = load ptr, ptr %7, align 8, !tbaa !5
  %114 = getelementptr inbounds %struct.DNvoxelModel, ptr %113, i32 0, i32 0
  %115 = getelementptr inbounds %struct.DNuvec3, ptr %114, i32 0, i32 2
  %116 = load i32, ptr %115, align 8, !tbaa !23
  %117 = mul i32 %112, %116
  %118 = zext i32 %117 to i64
  store i64 %118, ptr %19, align 8, !tbaa !24
  %119 = load i64, ptr %19, align 8, !tbaa !24
  %120 = mul i64 %119, 8
  %121 = call noalias ptr @malloc(i64 noundef %120) #7
  %122 = load ptr, ptr %7, align 8, !tbaa !5
  %123 = getelementptr inbounds %struct.DNvoxelModel, ptr %122, i32 0, i32 1
  store ptr %121, ptr %123, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #6
  store i32 0, ptr %20, align 4, !tbaa !9
  br label %124

124:                                              ; preds = %138, %103
  %125 = load i32, ptr %20, align 4, !tbaa !9
  %126 = sext i32 %125 to i64
  %127 = load i64, ptr %19, align 8, !tbaa !24
  %128 = icmp ult i64 %126, %127
  br i1 %128, label %130, label %129

129:                                              ; preds = %124
  store i32 5, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #6
  br label %141

130:                                              ; preds = %124
  %131 = load ptr, ptr %7, align 8, !tbaa !5
  %132 = getelementptr inbounds %struct.DNvoxelModel, ptr %131, i32 0, i32 1
  %133 = load ptr, ptr %132, align 8, !tbaa !11
  %134 = load i32, ptr %20, align 4, !tbaa !9
  %135 = sext i32 %134 to i64
  %136 = getelementptr inbounds %struct.DNcompressedVoxel, ptr %133, i64 %135
  %137 = getelementptr inbounds %struct.DNcompressedVoxel, ptr %136, i32 0, i32 0
  store i32 -1, ptr %137, align 4, !tbaa !25
  br label %138

138:                                              ; preds = %130
  %139 = load i32, ptr %20, align 4, !tbaa !9
  %140 = add nsw i32 %139, 1
  store i32 %140, ptr %20, align 4, !tbaa !9
  br label %124, !llvm.loop !27

141:                                              ; preds = %129
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #6
  store i32 0, ptr %21, align 4, !tbaa !9
  br label %142

142:                                              ; preds = %225, %141
  %143 = load i32, ptr %21, align 4, !tbaa !9
  %144 = load i32, ptr %11, align 4, !tbaa !9
  %145 = icmp ult i32 %143, %144
  br i1 %145, label %147, label %146

146:                                              ; preds = %142
  store i32 8, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #6
  br label %228

147:                                              ; preds = %142
  call void @llvm.lifetime.start.p0(i64 20, ptr %22) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #6
  %148 = load ptr, ptr %12, align 8, !tbaa !5
  %149 = load i32, ptr %21, align 4, !tbaa !9
  %150 = sext i32 %149 to i64
  %151 = getelementptr inbounds %struct.VoxFileVoxel, ptr %148, i64 %150
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %23, ptr align 1 %151, i64 4, i1 false), !tbaa.struct !28
  %152 = load i32, ptr %6, align 4, !tbaa !9
  %153 = icmp sge i32 %152, 0
  br i1 %153, label %154, label %156

154:                                              ; preds = %147
  %155 = load i32, ptr %6, align 4, !tbaa !9
  br label %160

156:                                              ; preds = %147
  %157 = getelementptr inbounds %struct.VoxFileVoxel, ptr %23, i32 0, i32 3
  %158 = load i8, ptr %157, align 1, !tbaa !30
  %159 = zext i8 %158 to i32
  br label %160

160:                                              ; preds = %156, %154
  %161 = phi i32 [ %155, %154 ], [ %159, %156 ]
  %162 = trunc i32 %161 to i8
  %163 = getelementptr inbounds %struct.DNvoxel, ptr %22, i32 0, i32 0
  store i8 %162, ptr %163, align 4, !tbaa !32
  %164 = getelementptr inbounds %struct.DNvoxel, ptr %22, i32 0, i32 1
  store float 0.000000e+00, ptr %24, align 4, !tbaa !35
  %165 = getelementptr inbounds float, ptr %24, i64 1
  store float 1.000000e+00, ptr %165, align 4, !tbaa !35
  %166 = getelementptr inbounds float, ptr %24, i64 2
  store float 0.000000e+00, ptr %166, align 4, !tbaa !35
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %164, ptr align 4 %24, i64 12, i1 false), !tbaa.struct !37
  %167 = getelementptr inbounds %struct.DNvoxel, ptr %22, i32 0, i32 2
  %168 = getelementptr inbounds %struct.DNcolor, ptr %25, i32 0, i32 0
  %169 = getelementptr inbounds %struct.VoxFileVoxel, ptr %23, i32 0, i32 3
  %170 = load i8, ptr %169, align 1, !tbaa !30
  %171 = zext i8 %170 to i64
  %172 = getelementptr inbounds [256 x %struct.VoxFileVoxel], ptr %13, i64 0, i64 %171
  %173 = getelementptr inbounds %struct.VoxFileVoxel, ptr %172, i32 0, i32 0
  %174 = load i8, ptr %173, align 4, !tbaa !38
  store i8 %174, ptr %168, align 1, !tbaa !39
  %175 = getelementptr inbounds %struct.DNcolor, ptr %25, i32 0, i32 1
  %176 = getelementptr inbounds %struct.VoxFileVoxel, ptr %23, i32 0, i32 3
  %177 = load i8, ptr %176, align 1, !tbaa !30
  %178 = zext i8 %177 to i64
  %179 = getelementptr inbounds [256 x %struct.VoxFileVoxel], ptr %13, i64 0, i64 %178
  %180 = getelementptr inbounds %struct.VoxFileVoxel, ptr %179, i32 0, i32 1
  %181 = load i8, ptr %180, align 1, !tbaa !40
  store i8 %181, ptr %175, align 1, !tbaa !41
  %182 = getelementptr inbounds %struct.DNcolor, ptr %25, i32 0, i32 2
  %183 = getelementptr inbounds %struct.VoxFileVoxel, ptr %23, i32 0, i32 3
  %184 = load i8, ptr %183, align 1, !tbaa !30
  %185 = zext i8 %184 to i64
  %186 = getelementptr inbounds [256 x %struct.VoxFileVoxel], ptr %13, i64 0, i64 %185
  %187 = getelementptr inbounds %struct.VoxFileVoxel, ptr %186, i32 0, i32 2
  %188 = load i8, ptr %187, align 2, !tbaa !42
  store i8 %188, ptr %182, align 1, !tbaa !43
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %167, ptr align 1 %25, i64 3, i1 false), !tbaa.struct !44
  call void @llvm.lifetime.start.p0(i64 12, ptr %26) #6
  %189 = getelementptr inbounds %struct.DNivec3, ptr %26, i32 0, i32 0
  %190 = getelementptr inbounds %struct.VoxFileVoxel, ptr %23, i32 0, i32 0
  %191 = load i8, ptr %190, align 1, !tbaa !38
  %192 = zext i8 %191 to i32
  store i32 %192, ptr %189, align 4, !tbaa !45
  %193 = getelementptr inbounds %struct.DNivec3, ptr %26, i32 0, i32 1
  %194 = getelementptr inbounds %struct.VoxFileVoxel, ptr %23, i32 0, i32 2
  %195 = load i8, ptr %194, align 1, !tbaa !42
  %196 = zext i8 %195 to i32
  store i32 %196, ptr %193, align 4, !tbaa !47
  %197 = getelementptr inbounds %struct.DNivec3, ptr %26, i32 0, i32 2
  %198 = getelementptr inbounds %struct.VoxFileVoxel, ptr %23, i32 0, i32 1
  %199 = load i8, ptr %198, align 1, !tbaa !40
  %200 = zext i8 %199 to i32
  store i32 %200, ptr %197, align 4, !tbaa !48
  %201 = load ptr, ptr %7, align 8, !tbaa !5
  %202 = getelementptr inbounds %struct.DNvoxelModel, ptr %201, i32 0, i32 1
  %203 = load ptr, ptr %202, align 8, !tbaa !11
  %204 = getelementptr inbounds %struct.DNivec3, ptr %26, i32 0, i32 0
  %205 = load i32, ptr %204, align 4, !tbaa !45
  %206 = load ptr, ptr %7, align 8, !tbaa !5
  %207 = getelementptr inbounds %struct.DNvoxelModel, ptr %206, i32 0, i32 0
  %208 = getelementptr inbounds %struct.DNuvec3, ptr %207, i32 0, i32 0
  %209 = load i32, ptr %208, align 8, !tbaa !21
  %210 = getelementptr inbounds %struct.DNivec3, ptr %26, i32 0, i32 1
  %211 = load i32, ptr %210, align 4, !tbaa !47
  %212 = getelementptr inbounds %struct.DNivec3, ptr %26, i32 0, i32 2
  %213 = load i32, ptr %212, align 4, !tbaa !48
  %214 = load ptr, ptr %7, align 8, !tbaa !5
  %215 = getelementptr inbounds %struct.DNvoxelModel, ptr %214, i32 0, i32 0
  %216 = getelementptr inbounds %struct.DNuvec3, ptr %215, i32 0, i32 1
  %217 = load i32, ptr %216, align 4, !tbaa !22
  %218 = mul i32 %213, %217
  %219 = add i32 %211, %218
  %220 = mul i32 %209, %219
  %221 = add i32 %205, %220
  %222 = zext i32 %221 to i64
  %223 = getelementptr inbounds %struct.DNcompressedVoxel, ptr %203, i64 %222
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #6
  %224 = call i64 @DN_compress_voxel(ptr noundef byval(%struct.DNvoxel) align 8 %22)
  store i64 %224, ptr %27, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %223, ptr align 4 %27, i64 8, i1 false), !tbaa.struct !49
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #6
  call void @llvm.lifetime.end.p0(i64 12, ptr %26) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #6
  call void @llvm.lifetime.end.p0(i64 20, ptr %22) #6
  br label %225

225:                                              ; preds = %160
  %226 = load i32, ptr %21, align 4, !tbaa !9
  %227 = add nsw i32 %226, 1
  store i32 %227, ptr %21, align 4, !tbaa !9
  br label %142, !llvm.loop !50

228:                                              ; preds = %146
  store i1 true, ptr %4, align 1
  store i32 1, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %16) #6
  br label %229

229:                                              ; preds = %228, %45
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 1024, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  br label %230

230:                                              ; preds = %229, %32
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  %231 = load i1, ptr %4, align 1
  ret i1 %231
}

declare noalias ptr @fopen(ptr noundef, ptr noundef) #3

; Function Attrs: nounwind
declare i32 @sprintf(ptr noundef, ptr noundef, ...) #4

declare i32 @fseek(ptr noundef, i64 noundef, i32 noundef) #3

; Function Attrs: nounwind
declare void @free(ptr noundef) #4

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

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

attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind allocsize(0) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nounwind }
attributes #7 = { 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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !6, i64 16}
!12 = !{!"DNvoxelModel", !13, i64 0, !6, i64 16}
!13 = !{!"DNuvec3", !10, i64 0, !10, i64 4, !10, i64 8}
!14 = !{!15, !16, i64 16}
!15 = !{!"VoxFileChunk", !10, i64 0, !10, i64 4, !10, i64 8, !16, i64 16}
!16 = !{!"long", !7, i64 0}
!17 = !{!15, !10, i64 0}
!18 = !{i64 0, i64 4, !9, i64 4, i64 4, !9, i64 8, i64 4, !9}
!19 = distinct !{!19, !20}
!20 = !{!"llvm.loop.mustprogress"}
!21 = !{!12, !10, i64 0}
!22 = !{!12, !10, i64 4}
!23 = !{!12, !10, i64 8}
!24 = !{!16, !16, i64 0}
!25 = !{!26, !10, i64 0}
!26 = !{!"DNcompressedVoxel", !10, i64 0, !10, i64 4}
!27 = distinct !{!27, !20}
!28 = !{i64 0, i64 1, !29, i64 1, i64 1, !29, i64 2, i64 1, !29, i64 3, i64 1, !29}
!29 = !{!7, !7, i64 0}
!30 = !{!31, !7, i64 3}
!31 = !{!"VoxFileVoxel", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3}
!32 = !{!33, !7, i64 0}
!33 = !{!"DNvoxel", !7, i64 0, !7, i64 4, !34, i64 16}
!34 = !{!"DNcolor", !7, i64 0, !7, i64 1, !7, i64 2}
!35 = !{!36, !36, i64 0}
!36 = !{!"float", !7, i64 0}
!37 = !{i64 0, i64 12, !29}
!38 = !{!31, !7, i64 0}
!39 = !{!34, !7, i64 0}
!40 = !{!31, !7, i64 1}
!41 = !{!34, !7, i64 1}
!42 = !{!31, !7, i64 2}
!43 = !{!34, !7, i64 2}
!44 = !{i64 0, i64 1, !29, i64 1, i64 1, !29, i64 2, i64 1, !29}
!45 = !{!46, !10, i64 0}
!46 = !{!"DNivec3", !10, i64 0, !10, i64 4, !10, i64 8}
!47 = !{!46, !10, i64 4}
!48 = !{!46, !10, i64 8}
!49 = !{i64 0, i64 4, !9, i64 4, i64 4, !9}
!50 = distinct !{!50, !20}


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

%struct.VoxFileVoxel = type { i8, i8, i8, i8 }
%struct.VoxFileChunk = type { i32, i32, i32, i64 }
%struct.DNuvec3 = type { i32, i32, i32 }
%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 }

@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [37 x i8], align 1
@g_DN_message_callback = external local_unnamed_addr global ptr, align 8
@.str.2 = external hidden unnamed_addr constant [35 x i8], align 1

; Function Attrs: mustprogress 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: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1

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

; Function Attrs: nounwind uwtable
declare dso_local void @_DN_read_chunk_info(ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: nofree nounwind
declare noundef i64 @fread(ptr nocapture noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #3

; Function Attrs: nofree nounwind
declare noundef i64 @ftell(ptr nocapture noundef) local_unnamed_addr #3

; Function Attrs: nounwind uwtable
define dso_local noundef zeroext i1 @DN_load_vox_file(ptr noundef %0, i32 noundef %1, ptr nocapture noundef %2) local_unnamed_addr #2 {
  %4 = alloca [256 x i8], align 16
  %5 = alloca i32, align 4
  %6 = alloca [256 x %struct.VoxFileVoxel], align 16
  %7 = alloca i32, align 4
  %8 = alloca [256 x i8], align 16
  %9 = alloca %struct.VoxFileChunk, align 8
  %10 = alloca %struct.VoxFileChunk, align 8
  %11 = alloca %struct.DNuvec3, align 4
  %12 = alloca %struct.DNvoxel, align 8
  %13 = tail call noalias ptr @fopen(ptr noundef %0, ptr noundef nonnull @.str)
  %14 = icmp eq ptr %13, null
  br i1 %14, label %15, label %18

15:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 256, ptr nonnull %4) #7
  %16 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %4, ptr noundef nonnull dereferenceable(1) @.str.1, ptr noundef %0) #7
  %17 = load ptr, ptr @g_DN_message_callback, align 8, !tbaa !5
  call void %17(i32 noundef 3, i32 noundef 1, ptr noundef nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 256, ptr nonnull %4) #7
  br label %129

18:                                               ; preds = %3
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #7
  call void @llvm.lifetime.start.p0(i64 1024, ptr nonnull %6) #7
  %19 = getelementptr inbounds i8, ptr %2, i64 16
  store ptr null, ptr %19, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #7
  %20 = call i64 @fread(ptr noundef nonnull %7, i64 noundef 4, i64 noundef 1, ptr noundef nonnull %13)
  %21 = load i32, ptr %7, align 4, !tbaa !13
  %.not = icmp eq i32 %21, 542658390
  br i1 %.not, label %25, label %22

22:                                               ; preds = %18
  call void @llvm.lifetime.start.p0(i64 256, ptr nonnull %8) #7
  %23 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %8, ptr noundef nonnull dereferenceable(1) @.str.2, ptr noundef %0) #7
  %24 = load ptr, ptr @g_DN_message_callback, align 8, !tbaa !5
  call void %24(i32 noundef 3, i32 noundef 1, ptr noundef nonnull %8) #7
  call void @llvm.lifetime.end.p0(i64 256, ptr nonnull %8) #7
  br label %128

25:                                               ; preds = %18
  %26 = tail call i32 @fseek(ptr noundef nonnull %13, i64 noundef 4, i32 noundef 1)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %9) #7
  call void @_DN_read_chunk_info(ptr noundef nonnull %13, ptr noundef nonnull %9)
  %27 = call i64 @ftell(ptr noundef nonnull %13)
  %28 = getelementptr inbounds i8, ptr %9, i64 16
  %29 = load i64, ptr %28, align 8, !tbaa !14
  %30 = icmp ult i64 %27, %29
  br i1 %30, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %25
  %31 = getelementptr inbounds i8, ptr %6, i64 4
  %32 = getelementptr inbounds i8, ptr %11, i64 4
  %33 = getelementptr inbounds i8, ptr %11, i64 8
  %34 = getelementptr inbounds i8, ptr %10, i64 16
  br label %35

35:                                               ; preds = %.lr.ph, %53
  %36 = phi i32 [ undef, %.lr.ph ], [ %54, %53 ]
  %.05158 = phi ptr [ null, %.lr.ph ], [ %.152, %53 ]
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %10) #7
  call void @_DN_read_chunk_info(ptr noundef nonnull %13, ptr noundef nonnull %10)
  %37 = load i32, ptr %10, align 8, !tbaa !17
  switch i32 %37, label %53 [
    i32 1163544915, label %38
    i32 1230657880, label %42
    i32 1094862674, label %51
  ]

38:                                               ; preds = %35
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %11) #7
  %39 = call i64 @fread(ptr noundef nonnull %11, i64 noundef 4, i64 noundef 1, ptr noundef nonnull %13)
  %40 = call i64 @fread(ptr noundef nonnull %32, i64 noundef 4, i64 noundef 1, ptr noundef nonnull %13)
  %41 = call i64 @fread(ptr noundef nonnull %33, i64 noundef 4, i64 noundef 1, ptr noundef nonnull %13)
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(12) %2, ptr noundef nonnull align 4 dereferenceable(12) %11, i64 12, i1 false), !tbaa.struct !18
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %11) #7
  br label %53

42:                                               ; preds = %35
  %.not57 = icmp eq ptr %.05158, null
  br i1 %.not57, label %44, label %43

43:                                               ; preds = %42
  call void @free(ptr noundef nonnull %.05158) #7
  br label %44

44:                                               ; preds = %43, %42
  %45 = call i64 @fread(ptr noundef nonnull %5, i64 noundef 4, i64 noundef 1, ptr noundef nonnull %13)
  %46 = load i32, ptr %5, align 4, !tbaa !13
  %47 = zext i32 %46 to i64
  %48 = shl nuw nsw i64 %47, 2
  %49 = call noalias ptr @malloc(i64 noundef %48) #8
  %50 = call i64 @fread(ptr noundef %49, i64 noundef 4, i64 noundef %47, ptr noundef nonnull %13)
  br label %53

51:                                               ; preds = %35
  %52 = call i64 @fread(ptr noundef nonnull %31, i64 noundef 4, i64 noundef 255, ptr noundef nonnull %13)
  br label %53

53:                                               ; preds = %51, %44, %38, %35
  %54 = phi i32 [ %36, %35 ], [ %36, %51 ], [ %46, %44 ], [ %36, %38 ]
  %.152 = phi ptr [ %.05158, %35 ], [ %.05158, %51 ], [ %49, %44 ], [ %.05158, %38 ]
  %55 = load i64, ptr %34, align 8, !tbaa !14
  %56 = call i32 @fseek(ptr noundef nonnull %13, i64 noundef %55, i32 noundef 0)
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %10) #7
  %57 = call i64 @ftell(ptr noundef nonnull %13)
  %58 = load i64, ptr %28, align 8, !tbaa !14
  %59 = icmp ult i64 %57, %58
  br i1 %59, label %35, label %._crit_edge, !llvm.loop !19

._crit_edge:                                      ; preds = %53, %25
  %60 = phi i32 [ undef, %25 ], [ %54, %53 ]
  %.051.lcssa = phi ptr [ null, %25 ], [ %.152, %53 ]
  %61 = load i32, ptr %2, align 8, !tbaa !21
  %62 = getelementptr inbounds i8, ptr %2, i64 4
  %63 = load i32, ptr %62, align 4, !tbaa !22
  %64 = mul i32 %63, %61
  %65 = getelementptr inbounds i8, ptr %2, i64 8
  %66 = load i32, ptr %65, align 8, !tbaa !23
  %67 = mul i32 %64, %66
  %68 = zext i32 %67 to i64
  %69 = shl nuw nsw i64 %68, 3
  %70 = call noalias ptr @malloc(i64 noundef %69) #8
  store ptr %70, ptr %19, align 8, !tbaa !9
  %.not65 = icmp eq i32 %67, 0
  br i1 %.not65, label %.preheader, label %.lr.ph61.preheader

.lr.ph61.preheader:                               ; preds = %._crit_edge
  %xtraiter = and i64 %68, 7
  %71 = icmp ult i32 %67, 8
  br i1 %71, label %.preheader.loopexit.unr-lcssa, label %.lr.ph61.preheader.new

.lr.ph61.preheader.new:                           ; preds = %.lr.ph61.preheader
  %unroll_iter = and i64 %68, 4294967288
  br label %.lr.ph61

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

.lr.ph61.epil:                                    ; preds = %.preheader.loopexit.unr-lcssa, %.lr.ph61.epil
  %indvars.iv.epil = phi i64 [ %indvars.iv.next.epil, %.lr.ph61.epil ], [ %indvars.iv.unr, %.preheader.loopexit.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.lr.ph61.epil ], [ 0, %.preheader.loopexit.unr-lcssa ]
  %72 = getelementptr inbounds %struct.DNcompressedVoxel, ptr %70, i64 %indvars.iv.epil
  store i32 -1, ptr %72, align 4, !tbaa !24
  %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 %.preheader, label %.lr.ph61.epil, !llvm.loop !26

.preheader:                                       ; preds = %.preheader.loopexit.unr-lcssa, %.lr.ph61.epil, %._crit_edge
  %.not66 = icmp eq i32 %60, 0
  br i1 %.not66, label %._crit_edge64, label %.lr.ph63

.lr.ph63:                                         ; preds = %.preheader
  %73 = icmp slt i32 %1, 0
  %74 = getelementptr inbounds i8, ptr %12, i64 4
  %.sroa.35.0..sroa_idx = getelementptr inbounds i8, ptr %12, i64 12
  %75 = getelementptr inbounds i8, ptr %12, i64 16
  %.sroa.2.0..sroa_idx = getelementptr inbounds i8, ptr %12, i64 17
  %.sroa.3.0..sroa_idx = getelementptr inbounds i8, ptr %12, i64 18
  br i1 %73, label %.lr.ph63.split.us.preheader, label %.lr.ph63.split

.lr.ph63.split.us.preheader:                      ; preds = %.lr.ph63
  %wide.trip.count77 = zext i32 %60 to i64
  br label %.lr.ph63.split.us

.lr.ph63.split.us:                                ; preds = %.lr.ph63.split.us.preheader, %.lr.ph63.split.us
  %indvars.iv74 = phi i64 [ 0, %.lr.ph63.split.us.preheader ], [ %indvars.iv.next75, %.lr.ph63.split.us ]
  call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %12) #7
  %76 = getelementptr inbounds %struct.VoxFileVoxel, ptr %.051.lcssa, i64 %indvars.iv74
  %.sroa.06.0.copyload.us = load i8, ptr %76, align 1, !tbaa !28
  %.sroa.47.0..sroa_idx.us = getelementptr inbounds i8, ptr %76, i64 1
  %.sroa.47.0.copyload.us = load i8, ptr %.sroa.47.0..sroa_idx.us, align 1, !tbaa !28
  %.sroa.5.0..sroa_idx.us = getelementptr inbounds i8, ptr %76, i64 2
  %.sroa.5.0.copyload.us = load i8, ptr %.sroa.5.0..sroa_idx.us, align 1, !tbaa !28
  %.sroa.68.0..sroa_idx.us = getelementptr inbounds i8, ptr %76, i64 3
  %.sroa.68.0.copyload.us = load i8, ptr %.sroa.68.0..sroa_idx.us, align 1, !tbaa !28
  store i8 %.sroa.68.0.copyload.us, ptr %12, align 8, !tbaa !29
  store <2 x float> <float 0.000000e+00, float 1.000000e+00>, ptr %74, align 4
  store float 0.000000e+00, ptr %.sroa.35.0..sroa_idx, align 4, !tbaa !28
  %77 = zext i8 %.sroa.68.0.copyload.us to i64
  %78 = getelementptr inbounds [256 x %struct.VoxFileVoxel], ptr %6, i64 0, i64 %77
  %79 = load i8, ptr %78, align 4, !tbaa !32
  %80 = getelementptr inbounds i8, ptr %78, i64 1
  %81 = load i8, ptr %80, align 1, !tbaa !34
  %82 = getelementptr inbounds i8, ptr %78, i64 2
  %83 = load i8, ptr %82, align 2, !tbaa !35
  store i8 %79, ptr %75, align 8, !tbaa !28
  store i8 %81, ptr %.sroa.2.0..sroa_idx, align 1, !tbaa !28
  store i8 %83, ptr %.sroa.3.0..sroa_idx, align 2, !tbaa !28
  %84 = zext i8 %.sroa.06.0.copyload.us to i32
  %85 = zext i8 %.sroa.5.0.copyload.us to i32
  %86 = zext i8 %.sroa.47.0.copyload.us to i32
  %87 = load ptr, ptr %19, align 8, !tbaa !9
  %88 = load i32, ptr %2, align 8, !tbaa !21
  %89 = load i32, ptr %62, align 4, !tbaa !22
  %90 = mul i32 %89, %86
  %91 = add i32 %90, %85
  %92 = mul i32 %91, %88
  %93 = add i32 %92, %84
  %94 = zext i32 %93 to i64
  %95 = getelementptr inbounds %struct.DNcompressedVoxel, ptr %87, i64 %94
  %96 = call i64 @DN_compress_voxel(ptr noundef nonnull byval(%struct.DNvoxel) align 8 %12) #7
  store i64 %96, ptr %95, align 4
  call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %12) #7
  %indvars.iv.next75 = add nuw nsw i64 %indvars.iv74, 1
  %exitcond78.not = icmp eq i64 %indvars.iv.next75, %wide.trip.count77
  br i1 %exitcond78.not, label %._crit_edge64, label %.lr.ph63.split.us, !llvm.loop !36

.lr.ph63.split:                                   ; preds = %.lr.ph63
  %97 = trunc i32 %1 to i8
  %wide.trip.count72 = zext i32 %60 to i64
  br label %106

.lr.ph61:                                         ; preds = %.lr.ph61, %.lr.ph61.preheader.new
  %indvars.iv = phi i64 [ 0, %.lr.ph61.preheader.new ], [ %indvars.iv.next.7, %.lr.ph61 ]
  %niter = phi i64 [ 0, %.lr.ph61.preheader.new ], [ %niter.next.7, %.lr.ph61 ]
  %98 = getelementptr inbounds %struct.DNcompressedVoxel, ptr %70, i64 %indvars.iv
  store i32 -1, ptr %98, align 4, !tbaa !24
  %indvars.iv.next = or disjoint i64 %indvars.iv, 1
  %99 = getelementptr inbounds %struct.DNcompressedVoxel, ptr %70, i64 %indvars.iv.next
  store i32 -1, ptr %99, align 4, !tbaa !24
  %indvars.iv.next.1 = or disjoint i64 %indvars.iv, 2
  %100 = getelementptr inbounds %struct.DNcompressedVoxel, ptr %70, i64 %indvars.iv.next.1
  store i32 -1, ptr %100, align 4, !tbaa !24
  %indvars.iv.next.2 = or disjoint i64 %indvars.iv, 3
  %101 = getelementptr inbounds %struct.DNcompressedVoxel, ptr %70, i64 %indvars.iv.next.2
  store i32 -1, ptr %101, align 4, !tbaa !24
  %indvars.iv.next.3 = or disjoint i64 %indvars.iv, 4
  %102 = getelementptr inbounds %struct.DNcompressedVoxel, ptr %70, i64 %indvars.iv.next.3
  store i32 -1, ptr %102, align 4, !tbaa !24
  %indvars.iv.next.4 = or disjoint i64 %indvars.iv, 5
  %103 = getelementptr inbounds %struct.DNcompressedVoxel, ptr %70, i64 %indvars.iv.next.4
  store i32 -1, ptr %103, align 4, !tbaa !24
  %indvars.iv.next.5 = or disjoint i64 %indvars.iv, 6
  %104 = getelementptr inbounds %struct.DNcompressedVoxel, ptr %70, i64 %indvars.iv.next.5
  store i32 -1, ptr %104, align 4, !tbaa !24
  %indvars.iv.next.6 = or disjoint i64 %indvars.iv, 7
  %105 = getelementptr inbounds %struct.DNcompressedVoxel, ptr %70, i64 %indvars.iv.next.6
  store i32 -1, ptr %105, align 4, !tbaa !24
  %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 %.preheader.loopexit.unr-lcssa, label %.lr.ph61, !llvm.loop !37

._crit_edge64:                                    ; preds = %106, %.lr.ph63.split.us, %.preheader
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %9) #7
  br label %128

106:                                              ; preds = %.lr.ph63.split, %106
  %indvars.iv69 = phi i64 [ 0, %.lr.ph63.split ], [ %indvars.iv.next70, %106 ]
  call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %12) #7
  %107 = getelementptr inbounds %struct.VoxFileVoxel, ptr %.051.lcssa, i64 %indvars.iv69
  %.sroa.06.0.copyload = load i8, ptr %107, align 1, !tbaa !28
  %.sroa.47.0..sroa_idx = getelementptr inbounds i8, ptr %107, i64 1
  %.sroa.47.0.copyload = load i8, ptr %.sroa.47.0..sroa_idx, align 1, !tbaa !28
  %.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %107, i64 2
  %.sroa.5.0.copyload = load i8, ptr %.sroa.5.0..sroa_idx, align 1, !tbaa !28
  %.sroa.68.0..sroa_idx = getelementptr inbounds i8, ptr %107, i64 3
  %.sroa.68.0.copyload = load i8, ptr %.sroa.68.0..sroa_idx, align 1, !tbaa !28
  store i8 %97, ptr %12, align 8, !tbaa !29
  store <2 x float> <float 0.000000e+00, float 1.000000e+00>, ptr %74, align 4
  store float 0.000000e+00, ptr %.sroa.35.0..sroa_idx, align 4, !tbaa !28
  %108 = zext i8 %.sroa.68.0.copyload to i64
  %109 = getelementptr inbounds [256 x %struct.VoxFileVoxel], ptr %6, i64 0, i64 %108
  %110 = load i8, ptr %109, align 4, !tbaa !32
  %111 = getelementptr inbounds i8, ptr %109, i64 1
  %112 = load i8, ptr %111, align 1, !tbaa !34
  %113 = getelementptr inbounds i8, ptr %109, i64 2
  %114 = load i8, ptr %113, align 2, !tbaa !35
  store i8 %110, ptr %75, align 8, !tbaa !28
  store i8 %112, ptr %.sroa.2.0..sroa_idx, align 1, !tbaa !28
  store i8 %114, ptr %.sroa.3.0..sroa_idx, align 2, !tbaa !28
  %115 = zext i8 %.sroa.06.0.copyload to i32
  %116 = zext i8 %.sroa.5.0.copyload to i32
  %117 = zext i8 %.sroa.47.0.copyload to i32
  %118 = load ptr, ptr %19, align 8, !tbaa !9
  %119 = load i32, ptr %2, align 8, !tbaa !21
  %120 = load i32, ptr %62, align 4, !tbaa !22
  %121 = mul i32 %120, %117
  %122 = add i32 %121, %116
  %123 = mul i32 %122, %119
  %124 = add i32 %123, %115
  %125 = zext i32 %124 to i64
  %126 = getelementptr inbounds %struct.DNcompressedVoxel, ptr %118, i64 %125
  %127 = call i64 @DN_compress_voxel(ptr noundef nonnull byval(%struct.DNvoxel) align 8 %12) #7
  store i64 %127, ptr %126, align 4
  call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %12) #7
  %indvars.iv.next70 = add nuw nsw i64 %indvars.iv69, 1
  %exitcond73.not = icmp eq i64 %indvars.iv.next70, %wide.trip.count72
  br i1 %exitcond73.not, label %._crit_edge64, label %106, !llvm.loop !36

128:                                              ; preds = %._crit_edge64, %22
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #7
  call void @llvm.lifetime.end.p0(i64 1024, ptr nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #7
  br label %129

129:                                              ; preds = %128, %15
  %.1 = phi i1 [ false, %15 ], [ %.not, %128 ]
  ret i1 %.1
}

; Function Attrs: nofree nounwind
declare noalias noundef ptr @fopen(ptr nocapture noundef readonly, ptr nocapture noundef readonly) local_unnamed_addr #3

; Function Attrs: nofree nounwind
declare noundef i32 @sprintf(ptr noalias nocapture noundef writeonly, ptr nocapture noundef readonly, ...) local_unnamed_addr #3

; Function Attrs: nofree nounwind
declare noundef i32 @fseek(ptr nocapture noundef, i64 noundef, i32 noundef) local_unnamed_addr #3

; Function Attrs: mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite)
declare void @free(ptr allocptr nocapture noundef) local_unnamed_addr #4

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

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

attributes #0 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress nounwind willreturn allockind("free") memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { mustprogress nofree nounwind willreturn 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 #6 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { nounwind }
attributes #8 = { 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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !6, i64 16}
!10 = !{!"DNvoxelModel", !11, i64 0, !6, i64 16}
!11 = !{!"DNuvec3", !12, i64 0, !12, i64 4, !12, i64 8}
!12 = !{!"int", !7, i64 0}
!13 = !{!12, !12, i64 0}
!14 = !{!15, !16, i64 16}
!15 = !{!"VoxFileChunk", !12, i64 0, !12, i64 4, !12, i64 8, !16, i64 16}
!16 = !{!"long", !7, i64 0}
!17 = !{!15, !12, i64 0}
!18 = !{i64 0, i64 4, !13, i64 4, i64 4, !13, i64 8, i64 4, !13}
!19 = distinct !{!19, !20}
!20 = !{!"llvm.loop.mustprogress"}
!21 = !{!10, !12, i64 0}
!22 = !{!10, !12, i64 4}
!23 = !{!10, !12, i64 8}
!24 = !{!25, !12, i64 0}
!25 = !{!"DNcompressedVoxel", !12, i64 0, !12, i64 4}
!26 = distinct !{!26, !27}
!27 = !{!"llvm.loop.unroll.disable"}
!28 = !{!7, !7, i64 0}
!29 = !{!30, !7, i64 0}
!30 = !{!"DNvoxel", !7, i64 0, !7, i64 4, !31, i64 16}
!31 = !{!"DNcolor", !7, i64 0, !7, i64 1, !7, i64 2}
!32 = !{!33, !7, i64 0}
!33 = !{!"VoxFileVoxel", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3}
!34 = !{!33, !7, i64 1}
!35 = !{!33, !7, i64 2}
!36 = distinct !{!36, !20}
!37 = distinct !{!37, !20}


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