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

; 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.meshopt_CoverageStatistics = type { [3 x float], float }
%class.meshopt_Allocator = type { [24 x ptr], i64 }
%"struct.meshopt::OverdrawBuffer" = type { [256 x [256 x [2 x float]]], [256 x [256 x [2 x i32]]] }

@.str = external hidden unnamed_addr constant [21 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [71 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [64 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [45 x i8], align 1
@__PRETTY_FUNCTION__.meshopt_analyzeCoverage = external hidden unnamed_addr constant [112 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: mustprogress nounwind uwtable
declare dso_local void @_ZN17meshopt_AllocatorC2Ev(ptr noundef nonnull align 8 dereferenceable(200)) unnamed_addr #2 align 2

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN17meshopt_Allocator8allocateIfEEPT_m(ptr noundef nonnull align 8 dereferenceable(200), i64 noundef) #4 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare hidden noundef float @_ZN7meshoptL18transformTrianglesEPfPKjmPKfmm(ptr noundef, ptr noundef, i64 noundef, ptr noundef, i64 noundef, i64 noundef) #2

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN17meshopt_Allocator8allocateIN7meshopt14OverdrawBufferEEEPT_m(ptr noundef nonnull align 8 dereferenceable(200), i64 noundef) #4 align 2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN17meshopt_AllocatorD2Ev(ptr noundef nonnull align 8 dereferenceable(200)) unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local { <2 x float>, <2 x float> } @meshopt_analyzeCoverage(ptr noundef %0, i64 noundef %1, ptr noundef %2, i64 noundef %3, i64 noundef %4) #4 personality ptr @__gxx_personality_v0 {
  %6 = alloca %struct.meshopt_CoverageStatistics, align 4
  %7 = alloca ptr, align 8
  %8 = alloca i64, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i64, align 8
  %11 = alloca i64, align 8
  %12 = alloca %class.meshopt_Allocator, align 8
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca i32, align 4
  %16 = alloca float, align 4
  %17 = alloca ptr, align 8
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  store ptr %0, ptr %7, align 8, !tbaa !5
  store i64 %1, ptr %8, align 8, !tbaa !9
  store ptr %2, ptr %9, align 8, !tbaa !5
  store i64 %3, ptr %10, align 8, !tbaa !9
  store i64 %4, ptr %11, align 8, !tbaa !9
  %23 = load i64, ptr %8, align 8, !tbaa !9
  %24 = urem i64 %23, 3
  %25 = icmp eq i64 %24, 0
  br i1 %25, label %26, label %27

26:                                               ; preds = %5
  br label %29

27:                                               ; preds = %5
  call void @__assert_fail(ptr noundef @.str, ptr noundef @.str.1, i32 noundef 259, ptr noundef @__PRETTY_FUNCTION__.meshopt_analyzeCoverage) #5
  unreachable

28:                                               ; No predecessors!
  br label %29

29:                                               ; preds = %28, %26
  %30 = load i64, ptr %11, align 8, !tbaa !9
  %31 = icmp uge i64 %30, 12
  br i1 %31, label %32, label %35

32:                                               ; preds = %29
  %33 = load i64, ptr %11, align 8, !tbaa !9
  %34 = icmp ule i64 %33, 256
  br label %35

35:                                               ; preds = %32, %29
  %36 = phi i1 [ false, %29 ], [ %34, %32 ]
  br i1 %36, label %37, label %38

37:                                               ; preds = %35
  br label %40

38:                                               ; preds = %35
  call void @__assert_fail(ptr noundef @.str.2, ptr noundef @.str.1, i32 noundef 260, ptr noundef @__PRETTY_FUNCTION__.meshopt_analyzeCoverage) #5
  unreachable

39:                                               ; No predecessors!
  br label %40

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

44:                                               ; preds = %40
  br label %47

45:                                               ; preds = %40
  call void @__assert_fail(ptr noundef @.str.3, ptr noundef @.str.1, i32 noundef 261, ptr noundef @__PRETTY_FUNCTION__.meshopt_analyzeCoverage) #5
  unreachable

46:                                               ; No predecessors!
  br label %47

47:                                               ; preds = %46, %44
  call void @llvm.lifetime.start.p0(i64 200, ptr %12) #6
  call void @_ZN17meshopt_AllocatorC2Ev(ptr noundef nonnull align 8 dereferenceable(200) %12)
  call void @llvm.memset.p0.i64(ptr align 4 %6, i8 0, i64 16, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  %48 = load i64, ptr %8, align 8, !tbaa !9
  %49 = mul i64 %48, 3
  %50 = invoke noundef ptr @_ZN17meshopt_Allocator8allocateIfEEPT_m(ptr noundef nonnull align 8 dereferenceable(200) %12, i64 noundef %49)
          to label %51 unwind label %66

51:                                               ; preds = %47
  store ptr %50, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #6
  %52 = load ptr, ptr %13, align 8, !tbaa !5
  %53 = load ptr, ptr %7, align 8, !tbaa !5
  %54 = load i64, ptr %8, align 8, !tbaa !9
  %55 = load ptr, ptr %9, align 8, !tbaa !5
  %56 = load i64, ptr %10, align 8, !tbaa !9
  %57 = load i64, ptr %11, align 8, !tbaa !9
  %58 = invoke noundef float @_ZN7meshoptL18transformTrianglesEPfPKjmPKfmm(ptr noundef %52, ptr noundef %53, i64 noundef %54, ptr noundef %55, i64 noundef %56, i64 noundef %57)
          to label %59 unwind label %70

59:                                               ; preds = %51
  store float %58, ptr %16, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #6
  %60 = invoke noundef ptr @_ZN17meshopt_Allocator8allocateIN7meshopt14OverdrawBufferEEEPT_m(ptr noundef nonnull align 8 dereferenceable(200) %12, i64 noundef 1)
          to label %61 unwind label %74

61:                                               ; preds = %59
  store ptr %60, ptr %17, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #6
  store i32 0, ptr %18, align 4, !tbaa !13
  br label %62

62:                                               ; preds = %139, %61
  %63 = load i32, ptr %18, align 4, !tbaa !13
  %64 = icmp slt i32 %63, 3
  br i1 %64, label %78, label %65

65:                                               ; preds = %62
  store i32 2, ptr %19, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #6
  br label %142

66:                                               ; preds = %47
  %67 = landingpad { ptr, i32 }
          cleanup
  %68 = extractvalue { ptr, i32 } %67, 0
  store ptr %68, ptr %14, align 8
  %69 = extractvalue { ptr, i32 } %67, 1
  store i32 %69, ptr %15, align 4
  br label %148

70:                                               ; preds = %51
  %71 = landingpad { ptr, i32 }
          cleanup
  %72 = extractvalue { ptr, i32 } %71, 0
  store ptr %72, ptr %14, align 8
  %73 = extractvalue { ptr, i32 } %71, 1
  store i32 %73, ptr %15, align 4
  br label %147

74:                                               ; preds = %59
  %75 = landingpad { ptr, i32 }
          cleanup
  %76 = extractvalue { ptr, i32 } %75, 0
  store ptr %76, ptr %14, align 8
  %77 = extractvalue { ptr, i32 } %75, 1
  store i32 %77, ptr %15, align 4
  br label %146

78:                                               ; preds = %62
  %79 = load ptr, ptr %17, align 8, !tbaa !5
  call void @llvm.memset.p0.i64(ptr align 4 %79, i8 0, i64 1048576, i1 false)
  %80 = load ptr, ptr %17, align 8, !tbaa !5
  %81 = load ptr, ptr %13, align 8, !tbaa !5
  %82 = load i64, ptr %8, align 8, !tbaa !9
  %83 = load i32, ptr %18, align 4, !tbaa !13
  invoke void @_ZN7meshoptL18rasterizeTrianglesEPNS_14OverdrawBufferEPKfmi(ptr noundef %80, ptr noundef %81, i64 noundef %82, i32 noundef %83)
          to label %84 unwind label %89

84:                                               ; preds = %78
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #6
  store i32 0, ptr %20, align 4, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #6
  store i32 0, ptr %21, align 4, !tbaa !13
  br label %85

85:                                               ; preds = %128, %84
  %86 = load i32, ptr %21, align 4, !tbaa !13
  %87 = icmp slt i32 %86, 256
  br i1 %87, label %93, label %88

88:                                               ; preds = %85
  store i32 5, ptr %19, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #6
  br label %131

89:                                               ; preds = %78
  %90 = landingpad { ptr, i32 }
          cleanup
  %91 = extractvalue { ptr, i32 } %90, 0
  store ptr %91, ptr %14, align 8
  %92 = extractvalue { ptr, i32 } %90, 1
  store i32 %92, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #6
  br label %146

93:                                               ; preds = %85
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #6
  store i32 0, ptr %22, align 4, !tbaa !13
  br label %94

94:                                               ; preds = %124, %93
  %95 = load i32, ptr %22, align 4, !tbaa !13
  %96 = icmp slt i32 %95, 256
  br i1 %96, label %98, label %97

97:                                               ; preds = %94
  store i32 8, ptr %19, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #6
  br label %127

98:                                               ; preds = %94
  %99 = load ptr, ptr %17, align 8, !tbaa !5
  %100 = getelementptr inbounds %"struct.meshopt::OverdrawBuffer", ptr %99, i32 0, i32 1
  %101 = load i32, ptr %21, align 4, !tbaa !13
  %102 = sext i32 %101 to i64
  %103 = getelementptr inbounds [256 x [256 x [2 x i32]]], ptr %100, i64 0, i64 %102
  %104 = load i32, ptr %22, align 4, !tbaa !13
  %105 = sext i32 %104 to i64
  %106 = getelementptr inbounds [256 x [2 x i32]], ptr %103, i64 0, i64 %105
  %107 = getelementptr inbounds [2 x i32], ptr %106, i64 0, i64 0
  %108 = load i32, ptr %107, align 4, !tbaa !13
  %109 = load ptr, ptr %17, align 8, !tbaa !5
  %110 = getelementptr inbounds %"struct.meshopt::OverdrawBuffer", ptr %109, i32 0, i32 1
  %111 = load i32, ptr %21, align 4, !tbaa !13
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds [256 x [256 x [2 x i32]]], ptr %110, i64 0, i64 %112
  %114 = load i32, ptr %22, align 4, !tbaa !13
  %115 = sext i32 %114 to i64
  %116 = getelementptr inbounds [256 x [2 x i32]], ptr %113, i64 0, i64 %115
  %117 = getelementptr inbounds [2 x i32], ptr %116, i64 0, i64 1
  %118 = load i32, ptr %117, align 4, !tbaa !13
  %119 = or i32 %108, %118
  %120 = icmp ugt i32 %119, 0
  %121 = zext i1 %120 to i32
  %122 = load i32, ptr %20, align 4, !tbaa !13
  %123 = add i32 %122, %121
  store i32 %123, ptr %20, align 4, !tbaa !13
  br label %124

124:                                              ; preds = %98
  %125 = load i32, ptr %22, align 4, !tbaa !13
  %126 = add nsw i32 %125, 1
  store i32 %126, ptr %22, align 4, !tbaa !13
  br label %94, !llvm.loop !15

127:                                              ; preds = %97
  br label %128

128:                                              ; preds = %127
  %129 = load i32, ptr %21, align 4, !tbaa !13
  %130 = add nsw i32 %129, 1
  store i32 %130, ptr %21, align 4, !tbaa !13
  br label %85, !llvm.loop !17

131:                                              ; preds = %88
  %132 = load i32, ptr %20, align 4, !tbaa !13
  %133 = uitofp i32 %132 to float
  %134 = fdiv float %133, 6.553600e+04
  %135 = getelementptr inbounds %struct.meshopt_CoverageStatistics, ptr %6, i32 0, i32 0
  %136 = load i32, ptr %18, align 4, !tbaa !13
  %137 = sext i32 %136 to i64
  %138 = getelementptr inbounds [3 x float], ptr %135, i64 0, i64 %137
  store float %134, ptr %138, align 4, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #6
  br label %139

139:                                              ; preds = %131
  %140 = load i32, ptr %18, align 4, !tbaa !13
  %141 = add nsw i32 %140, 1
  store i32 %141, ptr %18, align 4, !tbaa !13
  br label %62, !llvm.loop !18

142:                                              ; preds = %65
  %143 = load float, ptr %16, align 4, !tbaa !11
  %144 = getelementptr inbounds %struct.meshopt_CoverageStatistics, ptr %6, i32 0, i32 1
  store float %143, ptr %144, align 4, !tbaa !19
  store i32 1, ptr %19, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  call void @_ZN17meshopt_AllocatorD2Ev(ptr noundef nonnull align 8 dereferenceable(200) %12) #6
  call void @llvm.lifetime.end.p0(i64 200, ptr %12) #6
  %145 = load { <2 x float>, <2 x float> }, ptr %6, align 4
  ret { <2 x float>, <2 x float> } %145

146:                                              ; preds = %89, %74
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #6
  br label %147

147:                                              ; preds = %146, %70
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  br label %148

148:                                              ; preds = %147, %66
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  call void @_ZN17meshopt_AllocatorD2Ev(ptr noundef nonnull align 8 dereferenceable(200) %12) #6
  call void @llvm.lifetime.end.p0(i64 200, ptr %12) #6
  br label %149

149:                                              ; preds = %148
  %150 = load ptr, ptr %14, align 8
  %151 = load i32, ptr %15, align 4
  %152 = insertvalue { ptr, i32 } poison, ptr %150, 0
  %153 = insertvalue { ptr, i32 } %152, i32 %151, 1
  resume { ptr, i32 } %153
}

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 = { 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 #3 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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 = { noreturn nounwind }
attributes #6 = { 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 = !{!"float", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"int", !7, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = distinct !{!17, !16}
!18 = distinct !{!18, !16}
!19 = !{!20, !12, i64 12}
!20 = !{!"_ZTS26meshopt_CoverageStatistics", !7, i64 0, !12, 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"

%class.meshopt_Allocator = type { [24 x ptr], i64 }

@.str = external hidden unnamed_addr constant [21 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [71 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [64 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [45 x i8], align 1
@__PRETTY_FUNCTION__.meshopt_analyzeCoverage = external hidden unnamed_addr constant [112 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 nounwind uwtable
declare dso_local void @_ZN17meshopt_AllocatorC2Ev(ptr noundef nonnull align 8 dereferenceable(200)) unnamed_addr #2 align 2

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN17meshopt_Allocator8allocateIfEEPT_m(ptr noundef nonnull align 8 dereferenceable(200), i64 noundef) local_unnamed_addr #4 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare hidden noundef float @_ZN7meshoptL18transformTrianglesEPfPKjmPKfmm(ptr noundef, ptr noundef, i64 noundef, ptr noundef, i64 noundef, i64 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN17meshopt_Allocator8allocateIN7meshopt14OverdrawBufferEEEPT_m(ptr noundef nonnull align 8 dereferenceable(200), i64 noundef) local_unnamed_addr #4 align 2

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

; 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 nounwind uwtable
declare dso_local void @_ZN17meshopt_AllocatorD2Ev(ptr noundef nonnull align 8 dereferenceable(200)) unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local { <2 x float>, <2 x float> } @meshopt_analyzeCoverage(ptr noundef %0, i64 noundef %1, ptr noundef %2, i64 noundef %3, i64 noundef %4) local_unnamed_addr #4 personality ptr @__gxx_personality_v0 {
  %6 = alloca %class.meshopt_Allocator, align 8
  %7 = urem i64 %1, 3
  %8 = icmp eq i64 %7, 0
  br i1 %8, label %10, label %9

9:                                                ; preds = %5
  tail call void @__assert_fail(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 259, ptr noundef nonnull @__PRETTY_FUNCTION__.meshopt_analyzeCoverage) #6
  unreachable

10:                                               ; preds = %5
  %11 = add i64 %4, -12
  %12 = icmp ult i64 %11, 245
  br i1 %12, label %14, label %13

13:                                               ; preds = %10
  tail call void @__assert_fail(ptr noundef nonnull @.str.2, ptr noundef nonnull @.str.1, i32 noundef 260, ptr noundef nonnull @__PRETTY_FUNCTION__.meshopt_analyzeCoverage) #6
  unreachable

14:                                               ; preds = %10
  %15 = and i64 %4, 3
  %16 = icmp eq i64 %15, 0
  br i1 %16, label %18, label %17

17:                                               ; preds = %14
  tail call void @__assert_fail(ptr noundef nonnull @.str.3, ptr noundef nonnull @.str.1, i32 noundef 261, ptr noundef nonnull @__PRETTY_FUNCTION__.meshopt_analyzeCoverage) #6
  unreachable

18:                                               ; preds = %14
  call void @llvm.lifetime.start.p0(i64 200, ptr nonnull %6) #7
  call void @_ZN17meshopt_AllocatorC2Ev(ptr noundef nonnull align 8 dereferenceable(200) %6)
  %19 = mul i64 %1, 3
  %20 = invoke noundef ptr @_ZN17meshopt_Allocator8allocateIfEEPT_m(ptr noundef nonnull align 8 dereferenceable(200) %6, i64 noundef %19)
          to label %21 unwind label %25

21:                                               ; preds = %18
  %22 = call noundef float @_ZN7meshoptL18transformTrianglesEPfPKjmPKfmm(ptr noundef %20, ptr noundef %0, i64 noundef %1, ptr noundef %2, i64 noundef %3, i64 noundef %4)
  %23 = invoke noundef ptr @_ZN17meshopt_Allocator8allocateIN7meshopt14OverdrawBufferEEEPT_m(ptr noundef nonnull align 8 dereferenceable(200) %6, i64 noundef 1)
          to label %.preheader44 unwind label %27

.preheader44:                                     ; preds = %21
  %24 = getelementptr inbounds i8, ptr %23, i64 524288
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(1048576) %23, i8 0, i64 1048576, i1 false)
  invoke void @_ZN7meshoptL18rasterizeTrianglesEPNS_14OverdrawBufferEPKfmi(ptr noundef nonnull %23, ptr noundef %20, i64 noundef %1, i32 noundef 0)
          to label %vector.ph unwind label %80

25:                                               ; preds = %18
  %26 = landingpad { ptr, i32 }
          cleanup
  br label %82

27:                                               ; preds = %21
  %28 = landingpad { ptr, i32 }
          cleanup
  br label %82

vector.ph:                                        ; preds = %.preheader44, %middle.block
  %indvars.iv51 = phi i64 [ %indvars.iv.next52, %middle.block ], [ 0, %.preheader44 ]
  %.03447 = phi i32 [ %42, %middle.block ], [ 0, %.preheader44 ]
  %29 = insertelement <4 x i32> <i32 poison, i32 0, i32 0, i32 0>, i32 %.03447, i64 0
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %vec.phi = phi <4 x i32> [ %29, %vector.ph ], [ %39, %vector.body ]
  %vec.phi65 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %40, %vector.body ]
  %30 = or disjoint i64 %index, 4
  %31 = getelementptr inbounds [256 x [256 x [2 x i32]]], ptr %24, i64 0, i64 %indvars.iv51, i64 %index
  %32 = getelementptr inbounds [256 x [256 x [2 x i32]]], ptr %24, i64 0, i64 %indvars.iv51, i64 %30
  %wide.vec = load <8 x i32>, ptr %31, align 4, !tbaa !5
  %wide.vec66 = load <8 x i32>, ptr %32, align 4, !tbaa !5
  %strided.vec = shufflevector <8 x i32> %wide.vec, <8 x i32> poison, <4 x i32> <i32 0, i32 2, i32 4, i32 6>
  %strided.vec67 = shufflevector <8 x i32> %wide.vec66, <8 x i32> poison, <4 x i32> <i32 0, i32 2, i32 4, i32 6>
  %strided.vec68 = shufflevector <8 x i32> %wide.vec, <8 x i32> poison, <4 x i32> <i32 1, i32 3, i32 5, i32 7>
  %strided.vec69 = shufflevector <8 x i32> %wide.vec66, <8 x i32> poison, <4 x i32> <i32 1, i32 3, i32 5, i32 7>
  %33 = or <4 x i32> %strided.vec68, %strided.vec
  %34 = or <4 x i32> %strided.vec69, %strided.vec67
  %35 = icmp ne <4 x i32> %33, zeroinitializer
  %36 = icmp ne <4 x i32> %34, zeroinitializer
  %37 = zext <4 x i1> %35 to <4 x i32>
  %38 = zext <4 x i1> %36 to <4 x i32>
  %39 = add <4 x i32> %vec.phi, %37
  %40 = add <4 x i32> %vec.phi65, %38
  %index.next = add nuw i64 %index, 8
  %41 = icmp eq i64 %index.next, 256
  br i1 %41, label %middle.block, label %vector.body, !llvm.loop !9

middle.block:                                     ; preds = %vector.body
  %bin.rdx = add <4 x i32> %40, %39
  %42 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
  %indvars.iv.next52 = add nuw nsw i64 %indvars.iv51, 1
  %exitcond54.not = icmp eq i64 %indvars.iv.next52, 256
  br i1 %exitcond54.not, label %43, label %vector.ph, !llvm.loop !13

43:                                               ; preds = %middle.block
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(1048576) %23, i8 0, i64 1048576, i1 false)
  invoke void @_ZN7meshoptL18rasterizeTrianglesEPNS_14OverdrawBufferEPKfmi(ptr noundef nonnull %23, ptr noundef %20, i64 noundef %1, i32 noundef 1)
          to label %vector.ph72 unwind label %80

vector.ph72:                                      ; preds = %43, %middle.block70
  %indvars.iv51.1 = phi i64 [ %indvars.iv.next52.1, %middle.block70 ], [ 0, %43 ]
  %.03447.1 = phi i32 [ %57, %middle.block70 ], [ 0, %43 ]
  %44 = insertelement <4 x i32> <i32 poison, i32 0, i32 0, i32 0>, i32 %.03447.1, i64 0
  br label %vector.body74

vector.body74:                                    ; preds = %vector.body74, %vector.ph72
  %index75 = phi i64 [ 0, %vector.ph72 ], [ %index.next84, %vector.body74 ]
  %vec.phi76 = phi <4 x i32> [ %44, %vector.ph72 ], [ %54, %vector.body74 ]
  %vec.phi77 = phi <4 x i32> [ zeroinitializer, %vector.ph72 ], [ %55, %vector.body74 ]
  %45 = or disjoint i64 %index75, 4
  %46 = getelementptr inbounds [256 x [256 x [2 x i32]]], ptr %24, i64 0, i64 %indvars.iv51.1, i64 %index75
  %47 = getelementptr inbounds [256 x [256 x [2 x i32]]], ptr %24, i64 0, i64 %indvars.iv51.1, i64 %45
  %wide.vec78 = load <8 x i32>, ptr %46, align 4, !tbaa !5
  %wide.vec79 = load <8 x i32>, ptr %47, align 4, !tbaa !5
  %strided.vec80 = shufflevector <8 x i32> %wide.vec78, <8 x i32> poison, <4 x i32> <i32 0, i32 2, i32 4, i32 6>
  %strided.vec81 = shufflevector <8 x i32> %wide.vec79, <8 x i32> poison, <4 x i32> <i32 0, i32 2, i32 4, i32 6>
  %strided.vec82 = shufflevector <8 x i32> %wide.vec78, <8 x i32> poison, <4 x i32> <i32 1, i32 3, i32 5, i32 7>
  %strided.vec83 = shufflevector <8 x i32> %wide.vec79, <8 x i32> poison, <4 x i32> <i32 1, i32 3, i32 5, i32 7>
  %48 = or <4 x i32> %strided.vec82, %strided.vec80
  %49 = or <4 x i32> %strided.vec83, %strided.vec81
  %50 = icmp ne <4 x i32> %48, zeroinitializer
  %51 = icmp ne <4 x i32> %49, zeroinitializer
  %52 = zext <4 x i1> %50 to <4 x i32>
  %53 = zext <4 x i1> %51 to <4 x i32>
  %54 = add <4 x i32> %vec.phi76, %52
  %55 = add <4 x i32> %vec.phi77, %53
  %index.next84 = add nuw i64 %index75, 8
  %56 = icmp eq i64 %index.next84, 256
  br i1 %56, label %middle.block70, label %vector.body74, !llvm.loop !14

middle.block70:                                   ; preds = %vector.body74
  %bin.rdx85 = add <4 x i32> %55, %54
  %57 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx85)
  %indvars.iv.next52.1 = add nuw nsw i64 %indvars.iv51.1, 1
  %exitcond54.1.not = icmp eq i64 %indvars.iv.next52.1, 256
  br i1 %exitcond54.1.not, label %58, label %vector.ph72, !llvm.loop !13

58:                                               ; preds = %middle.block70
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 4 dereferenceable(1048576) %23, i8 0, i64 1048576, i1 false)
  invoke void @_ZN7meshoptL18rasterizeTrianglesEPNS_14OverdrawBufferEPKfmi(ptr noundef nonnull %23, ptr noundef %20, i64 noundef %1, i32 noundef 2)
          to label %vector.ph89 unwind label %80

vector.ph89:                                      ; preds = %58, %middle.block87
  %indvars.iv51.2 = phi i64 [ %indvars.iv.next52.2, %middle.block87 ], [ 0, %58 ]
  %.03447.2 = phi i32 [ %72, %middle.block87 ], [ 0, %58 ]
  %59 = insertelement <4 x i32> <i32 poison, i32 0, i32 0, i32 0>, i32 %.03447.2, i64 0
  br label %vector.body91

vector.body91:                                    ; preds = %vector.body91, %vector.ph89
  %index92 = phi i64 [ 0, %vector.ph89 ], [ %index.next101, %vector.body91 ]
  %vec.phi93 = phi <4 x i32> [ %59, %vector.ph89 ], [ %69, %vector.body91 ]
  %vec.phi94 = phi <4 x i32> [ zeroinitializer, %vector.ph89 ], [ %70, %vector.body91 ]
  %60 = or disjoint i64 %index92, 4
  %61 = getelementptr inbounds [256 x [256 x [2 x i32]]], ptr %24, i64 0, i64 %indvars.iv51.2, i64 %index92
  %62 = getelementptr inbounds [256 x [256 x [2 x i32]]], ptr %24, i64 0, i64 %indvars.iv51.2, i64 %60
  %wide.vec95 = load <8 x i32>, ptr %61, align 4, !tbaa !5
  %wide.vec96 = load <8 x i32>, ptr %62, align 4, !tbaa !5
  %strided.vec97 = shufflevector <8 x i32> %wide.vec95, <8 x i32> poison, <4 x i32> <i32 0, i32 2, i32 4, i32 6>
  %strided.vec98 = shufflevector <8 x i32> %wide.vec96, <8 x i32> poison, <4 x i32> <i32 0, i32 2, i32 4, i32 6>
  %strided.vec99 = shufflevector <8 x i32> %wide.vec95, <8 x i32> poison, <4 x i32> <i32 1, i32 3, i32 5, i32 7>
  %strided.vec100 = shufflevector <8 x i32> %wide.vec96, <8 x i32> poison, <4 x i32> <i32 1, i32 3, i32 5, i32 7>
  %63 = or <4 x i32> %strided.vec99, %strided.vec97
  %64 = or <4 x i32> %strided.vec100, %strided.vec98
  %65 = icmp ne <4 x i32> %63, zeroinitializer
  %66 = icmp ne <4 x i32> %64, zeroinitializer
  %67 = zext <4 x i1> %65 to <4 x i32>
  %68 = zext <4 x i1> %66 to <4 x i32>
  %69 = add <4 x i32> %vec.phi93, %67
  %70 = add <4 x i32> %vec.phi94, %68
  %index.next101 = add nuw i64 %index92, 8
  %71 = icmp eq i64 %index.next101, 256
  br i1 %71, label %middle.block87, label %vector.body91, !llvm.loop !15

middle.block87:                                   ; preds = %vector.body91
  %bin.rdx102 = add <4 x i32> %70, %69
  %72 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx102)
  %indvars.iv.next52.2 = add nuw nsw i64 %indvars.iv51.2, 1
  %exitcond54.2.not = icmp eq i64 %indvars.iv.next52.2, 256
  br i1 %exitcond54.2.not, label %73, label %vector.ph89, !llvm.loop !13

73:                                               ; preds = %middle.block87
  %74 = uitofp i32 %42 to float
  %75 = fmul float %74, 0x3EF0000000000000
  %.sroa.0.0.vec.insert = insertelement <2 x float> poison, float %75, i64 0
  %76 = uitofp i32 %57 to float
  %77 = fmul float %76, 0x3EF0000000000000
  %.sroa.0.4.vec.insert = insertelement <2 x float> %.sroa.0.0.vec.insert, float %77, i64 1
  %78 = uitofp i32 %72 to float
  %79 = fmul float %78, 0x3EF0000000000000
  %.sroa.4.8.vec.insert = insertelement <2 x float> poison, float %79, i64 0
  %.sroa.4.12.vec.insert = insertelement <2 x float> %.sroa.4.8.vec.insert, float %22, i64 1
  call void @_ZN17meshopt_AllocatorD2Ev(ptr noundef nonnull align 8 dereferenceable(200) %6) #7
  call void @llvm.lifetime.end.p0(i64 200, ptr nonnull %6) #7
  %.fca.0.insert = insertvalue { <2 x float>, <2 x float> } poison, <2 x float> %.sroa.0.4.vec.insert, 0
  %.fca.1.insert = insertvalue { <2 x float>, <2 x float> } %.fca.0.insert, <2 x float> %.sroa.4.12.vec.insert, 1
  ret { <2 x float>, <2 x float> } %.fca.1.insert

80:                                               ; preds = %58, %43, %.preheader44
  %81 = landingpad { ptr, i32 }
          cleanup
  br label %82

82:                                               ; preds = %27, %80, %25
  %.pn.pn = phi { ptr, i32 } [ %26, %25 ], [ %81, %80 ], [ %28, %27 ]
  call void @_ZN17meshopt_AllocatorD2Ev(ptr noundef nonnull align 8 dereferenceable(200) %6) #7
  call void @llvm.lifetime.end.p0(i64 200, ptr nonnull %6) #7
  resume { ptr, i32 } %.pn.pn
}

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #5

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 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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10, !11, !12}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!"llvm.loop.isvectorized", i32 1}
!12 = !{!"llvm.loop.unroll.runtime.disable"}
!13 = distinct !{!13, !10}
!14 = distinct !{!14, !10, !11, !12}
!15 = distinct !{!15, !10, !11, !12}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,LCSSAPass,LICMPass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass