; LLVM IR from erwincoumans/tiny-differentiable-simulator :: src/visualizer/opengl (tiny_opengl3_app)

; 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.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<unsigned char, std::allocator<unsigned char>>::_Vector_impl" }
%"struct.std::_Vector_base<unsigned char, std::allocator<unsigned char>>::_Vector_impl" = type { %"struct.std::_Vector_base<unsigned char, std::allocator<unsigned char>>::_Vector_impl_data" }
%"struct.std::_Vector_base<unsigned char, std::allocator<unsigned char>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.10" = type { %"struct.std::_Vector_base.11" }
%"struct.std::_Vector_base.11" = type { %"struct.std::_Vector_base<float, std::allocator<float>>::_Vector_impl" }
%"struct.std::_Vector_base<float, std::allocator<float>>::_Vector_impl" = type { %"struct.std::_Vector_base<float, std::allocator<float>>::_Vector_impl_data" }
%"struct.std::_Vector_base<float, std::allocator<float>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.TINY::TinyVector3" = type { float, float, float, i32 }
%struct.TinyOpenGL3App = type { %struct.TinyCommonGraphicsApp.base, ptr, ptr, ptr }
%struct.TinyCommonGraphicsApp.base = type <{ ptr, ptr, ptr, ptr, ptr, i8, i8, i8, i8, float, float, float, float, i8, [3 x i8], [3 x float] }>
%struct.TinyOpenGL3AppInternalData = type { i32, i32, ptr, ptr, ptr, ptr, i32, i32, i32, ptr, ptr, ptr, ptr, i32, i32, i32, i32 }

@_ZL33textured_detailed_sphere_vertices = external hidden constant [48384 x float], align 16
@_ZL32textured_detailed_sphere_indices = external hidden constant [5376 x i32], align 16

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZN4TINY11TinyVector3IfNS_10FloatUtilsEEixEi(ptr noundef nonnull align 4 dereferenceable(16), i32 noundef) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4TINY11TinyVector3IfNS_10FloatUtilsEEC2Ei(ptr noundef nonnull align 4 dereferenceable(16), i32 noundef) unnamed_addr #2 align 2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIhSaIhEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #2 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN14TinyOpenGL3App31register_graphics_capsule_shapeEffii(ptr noundef nonnull align 8 dereferenceable(104) %0, float noundef %1, float noundef %2, i32 noundef %3, i32 noundef %4) unnamed_addr #3 align 2 personality ptr @__gxx_personality_v0 {
  %6 = alloca ptr, align 8
  %7 = alloca float, align 4
  %8 = alloca float, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca %"class.std::vector.0", align 8
  %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
  %23 = alloca i32, align 4
  %24 = alloca i32, align 4
  %25 = alloca i32, align 4
  %26 = alloca i32, align 4
  %27 = alloca i32, align 4
  %28 = alloca i32, align 4
  %29 = alloca %"class.std::vector.10", align 8
  %30 = alloca i32, align 4
  %31 = alloca i32, align 4
  %32 = alloca %"struct.TINY::TinyVector3", align 4
  %33 = alloca %"struct.TINY::TinyVector3", align 4
  %34 = alloca float, align 4
  store ptr %0, ptr %6, align 8, !tbaa !5
  store float %1, ptr %7, align 4, !tbaa !9
  store float %2, ptr %8, align 4, !tbaa !9
  store i32 %3, ptr %9, align 4, !tbaa !11
  store i32 %4, ptr %10, align 4, !tbaa !11
  %35 = load ptr, ptr %6, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  store i32 0, ptr %11, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  store i32 255, ptr %12, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  store i32 0, ptr %13, align 4, !tbaa !11
  %36 = load i32, ptr %10, align 4, !tbaa !11
  %37 = icmp slt i32 %36, 0
  br i1 %37, label %38, label %159

38:                                               ; preds = %5
  %39 = getelementptr inbounds %struct.TinyOpenGL3App, ptr %35, i32 0, i32 1
  %40 = load ptr, ptr %39, align 8, !tbaa !13
  %41 = getelementptr inbounds %struct.TinyOpenGL3AppInternalData, ptr %40, i32 0, i32 8
  %42 = load i32, ptr %41, align 8, !tbaa !17
  %43 = icmp slt i32 %42, 0
  br i1 %43, label %44, label %154

44:                                               ; preds = %38
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  store i32 1024, ptr %14, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #5
  store i32 1024, ptr %15, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 24, ptr %16) #5
  call void @_ZNSt6vectorIhSaIhEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %16) #5
  %45 = load i32, ptr %14, align 4, !tbaa !11
  %46 = load i32, ptr %15, align 4, !tbaa !11
  %47 = mul nsw i32 %45, %46
  %48 = mul nsw i32 %47, 3
  %49 = sext i32 %48 to i64
  invoke void @_ZNSt6vectorIhSaIhEE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) %16, i64 noundef %49)
          to label %50 unwind label %59

50:                                               ; preds = %44
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #5
  store i32 0, ptr %19, align 4, !tbaa !11
  br label %51

51:                                               ; preds = %67, %50
  %52 = load i32, ptr %19, align 4, !tbaa !11
  %53 = load i32, ptr %14, align 4, !tbaa !11
  %54 = load i32, ptr %15, align 4, !tbaa !11
  %55 = mul nsw i32 %53, %54
  %56 = mul nsw i32 %55, 3
  %57 = icmp slt i32 %52, %56
  br i1 %57, label %63, label %58

58:                                               ; preds = %51
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #5
  br label %70

59:                                               ; preds = %140, %44
  %60 = landingpad { ptr, i32 }
          cleanup
  %61 = extractvalue { ptr, i32 } %60, 0
  store ptr %61, ptr %17, align 8
  %62 = extractvalue { ptr, i32 } %60, 1
  store i32 %62, ptr %18, align 4
  call void @_ZNSt6vectorIhSaIhEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %16) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  br label %348

63:                                               ; preds = %51
  %64 = load i32, ptr %19, align 4, !tbaa !11
  %65 = sext i32 %64 to i64
  %66 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIhSaIhEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %16, i64 noundef %65) #5
  store i8 -1, ptr %66, align 1, !tbaa !19
  br label %67

67:                                               ; preds = %63
  %68 = load i32, ptr %19, align 4, !tbaa !11
  %69 = add nsw i32 %68, 1
  store i32 %69, ptr %19, align 4, !tbaa !11
  br label %51, !llvm.loop !20

70:                                               ; preds = %58
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #5
  store i32 0, ptr %20, align 4, !tbaa !11
  br label %71

71:                                               ; preds = %137, %70
  %72 = load i32, ptr %20, align 4, !tbaa !11
  %73 = load i32, ptr %14, align 4, !tbaa !11
  %74 = icmp slt i32 %72, %73
  br i1 %74, label %76, label %75

75:                                               ; preds = %71
  store i32 5, ptr %21, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #5
  br label %140

76:                                               ; preds = %71
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #5
  store i32 0, ptr %22, align 4, !tbaa !11
  br label %77

77:                                               ; preds = %133, %76
  %78 = load i32, ptr %22, align 4, !tbaa !11
  %79 = load i32, ptr %15, align 4, !tbaa !11
  %80 = icmp slt i32 %78, %79
  br i1 %80, label %82, label %81

81:                                               ; preds = %77
  store i32 8, ptr %21, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #5
  br label %136

82:                                               ; preds = %77
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #5
  %83 = load i32, ptr %20, align 4, !tbaa !11
  %84 = load i32, ptr %14, align 4, !tbaa !11
  %85 = sdiv i32 %84, 2
  %86 = icmp slt i32 %83, %85
  %87 = zext i1 %86 to i64
  %88 = select i1 %86, i32 1, i32 0
  store i32 %88, ptr %23, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #5
  %89 = load i32, ptr %22, align 4, !tbaa !11
  %90 = load i32, ptr %14, align 4, !tbaa !11
  %91 = sdiv i32 %90, 2
  %92 = icmp slt i32 %89, %91
  %93 = zext i1 %92 to i64
  %94 = select i1 %92, i32 1, i32 0
  store i32 %94, ptr %24, align 4, !tbaa !11
  %95 = load i32, ptr %23, align 4, !tbaa !11
  %96 = load i32, ptr %24, align 4, !tbaa !11
  %97 = icmp eq i32 %95, %96
  br i1 %97, label %98, label %132

98:                                               ; preds = %82
  %99 = load i32, ptr %11, align 4, !tbaa !11
  %100 = trunc i32 %99 to i8
  %101 = load i32, ptr %20, align 4, !tbaa !11
  %102 = load i32, ptr %22, align 4, !tbaa !11
  %103 = load i32, ptr %14, align 4, !tbaa !11
  %104 = mul nsw i32 %102, %103
  %105 = add nsw i32 %101, %104
  %106 = mul nsw i32 %105, 3
  %107 = add nsw i32 %106, 0
  %108 = sext i32 %107 to i64
  %109 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIhSaIhEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %16, i64 noundef %108) #5
  store i8 %100, ptr %109, align 1, !tbaa !19
  %110 = load i32, ptr %12, align 4, !tbaa !11
  %111 = trunc i32 %110 to i8
  %112 = load i32, ptr %20, align 4, !tbaa !11
  %113 = load i32, ptr %22, align 4, !tbaa !11
  %114 = load i32, ptr %14, align 4, !tbaa !11
  %115 = mul nsw i32 %113, %114
  %116 = add nsw i32 %112, %115
  %117 = mul nsw i32 %116, 3
  %118 = add nsw i32 %117, 1
  %119 = sext i32 %118 to i64
  %120 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIhSaIhEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %16, i64 noundef %119) #5
  store i8 %111, ptr %120, align 1, !tbaa !19
  %121 = load i32, ptr %13, align 4, !tbaa !11
  %122 = trunc i32 %121 to i8
  %123 = load i32, ptr %20, align 4, !tbaa !11
  %124 = load i32, ptr %22, align 4, !tbaa !11
  %125 = load i32, ptr %14, align 4, !tbaa !11
  %126 = mul nsw i32 %124, %125
  %127 = add nsw i32 %123, %126
  %128 = mul nsw i32 %127, 3
  %129 = add nsw i32 %128, 2
  %130 = sext i32 %129 to i64
  %131 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIhSaIhEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %16, i64 noundef %130) #5
  store i8 %122, ptr %131, align 1, !tbaa !19
  br label %132

132:                                              ; preds = %98, %82
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #5
  br label %133

133:                                              ; preds = %132
  %134 = load i32, ptr %22, align 4, !tbaa !11
  %135 = add nsw i32 %134, 1
  store i32 %135, ptr %22, align 4, !tbaa !11
  br label %77, !llvm.loop !22

136:                                              ; preds = %81
  br label %137

137:                                              ; preds = %136
  %138 = load i32, ptr %20, align 4, !tbaa !11
  %139 = add nsw i32 %138, 1
  store i32 %139, ptr %20, align 4, !tbaa !11
  br label %71, !llvm.loop !23

140:                                              ; preds = %75
  %141 = getelementptr inbounds %struct.TinyOpenGL3App, ptr %35, i32 0, i32 3
  %142 = load ptr, ptr %141, align 8, !tbaa !24
  %143 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIhSaIhEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %16, i64 noundef 0) #5
  %144 = load i32, ptr %14, align 4, !tbaa !11
  %145 = load i32, ptr %15, align 4, !tbaa !11
  %146 = load ptr, ptr %142, align 8, !tbaa !25
  %147 = getelementptr inbounds ptr, ptr %146, i64 11
  %148 = load ptr, ptr %147, align 8
  %149 = invoke noundef i32 %148(ptr noundef nonnull align 8 dereferenceable(60) %142, ptr noundef %143, i32 noundef %144, i32 noundef %145, i1 noundef zeroext true)
          to label %150 unwind label %59

150:                                              ; preds = %140
  %151 = getelementptr inbounds %struct.TinyOpenGL3App, ptr %35, i32 0, i32 1
  %152 = load ptr, ptr %151, align 8, !tbaa !13
  %153 = getelementptr inbounds %struct.TinyOpenGL3AppInternalData, ptr %152, i32 0, i32 8
  store i32 %149, ptr %153, align 8, !tbaa !17
  call void @_ZNSt6vectorIhSaIhEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %16) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  br label %154

154:                                              ; preds = %150, %38
  %155 = getelementptr inbounds %struct.TinyOpenGL3App, ptr %35, i32 0, i32 1
  %156 = load ptr, ptr %155, align 8, !tbaa !13
  %157 = getelementptr inbounds %struct.TinyOpenGL3AppInternalData, ptr %156, i32 0, i32 8
  %158 = load i32, ptr %157, align 8, !tbaa !17
  store i32 %158, ptr %10, align 4, !tbaa !11
  br label %159

159:                                              ; preds = %154, %5
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #5
  store i32 36, ptr %25, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #5
  store i32 -1, ptr %26, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #5
  %160 = load i32, ptr %25, align 4, !tbaa !11
  %161 = sext i32 %160 to i64
  %162 = udiv i64 193536, %161
  %163 = trunc i64 %162 to i32
  store i32 %163, ptr %27, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #5
  store i32 5376, ptr %28, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 24, ptr %29) #5
  call void @_ZNSt6vectorIfSaIfEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %29) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %30) #5
  %164 = load i32, ptr %25, align 4, !tbaa !11
  %165 = sext i32 %164 to i64
  %166 = udiv i64 193536, %165
  %167 = trunc i64 %166 to i32
  store i32 %167, ptr %30, align 4, !tbaa !11
  %168 = load i32, ptr %30, align 4, !tbaa !11
  %169 = mul nsw i32 %168, 9
  %170 = sext i32 %169 to i64
  invoke void @_ZNSt6vectorIfSaIfEE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) %29, i64 noundef %170)
          to label %171 unwind label %177

171:                                              ; preds = %159
  call void @llvm.lifetime.start.p0(i64 4, ptr %31) #5
  store i32 0, ptr %31, align 4, !tbaa !11
  br label %172

172:                                              ; preds = %324, %171
  %173 = load i32, ptr %31, align 4, !tbaa !11
  %174 = load i32, ptr %30, align 4, !tbaa !11
  %175 = icmp slt i32 %173, %174
  br i1 %175, label %181, label %176

176:                                              ; preds = %172
  store i32 11, ptr %21, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %31) #5
  br label %329

177:                                              ; preds = %159
  %178 = landingpad { ptr, i32 }
          cleanup
  %179 = extractvalue { ptr, i32 } %178, 0
  store ptr %179, ptr %17, align 8
  %180 = extractvalue { ptr, i32 } %178, 1
  store i32 %180, ptr %18, align 4
  br label %342

181:                                              ; preds = %172
  call void @llvm.lifetime.start.p0(i64 16, ptr %32) #5
  invoke void @_ZN4TINY11TinyVector3IfNS_10FloatUtilsEEC2Ei(ptr noundef nonnull align 4 dereferenceable(16) %32, i32 noundef 0)
          to label %182 unwind label %214

182:                                              ; preds = %181
  %183 = load i32, ptr %31, align 4, !tbaa !11
  %184 = mul nsw i32 %183, 9
  %185 = add nsw i32 %184, 0
  %186 = sext i32 %185 to i64
  %187 = getelementptr inbounds [48384 x float], ptr @_ZL33textured_detailed_sphere_vertices, i64 0, i64 %186
  %188 = load i32, ptr %31, align 4, !tbaa !11
  %189 = mul nsw i32 %188, 9
  %190 = add nsw i32 %189, 1
  %191 = sext i32 %190 to i64
  %192 = getelementptr inbounds [48384 x float], ptr @_ZL33textured_detailed_sphere_vertices, i64 0, i64 %191
  %193 = load i32, ptr %31, align 4, !tbaa !11
  %194 = mul nsw i32 %193, 9
  %195 = add nsw i32 %194, 2
  %196 = sext i32 %195 to i64
  %197 = getelementptr inbounds [48384 x float], ptr @_ZL33textured_detailed_sphere_vertices, i64 0, i64 %196
  invoke void @_ZN4TINY11TinyVector3IfNS_10FloatUtilsEE8setValueERKfS4_S4_(ptr noundef nonnull align 4 dereferenceable(16) %32, ptr noundef nonnull align 4 dereferenceable(4) %187, ptr noundef nonnull align 4 dereferenceable(4) %192, ptr noundef nonnull align 4 dereferenceable(4) %197)
          to label %198 unwind label %214

198:                                              ; preds = %182
  call void @llvm.lifetime.start.p0(i64 16, ptr %33) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %34) #5
  %199 = load float, ptr %7, align 4, !tbaa !9
  %200 = fmul float 2.000000e+00, %199
  store float %200, ptr %34, align 4, !tbaa !9
  invoke void @_ZN4TINYmlIfNS_10FloatUtilsEEENS_11TinyVector3IT_T0_EERKS3_RKS5_(ptr dead_on_unwind writable sret(%"struct.TINY::TinyVector3") align 4 %33, ptr noundef nonnull align 4 dereferenceable(4) %34, ptr noundef nonnull align 4 dereferenceable(16) %32)
          to label %201 unwind label %218

201:                                              ; preds = %198
  call void @llvm.lifetime.end.p0(i64 4, ptr %34) #5
  %202 = load i32, ptr %9, align 4, !tbaa !11
  %203 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN4TINY11TinyVector3IfNS_10FloatUtilsEEixEi(ptr noundef nonnull align 4 dereferenceable(16) %33, i32 noundef %202)
          to label %204 unwind label %222

204:                                              ; preds = %201
  %205 = load float, ptr %203, align 4, !tbaa !9
  %206 = fcmp ogt float %205, 0.000000e+00
  br i1 %206, label %207, label %226

207:                                              ; preds = %204
  %208 = load float, ptr %8, align 4, !tbaa !9
  %209 = load i32, ptr %9, align 4, !tbaa !11
  %210 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN4TINY11TinyVector3IfNS_10FloatUtilsEEixEi(ptr noundef nonnull align 4 dereferenceable(16) %33, i32 noundef %209)
          to label %211 unwind label %222

211:                                              ; preds = %207
  %212 = load float, ptr %210, align 4, !tbaa !9
  %213 = fadd float %212, %208
  store float %213, ptr %210, align 4, !tbaa !9
  br label %233

214:                                              ; preds = %182, %181
  %215 = landingpad { ptr, i32 }
          cleanup
  %216 = extractvalue { ptr, i32 } %215, 0
  store ptr %216, ptr %17, align 8
  %217 = extractvalue { ptr, i32 } %215, 1
  store i32 %217, ptr %18, align 4
  br label %328

218:                                              ; preds = %198
  %219 = landingpad { ptr, i32 }
          cleanup
  %220 = extractvalue { ptr, i32 } %219, 0
  store ptr %220, ptr %17, align 8
  %221 = extractvalue { ptr, i32 } %219, 1
  store i32 %221, ptr %18, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %34) #5
  br label %327

222:                                              ; preds = %243, %235, %233, %226, %207, %201
  %223 = landingpad { ptr, i32 }
          cleanup
  %224 = extractvalue { ptr, i32 } %223, 0
  store ptr %224, ptr %17, align 8
  %225 = extractvalue { ptr, i32 } %223, 1
  store i32 %225, ptr %18, align 4
  br label %327

226:                                              ; preds = %204
  %227 = load float, ptr %8, align 4, !tbaa !9
  %228 = load i32, ptr %9, align 4, !tbaa !11
  %229 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN4TINY11TinyVector3IfNS_10FloatUtilsEEixEi(ptr noundef nonnull align 4 dereferenceable(16) %33, i32 noundef %228)
          to label %230 unwind label %222

230:                                              ; preds = %226
  %231 = load float, ptr %229, align 4, !tbaa !9
  %232 = fsub float %231, %227
  store float %232, ptr %229, align 4, !tbaa !9
  br label %233

233:                                              ; preds = %230, %211
  %234 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN4TINY11TinyVector3IfNS_10FloatUtilsEEixEi(ptr noundef nonnull align 4 dereferenceable(16) %33, i32 noundef 0)
          to label %235 unwind label %222

235:                                              ; preds = %233
  %236 = load float, ptr %234, align 4, !tbaa !9
  %237 = load i32, ptr %31, align 4, !tbaa !11
  %238 = mul nsw i32 %237, 9
  %239 = add nsw i32 %238, 0
  %240 = sext i32 %239 to i64
  %241 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIfSaIfEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %29, i64 noundef %240) #5
  store float %236, ptr %241, align 4, !tbaa !9
  %242 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN4TINY11TinyVector3IfNS_10FloatUtilsEEixEi(ptr noundef nonnull align 4 dereferenceable(16) %33, i32 noundef 1)
          to label %243 unwind label %222

243:                                              ; preds = %235
  %244 = load float, ptr %242, align 4, !tbaa !9
  %245 = load i32, ptr %31, align 4, !tbaa !11
  %246 = mul nsw i32 %245, 9
  %247 = add nsw i32 %246, 1
  %248 = sext i32 %247 to i64
  %249 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIfSaIfEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %29, i64 noundef %248) #5
  store float %244, ptr %249, align 4, !tbaa !9
  %250 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN4TINY11TinyVector3IfNS_10FloatUtilsEEixEi(ptr noundef nonnull align 4 dereferenceable(16) %33, i32 noundef 2)
          to label %251 unwind label %222

