; LLVM IR from zeux/meshoptimizer :: src (vertexcodec)

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

@_ZN7meshoptL28gDecodeBytesGroupInitializedE = external hidden global i8, align 1
@_ZN7meshoptL5cpuidE = external hidden global i32, align 4
@.str = external hidden unnamed_addr constant [38 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [72 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [21 x i8], align 1
@__PRETTY_FUNCTION__.meshopt_decodeVertexBuffer = external hidden unnamed_addr constant [86 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [29 x i8], align 1

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #0

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #2

; Function Attrs: mustprogress nounwind uwtable
declare hidden noundef i64 @_ZN7meshoptL18getVertexBlockSizeEm(i64 noundef) #3

; 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
define dso_local i32 @meshopt_decodeVertexBuffer(ptr noundef %0, i64 noundef %1, i64 noundef %2, ptr noundef %3, i64 noundef %4) #4 {
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i64, align 8
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca i32, align 4
  %17 = alloca i8, align 1
  %18 = alloca i32, align 4
  %19 = alloca i64, align 8
  %20 = alloca i64, align 8
  %21 = alloca i64, align 8
  %22 = alloca ptr, align 8
  %23 = alloca [256 x i8], align 16
  %24 = alloca ptr, align 8
  %25 = alloca i64, align 8
  %26 = alloca i64, align 8
  %27 = alloca i64, align 8
  store ptr %0, ptr %7, align 8, !tbaa !5
  store i64 %1, ptr %8, align 8, !tbaa !9
  store i64 %2, ptr %9, align 8, !tbaa !9
  store ptr %3, ptr %10, align 8, !tbaa !5
  store i64 %4, ptr %11, align 8, !tbaa !9
  %28 = load i64, ptr %9, align 8, !tbaa !9
  %29 = icmp ugt i64 %28, 0
  br i1 %29, label %30, label %33

30:                                               ; preds = %5
  %31 = load i64, ptr %9, align 8, !tbaa !9
  %32 = icmp ule i64 %31, 256
  br label %33

33:                                               ; preds = %30, %5
  %34 = phi i1 [ false, %5 ], [ %32, %30 ]
  br i1 %34, label %35, label %36

35:                                               ; preds = %33
  br label %38

36:                                               ; preds = %33
  call void @__assert_fail(ptr noundef @.str, ptr noundef @.str.2, i32 noundef 1834, ptr noundef @__PRETTY_FUNCTION__.meshopt_decodeVertexBuffer) #6
  unreachable

37:                                               ; No predecessors!
  br label %38

38:                                               ; preds = %37, %35
  %39 = load i64, ptr %9, align 8, !tbaa !9
  %40 = urem i64 %39, 4
  %41 = icmp eq i64 %40, 0
  br i1 %41, label %42, label %43

42:                                               ; preds = %38
  br label %45

43:                                               ; preds = %38
  call void @__assert_fail(ptr noundef @.str.3, ptr noundef @.str.2, i32 noundef 1835, ptr noundef @__PRETTY_FUNCTION__.meshopt_decodeVertexBuffer) #6
  unreachable

44:                                               ; No predecessors!
  br label %45

45:                                               ; preds = %44, %42
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #7
  store ptr null, ptr %12, align 8, !tbaa !5
  %46 = load i32, ptr @_ZN7meshoptL5cpuidE, align 4, !tbaa !11
  %47 = and i32 %46, 512
  %48 = icmp ne i32 %47, 0
  br i1 %48, label %49, label %50

49:                                               ; preds = %45
  br label %51

50:                                               ; preds = %45
  br label %51

51:                                               ; preds = %50, %49
  %52 = phi ptr [ @_ZN7meshoptL21decodeVertexBlockSimdEPKhS1_PhmmS2_S1_i, %49 ], [ @_ZN7meshoptL17decodeVertexBlockEPKhS1_PhmmS2_S1_i, %50 ]
  store ptr %52, ptr %12, align 8, !tbaa !5
  %53 = load i8, ptr @_ZN7meshoptL28gDecodeBytesGroupInitializedE, align 1, !tbaa !13, !range !15, !noundef !16
  %54 = trunc i8 %53 to i1
  br i1 %54, label %55, label %56

55:                                               ; preds = %51
  br label %58

56:                                               ; preds = %51
  call void @__assert_fail(ptr noundef @.str.11, ptr noundef @.str.2, i32 noundef 1848, ptr noundef @__PRETTY_FUNCTION__.meshopt_decodeVertexBuffer) #6
  unreachable

57:                                               ; No predecessors!
  br label %58

58:                                               ; preds = %57, %55
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #7
  %59 = load ptr, ptr %7, align 8, !tbaa !5
  store ptr %59, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #7
  %60 = load ptr, ptr %10, align 8, !tbaa !5
  store ptr %60, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #7
  %61 = load ptr, ptr %10, align 8, !tbaa !5
  %62 = load i64, ptr %11, align 8, !tbaa !9
  %63 = getelementptr inbounds i8, ptr %61, i64 %62
  store ptr %63, ptr %15, align 8, !tbaa !5
  %64 = load ptr, ptr %15, align 8, !tbaa !5
  %65 = load ptr, ptr %14, align 8, !tbaa !5
  %66 = ptrtoint ptr %64 to i64
  %67 = ptrtoint ptr %65 to i64
  %68 = sub i64 %66, %67
  %69 = icmp ult i64 %68, 1
  br i1 %69, label %70, label %71

70:                                               ; preds = %58
  store i32 -2, ptr %6, align 4
  store i32 1, ptr %16, align 4
  br label %194

71:                                               ; preds = %58
  call void @llvm.lifetime.start.p0(i64 1, ptr %17) #7
  %72 = load ptr, ptr %14, align 8, !tbaa !5
  %73 = getelementptr inbounds i8, ptr %72, i32 1
  store ptr %73, ptr %14, align 8, !tbaa !5
  %74 = load i8, ptr %72, align 1, !tbaa !17
  store i8 %74, ptr %17, align 1, !tbaa !17
  %75 = load i8, ptr %17, align 1, !tbaa !17
  %76 = zext i8 %75 to i32
  %77 = and i32 %76, 240
  %78 = icmp ne i32 %77, 160
  br i1 %78, label %79, label %80

79:                                               ; preds = %71
  store i32 -1, ptr %6, align 4
  store i32 1, ptr %16, align 4
  br label %193

80:                                               ; preds = %71
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #7
  %81 = load i8, ptr %17, align 1, !tbaa !17
  %82 = zext i8 %81 to i32
  %83 = and i32 %82, 15
  store i32 %83, ptr %18, align 4, !tbaa !11
  %84 = load i32, ptr %18, align 4, !tbaa !11
  %85 = icmp sgt i32 %84, 1
  br i1 %85, label %86, label %87

86:                                               ; preds = %80
  store i32 -1, ptr %6, align 4
  store i32 1, ptr %16, align 4
  br label %192

87:                                               ; preds = %80
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #7
  %88 = load i64, ptr %9, align 8, !tbaa !9
  %89 = load i32, ptr %18, align 4, !tbaa !11
  %90 = icmp eq i32 %89, 0
  br i1 %90, label %91, label %92

91:                                               ; preds = %87
  br label %95

92:                                               ; preds = %87
  %93 = load i64, ptr %9, align 8, !tbaa !9
  %94 = udiv i64 %93, 4
  br label %95

95:                                               ; preds = %92, %91
  %96 = phi i64 [ 0, %91 ], [ %94, %92 ]
  %97 = add i64 %88, %96
  store i64 %97, ptr %19, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #7
  %98 = load i32, ptr %18, align 4, !tbaa !11
  %99 = icmp eq i32 %98, 0
  %100 = zext i1 %99 to i64
  %101 = select i1 %99, i64 32, i64 24
  store i64 %101, ptr %20, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #7
  %102 = load i64, ptr %19, align 8, !tbaa !9
  %103 = load i64, ptr %20, align 8, !tbaa !9
  %104 = icmp ult i64 %102, %103
  br i1 %104, label %105, label %107

105:                                              ; preds = %95
  %106 = load i64, ptr %20, align 8, !tbaa !9
  br label %109

107:                                              ; preds = %95
  %108 = load i64, ptr %19, align 8, !tbaa !9
  br label %109

109:                                              ; preds = %107, %105
  %110 = phi i64 [ %106, %105 ], [ %108, %107 ]
  store i64 %110, ptr %21, align 8, !tbaa !9
  %111 = load ptr, ptr %15, align 8, !tbaa !5
  %112 = load ptr, ptr %14, align 8, !tbaa !5
  %113 = ptrtoint ptr %111 to i64
  %114 = ptrtoint ptr %112 to i64
  %115 = sub i64 %113, %114
  %116 = load i64, ptr %21, align 8, !tbaa !9
  %117 = icmp ult i64 %115, %116
  br i1 %117, label %118, label %119

118:                                              ; preds = %109
  store i32 -2, ptr %6, align 4
  store i32 1, ptr %16, align 4
  br label %191

119:                                              ; preds = %109
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #7
  %120 = load ptr, ptr %15, align 8, !tbaa !5
  %121 = load i64, ptr %19, align 8, !tbaa !9
  %122 = sub i64 0, %121
  %123 = getelementptr inbounds i8, ptr %120, i64 %122
  store ptr %123, ptr %22, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 256, ptr %23) #7
  %124 = getelementptr inbounds [256 x i8], ptr %23, i64 0, i64 0
  %125 = load ptr, ptr %22, align 8, !tbaa !5
  %126 = load i64, ptr %9, align 8, !tbaa !9
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %124, ptr align 1 %125, i64 %126, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #7
  %127 = load i32, ptr %18, align 4, !tbaa !11
  %128 = icmp eq i32 %127, 0
  br i1 %128, label %129, label %130

129:                                              ; preds = %119
  br label %134

130:                                              ; preds = %119
  %131 = load ptr, ptr %22, align 8, !tbaa !5
  %132 = load i64, ptr %9, align 8, !tbaa !9
  %133 = getelementptr inbounds i8, ptr %131, i64 %132
  br label %134

134:                                              ; preds = %130, %129
  %135 = phi ptr [ null, %129 ], [ %133, %130 ]
  store ptr %135, ptr %24, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #7
  %136 = load i64, ptr %9, align 8, !tbaa !9
  %137 = call noundef i64 @_ZN7meshoptL18getVertexBlockSizeEm(i64 noundef %136)
  store i64 %137, ptr %25, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #7
  store i64 0, ptr %26, align 8, !tbaa !9
  br label %138

138:                                              ; preds = %179, %134
  %139 = load i64, ptr %26, align 8, !tbaa !9
  %140 = load i64, ptr %8, align 8, !tbaa !9
  %141 = icmp ult i64 %139, %140
  br i1 %141, label %142, label %180

142:                                              ; preds = %138
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #7
  %143 = load i64, ptr %26, align 8, !tbaa !9
  %144 = load i64, ptr %25, align 8, !tbaa !9
  %145 = add i64 %143, %144
  %146 = load i64, ptr %8, align 8, !tbaa !9
  %147 = icmp ult i64 %145, %146
  br i1 %147, label %148, label %150

148:                                              ; preds = %142
  %149 = load i64, ptr %25, align 8, !tbaa !9
  br label %154

150:                                              ; preds = %142
  %151 = load i64, ptr %8, align 8, !tbaa !9
  %152 = load i64, ptr %26, align 8, !tbaa !9
  %153 = sub i64 %151, %152
  br label %154

154:                                              ; preds = %150, %148
  %155 = phi i64 [ %149, %148 ], [ %153, %150 ]
  store i64 %155, ptr %27, align 8, !tbaa !9
  %156 = load ptr, ptr %12, align 8, !tbaa !5
  %157 = load ptr, ptr %14, align 8, !tbaa !5
  %158 = load ptr, ptr %15, align 8, !tbaa !5
  %159 = load ptr, ptr %13, align 8, !tbaa !5
  %160 = load i64, ptr %26, align 8, !tbaa !9
  %161 = load i64, ptr %9, align 8, !tbaa !9
  %162 = mul i64 %160, %161
  %163 = getelementptr inbounds i8, ptr %159, i64 %162
  %164 = load i64, ptr %27, align 8, !tbaa !9
  %165 = load i64, ptr %9, align 8, !tbaa !9
  %166 = getelementptr inbounds [256 x i8], ptr %23, i64 0, i64 0
  %167 = load ptr, ptr %24, align 8, !tbaa !5
  %168 = load i32, ptr %18, align 4, !tbaa !11
  %169 = call noundef ptr %156(ptr noundef %157, ptr noundef %158, ptr noundef %163, i64 noundef %164, i64 noundef %165, ptr noundef %166, ptr noundef %167, i32 noundef %168)
  store ptr %169, ptr %14, align 8, !tbaa !5
  %170 = load ptr, ptr %14, align 8, !tbaa !5
  %171 = icmp ne ptr %170, null
  br i1 %171, label %173, label %172

172:                                              ; preds = %154
  store i32 -2, ptr %6, align 4
  store i32 1, ptr %16, align 4
  br label %177

173:                                              ; preds = %154
  %174 = load i64, ptr %27, align 8, !tbaa !9
  %175 = load i64, ptr %26, align 8, !tbaa !9
  %176 = add i64 %175, %174
  store i64 %176, ptr %26, align 8, !tbaa !9
  store i32 0, ptr %16, align 4
  br label %177

177:                                              ; preds = %173, %172
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #7
  %178 = load i32, ptr %16, align 4
  switch i32 %178, label %190 [
    i32 0, label %179
  ]

179:                                              ; preds = %177
  br label %138, !llvm.loop !18

180:                                              ; preds = %138
  %181 = load ptr, ptr %15, align 8, !tbaa !5
  %182 = load ptr, ptr %14, align 8, !tbaa !5
  %183 = ptrtoint ptr %181 to i64
  %184 = ptrtoint ptr %182 to i64
  %185 = sub i64 %183, %184
  %186 = load i64, ptr %21, align 8, !tbaa !9
  %187 = icmp ne i64 %185, %186
  br i1 %187, label %188, label %189

188:                                              ; preds = %180
  store i32 -3, ptr %6, align 4
  store i32 1, ptr %16, align 4
  br label %190

189:                                              ; preds = %180
  store i32 0, ptr %6, align 4
  store i32 1, ptr %16, align 4
  br label %190

190:                                              ; preds = %189, %188, %177
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #7
  call void @llvm.lifetime.end.p0(i64 256, ptr %23) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #7
  br label %191

191:                                              ; preds = %190, %118
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #7
  br label %192

192:                                              ; preds = %191, %86
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #7
  br label %193

193:                                              ; preds = %192, %79
  call void @llvm.lifetime.end.p0(i64 1, ptr %17) #7
  br label %194

194:                                              ; preds = %193, %70
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  %195 = load i32, ptr %6, align 4
  ret i32 %195
}

; Function Attrs: mustprogress uwtable
declare hidden noundef ptr @_ZN7meshoptL21decodeVertexBlockSimdEPKhS1_PhmmS2_S1_i(ptr noundef, ptr noundef, ptr noundef, i64 noundef, i64 noundef, ptr noundef, ptr noundef, i32 noundef) #5

; Function Attrs: mustprogress uwtable
declare hidden noundef ptr @_ZN7meshoptL17decodeVertexBlockEPKhS1_PhmmS2_S1_i(ptr noundef, ptr noundef, ptr noundef, i64 noundef, i64 noundef, ptr noundef, ptr noundef, i32 noundef) #4

attributes #0 = { noreturn 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 #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 #4 = { 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 #5 = { 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,+sse3,+ssse3,+x87" "tune-cpu"="generic" }
attributes #6 = { noreturn nounwind }
attributes #7 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"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, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"bool", !7, i64 0}
!15 = !{i8 0, i8 2}
!16 = !{}
!17 = !{!7, !7, i64 0}
!18 = distinct !{!18, !19}
!19 = !{!"llvm.loop.mustprogress"}


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

@_ZN7meshoptL28gDecodeBytesGroupInitializedE = external hidden local_unnamed_addr global i8, align 1
@_ZN7meshoptL5cpuidE = external hidden local_unnamed_addr global i32, align 4
@.str = external hidden unnamed_addr constant [38 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [72 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [21 x i8], align 1
@__PRETTY_FUNCTION__.meshopt_decodeVertexBuffer = external hidden unnamed_addr constant [86 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [29 x i8], align 1

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #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 nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #2

; Function Attrs: mustprogress nounwind uwtable
declare hidden noundef i64 @_ZN7meshoptL18getVertexBlockSizeEm(i64 noundef) local_unnamed_addr #3

; 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
define dso_local i32 @meshopt_decodeVertexBuffer(ptr noundef %0, i64 noundef %1, i64 noundef %2, ptr noundef %3, i64 noundef %4) local_unnamed_addr #4 {
  %6 = alloca [256 x i8], align 16
  %7 = add i64 %2, -1
  %8 = icmp ult i64 %7, 256
  br i1 %8, label %10, label %9

9:                                                ; preds = %5
  tail call void @__assert_fail(ptr noundef nonnull @.str, ptr noundef nonnull @.str.2, i32 noundef 1834, ptr noundef nonnull @__PRETTY_FUNCTION__.meshopt_decodeVertexBuffer) #7
  unreachable

10:                                               ; preds = %5
  %11 = and i64 %2, 3
  %12 = icmp eq i64 %11, 0
  br i1 %12, label %14, label %13

13:                                               ; preds = %10
  tail call void @__assert_fail(ptr noundef nonnull @.str.3, ptr noundef nonnull @.str.2, i32 noundef 1835, ptr noundef nonnull @__PRETTY_FUNCTION__.meshopt_decodeVertexBuffer) #7
  unreachable

14:                                               ; preds = %10
  %15 = load i32, ptr @_ZN7meshoptL5cpuidE, align 4, !tbaa !5
  %16 = and i32 %15, 512
  %.not = icmp eq i32 %16, 0
  %_ZN7meshoptL21decodeVertexBlockSimdEPKhS1_PhmmS2_S1_i._ZN7meshoptL17decodeVertexBlockEPKhS1_PhmmS2_S1_i = select i1 %.not, ptr @_ZN7meshoptL17decodeVertexBlockEPKhS1_PhmmS2_S1_i, ptr @_ZN7meshoptL21decodeVertexBlockSimdEPKhS1_PhmmS2_S1_i
  %17 = load i8, ptr @_ZN7meshoptL28gDecodeBytesGroupInitializedE, align 1, !tbaa !9, !range !11, !noundef !12
  %18 = trunc nuw i8 %17 to i1
  br i1 %18, label %20, label %19

19:                                               ; preds = %14
  tail call void @__assert_fail(ptr noundef nonnull @.str.11, ptr noundef nonnull @.str.2, i32 noundef 1848, ptr noundef nonnull @__PRETTY_FUNCTION__.meshopt_decodeVertexBuffer) #7
  unreachable

20:                                               ; preds = %14
  %21 = getelementptr inbounds i8, ptr %3, i64 %4
  %22 = ptrtoint ptr %21 to i64
  %23 = icmp eq i64 %4, 0
  br i1 %23, label %60, label %24

24:                                               ; preds = %20
  %25 = getelementptr inbounds i8, ptr %3, i64 1
  %26 = load i8, ptr %3, align 1, !tbaa !13
  %27 = zext i8 %26 to i32
  %28 = and i32 %27, 240
  %.not65 = icmp eq i32 %28, 160
  br i1 %.not65, label %29, label %60

29:                                               ; preds = %24
  %30 = and i32 %27, 15
  %31 = icmp ugt i32 %30, 1
  br i1 %31, label %60, label %32

32:                                               ; preds = %29
  %33 = icmp eq i32 %30, 0
  %34 = lshr exact i64 %2, 2
  %35 = select i1 %33, i64 0, i64 %34
  %36 = add nuw nsw i64 %35, %2
  %37 = select i1 %33, i64 32, i64 24
  %38 = tail call i64 @llvm.umax.i64(i64 %36, i64 %37)
  %gepdiff = add nsw i64 %4, -1
  %39 = icmp ult i64 %gepdiff, %38
  br i1 %39, label %60, label %40

40:                                               ; preds = %32
  %41 = sub nsw i64 0, %36
  %42 = getelementptr inbounds i8, ptr %21, i64 %41
  call void @llvm.lifetime.start.p0(i64 256, ptr nonnull %6) #8
  call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 16 %6, ptr nonnull align 1 %42, i64 %2, i1 false)
  %43 = getelementptr inbounds i8, ptr %42, i64 %2
  %44 = select i1 %33, ptr null, ptr %43
  %45 = tail call noundef i64 @_ZN7meshoptL18getVertexBlockSizeEm(i64 noundef %2)
  br label %46

46:                                               ; preds = %48, %40
  %.059 = phi ptr [ %25, %40 ], [ %55, %48 ]
  %.057 = phi i64 [ 0, %40 ], [ %56, %48 ]
  %47 = icmp ult i64 %.057, %1
  br i1 %47, label %48, label %57

48:                                               ; preds = %46
  %49 = add i64 %.057, %45
  %50 = icmp ult i64 %49, %1
  %51 = sub i64 %1, %.057
  %52 = select i1 %50, i64 %45, i64 %51
  %53 = mul i64 %.057, %2
  %54 = getelementptr inbounds i8, ptr %0, i64 %53
  %55 = call noundef ptr %_ZN7meshoptL21decodeVertexBlockSimdEPKhS1_PhmmS2_S1_i._ZN7meshoptL17decodeVertexBlockEPKhS1_PhmmS2_S1_i(ptr noundef nonnull %.059, ptr noundef nonnull %21, ptr noundef %54, i64 noundef %52, i64 noundef %2, ptr noundef nonnull %6, ptr noundef %44, i32 noundef %30), !callees !14
  %.not67.not = icmp eq ptr %55, null
  %56 = add i64 %52, %.057
  br i1 %.not67.not, label %.loopexit, label %46, !llvm.loop !15

57:                                               ; preds = %46
  %58 = ptrtoint ptr %.059 to i64
  %59 = sub i64 %22, %58
  %.not66 = icmp eq i64 %59, %38
  %. = select i1 %.not66, i32 0, i32 -3
  br label %.loopexit

.loopexit:                                        ; preds = %48, %57
  %.2 = phi i32 [ %., %57 ], [ -2, %48 ]
  call void @llvm.lifetime.end.p0(i64 256, ptr nonnull %6) #8
  br label %60

60:                                               ; preds = %24, %.loopexit, %32, %29, %20
  %.6 = phi i32 [ -2, %20 ], [ -1, %24 ], [ -1, %29 ], [ %.2, %.loopexit ], [ -2, %32 ]
  ret i32 %.6
}

; Function Attrs: mustprogress uwtable
declare hidden noundef ptr @_ZN7meshoptL21decodeVertexBlockSimdEPKhS1_PhmmS2_S1_i(ptr noundef, ptr noundef, ptr noundef, i64 noundef, i64 noundef, ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #5

; Function Attrs: mustprogress uwtable
declare hidden noundef ptr @_ZN7meshoptL17decodeVertexBlockEPKhS1_PhmmS2_S1_i(ptr noundef, ptr noundef, ptr noundef, i64 noundef, i64 noundef, ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #4

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i64 @llvm.umax.i64(i64, i64) #6

attributes #0 = { noreturn 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 #1 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 #4 = { 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 #5 = { 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,+sse3,+ssse3,+x87" "tune-cpu"="generic" }
attributes #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #7 = { noreturn nounwind }
attributes #8 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"bool", !7, i64 0}
!11 = !{i8 0, i8 2}
!12 = !{}
!13 = !{!7, !7, i64 0}
!14 = !{ptr @_ZN7meshoptL17decodeVertexBlockEPKhS1_PhmmS2_S1_i, ptr @_ZN7meshoptL21decodeVertexBlockSimdEPKhS1_PhmmS2_S1_i}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: CalledValuePropagationPass,CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass