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

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

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

; Function Attrs: 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) #1

; Function Attrs: nounwind uwtable
declare dso_local i32 @DN_add_chunk(ptr noundef, i64, i32) #2

; Function Attrs: nounwind uwtable
declare dso_local void @DN_remove_chunk(ptr noundef, i64, i32) #2

; Function Attrs: nounwind uwtable
define dso_local void @DN_set_compressed_voxel(ptr noundef %0, i64 %1, i32 %2, i64 %3, i32 %4, i64 %5) #2 {
  %7 = alloca %struct.DNivec3, align 4
  %8 = alloca { i64, i32 }, align 4
  %9 = alloca %struct.DNivec3, align 4
  %10 = alloca { i64, i32 }, align 4
  %11 = alloca %struct.DNcompressedVoxel, align 4
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca { i64, i32 }, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca { i64, i32 }, align 4
  %20 = getelementptr inbounds { i64, i32 }, ptr %8, i32 0, i32 0
  store i64 %1, ptr %20, align 4
  %21 = getelementptr inbounds { i64, i32 }, ptr %8, i32 0, i32 1
  store i32 %2, ptr %21, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %7, ptr align 4 %8, i64 12, i1 false)
  %22 = getelementptr inbounds { i64, i32 }, ptr %10, i32 0, i32 0
  store i64 %3, ptr %22, align 4
  %23 = getelementptr inbounds { i64, i32 }, ptr %10, i32 0, i32 1
  store i32 %4, ptr %23, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %9, ptr align 4 %10, i64 12, i1 false)
  store i64 %5, ptr %11, align 4
  store ptr %0, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #3
  %24 = getelementptr inbounds %struct.DNivec3, ptr %7, i32 0, i32 0
  %25 = load i32, ptr %24, align 4, !tbaa !9
  %26 = load ptr, ptr %12, align 8, !tbaa !5
  %27 = getelementptr inbounds %struct.DNvolume, ptr %26, i32 0, i32 3
  %28 = getelementptr inbounds %struct.DNuvec3, ptr %27, i32 0, i32 0
  %29 = load i32, ptr %28, align 4, !tbaa !12
  %30 = getelementptr inbounds %struct.DNivec3, ptr %7, i32 0, i32 1
  %31 = load i32, ptr %30, align 4, !tbaa !18
  %32 = getelementptr inbounds %struct.DNivec3, ptr %7, i32 0, i32 2
  %33 = load i32, ptr %32, align 4, !tbaa !19
  %34 = load ptr, ptr %12, align 8, !tbaa !5
  %35 = getelementptr inbounds %struct.DNvolume, ptr %34, i32 0, i32 3
  %36 = getelementptr inbounds %struct.DNuvec3, ptr %35, i32 0, i32 1
  %37 = load i32, ptr %36, align 4, !tbaa !20
  %38 = mul i32 %33, %37
  %39 = add i32 %31, %38
  %40 = mul i32 %29, %39
  %41 = add i32 %25, %40
  store i32 %41, ptr %13, align 4, !tbaa !21
  %42 = load ptr, ptr %12, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct.DNvolume, ptr %42, i32 0, i32 10
  %44 = load ptr, ptr %43, align 8, !tbaa !22
  %45 = load i32, ptr %13, align 4, !tbaa !21
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds %struct.DNchunkHandle, ptr %44, i64 %46
  %48 = getelementptr inbounds %struct.DNchunkHandle, ptr %47, i32 0, i32 0
  %49 = load i8, ptr %48, align 4, !tbaa !23
  %50 = zext i8 %49 to i32
  %51 = icmp eq i32 %50, 0
  br i1 %51, label %52, label %65

52:                                               ; preds = %6
  %53 = getelementptr inbounds %struct.DNcompressedVoxel, ptr %11, i32 0, i32 0
  %54 = load i32, ptr %53, align 4, !tbaa !25
  %55 = lshr i32 %54, 24
  %56 = icmp eq i32 %55, 255
  br i1 %56, label %57, label %58

57:                                               ; preds = %52
  store i32 1, ptr %14, align 4
  br label %175

58:                                               ; preds = %52
  %59 = load ptr, ptr %12, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %15, ptr align 4 %7, i64 12, i1 false)
  %60 = getelementptr inbounds { i64, i32 }, ptr %15, i32 0, i32 0
  %61 = load i64, ptr %60, align 4
  %62 = getelementptr inbounds { i64, i32 }, ptr %15, i32 0, i32 1
  %63 = load i32, ptr %62, align 4
  %64 = call i32 @DN_add_chunk(ptr noundef %59, i64 %61, i32 %63)
  br label %65

65:                                               ; preds = %58, %6
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #3
  %66 = load ptr, ptr %12, align 8, !tbaa !5
  %67 = getelementptr inbounds %struct.DNvolume, ptr %66, i32 0, i32 10
  %68 = load ptr, ptr %67, align 8, !tbaa !22
  %69 = load i32, ptr %13, align 4, !tbaa !21
  %70 = sext i32 %69 to i64
  %71 = getelementptr inbounds %struct.DNchunkHandle, ptr %68, i64 %70
  %72 = getelementptr inbounds %struct.DNchunkHandle, ptr %71, i32 0, i32 1
  %73 = load i32, ptr %72, align 4, !tbaa !27
  store i32 %73, ptr %16, align 4, !tbaa !21
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #3
  %74 = load ptr, ptr %12, align 8, !tbaa !5
  %75 = getelementptr inbounds %struct.DNvolume, ptr %74, i32 0, i32 11
  %76 = load ptr, ptr %75, align 8, !tbaa !28
  %77 = load i32, ptr %16, align 4, !tbaa !21
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds %struct.DNchunk, ptr %76, i64 %78
  %80 = getelementptr inbounds %struct.DNchunk, ptr %79, i32 0, i32 4
  %81 = getelementptr inbounds %struct.DNivec3, ptr %9, i32 0, i32 0
  %82 = load i32, ptr %81, align 4, !tbaa !9
  %83 = sext i32 %82 to i64
  %84 = getelementptr inbounds [8 x [8 x [8 x %struct.DNcompressedVoxel]]], ptr %80, i64 0, i64 %83
  %85 = getelementptr inbounds %struct.DNivec3, ptr %9, i32 0, i32 1
  %86 = load i32, ptr %85, align 4, !tbaa !18
  %87 = sext i32 %86 to i64
  %88 = getelementptr inbounds [8 x [8 x %struct.DNcompressedVoxel]], ptr %84, i64 0, i64 %87
  %89 = getelementptr inbounds %struct.DNivec3, ptr %9, i32 0, i32 2
  %90 = load i32, ptr %89, align 4, !tbaa !19
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds [8 x %struct.DNcompressedVoxel], ptr %88, i64 0, i64 %91
  %93 = getelementptr inbounds %struct.DNcompressedVoxel, ptr %92, i32 0, i32 0
  %94 = load i32, ptr %93, align 4, !tbaa !25
  %95 = lshr i32 %94, 24
  store i32 %95, ptr %17, align 4, !tbaa !21
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #3
  %96 = getelementptr inbounds %struct.DNcompressedVoxel, ptr %11, i32 0, i32 0
  %97 = load i32, ptr %96, align 4, !tbaa !25
  %98 = lshr i32 %97, 24
  store i32 %98, ptr %18, align 4, !tbaa !21
  %99 = load i32, ptr %17, align 4, !tbaa !21
  %100 = icmp eq i32 %99, 255
  br i1 %100, label %101, label %114

101:                                              ; preds = %65
  %102 = load i32, ptr %18, align 4, !tbaa !21
  %103 = icmp ne i32 %102, 255
  br i1 %103, label %104, label %114