251:                                              ; preds = %243
  %252 = load float, ptr %250, align 4, !tbaa !9
  %253 = load i32, ptr %31, align 4, !tbaa !11
  %254 = mul nsw i32 %253, 9
  %255 = add nsw i32 %254, 2
  %256 = sext i32 %255 to i64
  %257 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIfSaIfEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %29, i64 noundef %256) #5
  store float %252, ptr %257, align 4, !tbaa !9
  %258 = load i32, ptr %31, align 4, !tbaa !11
  %259 = mul nsw i32 %258, 9
  %260 = add nsw i32 %259, 3
  %261 = sext i32 %260 to i64
  %262 = getelementptr inbounds [48384 x float], ptr @_ZL33textured_detailed_sphere_vertices, i64 0, i64 %261
  %263 = load float, ptr %262, align 4, !tbaa !9
  %264 = load i32, ptr %31, align 4, !tbaa !11
  %265 = mul nsw i32 %264, 9
  %266 = add nsw i32 %265, 3
  %267 = sext i32 %266 to i64
  %268 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIfSaIfEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %29, i64 noundef %267) #5
  store float %263, ptr %268, align 4, !tbaa !9
  %269 = load i32, ptr %31, align 4, !tbaa !11
  %270 = mul nsw i32 %269, 9
  %271 = add nsw i32 %270, 4
  %272 = sext i32 %271 to i64
  %273 = getelementptr inbounds [48384 x float], ptr @_ZL33textured_detailed_sphere_vertices, i64 0, i64 %272
  %274 = load float, ptr %273, align 4, !tbaa !9
  %275 = load i32, ptr %31, align 4, !tbaa !11
  %276 = mul nsw i32 %275, 9
  %277 = add nsw i32 %276, 4
  %278 = sext i32 %277 to i64
  %279 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIfSaIfEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %29, i64 noundef %278) #5
  store float %274, ptr %279, align 4, !tbaa !9
  %280 = load i32, ptr %31, align 4, !tbaa !11
  %281 = mul nsw i32 %280, 9
  %282 = add nsw i32 %281, 5
  %283 = sext i32 %282 to i64
  %284 = getelementptr inbounds [48384 x float], ptr @_ZL33textured_detailed_sphere_vertices, i64 0, i64 %283
  %285 = load float, ptr %284, align 4, !tbaa !9
  %286 = load i32, ptr %31, align 4, !tbaa !11
  %287 = mul nsw i32 %286, 9
  %288 = add nsw i32 %287, 5
  %289 = sext i32 %288 to i64
  %290 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIfSaIfEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %29, i64 noundef %289) #5
  store float %285, ptr %290, align 4, !tbaa !9
  %291 = load i32, ptr %31, align 4, !tbaa !11
  %292 = mul nsw i32 %291, 9
  %293 = add nsw i32 %292, 6
  %294 = sext i32 %293 to i64
  %295 = getelementptr inbounds [48384 x float], ptr @_ZL33textured_detailed_sphere_vertices, i64 0, i64 %294
  %296 = load float, ptr %295, align 4, !tbaa !9
  %297 = load i32, ptr %31, align 4, !tbaa !11
  %298 = mul nsw i32 %297, 9
  %299 = add nsw i32 %298, 6
  %300 = sext i32 %299 to i64
  %301 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIfSaIfEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %29, i64 noundef %300) #5
  store float %296, ptr %301, align 4, !tbaa !9
  %302 = load i32, ptr %31, align 4, !tbaa !11
  %303 = mul nsw i32 %302, 9
  %304 = add nsw i32 %303, 7
  %305 = sext i32 %304 to i64
  %306 = getelementptr inbounds [48384 x float], ptr @_ZL33textured_detailed_sphere_vertices, i64 0, i64 %305
  %307 = load float, ptr %306, align 4, !tbaa !9
  %308 = load i32, ptr %31, align 4, !tbaa !11
  %309 = mul nsw i32 %308, 9
  %310 = add nsw i32 %309, 7
  %311 = sext i32 %310 to i64
  %312 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIfSaIfEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %29, i64 noundef %311) #5
  store float %307, ptr %312, align 4, !tbaa !9
  %313 = load i32, ptr %31, align 4, !tbaa !11
  %314 = mul nsw i32 %313, 9
  %315 = add nsw i32 %314, 8
  %316 = sext i32 %315 to i64
  %317 = getelementptr inbounds [48384 x float], ptr @_ZL33textured_detailed_sphere_vertices, i64 0, i64 %316
  %318 = load float, ptr %317, align 4, !tbaa !9
  %319 = load i32, ptr %31, align 4, !tbaa !11
  %320 = mul nsw i32 %319, 9
  %321 = add nsw i32 %320, 8
  %322 = sext i32 %321 to i64
  %323 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIfSaIfEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %29, i64 noundef %322) #5
  store float %318, ptr %323, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 16, ptr %33) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %32) #5
  br label %324

324:                                              ; preds = %251
  %325 = load i32, ptr %31, align 4, !tbaa !11
  %326 = add nsw i32 %325, 1
  store i32 %326, ptr %31, align 4, !tbaa !11
  br label %172, !llvm.loop !27

327:                                              ; preds = %222, %218
  call void @llvm.lifetime.end.p0(i64 16, ptr %33) #5
  br label %328

328:                                              ; preds = %327, %214
  call void @llvm.lifetime.end.p0(i64 16, ptr %32) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %31) #5
  br label %342

329:                                              ; preds = %176
  call void @llvm.lifetime.end.p0(i64 4, ptr %30) #5
  %330 = getelementptr inbounds %struct.TinyOpenGL3App, ptr %35, i32 0, i32 3
  %331 = load ptr, ptr %330, align 8, !tbaa !24
  %332 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIfSaIfEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %29, i64 noundef 0) #5
  %333 = load i32, ptr %27, align 4, !tbaa !11
  %334 = load i32, ptr %28, align 4, !tbaa !11
  %335 = load i32, ptr %10, align 4, !tbaa !11
  %336 = load ptr, ptr %331, align 8, !tbaa !25
  %337 = getelementptr inbounds ptr, ptr %336, i64 9
  %338 = load ptr, ptr %337, align 8
  %339 = invoke noundef i32 %338(ptr noundef nonnull align 8 dereferenceable(60) %331, ptr noundef %332, i32 noundef %333, ptr noundef @_ZL32textured_detailed_sphere_indices, i32 noundef %334, i32 noundef 1, i32 noundef %335)
          to label %340 unwind label %343

340:                                              ; preds = %329
  store i32 %339, ptr %26, align 4, !tbaa !11
  %341 = load i32, ptr %26, align 4, !tbaa !11
  store i32 1, ptr %21, align 4
  call void @_ZNSt6vectorIfSaIfEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %29) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %29) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  ret i32 %341

342:                                              ; preds = %328, %177
  call void @llvm.lifetime.end.p0(i64 4, ptr %30) #5
  br label %347

343:                                              ; preds = %329
  %344 = landingpad { ptr, i32 }
          cleanup
  %345 = extractvalue { ptr, i32 } %344, 0
  store ptr %345, ptr %17, align 8
  %346 = extractvalue { ptr, i32 } %344, 1
  store i32 %346, ptr %18, align 4
  br label %347

347:                                              ; preds = %343, %342
  call void @_ZNSt6vectorIfSaIfEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %29) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %29) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #5
  br label %348

348:                                              ; preds = %347, %59
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  br label %349

349:                                              ; preds = %348
  %350 = load ptr, ptr %17, align 8
  %351 = load i32, ptr %18, align 4
  %352 = insertvalue { ptr, i32 } poison, ptr %350, 0
  %353 = insertvalue { ptr, i32 } %352, i32 %351, 1
  resume { ptr, i32 } %353
}

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4TINY11TinyVector3IfNS_10FloatUtilsEE8setValueERKfS4_S4_(ptr noundef nonnull align 4 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN4TINYmlIfNS_10FloatUtilsEEENS_11TinyVector3IT_T0_EERKS3_RKS5_(ptr dead_on_unwind noalias writable sret(%"struct.TINY::TinyVector3") align 4, ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(16)) #4

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { inlinehint 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 #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 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 = { 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 #5 = { 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 = !{!"float", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!14, !6, i64 80}
!14 = !{!"_ZTS14TinyOpenGL3App", !15, i64 0, !6, i64 80, !6, i64 88, !6, i64 96}
!15 = !{!"_ZTS21TinyCommonGraphicsApp", !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !16, i64 40, !16, i64 41, !16, i64 42, !10, i64 44, !10, i64 48, !10, i64 52, !10, i64 56, !16, i64 60, !7, i64 64}
!16 = !{!"bool", !7, i64 0}
!17 = !{!18, !12, i64 48}
!18 = !{!"_ZTS26TinyOpenGL3AppInternalData", !12, i64 0, !12, i64 4, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !12, i64 40, !12, i64 44, !12, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !12, i64 88, !12, i64 92, !12, i64 96, !12, i64 100}
!19 = !{!7, !7, i64 0}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.mustprogress"}
!22 = distinct !{!22, !21}
!23 = distinct !{!23, !21}
!24 = !{!14, !6, i64 96}
!25 = !{!26, !26, i64 0}
!26 = !{!"vtable pointer", !8, i64 0}
!27 = distinct !{!27, !21}


; 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.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<unsigned char, std::allocator<unsigned char>>::_Vector_impl" }
%"struct.std::_Vector_base<unsigned char, std::allocator<unsigned char>>::_Vector_impl" = type { %"struct.std::_Vector_base<unsigned char, std::allocator<unsigned char>>::_Vector_impl_data" }
%"struct.std::_Vector_base<unsigned char, std::allocator<unsigned char>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.10" = type { %"struct.std::_Vector_base.11" }
%"struct.std::_Vector_base.11" = type { %"struct.std::_Vector_base<float, std::allocator<float>>::_Vector_impl" }
%"struct.std::_Vector_base<float, std::allocator<float>>::_Vector_impl" = type { %"struct.std::_Vector_base<float, std::allocator<float>>::_Vector_impl_data" }
%"struct.std::_Vector_base<float, std::allocator<float>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.TINY::TinyVector3" = type { float, float, float, i32 }

@_ZL33textured_detailed_sphere_vertices = external hidden constant [48384 x float], align 16
@_ZL32textured_detailed_sphere_indices = external hidden constant [5376 x i32], align 16

declare i32 @__gxx_personality_v0(...)

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZN4TINY11TinyVector3IfNS_10FloatUtilsEEixEi(ptr noundef nonnull align 4 dereferenceable(16), i32 noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4TINY11TinyVector3IfNS_10FloatUtilsEEC2Ei(ptr noundef nonnull align 4 dereferenceable(16), i32 noundef) unnamed_addr #2 align 2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIhSaIhEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #2 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN14TinyOpenGL3App31register_graphics_capsule_shapeEffii(ptr nocapture noundef nonnull readonly align 8 dereferenceable(104) %0, float noundef %1, float noundef %2, i32 noundef %3, i32 noundef %4) unnamed_addr #3 align 2 personality ptr @__gxx_personality_v0 {
  %6 = alloca %"class.std::vector.0", align 8
  %7 = alloca %"class.std::vector.10", align 8
  %8 = alloca %"struct.TINY::TinyVector3", align 4
  %9 = alloca %"struct.TINY::TinyVector3", align 4
  %10 = alloca float, align 4
  %11 = icmp slt i32 %4, 0
  br i1 %11, label %12, label %48

12:                                               ; preds = %5
  %13 = getelementptr inbounds i8, ptr %0, i64 80
  %14 = load ptr, ptr %13, align 8, !tbaa !5
  %15 = getelementptr inbounds i8, ptr %14, i64 48
  %16 = load i32, ptr %15, align 8, !tbaa !13
  %17 = icmp slt i32 %16, 0
  br i1 %17, label %18, label %48

18:                                               ; preds = %12
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %6) #5
  call void @_ZNSt6vectorIhSaIhEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #5
  invoke void @_ZNSt6vectorIhSaIhEE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) %6, i64 noundef 3145728)
          to label %.preheader84 unwind label %19

19:                                               ; preds = %23, %18
  %20 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt6vectorIhSaIhEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #5
  br label %113

.preheader84:                                     ; preds = %18, %.preheader84
  %indvars.iv = phi i64 [ %indvars.iv.next, %.preheader84 ], [ 0, %18 ]
  %21 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIhSaIhEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %6, i64 noundef %indvars.iv) #5
  store i8 -1, ptr %21, align 1, !tbaa !16
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, 3145728
  br i1 %exitcond.not, label %.preheader82, label %.preheader84, !llvm.loop !17

.preheader82:                                     ; preds = %.preheader84, %31
  %indvars.iv94 = phi i64 [ %indvars.iv.next95, %31 ], [ 0, %.preheader84 ]
  %22 = icmp ult i64 %indvars.iv94, 512
  br label %32

23:                                               ; preds = %31
  %24 = getelementptr inbounds i8, ptr %0, i64 96
  %25 = load ptr, ptr %24, align 8, !tbaa !19
  %26 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIhSaIhEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %6, i64 noundef 0) #5
  %27 = load ptr, ptr %25, align 8, !tbaa !20
  %28 = getelementptr inbounds i8, ptr %27, i64 88
  %29 = load ptr, ptr %28, align 8
  %30 = invoke noundef i32 %29(ptr noundef nonnull align 8 dereferenceable(60) %25, ptr noundef nonnull %26, i32 noundef 1024, i32 noundef 1024, i1 noundef zeroext true)
          to label %45 unwind label %19

31:                                               ; preds = %44
  %indvars.iv.next95 = add nuw nsw i64 %indvars.iv94, 1
  %exitcond97.not = icmp eq i64 %indvars.iv.next95, 1024
  br i1 %exitcond97.not, label %23, label %.preheader82, !llvm.loop !22

32:                                               ; preds = %.preheader82, %44
  %indvars.iv90 = phi i64 [ 0, %.preheader82 ], [ %indvars.iv.next91, %44 ]
  %33 = icmp ugt i64 %indvars.iv90, 511
  %34 = xor i1 %22, %33
  br i1 %34, label %35, label %44

35:                                               ; preds = %32
  %36 = shl nuw nsw i64 %indvars.iv90, 10
  %37 = add nuw nsw i64 %36, %indvars.iv94
  %38 = mul nuw nsw i64 %37, 3
  %39 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIhSaIhEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %6, i64 noundef %38) #5
  store i8 0, ptr %39, align 1, !tbaa !16
  %40 = add nuw nsw i64 %38, 1
  %41 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIhSaIhEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %6, i64 noundef %40) #5
  store i8 -1, ptr %41, align 1, !tbaa !16
  %42 = add nuw nsw i64 %38, 2
  %43 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNSt6vectorIhSaIhEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %6, i64 noundef %42) #5
  store i8 0, ptr %43, align 1, !tbaa !16
  br label %44

44:                                               ; preds = %35, %32
  %indvars.iv.next91 = add nuw nsw i64 %indvars.iv90, 1
  %exitcond93.not = icmp eq i64 %indvars.iv.next91, 1024
  br i1 %exitcond93.not, label %31, label %32, !llvm.loop !23

45:                                               ; preds = %23
  %46 = load ptr, ptr %13, align 8, !tbaa !5
  %47 = getelementptr inbounds i8, ptr %46, i64 48
  store i32 %30, ptr %47, align 8, !tbaa !13
  call void @_ZNSt6vectorIhSaIhEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #5
  %.pre = load ptr, ptr %13, align 8, !tbaa !5
  %.phi.trans.insert = getelementptr inbounds i8, ptr %.pre, i64 48
  %.pre102 = load i32, ptr %.phi.trans.insert, align 8, !tbaa !13
  br label %48

48:                                               ; preds = %12, %45, %5
  %.070 = phi i32 [ %4, %5 ], [ %.pre102, %45 ], [ %16, %12 ]
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %7) #5
  call void @_ZNSt6vectorIfSaIfEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #5
  invoke void @_ZNSt6vectorIfSaIfEE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) %7, i64 noundef 48384)
          to label %.preheader unwind label %59

.preheader:                                       ; preds = %48
  %49 = fmul float %1, 2.000000e+00
  %50 = fneg float %2
  br label %61

51:                                               ; preds = %68
  %52 = getelementptr inbounds i8, ptr %0, i64 96
  %53 = load ptr, ptr %52, align 8, !tbaa !19
  %54 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIfSaIfEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %7, i64 noundef 0) #5
  %55 = load ptr, ptr %53, align 8, !tbaa !20
  %56 = getelementptr inbounds i8, ptr %55, i64 72
  %57 = load ptr, ptr %56, align 8
  %58 = invoke noundef i32 %57(ptr noundef nonnull align 8 dereferenceable(60) %53, ptr noundef nonnull %54, i32 noundef 5376, ptr noundef nonnull @_ZL32textured_detailed_sphere_indices, i32 noundef 5376, i32 noundef 1, i32 noundef %.070)
          to label %109 unwind label %110

59:                                               ; preds = %48
  %60 = landingpad { ptr, i32 }
          cleanup
  br label %112

61:                                               ; preds = %.preheader, %68
  %indvars.iv98 = phi i64 [ 0, %.preheader ], [ %indvars.iv.next99, %68 ]
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %8) #5
  call void @_ZN4TINY11TinyVector3IfNS_10FloatUtilsEEC2Ei(ptr noundef nonnull align 4 dereferenceable(16) %8, i32 noundef 0)
  %62 = mul nuw nsw i64 %indvars.iv98, 9
  %63 = getelementptr inbounds [48384 x float], ptr @_ZL33textured_detailed_sphere_vertices, i64 0, i64 %62
  %64 = add nuw nsw i64 %62, 1
  %65 = getelementptr inbounds [48384 x float], ptr @_ZL33textured_detailed_sphere_vertices, i64 0, i64 %64
  %66 = add nuw nsw i64 %62, 2
  %67 = getelementptr inbounds [48384 x float], ptr @_ZL33textured_detailed_sphere_vertices, i64 0, i64 %66
  call void @_ZN4TINY11TinyVector3IfNS_10FloatUtilsEE8setValueERKfS4_S4_(ptr noundef nonnull align 4 dereferenceable(16) %8, ptr noundef nonnull align 4 dereferenceable(4) %63, ptr noundef nonnull align 4 dereferenceable(4) %65, ptr noundef nonnull align 4 dereferenceable(4) %67)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %9) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %10) #5
  store float %49, ptr %10, align 4, !tbaa !24
  invoke void @_ZN4TINYmlIfNS_10FloatUtilsEEENS_11TinyVector3IT_T0_EERKS3_RKS5_(ptr dead_on_unwind nonnull writable sret(%"struct.TINY::TinyVector3") align 4 %9, ptr noundef nonnull align 4 dereferenceable(4) %10, ptr noundef nonnull align 4 dereferenceable(16) %8)
          to label %68 unwind label %107

68:                                               ; preds = %61
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #5
  %69 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN4TINY11TinyVector3IfNS_10FloatUtilsEEixEi(ptr noundef nonnull align 4 dereferenceable(16) %9, i32 noundef %3)
  %70 = load float, ptr %69, align 4, !tbaa !24
  %71 = fcmp ogt float %70, 0.000000e+00
  %72 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN4TINY11TinyVector3IfNS_10FloatUtilsEEixEi(ptr noundef nonnull align 4 dereferenceable(16) %9, i32 noundef %3)
  %73 = load float, ptr %72, align 4, !tbaa !24
  %.sink.p = select i1 %71, float %2, float %50
  %.sink = fadd float %73, %.sink.p
  store float %.sink, ptr %72, align 4, !tbaa !24
  %74 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN4TINY11TinyVector3IfNS_10FloatUtilsEEixEi(ptr noundef nonnull align 4 dereferenceable(16) %9, i32 noundef 0)
  %75 = load float, ptr %74, align 4, !tbaa !24
  %76 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIfSaIfEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %7, i64 noundef %62) #5
  store float %75, ptr %76, align 4, !tbaa !24
  %77 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN4TINY11TinyVector3IfNS_10FloatUtilsEEixEi(ptr noundef nonnull align 4 dereferenceable(16) %9, i32 noundef 1)
  %78 = load float, ptr %77, align 4, !tbaa !24
  %79 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIfSaIfEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %7, i64 noundef %64) #5
  store float %78, ptr %79, align 4, !tbaa !24
  %80 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN4TINY11TinyVector3IfNS_10FloatUtilsEEixEi(ptr noundef nonnull align 4 dereferenceable(16) %9, i32 noundef 2)
  %81 = load float, ptr %80, align 4, !tbaa !24
  %82 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIfSaIfEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %7, i64 noundef %66) #5
  store float %81, ptr %82, align 4, !tbaa !24
  %83 = add nuw nsw i64 %62, 3
  %84 = getelementptr inbounds [48384 x float], ptr @_ZL33textured_detailed_sphere_vertices, i64 0, i64 %83
  %85 = load float, ptr %84, align 4, !tbaa !24
  %86 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIfSaIfEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %7, i64 noundef %83) #5
  store float %85, ptr %86, align 4, !tbaa !24
  %87 = add nuw nsw i64 %62, 4
  %88 = getelementptr inbounds [48384 x float], ptr @_ZL33textured_detailed_sphere_vertices, i64 0, i64 %87
  %89 = load float, ptr %88, align 4, !tbaa !24
  %90 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIfSaIfEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %7, i64 noundef %87) #5
  store float %89, ptr %90, align 4, !tbaa !24
  %91 = add nuw nsw i64 %62, 5
  %92 = getelementptr inbounds [48384 x float], ptr @_ZL33textured_detailed_sphere_vertices, i64 0, i64 %91
  %93 = load float, ptr %92, align 4, !tbaa !24
  %94 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIfSaIfEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %7, i64 noundef %91) #5
  store float %93, ptr %94, align 4, !tbaa !24
  %95 = add nuw nsw i64 %62, 6
  %96 = getelementptr inbounds [48384 x float], ptr @_ZL33textured_detailed_sphere_vertices, i64 0, i64 %95
  %97 = load float, ptr %96, align 4, !tbaa !24
  %98 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIfSaIfEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %7, i64 noundef %95) #5
  store float %97, ptr %98, align 4, !tbaa !24
  %99 = add nuw nsw i64 %62, 7
  %100 = getelementptr inbounds [48384 x float], ptr @_ZL33textured_detailed_sphere_vertices, i64 0, i64 %99
  %101 = load float, ptr %100, align 4, !tbaa !24
  %102 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIfSaIfEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %7, i64 noundef %99) #5
  store float %101, ptr %102, align 4, !tbaa !24
  %103 = add nuw nsw i64 %62, 8
  %104 = getelementptr inbounds [48384 x float], ptr @_ZL33textured_detailed_sphere_vertices, i64 0, i64 %103
  %105 = load float, ptr %104, align 4, !tbaa !24
  %106 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIfSaIfEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %7, i64 noundef %103) #5
  store float %105, ptr %106, align 4, !tbaa !24
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %9) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %8) #5
  %indvars.iv.next99 = add nuw nsw i64 %indvars.iv98, 1
  %exitcond101.not = icmp eq i64 %indvars.iv.next99, 5376
  br i1 %exitcond101.not, label %51, label %61, !llvm.loop !25

107:                                              ; preds = %61
  %108 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %9) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %8) #5
  br label %112

109:                                              ; preds = %51
  call void @_ZNSt6vectorIfSaIfEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #5
  ret i32 %58

110:                                              ; preds = %51
  %111 = landingpad { ptr, i32 }
          cleanup
  br label %112

112:                                              ; preds = %59, %107, %110
  %.pn.pn = phi { ptr, i32 } [ %111, %110 ], [ %108, %107 ], [ %60, %59 ]
  call void @_ZNSt6vectorIfSaIfEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #5
  br label %113

113:                                              ; preds = %112, %19
  %.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn, %112 ], [ %20, %19 ]
  resume { ptr, i32 } %.pn.pn.pn
}

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4TINY11TinyVector3IfNS_10FloatUtilsEE8setValueERKfS4_S4_(ptr noundef nonnull align 4 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN4TINYmlIfNS_10FloatUtilsEEENS_11TinyVector3IT_T0_EERKS3_RKS5_(ptr dead_on_unwind noalias writable sret(%"struct.TINY::TinyVector3") align 4, ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(16)) local_unnamed_addr #4

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

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { inlinehint 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 #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 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 = { 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 #5 = { 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, !8, i64 80}
!6 = !{!"_ZTS14TinyOpenGL3App", !7, i64 0, !8, i64 80, !8, i64 88, !8, i64 96}
!7 = !{!"_ZTS21TinyCommonGraphicsApp", !8, i64 8, !8, i64 16, !8, i64 24, !8, i64 32, !11, i64 40, !11, i64 41, !11, i64 42, !12, i64 44, !12, i64 48, !12, i64 52, !12, i64 56, !11, i64 60, !9, i64 64}
!8 = !{!"any pointer", !9, i64 0}
!9 = !{!"omnipotent char", !10, i64 0}
!10 = !{!"Simple C++ TBAA"}
!11 = !{!"bool", !9, i64 0}
!12 = !{!"float", !9, i64 0}
!13 = !{!14, !15, i64 48}
!14 = !{!"_ZTS26TinyOpenGL3AppInternalData", !15, i64 0, !15, i64 4, !8, i64 8, !8, i64 16, !8, i64 24, !8, i64 32, !15, i64 40, !15, i64 44, !15, i64 48, !8, i64 56, !8, i64 64, !8, i64 72, !8, i64 80, !15, i64 88, !15, i64 92, !15, i64 96, !15, i64 100}
!15 = !{!"int", !9, i64 0}
!16 = !{!9, !9, i64 0}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}
!19 = !{!6, !8, i64 96}
!20 = !{!21, !21, i64 0}
!21 = !{!"vtable pointer", !10, i64 0}
!22 = distinct !{!22, !18}
!23 = distinct !{!23, !18}
!24 = !{!12, !12, i64 0}
!25 = distinct !{!25, !18}


; Effective O3 passes: BDCEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass