; LLVM IR from wmcnamara/crynn :: lib/thirdparty/assimp/contrib/Open3DGC (o3dgcDynamicVectorEncoder)

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

%"class.o3dgc::DynamicVectorEncoder" = type <{ i64, i64, i64, i64, i64, ptr, ptr, i32, [4 x i8] }>

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNK5o3dgc14DVEncodeParams12GetQuantBitsEv(ptr noundef nonnull align 8 dereferenceable(16)) #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNK5o3dgc13DynamicVector10GetNVectorEv(ptr noundef nonnull align 8 dereferenceable(48)) #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNK5o3dgc13DynamicVector12GetDimVectorEv(ptr noundef nonnull align 8 dereferenceable(48)) #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNK5o3dgc13DynamicVector9GetStrideEv(ptr noundef nonnull align 8 dereferenceable(48)) #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNK5o3dgc13DynamicVector10GetVectorsEv(ptr noundef nonnull align 8 dereferenceable(48)) #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNK5o3dgc13DynamicVector6GetMinEv(ptr noundef nonnull align 8 dereferenceable(48)) #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNK5o3dgc13DynamicVector6GetMaxEv(ptr noundef nonnull align 8 dereferenceable(48)) #0 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZNK5o3dgc12BinaryStream7GetSizeEv(ptr noundef nonnull align 8 dereferenceable(28)) #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN5o3dgc20DynamicVectorEncoder13EncodePayloadERKNS_14DVEncodeParamsERKNS_13DynamicVectorERNS_12BinaryStreamE(ptr noundef nonnull align 8 dereferenceable(60) %0, ptr noundef nonnull align 8 dereferenceable(16) %1, ptr noundef nonnull align 8 dereferenceable(48) %2, ptr noundef nonnull align 8 dereferenceable(28) %3) #2 align 2 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i64, align 8
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  %12 = alloca i64, align 8
  %13 = alloca i64, align 8
  %14 = alloca i64, align 8
  %15 = alloca i32, align 4
  %16 = alloca i64, align 8
  %17 = alloca i64, align 8
  %18 = alloca i64, align 8
  %19 = alloca i64, align 8
  %20 = alloca i64, align 8
  %21 = alloca i64, align 8
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !5
  store ptr %3, ptr %8, align 8, !tbaa !5
  %22 = load ptr, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #4
  %23 = load ptr, ptr %8, align 8, !tbaa !5
  %24 = call noundef i64 @_ZNK5o3dgc12BinaryStream7GetSizeEv(ptr noundef nonnull align 8 dereferenceable(28) %23)
  store i64 %24, ptr %9, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #4
  %25 = load ptr, ptr %7, align 8, !tbaa !5
  %26 = call noundef i64 @_ZNK5o3dgc13DynamicVector12GetDimVectorEv(ptr noundef nonnull align 8 dereferenceable(48) %25)
  store i64 %26, ptr %10, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #4
  %27 = load ptr, ptr %7, align 8, !tbaa !5
  %28 = call noundef i64 @_ZNK5o3dgc13DynamicVector10GetNVectorEv(ptr noundef nonnull align 8 dereferenceable(48) %27)
  store i64 %28, ptr %11, align 8, !tbaa !9
  %29 = load ptr, ptr %8, align 8, !tbaa !5
  %30 = getelementptr inbounds %"class.o3dgc::DynamicVectorEncoder", ptr %22, i32 0, i32 7
  %31 = load i32, ptr %30, align 8, !tbaa !11
  call void @_ZN5o3dgc12BinaryStream11WriteUInt32EmNS_15O3DGCStreamTypeE(ptr noundef nonnull align 8 dereferenceable(28) %29, i64 noundef 0, i32 noundef %31)
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #4
  store i64 0, ptr %12, align 8, !tbaa !9
  br label %32

32:                                               ; preds = %51, %4
  %33 = load i64, ptr %12, align 8, !tbaa !9
  %34 = load ptr, ptr %7, align 8, !tbaa !5
  %35 = call noundef i64 @_ZNK5o3dgc13DynamicVector12GetDimVectorEv(ptr noundef nonnull align 8 dereferenceable(48) %34)
  %36 = icmp ult i64 %33, %35
  br i1 %36, label %38, label %37

37:                                               ; preds = %32
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  br label %54

38:                                               ; preds = %32
  %39 = load ptr, ptr %8, align 8, !tbaa !5
  %40 = load ptr, ptr %7, align 8, !tbaa !5
  %41 = load i64, ptr %12, align 8, !tbaa !9
  %42 = call noundef float @_ZNK5o3dgc13DynamicVector6GetMinEm(ptr noundef nonnull align 8 dereferenceable(48) %40, i64 noundef %41)
  %43 = getelementptr inbounds %"class.o3dgc::DynamicVectorEncoder", ptr %22, i32 0, i32 7
  %44 = load i32, ptr %43, align 8, !tbaa !11
  call void @_ZN5o3dgc12BinaryStream12WriteFloat32EfNS_15O3DGCStreamTypeE(ptr noundef nonnull align 8 dereferenceable(28) %39, float noundef %42, i32 noundef %44)
  %45 = load ptr, ptr %8, align 8, !tbaa !5
  %46 = load ptr, ptr %7, align 8, !tbaa !5
  %47 = load i64, ptr %12, align 8, !tbaa !9
  %48 = call noundef float @_ZNK5o3dgc13DynamicVector6GetMaxEm(ptr noundef nonnull align 8 dereferenceable(48) %46, i64 noundef %47)
  %49 = getelementptr inbounds %"class.o3dgc::DynamicVectorEncoder", ptr %22, i32 0, i32 7
  %50 = load i32, ptr %49, align 8, !tbaa !11
  call void @_ZN5o3dgc12BinaryStream12WriteFloat32EfNS_15O3DGCStreamTypeE(ptr noundef nonnull align 8 dereferenceable(28) %45, float noundef %48, i32 noundef %50)
  br label %51

51:                                               ; preds = %38
  %52 = load i64, ptr %12, align 8, !tbaa !9
  %53 = add i64 %52, 1
  store i64 %53, ptr %12, align 8, !tbaa !9
  br label %32, !llvm.loop !14

54:                                               ; preds = %37
  %55 = load ptr, ptr %7, align 8, !tbaa !5
  %56 = call noundef ptr @_ZNK5o3dgc13DynamicVector10GetVectorsEv(ptr noundef nonnull align 8 dereferenceable(48) %55)
  %57 = load i64, ptr %11, align 8, !tbaa !9
  %58 = load i64, ptr %10, align 8, !tbaa !9
  %59 = load ptr, ptr %7, align 8, !tbaa !5
  %60 = call noundef i64 @_ZNK5o3dgc13DynamicVector9GetStrideEv(ptr noundef nonnull align 8 dereferenceable(48) %59)
  %61 = load ptr, ptr %7, align 8, !tbaa !5
  %62 = call noundef ptr @_ZNK5o3dgc13DynamicVector6GetMinEv(ptr noundef nonnull align 8 dereferenceable(48) %61)
  %63 = load ptr, ptr %7, align 8, !tbaa !5
  %64 = call noundef ptr @_ZNK5o3dgc13DynamicVector6GetMaxEv(ptr noundef nonnull align 8 dereferenceable(48) %63)
  %65 = load ptr, ptr %6, align 8, !tbaa !5
  %66 = call noundef i64 @_ZNK5o3dgc14DVEncodeParams12GetQuantBitsEv(ptr noundef nonnull align 8 dereferenceable(16) %65)
  %67 = call noundef i32 @_ZN5o3dgc20DynamicVectorEncoder8QuantizeEPKfmmmS2_S2_m(ptr noundef nonnull align 8 dereferenceable(60) %22, ptr noundef %56, i64 noundef %57, i64 noundef %58, i64 noundef %60, ptr noundef %62, ptr noundef %64, i64 noundef %66)
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #4
  store i64 0, ptr %13, align 8, !tbaa !9
  br label %68

68:                                               ; preds = %82, %54
  %69 = load i64, ptr %13, align 8, !tbaa !9
  %70 = load i64, ptr %10, align 8, !tbaa !9
  %71 = icmp ult i64 %69, %70
  br i1 %71, label %73, label %72

72:                                               ; preds = %68
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #4
  br label %85

73:                                               ; preds = %68
  %74 = getelementptr inbounds %"class.o3dgc::DynamicVectorEncoder", ptr %22, i32 0, i32 6
  %75 = load ptr, ptr %74, align 8, !tbaa !16
  %76 = load i64, ptr %13, align 8, !tbaa !9
  %77 = load i64, ptr %11, align 8, !tbaa !9
  %78 = mul i64 %76, %77
  %79 = getelementptr inbounds i64, ptr %75, i64 %78
  %80 = load i64, ptr %11, align 8, !tbaa !9
  %81 = call noundef i32 @_ZN5o3dgc9TransformEPlm(ptr noundef %79, i64 noundef %80)
  br label %82

82:                                               ; preds = %73
  %83 = load i64, ptr %13, align 8, !tbaa !9
  %84 = add i64 %83, 1
  store i64 %84, ptr %13, align 8, !tbaa !9
  br label %68, !llvm.loop !17

85:                                               ; preds = %72
  %86 = getelementptr inbounds %"class.o3dgc::DynamicVectorEncoder", ptr %22, i32 0, i32 7
  %87 = load i32, ptr %86, align 8, !tbaa !11
  %88 = icmp eq i32 %87, 1
  br i1 %88, label %89, label %120

89:                                               ; preds = %85
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #4
  store i64 0, ptr %14, align 8, !tbaa !9
  br label %90

90:                                               ; preds = %116, %89
  %91 = load i64, ptr %14, align 8, !tbaa !9
  %92 = load i64, ptr %11, align 8, !tbaa !9
  %93 = icmp ult i64 %91, %92
  br i1 %93, label %95, label %94

94:                                               ; preds = %90
  store i32 8, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #4
  br label %119

95:                                               ; preds = %90
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #4
  store i64 0, ptr %16, align 8, !tbaa !9
  br label %96

96:                                               ; preds = %112, %95
  %97 = load i64, ptr %16, align 8, !tbaa !9
  %98 = load i64, ptr %10, align 8, !tbaa !9
  %99 = icmp ult i64 %97, %98
  br i1 %99, label %101, label %100

100:                                              ; preds = %96
  store i32 11, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #4
  br label %115

101:                                              ; preds = %96
  %102 = load ptr, ptr %8, align 8, !tbaa !5
  %103 = getelementptr inbounds %"class.o3dgc::DynamicVectorEncoder", ptr %22, i32 0, i32 6
  %104 = load ptr, ptr %103, align 8, !tbaa !16
  %105 = load i64, ptr %16, align 8, !tbaa !9
  %106 = load i64, ptr %11, align 8, !tbaa !9
  %107 = mul i64 %105, %106
  %108 = load i64, ptr %14, align 8, !tbaa !9
  %109 = add i64 %107, %108
  %110 = getelementptr inbounds i64, ptr %104, i64 %109
  %111 = load i64, ptr %110, align 8, !tbaa !9
  call void @_ZN5o3dgc12BinaryStream13WriteIntASCIIEl(ptr noundef nonnull align 8 dereferenceable(28) %102, i64 noundef %111)
  br label %112

112:                                              ; preds = %101
  %113 = load i64, ptr %16, align 8, !tbaa !9
  %114 = add i64 %113, 1
  store i64 %114, ptr %16, align 8, !tbaa !9
  br label %96, !llvm.loop !18

115:                                              ; preds = %100
  br label %116

116:                                              ; preds = %115
  %117 = load i64, ptr %14, align 8, !tbaa !9
  %118 = add i64 %117, 1
  store i64 %118, ptr %14, align 8, !tbaa !9
  br label %90, !llvm.loop !19

119:                                              ; preds = %94
  br label %159

120:                                              ; preds = %85
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #4
  store i64 0, ptr %17, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #4
  store i64 4294967295, ptr %18, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #4
  store i64 1, ptr %19, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #4
  store i64 1, ptr %20, align 8, !tbaa !9
  br label %121

121:                                              ; preds = %133, %120
  %122 = load i64, ptr %19, align 8, !tbaa !9
  %123 = icmp ult i64 %122, 1024
  br i1 %123, label %124, label %138

124:                                              ; preds = %121
  %125 = load i64, ptr %11, align 8, !tbaa !9
  %126 = load i64, ptr %10, align 8, !tbaa !9
  %127 = load i64, ptr %19, align 8, !tbaa !9
  %128 = call noundef i32 @_ZN5o3dgc20DynamicVectorEncoder8EncodeACEmmmRm(ptr noundef nonnull align 8 dereferenceable(60) %22, i64 noundef %125, i64 noundef %126, i64 noundef %127, ptr noundef nonnull align 8 dereferenceable(8) %17)
  %129 = load i64, ptr %17, align 8, !tbaa !9
  %130 = load i64, ptr %18, align 8, !tbaa !9
  %131 = icmp ugt i64 %129, %130
  br i1 %131, label %132, label %133

132:                                              ; preds = %124
  br label %138

133:                                              ; preds = %124
  %134 = load i64, ptr %19, align 8, !tbaa !9
  store i64 %134, ptr %20, align 8, !tbaa !9
  %135 = load i64, ptr %17, align 8, !tbaa !9
  store i64 %135, ptr %18, align 8, !tbaa !9
  %136 = load i64, ptr %19, align 8, !tbaa !9
  %137 = mul i64 %136, 2
  store i64 %137, ptr %19, align 8, !tbaa !9
  br label %121, !llvm.loop !20

138:                                              ; preds = %132, %121
  %139 = load i64, ptr %11, align 8, !tbaa !9
  %140 = load i64, ptr %10, align 8, !tbaa !9
  %141 = load i64, ptr %20, align 8, !tbaa !9
  %142 = call noundef i32 @_ZN5o3dgc20DynamicVectorEncoder8EncodeACEmmmRm(ptr noundef nonnull align 8 dereferenceable(60) %22, i64 noundef %139, i64 noundef %140, i64 noundef %141, ptr noundef nonnull align 8 dereferenceable(8) %17)
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #4
  store i64 0, ptr %21, align 8, !tbaa !9
  br label %143

143:                                              ; preds = %155, %138
  %144 = load i64, ptr %21, align 8, !tbaa !9
  %145 = load i64, ptr %17, align 8, !tbaa !9
  %146 = icmp ult i64 %144, %145
  br i1 %146, label %148, label %147

147:                                              ; preds = %143
  store i32 16, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #4
  br label %158

148:                                              ; preds = %143
  %149 = load ptr, ptr %8, align 8, !tbaa !5
  %150 = getelementptr inbounds %"class.o3dgc::DynamicVectorEncoder", ptr %22, i32 0, i32 5
  %151 = load ptr, ptr %150, align 8, !tbaa !21
  %152 = load i64, ptr %21, align 8, !tbaa !9
  %153 = getelementptr inbounds i8, ptr %151, i64 %152
  %154 = load i8, ptr %153, align 1, !tbaa !22
  call void @_ZN5o3dgc12BinaryStream14WriteUChar8BinEh(ptr noundef nonnull align 8 dereferenceable(28) %149, i8 noundef zeroext %154)
  br label %155

155:                                              ; preds = %148
  %156 = load i64, ptr %21, align 8, !tbaa !9
  %157 = add i64 %156, 1
  store i64 %157, ptr %21, align 8, !tbaa !9
  br label %143, !llvm.loop !23

158:                                              ; preds = %147
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #4
  br label %159

159:                                              ; preds = %158, %119
  %160 = load ptr, ptr %8, align 8, !tbaa !5
  %161 = load i64, ptr %9, align 8, !tbaa !9
  %162 = load ptr, ptr %8, align 8, !tbaa !5
  %163 = call noundef i64 @_ZNK5o3dgc12BinaryStream7GetSizeEv(ptr noundef nonnull align 8 dereferenceable(28) %162)
  %164 = load i64, ptr %9, align 8, !tbaa !9
  %165 = sub i64 %163, %164
  %166 = getelementptr inbounds %"class.o3dgc::DynamicVectorEncoder", ptr %22, i32 0, i32 7
  %167 = load i32, ptr %166, align 8, !tbaa !11
  call void @_ZN5o3dgc12BinaryStream11WriteUInt32EmmNS_15O3DGCStreamTypeE(ptr noundef nonnull align 8 dereferenceable(28) %160, i64 noundef %161, i64 noundef %165, i32 noundef %167)
  store i32 1, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #4
  ret i32 0
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN5o3dgc12BinaryStream11WriteUInt32EmmNS_15O3DGCStreamTypeE(ptr noundef nonnull align 8 dereferenceable(28), i64 noundef, i64 noundef, i32 noundef) #2 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN5o3dgc12BinaryStream11WriteUInt32EmNS_15O3DGCStreamTypeE(ptr noundef nonnull align 8 dereferenceable(28), i64 noundef, i32 noundef) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN5o3dgc20DynamicVectorEncoder8EncodeACEmmmRm(ptr noundef nonnull align 8 dereferenceable(60), i64 noundef, i64 noundef, i64 noundef, ptr noundef nonnull align 8 dereferenceable(8)) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN5o3dgc12BinaryStream12WriteFloat32EfNS_15O3DGCStreamTypeE(ptr noundef nonnull align 8 dereferenceable(28), float noundef, i32 noundef) #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef float @_ZNK5o3dgc13DynamicVector6GetMinEm(ptr noundef nonnull align 8 dereferenceable(48), i64 noundef) #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef float @_ZNK5o3dgc13DynamicVector6GetMaxEm(ptr noundef nonnull align 8 dereferenceable(48), i64 noundef) #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN5o3dgc20DynamicVectorEncoder8QuantizeEPKfmmmS2_S2_m(ptr noundef nonnull align 8 dereferenceable(60), ptr noundef, i64 noundef, i64 noundef, i64 noundef, ptr noundef, ptr noundef, i64 noundef) #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_ZN5o3dgc9TransformEPlm(ptr noundef, i64 noundef) #3

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN5o3dgc12BinaryStream13WriteIntASCIIEl(ptr noundef nonnull align 8 dereferenceable(28), i64 noundef) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN5o3dgc12BinaryStream14WriteUChar8BinEh(ptr noundef nonnull align 8 dereferenceable(28), i8 noundef zeroext) #2 align 2

attributes #0 = { mustprogress 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 = { mustprogress 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 = { inlinehint mustprogress 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 #4 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"long", !7, i64 0}
!11 = !{!12, !13, i64 56}
!12 = !{!"_ZTSN5o3dgc20DynamicVectorEncoderE", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !10, i64 32, !6, i64 40, !6, i64 48, !13, i64 56}
!13 = !{!"_ZTSN5o3dgc15O3DGCStreamTypeE", !7, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = !{!12, !6, i64 48}
!17 = distinct !{!17, !15}
!18 = distinct !{!18, !15}
!19 = distinct !{!19, !15}
!20 = distinct !{!20, !15}
!21 = !{!12, !6, i64 40}
!22 = !{!7, !7, i64 0}
!23 = distinct !{!23, !15}


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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNK5o3dgc14DVEncodeParams12GetQuantBitsEv(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNK5o3dgc13DynamicVector10GetNVectorEv(ptr noundef nonnull align 8 dereferenceable(48)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNK5o3dgc13DynamicVector12GetDimVectorEv(ptr noundef nonnull align 8 dereferenceable(48)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNK5o3dgc13DynamicVector9GetStrideEv(ptr noundef nonnull align 8 dereferenceable(48)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNK5o3dgc13DynamicVector10GetVectorsEv(ptr noundef nonnull align 8 dereferenceable(48)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNK5o3dgc13DynamicVector6GetMinEv(ptr noundef nonnull align 8 dereferenceable(48)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNK5o3dgc13DynamicVector6GetMaxEv(ptr noundef nonnull align 8 dereferenceable(48)) local_unnamed_addr #0 align 2

; 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 uwtable
declare dso_local noundef i64 @_ZNK5o3dgc12BinaryStream7GetSizeEv(ptr noundef nonnull align 8 dereferenceable(28)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN5o3dgc20DynamicVectorEncoder13EncodePayloadERKNS_14DVEncodeParamsERKNS_13DynamicVectorERNS_12BinaryStreamE(ptr noundef nonnull align 8 dereferenceable(60) %0, ptr noundef nonnull align 8 dereferenceable(16) %1, ptr noundef nonnull align 8 dereferenceable(48) %2, ptr noundef nonnull align 8 dereferenceable(28) %3) local_unnamed_addr #2 align 2 {
  %5 = alloca i64, align 8
  %6 = tail call noundef i64 @_ZNK5o3dgc12BinaryStream7GetSizeEv(ptr noundef nonnull align 8 dereferenceable(28) %3)
  %7 = tail call noundef i64 @_ZNK5o3dgc13DynamicVector12GetDimVectorEv(ptr noundef nonnull align 8 dereferenceable(48) %2)
  %8 = tail call noundef i64 @_ZNK5o3dgc13DynamicVector10GetNVectorEv(ptr noundef nonnull align 8 dereferenceable(48) %2)
  %9 = getelementptr inbounds i8, ptr %0, i64 56
  %10 = load i32, ptr %9, align 8, !tbaa !5
  tail call void @_ZN5o3dgc12BinaryStream11WriteUInt32EmNS_15O3DGCStreamTypeE(ptr noundef nonnull align 8 dereferenceable(28) %3, i64 noundef 0, i32 noundef %10)
  %11 = tail call noundef i64 @_ZNK5o3dgc13DynamicVector12GetDimVectorEv(ptr noundef nonnull align 8 dereferenceable(48) %2)
  %.not = icmp eq i64 %11, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %.lr.ph, %4
  %12 = tail call noundef ptr @_ZNK5o3dgc13DynamicVector10GetVectorsEv(ptr noundef nonnull align 8 dereferenceable(48) %2)
  %13 = tail call noundef i64 @_ZNK5o3dgc13DynamicVector9GetStrideEv(ptr noundef nonnull align 8 dereferenceable(48) %2)
  %14 = tail call noundef ptr @_ZNK5o3dgc13DynamicVector6GetMinEv(ptr noundef nonnull align 8 dereferenceable(48) %2)
  %15 = tail call noundef ptr @_ZNK5o3dgc13DynamicVector6GetMaxEv(ptr noundef nonnull align 8 dereferenceable(48) %2)
  %16 = tail call noundef i64 @_ZNK5o3dgc14DVEncodeParams12GetQuantBitsEv(ptr noundef nonnull align 8 dereferenceable(16) %1)
  %17 = tail call noundef i32 @_ZN5o3dgc20DynamicVectorEncoder8QuantizeEPKfmmmS2_S2_m(ptr noundef nonnull align 8 dereferenceable(60) %0, ptr noundef %12, i64 noundef %8, i64 noundef %7, i64 noundef %13, ptr noundef %14, ptr noundef %15, i64 noundef %16)
  %.not81 = icmp eq i64 %7, 0
  br i1 %.not81, label %._crit_edge69, label %.lr.ph68

.lr.ph68:                                         ; preds = %._crit_edge
  %18 = getelementptr inbounds i8, ptr %0, i64 48
  br label %37

.lr.ph:                                           ; preds = %4, %.lr.ph
  %.06065 = phi i64 [ %23, %.lr.ph ], [ 0, %4 ]
  %19 = tail call noundef float @_ZNK5o3dgc13DynamicVector6GetMinEm(ptr noundef nonnull align 8 dereferenceable(48) %2, i64 noundef %.06065)
  %20 = load i32, ptr %9, align 8, !tbaa !5
  tail call void @_ZN5o3dgc12BinaryStream12WriteFloat32EfNS_15O3DGCStreamTypeE(ptr noundef nonnull align 8 dereferenceable(28) %3, float noundef %19, i32 noundef %20)
  %21 = tail call noundef float @_ZNK5o3dgc13DynamicVector6GetMaxEm(ptr noundef nonnull align 8 dereferenceable(48) %2, i64 noundef %.06065)
  %22 = load i32, ptr %9, align 8, !tbaa !5
  tail call void @_ZN5o3dgc12BinaryStream12WriteFloat32EfNS_15O3DGCStreamTypeE(ptr noundef nonnull align 8 dereferenceable(28) %3, float noundef %21, i32 noundef %22)
  %23 = add nuw i64 %.06065, 1
  %24 = tail call noundef i64 @_ZNK5o3dgc13DynamicVector12GetDimVectorEv(ptr noundef nonnull align 8 dereferenceable(48) %2)
  %25 = icmp ult i64 %23, %24
  br i1 %25, label %.lr.ph, label %._crit_edge, !llvm.loop !12

._crit_edge69:                                    ; preds = %37, %._crit_edge
  %26 = load i32, ptr %9, align 8, !tbaa !5
  %27 = icmp eq i32 %26, 1
  br i1 %27, label %.preheader64, label %43

.preheader64:                                     ; preds = %._crit_edge69
  %.not83 = icmp eq i64 %8, 0
  br i1 %.not83, label %.loopexit, label %.preheader.lr.ph

.preheader.lr.ph:                                 ; preds = %.preheader64
  %28 = getelementptr inbounds i8, ptr %0, i64 48
  br i1 %.not81, label %.loopexit, label %.preheader.us

.preheader.us:                                    ; preds = %.preheader.lr.ph, %._crit_edge79.us
  %.05880.us = phi i64 [ %36, %._crit_edge79.us ], [ 0, %.preheader.lr.ph ]
  br label %29

29:                                               ; preds = %.preheader.us, %29
  %.05777.us = phi i64 [ 0, %.preheader.us ], [ %35, %29 ]
  %30 = load ptr, ptr %28, align 8, !tbaa !14
  %31 = mul i64 %.05777.us, %8
  %32 = getelementptr i64, ptr %30, i64 %31
  %33 = getelementptr i64, ptr %32, i64 %.05880.us
  %34 = load i64, ptr %33, align 8, !tbaa !15
  tail call void @_ZN5o3dgc12BinaryStream13WriteIntASCIIEl(ptr noundef nonnull align 8 dereferenceable(28) %3, i64 noundef %34)
  %35 = add nuw i64 %.05777.us, 1
  %exitcond86.not = icmp eq i64 %35, %7
  br i1 %exitcond86.not, label %._crit_edge79.us, label %29, !llvm.loop !16

._crit_edge79.us:                                 ; preds = %29
  %36 = add nuw i64 %.05880.us, 1
  %exitcond87.not = icmp eq i64 %36, %8
  br i1 %exitcond87.not, label %.loopexit, label %.preheader.us, !llvm.loop !17

37:                                               ; preds = %.lr.ph68, %37
  %.05966 = phi i64 [ 0, %.lr.ph68 ], [ %42, %37 ]
  %38 = load ptr, ptr %18, align 8, !tbaa !14
  %39 = mul i64 %.05966, %8
  %40 = getelementptr inbounds i64, ptr %38, i64 %39
  %41 = tail call noundef i32 @_ZN5o3dgc9TransformEPlm(ptr noundef %40, i64 noundef %8)
  %42 = add nuw i64 %.05966, 1
  %exitcond.not = icmp eq i64 %42, %7
  br i1 %exitcond.not, label %._crit_edge69, label %37, !llvm.loop !18

43:                                               ; preds = %._crit_edge69
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #4
  store i64 0, ptr %5, align 8, !tbaa !15
  %44 = call noundef i32 @_ZN5o3dgc20DynamicVectorEncoder8EncodeACEmmmRm(ptr noundef nonnull align 8 dereferenceable(60) %0, i64 noundef %8, i64 noundef %7, i64 noundef 1, ptr noundef nonnull align 8 dereferenceable(8) %5)
  %45 = load i64, ptr %5, align 8, !tbaa !15
  %46 = icmp ugt i64 %45, 4294967295
  br i1 %46, label %83, label %47

47:                                               ; preds = %43
  %48 = call noundef i32 @_ZN5o3dgc20DynamicVectorEncoder8EncodeACEmmmRm(ptr noundef nonnull align 8 dereferenceable(60) %0, i64 noundef %8, i64 noundef %7, i64 noundef 2, ptr noundef nonnull align 8 dereferenceable(8) %5)
  %49 = load i64, ptr %5, align 8, !tbaa !15
  %50 = icmp ugt i64 %49, %45
  br i1 %50, label %83, label %51

51:                                               ; preds = %47
  %52 = call noundef i32 @_ZN5o3dgc20DynamicVectorEncoder8EncodeACEmmmRm(ptr noundef nonnull align 8 dereferenceable(60) %0, i64 noundef %8, i64 noundef %7, i64 noundef 4, ptr noundef nonnull align 8 dereferenceable(8) %5)
  %53 = load i64, ptr %5, align 8, !tbaa !15
  %54 = icmp ugt i64 %53, %49
  br i1 %54, label %83, label %55

55:                                               ; preds = %51
  %56 = call noundef i32 @_ZN5o3dgc20DynamicVectorEncoder8EncodeACEmmmRm(ptr noundef nonnull align 8 dereferenceable(60) %0, i64 noundef %8, i64 noundef %7, i64 noundef 8, ptr noundef nonnull align 8 dereferenceable(8) %5)
  %57 = load i64, ptr %5, align 8, !tbaa !15
  %58 = icmp ugt i64 %57, %53
  br i1 %58, label %83, label %59

59:                                               ; preds = %55
  %60 = call noundef i32 @_ZN5o3dgc20DynamicVectorEncoder8EncodeACEmmmRm(ptr noundef nonnull align 8 dereferenceable(60) %0, i64 noundef %8, i64 noundef %7, i64 noundef 16, ptr noundef nonnull align 8 dereferenceable(8) %5)
  %61 = load i64, ptr %5, align 8, !tbaa !15
  %62 = icmp ugt i64 %61, %57
  br i1 %62, label %83, label %63

63:                                               ; preds = %59
  %64 = call noundef i32 @_ZN5o3dgc20DynamicVectorEncoder8EncodeACEmmmRm(ptr noundef nonnull align 8 dereferenceable(60) %0, i64 noundef %8, i64 noundef %7, i64 noundef 32, ptr noundef nonnull align 8 dereferenceable(8) %5)
  %65 = load i64, ptr %5, align 8, !tbaa !15
  %66 = icmp ugt i64 %65, %61
  br i1 %66, label %83, label %67

67:                                               ; preds = %63
  %68 = call noundef i32 @_ZN5o3dgc20DynamicVectorEncoder8EncodeACEmmmRm(ptr noundef nonnull align 8 dereferenceable(60) %0, i64 noundef %8, i64 noundef %7, i64 noundef 64, ptr noundef nonnull align 8 dereferenceable(8) %5)
  %69 = load i64, ptr %5, align 8, !tbaa !15
  %70 = icmp ugt i64 %69, %65
  br i1 %70, label %83, label %71

71:                                               ; preds = %67
  %72 = call noundef i32 @_ZN5o3dgc20DynamicVectorEncoder8EncodeACEmmmRm(ptr noundef nonnull align 8 dereferenceable(60) %0, i64 noundef %8, i64 noundef %7, i64 noundef 128, ptr noundef nonnull align 8 dereferenceable(8) %5)
  %73 = load i64, ptr %5, align 8, !tbaa !15
  %74 = icmp ugt i64 %73, %69
  br i1 %74, label %83, label %75

75:                                               ; preds = %71
  %76 = call noundef i32 @_ZN5o3dgc20DynamicVectorEncoder8EncodeACEmmmRm(ptr noundef nonnull align 8 dereferenceable(60) %0, i64 noundef %8, i64 noundef %7, i64 noundef 256, ptr noundef nonnull align 8 dereferenceable(8) %5)
  %77 = load i64, ptr %5, align 8, !tbaa !15
  %78 = icmp ugt i64 %77, %73
  br i1 %78, label %83, label %79

79:                                               ; preds = %75
  %80 = call noundef i32 @_ZN5o3dgc20DynamicVectorEncoder8EncodeACEmmmRm(ptr noundef nonnull align 8 dereferenceable(60) %0, i64 noundef %8, i64 noundef %7, i64 noundef 512, ptr noundef nonnull align 8 dereferenceable(8) %5)
  %81 = load i64, ptr %5, align 8, !tbaa !15
  %82 = icmp ugt i64 %81, %77
  %spec.select = select i1 %82, i64 256, i64 512
  br label %83

83:                                               ; preds = %79, %75, %71, %67, %63, %59, %55, %51, %47, %43
  %.054.lcssa = phi i64 [ 1, %43 ], [ 1, %47 ], [ 2, %51 ], [ 4, %55 ], [ 8, %59 ], [ 16, %63 ], [ 32, %67 ], [ 64, %71 ], [ 128, %75 ], [ %spec.select, %79 ]
  %84 = call noundef i32 @_ZN5o3dgc20DynamicVectorEncoder8EncodeACEmmmRm(ptr noundef nonnull align 8 dereferenceable(60) %0, i64 noundef %8, i64 noundef %7, i64 noundef %.054.lcssa, ptr noundef nonnull align 8 dereferenceable(8) %5)
  %85 = load i64, ptr %5, align 8, !tbaa !15
  %.not82 = icmp eq i64 %85, 0
  br i1 %.not82, label %._crit_edge76, label %.lr.ph75

.lr.ph75:                                         ; preds = %83
  %86 = getelementptr inbounds i8, ptr %0, i64 40
  br label %87

._crit_edge76:                                    ; preds = %87, %83
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #4
  br label %.loopexit

87:                                               ; preds = %.lr.ph75, %87
  %.073 = phi i64 [ 0, %.lr.ph75 ], [ %91, %87 ]
  %88 = load ptr, ptr %86, align 8, !tbaa !19
  %89 = getelementptr inbounds i8, ptr %88, i64 %.073
  %90 = load i8, ptr %89, align 1, !tbaa !20
  call void @_ZN5o3dgc12BinaryStream14WriteUChar8BinEh(ptr noundef nonnull align 8 dereferenceable(28) %3, i8 noundef zeroext %90)
  %91 = add nuw i64 %.073, 1
  %92 = load i64, ptr %5, align 8, !tbaa !15
  %93 = icmp ult i64 %91, %92
  br i1 %93, label %87, label %._crit_edge76, !llvm.loop !21

.loopexit:                                        ; preds = %._crit_edge79.us, %.preheader.lr.ph, %.preheader64, %._crit_edge76
  %94 = call noundef i64 @_ZNK5o3dgc12BinaryStream7GetSizeEv(ptr noundef nonnull align 8 dereferenceable(28) %3)
  %95 = sub i64 %94, %6
  %96 = load i32, ptr %9, align 8, !tbaa !5
  call void @_ZN5o3dgc12BinaryStream11WriteUInt32EmmNS_15O3DGCStreamTypeE(ptr noundef nonnull align 8 dereferenceable(28) %3, i64 noundef %6, i64 noundef %95, i32 noundef %96)
  ret i32 0
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN5o3dgc12BinaryStream11WriteUInt32EmmNS_15O3DGCStreamTypeE(ptr noundef nonnull align 8 dereferenceable(28), i64 noundef, i64 noundef, i32 noundef) local_unnamed_addr #2 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN5o3dgc12BinaryStream11WriteUInt32EmNS_15O3DGCStreamTypeE(ptr noundef nonnull align 8 dereferenceable(28), i64 noundef, i32 noundef) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN5o3dgc20DynamicVectorEncoder8EncodeACEmmmRm(ptr noundef nonnull align 8 dereferenceable(60), i64 noundef, i64 noundef, i64 noundef, ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN5o3dgc12BinaryStream12WriteFloat32EfNS_15O3DGCStreamTypeE(ptr noundef nonnull align 8 dereferenceable(28), float noundef, i32 noundef) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef float @_ZNK5o3dgc13DynamicVector6GetMinEm(ptr noundef nonnull align 8 dereferenceable(48), i64 noundef) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef float @_ZNK5o3dgc13DynamicVector6GetMaxEm(ptr noundef nonnull align 8 dereferenceable(48), i64 noundef) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN5o3dgc20DynamicVectorEncoder8QuantizeEPKfmmmS2_S2_m(ptr noundef nonnull align 8 dereferenceable(60), ptr noundef, i64 noundef, i64 noundef, i64 noundef, ptr noundef, ptr noundef, i64 noundef) local_unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_ZN5o3dgc9TransformEPlm(ptr noundef, i64 noundef) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN5o3dgc12BinaryStream13WriteIntASCIIEl(ptr noundef nonnull align 8 dereferenceable(28), i64 noundef) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN5o3dgc12BinaryStream14WriteUChar8BinEh(ptr noundef nonnull align 8 dereferenceable(28), i8 noundef zeroext) local_unnamed_addr #2 align 2

attributes #0 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress 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 = { inlinehint mustprogress 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 #4 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !11, i64 56}
!6 = !{!"_ZTSN5o3dgc20DynamicVectorEncoderE", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !10, i64 40, !10, i64 48, !11, i64 56}
!7 = !{!"long", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!"_ZTSN5o3dgc15O3DGCStreamTypeE", !8, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = !{!6, !10, i64 48}
!15 = !{!7, !7, i64 0}
!16 = distinct !{!16, !13}
!17 = distinct !{!17, !13}
!18 = distinct !{!18, !13}
!19 = !{!6, !10, i64 40}
!20 = !{!8, !8, i64 0}
!21 = distinct !{!21, !13}


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