104:                                              ; preds = %101
  %105 = load ptr, ptr %12, align 8, !tbaa !5
  %106 = getelementptr inbounds %struct.DNvolume, ptr %105, i32 0, i32 11
  %107 = load ptr, ptr %106, align 8, !tbaa !28
  %108 = load i32, ptr %16, align 4, !tbaa !21
  %109 = sext i32 %108 to i64
  %110 = getelementptr inbounds %struct.DNchunk, ptr %107, i64 %109
  %111 = getelementptr inbounds %struct.DNchunk, ptr %110, i32 0, i32 2
  %112 = load i32, ptr %111, align 4, !tbaa !29
  %113 = add i32 %112, 1
  store i32 %113, ptr %111, align 4, !tbaa !29
  br label %147

114:                                              ; preds = %101, %65
  %115 = load i32, ptr %17, align 4, !tbaa !21
  %116 = icmp ne i32 %115, 255
  br i1 %116, label %117, label %146

117:                                              ; preds = %114
  %118 = load i32, ptr %18, align 4, !tbaa !21
  %119 = icmp eq i32 %118, 255
  br i1 %119, label %120, label %146

120:                                              ; preds = %117
  %121 = load ptr, ptr %12, align 8, !tbaa !5
  %122 = getelementptr inbounds %struct.DNvolume, ptr %121, i32 0, i32 11
  %123 = load ptr, ptr %122, align 8, !tbaa !28
  %124 = load i32, ptr %16, align 4, !tbaa !21
  %125 = sext i32 %124 to i64
  %126 = getelementptr inbounds %struct.DNchunk, ptr %123, i64 %125
  %127 = getelementptr inbounds %struct.DNchunk, ptr %126, i32 0, i32 2
  %128 = load i32, ptr %127, align 4, !tbaa !29
  %129 = add i32 %128, -1
  store i32 %129, ptr %127, align 4, !tbaa !29
  %130 = load ptr, ptr %12, align 8, !tbaa !5
  %131 = getelementptr inbounds %struct.DNvolume, ptr %130, i32 0, i32 11
  %132 = load ptr, ptr %131, align 8, !tbaa !28
  %133 = load i32, ptr %16, align 4, !tbaa !21
  %134 = sext i32 %133 to i64
  %135 = getelementptr inbounds %struct.DNchunk, ptr %132, i64 %134
  %136 = getelementptr inbounds %struct.DNchunk, ptr %135, i32 0, i32 2
  %137 = load i32, ptr %136, align 4, !tbaa !29
  %138 = icmp ule i32 %137, 0
  br i1 %138, label %139, label %145

139:                                              ; preds = %120
  %140 = load ptr, ptr %12, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %19, ptr align 4 %7, i64 12, i1 false)
  %141 = getelementptr inbounds { i64, i32 }, ptr %19, i32 0, i32 0
  %142 = load i64, ptr %141, align 4
  %143 = getelementptr inbounds { i64, i32 }, ptr %19, i32 0, i32 1
  %144 = load i32, ptr %143, align 4
  call void @DN_remove_chunk(ptr noundef %140, i64 %142, i32 %144)
  store i32 1, ptr %14, align 4
  br label %174

145:                                              ; preds = %120
  br label %146

146:                                              ; preds = %145, %117, %114
  br label %147

147:                                              ; preds = %146, %104
  %148 = load ptr, ptr %12, align 8, !tbaa !5
  %149 = getelementptr inbounds %struct.DNvolume, ptr %148, i32 0, i32 11
  %150 = load ptr, ptr %149, align 8, !tbaa !28
  %151 = load i32, ptr %16, align 4, !tbaa !21
  %152 = sext i32 %151 to i64
  %153 = getelementptr inbounds %struct.DNchunk, ptr %150, i64 %152
  %154 = getelementptr inbounds %struct.DNchunk, ptr %153, i32 0, i32 4
  %155 = getelementptr inbounds %struct.DNivec3, ptr %9, i32 0, i32 0
  %156 = load i32, ptr %155, align 4, !tbaa !9
  %157 = sext i32 %156 to i64
  %158 = getelementptr inbounds [8 x [8 x [8 x %struct.DNcompressedVoxel]]], ptr %154, i64 0, i64 %157
  %159 = getelementptr inbounds %struct.DNivec3, ptr %9, i32 0, i32 1
  %160 = load i32, ptr %159, align 4, !tbaa !18
  %161 = sext i32 %160 to i64
  %162 = getelementptr inbounds [8 x [8 x %struct.DNcompressedVoxel]], ptr %158, i64 0, i64 %161
  %163 = getelementptr inbounds %struct.DNivec3, ptr %9, i32 0, i32 2
  %164 = load i32, ptr %163, align 4, !tbaa !19
  %165 = sext i32 %164 to i64
  %166 = getelementptr inbounds [8 x %struct.DNcompressedVoxel], ptr %162, i64 0, i64 %165
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %166, ptr align 4 %11, i64 8, i1 false), !tbaa.struct !31
  %167 = load ptr, ptr %12, align 8, !tbaa !5
  %168 = getelementptr inbounds %struct.DNvolume, ptr %167, i32 0, i32 11
  %169 = load ptr, ptr %168, align 8, !tbaa !28
  %170 = load i32, ptr %16, align 4, !tbaa !21
  %171 = sext i32 %170 to i64
  %172 = getelementptr inbounds %struct.DNchunk, ptr %169, i64 %171
  %173 = getelementptr inbounds %struct.DNchunk, ptr %172, i32 0, i32 1
  store i8 1, ptr %173, align 4, !tbaa !32
  store i32 0, ptr %14, align 4
  br label %174

174:                                              ; preds = %147, %139
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #3
  br label %175

175:                                              ; preds = %174, %57
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #3
  %176 = load i32, ptr %14, align 4
  switch i32 %176, label %178 [
    i32 0, label %177
    i32 1, label %177
  ]

177:                                              ; preds = %175, %175
  ret void

178:                                              ; preds = %175
  unreachable
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree 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 = { 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 = !{!"DNivec3", !11, i64 0, !11, i64 4, !11, i64 8}
!11 = !{!"int", !7, i64 0}
!12 = !{!13, !11, i64 12}
!13 = !{!"DNvolume", !11, i64 0, !11, i64 4, !11, i64 8, !14, i64 12, !15, i64 24, !15, i64 32, !15, i64 40, !15, i64 48, !15, i64 56, !15, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !7, i64 112, !7, i64 124, !16, i64 136, !11, i64 140, !7, i64 144, !7, i64 156, !7, i64 168, !11, i64 180, !11, i64 184, !16, i64 188, !17, i64 192, !11, i64 196, !7, i64 200, !7, i64 212, !11, i64 224, !16, i64 228}
!14 = !{!"DNuvec3", !11, i64 0, !11, i64 4, !11, i64 8}
!15 = !{!"long", !7, i64 0}
!16 = !{!"float", !7, i64 0}
!17 = !{!"_Bool", !7, i64 0}
!18 = !{!10, !11, i64 4}
!19 = !{!10, !11, i64 8}
!20 = !{!13, !11, i64 16}
!21 = !{!11, !11, i64 0}
!22 = !{!13, !6, i64 72}
!23 = !{!24, !7, i64 0}
!24 = !{!"DNchunkHandle", !7, i64 0, !11, i64 4}
!25 = !{!26, !11, i64 0}
!26 = !{!"DNcompressedVoxel", !11, i64 0, !11, i64 4}
!27 = !{!24, !11, i64 4}
!28 = !{!13, !6, i64 80}
!29 = !{!30, !11, i64 16}
!30 = !{!"DNchunk", !10, i64 0, !17, i64 12, !11, i64 16, !11, i64 20, !7, i64 24}
!31 = !{i64 0, i64 4, !21, i64 4, i64 4, !21}
!32 = !{!30, !17, i64 12}


; 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.DNchunk = type { %struct.DNivec3, i8, i32, i32, [8 x [8 x [8 x %struct.DNcompressedVoxel]]] }
%struct.DNivec3 = type { i32, i32, i32 }
%struct.DNcompressedVoxel = type { i32, i32 }

; Function Attrs: nounwind uwtable
declare dso_local i32 @DN_add_chunk(ptr noundef, i64, i32) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local void @DN_remove_chunk(ptr noundef, i64, i32) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local void @DN_set_compressed_voxel(ptr noundef %0, i64 %1, i32 %2, i64 %3, i32 %4, i64 %5) local_unnamed_addr #0 {
  %.sroa.038.0.extract.trunc = trunc i64 %1 to i32
  %.sroa.442.0.extract.shift = lshr i64 %1, 32
  %.sroa.442.0.extract.trunc = trunc nuw i64 %.sroa.442.0.extract.shift to i32
  %.sroa.028.0.extract.trunc = trunc i64 %5 to i32
  %.sroa.4.0.extract.shift = lshr i64 %5, 32
  %.sroa.4.0.extract.trunc = trunc nuw i64 %.sroa.4.0.extract.shift to i32
  %7 = getelementptr inbounds i8, ptr %0, i64 12
  %8 = load i32, ptr %7, align 4, !tbaa !5
  %9 = getelementptr inbounds i8, ptr %0, i64 16
  %10 = load i32, ptr %9, align 4, !tbaa !15
  %11 = mul i32 %10, %2
  %12 = add i32 %11, %.sroa.442.0.extract.trunc
  %13 = mul i32 %12, %8
  %14 = add i32 %13, %.sroa.038.0.extract.trunc
  %15 = getelementptr inbounds i8, ptr %0, i64 72
  %16 = load ptr, ptr %15, align 8, !tbaa !16
  %17 = sext i32 %14 to i64
  %18 = getelementptr inbounds %struct.DNchunkHandle, ptr %16, i64 %17
  %19 = load i8, ptr %18, align 4, !tbaa !17
  %20 = icmp eq i8 %19, 0
  br i1 %20, label %21, label %25

21:                                               ; preds = %6
  %22 = icmp ugt i32 %.sroa.028.0.extract.trunc, -16777217
  br i1 %22, label %59, label %23

23:                                               ; preds = %21
  %24 = tail call i32 @DN_add_chunk(ptr noundef nonnull %0, i64 %1, i32 %2)
  %.pre = load ptr, ptr %15, align 8, !tbaa !16
  br label %25

25:                                               ; preds = %23, %6
  %26 = phi ptr [ %.pre, %23 ], [ %16, %6 ]
  %27 = getelementptr inbounds %struct.DNchunkHandle, ptr %26, i64 %17, i32 1
  %28 = load i32, ptr %27, align 4, !tbaa !19
  %29 = getelementptr inbounds i8, ptr %0, i64 80
  %30 = load ptr, ptr %29, align 8, !tbaa !20
  %31 = sext i32 %28 to i64
  %32 = getelementptr inbounds %struct.DNchunk, ptr %30, i64 %31
  %33 = getelementptr inbounds i8, ptr %32, i64 24
  %sext = shl i64 %3, 32
  %34 = ashr exact i64 %sext, 32
  %35 = ashr i64 %3, 32
  %36 = sext i32 %4 to i64
  %37 = getelementptr inbounds [8 x [8 x [8 x %struct.DNcompressedVoxel]]], ptr %33, i64 0, i64 %34, i64 %35, i64 %36
  %38 = load i32, ptr %37, align 4, !tbaa !21
  %39 = lshr i32 %38, 24
  %40 = lshr i32 %.sroa.028.0.extract.trunc, 24
  %41 = icmp eq i32 %39, 255
  %42 = icmp ne i32 %40, 255
  %or.cond = select i1 %41, i1 %42, i1 false
  br i1 %or.cond, label %43, label %47

43:                                               ; preds = %25
  %44 = getelementptr inbounds i8, ptr %32, i64 16
  %45 = load i32, ptr %44, align 4, !tbaa !23
  %46 = add i32 %45, 1
  store i32 %46, ptr %44, align 4, !tbaa !23
  br label %56

47:                                               ; preds = %25
  %48 = icmp ne i32 %39, 255
  %49 = icmp eq i32 %40, 255
  %or.cond3 = select i1 %48, i1 %49, i1 false
  br i1 %or.cond3, label %50, label %56

50:                                               ; preds = %47
  %51 = getelementptr inbounds i8, ptr %32, i64 16
  %52 = load i32, ptr %51, align 4, !tbaa !23
  %53 = add i32 %52, -1
  store i32 %53, ptr %51, align 4, !tbaa !23
  %54 = icmp eq i32 %53, 0
  br i1 %54, label %55, label %56

55:                                               ; preds = %50
  tail call void @DN_remove_chunk(ptr noundef nonnull %0, i64 %1, i32 %2)
  br label %59

56:                                               ; preds = %47, %50, %43
  %57 = getelementptr inbounds %struct.DNchunk, ptr %30, i64 %31, i32 4, i64 %34, i64 %35, i64 %36
  store i32 %.sroa.028.0.extract.trunc, ptr %57, align 4, !tbaa !26
  %.sroa.4.0..sroa_idx = getelementptr inbounds i8, ptr %57, i64 4
  store i32 %.sroa.4.0.extract.trunc, ptr %.sroa.4.0..sroa_idx, align 4, !tbaa !26
  %58 = getelementptr inbounds %struct.DNchunk, ptr %30, i64 %31, i32 1
  store i8 1, ptr %58, align 4, !tbaa !27
  br label %59

59:                                               ; preds = %55, %56, %21
  ret void
}

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" }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !7, i64 12}
!6 = !{!"DNvolume", !7, i64 0, !7, i64 4, !7, i64 8, !10, i64 12, !11, i64 24, !11, i64 32, !11, i64 40, !11, i64 48, !11, i64 56, !11, i64 64, !12, i64 72, !12, i64 80, !12, i64 88, !12, i64 96, !12, i64 104, !8, i64 112, !8, i64 124, !13, i64 136, !7, i64 140, !8, i64 144, !8, i64 156, !8, i64 168, !7, i64 180, !7, i64 184, !13, i64 188, !14, i64 192, !7, i64 196, !8, i64 200, !8, i64 212, !7, i64 224, !13, i64 228}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"DNuvec3", !7, i64 0, !7, i64 4, !7, i64 8}
!11 = !{!"long", !8, i64 0}
!12 = !{!"any pointer", !8, i64 0}
!13 = !{!"float", !8, i64 0}
!14 = !{!"_Bool", !8, i64 0}
!15 = !{!6, !7, i64 16}
!16 = !{!6, !12, i64 72}
!17 = !{!18, !8, i64 0}
!18 = !{!"DNchunkHandle", !8, i64 0, !7, i64 4}
!19 = !{!18, !7, i64 4}
!20 = !{!6, !12, i64 80}
!21 = !{!22, !7, i64 0}
!22 = !{!"DNcompressedVoxel", !7, i64 0, !7, i64 4}
!23 = !{!24, !7, i64 16}
!24 = !{!"DNchunk", !25, i64 0, !14, i64 12, !7, i64 16, !7, i64 20, !8, i64 24}
!25 = !{!"DNivec3", !7, i64 0, !7, i64 4, !7, i64 8}
!26 = !{!7, !7, i64 0}
!27 = !{!24, !14, i64 12}


; Effective O3 passes: BDCEPass,CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass