; LLVM IR from BrunoLevy/learn-fpga :: FemtoRV/FIRMWARE/CPP_EXAMPLES (tinyrt_cpp)

; 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.Material = type { float, %struct.vec.0, %struct.vec, float }
%struct.vec.0 = type { float, float, float, float }
%struct.vec = type { float, float, float }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<Sphere, std::allocator<Sphere>>::_Vector_impl" }
%"struct.std::_Vector_base<Sphere, std::allocator<Sphere>>::_Vector_impl" = type { %"struct.std::_Vector_base<Sphere, std::allocator<Sphere>>::_Vector_impl_data" }
%"struct.std::_Vector_base<Sphere, std::allocator<Sphere>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%struct.Sphere = type { %struct.vec, float, %struct.Material }
%"class.std::vector.1" = type { %"struct.std::_Vector_base.2" }
%"struct.std::_Vector_base.2" = type { %"struct.std::_Vector_base<Light, std::allocator<Light>>::_Vector_impl" }
%"struct.std::_Vector_base<Light, std::allocator<Light>>::_Vector_impl" = type { %"struct.std::_Vector_base<Light, std::allocator<Light>>::_Vector_impl_data" }
%"struct.std::_Vector_base<Light, std::allocator<Light>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%struct.Light = type { %struct.vec, float }

@FGA_mode = external global i32, align 4

; 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: mustprogress nounwind uwtable
declare dso_local void @_ZN3vecILm3EfEC2Efff(ptr noundef nonnull align 4 dereferenceable(12), float noundef, float noundef, float noundef) unnamed_addr #1 align 2

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #3 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca %struct.Material, align 4
  %3 = alloca %struct.vec.0, align 4
  %4 = alloca %struct.vec, align 4
  %5 = alloca %struct.Material, align 4
  %6 = alloca %struct.vec.0, align 4
  %7 = alloca %struct.vec, align 4
  %8 = alloca %struct.Material, align 4
  %9 = alloca %struct.vec.0, align 4
  %10 = alloca %struct.vec, align 4
  %11 = alloca %struct.Material, align 4
  %12 = alloca %struct.vec.0, align 4
  %13 = alloca %struct.vec, align 4
  %14 = alloca %"class.std::vector", align 8
  %15 = alloca %struct.Sphere, align 4
  %16 = alloca %struct.vec, align 4
  %17 = alloca ptr, align 8
  %18 = alloca i32, align 4
  %19 = alloca %struct.Sphere, align 4
  %20 = alloca %struct.vec, align 4
  %21 = alloca %struct.Sphere, align 4
  %22 = alloca %struct.vec, align 4
  %23 = alloca %struct.Sphere, align 4
  %24 = alloca %struct.vec, align 4
  %25 = alloca %"class.std::vector.1", align 8
  %26 = alloca %struct.Light, align 4
  %27 = alloca %struct.vec, align 4
  %28 = alloca %struct.Light, align 4
  %29 = alloca %struct.vec, align 4
  %30 = alloca %struct.Light, align 4
  %31 = alloca %struct.vec, align 4
  %32 = alloca i32, align 4
  %33 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 36, ptr %2) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr %3) #7
  call void @_ZN3vecILm4EfEC2Effff(ptr noundef nonnull align 4 dereferenceable(16) %3, float noundef 0x3FE3333340000000, float noundef 0x3FD3333340000000, float noundef 0x3FB99999A0000000, float noundef 0.000000e+00)
  call void @llvm.lifetime.start.p0(i64 12, ptr %4) #7
  call void @_ZN3vecILm3EfEC2Efff(ptr noundef nonnull align 4 dereferenceable(12) %4, float noundef 0x3FD99999A0000000, float noundef 0x3FD99999A0000000, float noundef 0x3FD3333340000000)
  call void @_ZN8MaterialC2EfRK3vecILm4EfERKS0_ILm3EfEf(ptr noundef nonnull align 4 dereferenceable(36) %2, float noundef 1.000000e+00, ptr noundef nonnull align 4 dereferenceable(16) %3, ptr noundef nonnull align 4 dereferenceable(12) %4, float noundef 5.000000e+01)
  call void @llvm.lifetime.end.p0(i64 12, ptr %4) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %3) #7
  call void @llvm.lifetime.start.p0(i64 36, ptr %5) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr %6) #7
  call void @_ZN3vecILm4EfEC2Effff(ptr noundef nonnull align 4 dereferenceable(16) %6, float noundef 0.000000e+00, float noundef 5.000000e-01, float noundef 0x3FB99999A0000000, float noundef 0x3FE99999A0000000)
  call void @llvm.lifetime.start.p0(i64 12, ptr %7) #7
  call void @_ZN3vecILm3EfEC2Efff(ptr noundef nonnull align 4 dereferenceable(12) %7, float noundef 0x3FE3333340000000, float noundef 0x3FE6666660000000, float noundef 0x3FE99999A0000000)
  call void @_ZN8MaterialC2EfRK3vecILm4EfERKS0_ILm3EfEf(ptr noundef nonnull align 4 dereferenceable(36) %5, float noundef 1.500000e+00, ptr noundef nonnull align 4 dereferenceable(16) %6, ptr noundef nonnull align 4 dereferenceable(12) %7, float noundef 1.250000e+02)
  call void @llvm.lifetime.end.p0(i64 12, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %6) #7
  call void @llvm.lifetime.start.p0(i64 36, ptr %8) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr %9) #7
  call void @_ZN3vecILm4EfEC2Effff(ptr noundef nonnull align 4 dereferenceable(16) %9, float noundef 0x3FECCCCCC0000000, float noundef 0x3FB99999A0000000, float noundef 0.000000e+00, float noundef 0.000000e+00)
  call void @llvm.lifetime.start.p0(i64 12, ptr %10) #7
  call void @_ZN3vecILm3EfEC2Efff(ptr noundef nonnull align 4 dereferenceable(12) %10, float noundef 0x3FD3333340000000, float noundef 0x3FB99999A0000000, float noundef 0x3FB99999A0000000)
  call void @_ZN8MaterialC2EfRK3vecILm4EfERKS0_ILm3EfEf(ptr noundef nonnull align 4 dereferenceable(36) %8, float noundef 1.000000e+00, ptr noundef nonnull align 4 dereferenceable(16) %9, ptr noundef nonnull align 4 dereferenceable(12) %10, float noundef 1.000000e+01)
  call void @llvm.lifetime.end.p0(i64 12, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %9) #7
  call void @llvm.lifetime.start.p0(i64 36, ptr %11) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr %12) #7
  call void @_ZN3vecILm4EfEC2Effff(ptr noundef nonnull align 4 dereferenceable(16) %12, float noundef 0.000000e+00, float noundef 1.000000e+01, float noundef 0x3FE99999A0000000, float noundef 0.000000e+00)
  call void @llvm.lifetime.start.p0(i64 12, ptr %13) #7
  call void @_ZN3vecILm3EfEC2Efff(ptr noundef nonnull align 4 dereferenceable(12) %13, float noundef 1.000000e+00, float noundef 1.000000e+00, float noundef 1.000000e+00)
  call void @_ZN8MaterialC2EfRK3vecILm4EfERKS0_ILm3EfEf(ptr noundef nonnull align 4 dereferenceable(36) %11, float noundef 1.000000e+00, ptr noundef nonnull align 4 dereferenceable(16) %12, ptr noundef nonnull align 4 dereferenceable(12) %13, float noundef 1.425000e+03)
  call void @llvm.lifetime.end.p0(i64 12, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %12) #7
  call void @llvm.lifetime.start.p0(i64 24, ptr %14) #7
  call void @_ZNSt6vectorI6SphereSaIS0_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %14) #7
  call void @llvm.lifetime.start.p0(i64 52, ptr %15) #7
  call void @llvm.lifetime.start.p0(i64 12, ptr %16) #7
  invoke void @_ZN3vecILm3EfEC2Efff(ptr noundef nonnull align 4 dereferenceable(12) %16, float noundef -3.000000e+00, float noundef 0.000000e+00, float noundef -1.600000e+01)
          to label %34 unwind label %63

34:                                               ; preds = %0
  invoke void @_ZN6SphereC2ERK3vecILm3EfEfRK8Material(ptr noundef nonnull align 4 dereferenceable(52) %15, ptr noundef nonnull align 4 dereferenceable(12) %16, float noundef 2.000000e+00, ptr noundef nonnull align 4 dereferenceable(36) %2)
          to label %35 unwind label %63

35:                                               ; preds = %34
  invoke void @_ZNSt6vectorI6SphereSaIS0_EE9push_backEOS0_(ptr noundef nonnull align 8 dereferenceable(24) %14, ptr noundef nonnull align 4 dereferenceable(52) %15)
          to label %36 unwind label %63

36:                                               ; preds = %35
  call void @llvm.lifetime.end.p0(i64 12, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 52, ptr %15) #7
  call void @llvm.lifetime.start.p0(i64 52, ptr %19) #7
  call void @llvm.lifetime.start.p0(i64 12, ptr %20) #7
  invoke void @_ZN3vecILm3EfEC2Efff(ptr noundef nonnull align 4 dereferenceable(12) %20, float noundef -1.000000e+00, float noundef -1.500000e+00, float noundef -1.200000e+01)
          to label %37 unwind label %67

37:                                               ; preds = %36
  invoke void @_ZN6SphereC2ERK3vecILm3EfEfRK8Material(ptr noundef nonnull align 4 dereferenceable(52) %19, ptr noundef nonnull align 4 dereferenceable(12) %20, float noundef 2.000000e+00, ptr noundef nonnull align 4 dereferenceable(36) %5)
          to label %38 unwind label %67

38:                                               ; preds = %37
  invoke void @_ZNSt6vectorI6SphereSaIS0_EE9push_backEOS0_(ptr noundef nonnull align 8 dereferenceable(24) %14, ptr noundef nonnull align 4 dereferenceable(52) %19)
          to label %39 unwind label %67

39:                                               ; preds = %38
  call void @llvm.lifetime.end.p0(i64 12, ptr %20) #7
  call void @llvm.lifetime.end.p0(i64 52, ptr %19) #7
  call void @llvm.lifetime.start.p0(i64 52, ptr %21) #7
  call void @llvm.lifetime.start.p0(i64 12, ptr %22) #7
  invoke void @_ZN3vecILm3EfEC2Efff(ptr noundef nonnull align 4 dereferenceable(12) %22, float noundef 1.500000e+00, float noundef -5.000000e-01, float noundef -1.800000e+01)
          to label %40 unwind label %71

40:                                               ; preds = %39
  invoke void @_ZN6SphereC2ERK3vecILm3EfEfRK8Material(ptr noundef nonnull align 4 dereferenceable(52) %21, ptr noundef nonnull align 4 dereferenceable(12) %22, float noundef 3.000000e+00, ptr noundef nonnull align 4 dereferenceable(36) %8)
          to label %41 unwind label %71

41:                                               ; preds = %40
  invoke void @_ZNSt6vectorI6SphereSaIS0_EE9push_backEOS0_(ptr noundef nonnull align 8 dereferenceable(24) %14, ptr noundef nonnull align 4 dereferenceable(52) %21)
          to label %42 unwind label %71

42:                                               ; preds = %41
  call void @llvm.lifetime.end.p0(i64 12, ptr %22) #7
  call void @llvm.lifetime.end.p0(i64 52, ptr %21) #7
  call void @llvm.lifetime.start.p0(i64 52, ptr %23) #7
  call void @llvm.lifetime.start.p0(i64 12, ptr %24) #7
  invoke void @_ZN3vecILm3EfEC2Efff(ptr noundef nonnull align 4 dereferenceable(12) %24, float noundef 7.000000e+00, float noundef 5.000000e+00, float noundef -1.800000e+01)
          to label %43 unwind label %75

43:                                               ; preds = %42
  invoke void @_ZN6SphereC2ERK3vecILm3EfEfRK8Material(ptr noundef nonnull align 4 dereferenceable(52) %23, ptr noundef nonnull align 4 dereferenceable(12) %24, float noundef 4.000000e+00, ptr noundef nonnull align 4 dereferenceable(36) %11)
          to label %44 unwind label %75

44:                                               ; preds = %43
  invoke void @_ZNSt6vectorI6SphereSaIS0_EE9push_backEOS0_(ptr noundef nonnull align 8 dereferenceable(24) %14, ptr noundef nonnull align 4 dereferenceable(52) %23)
          to label %45 unwind label %75

45:                                               ; preds = %44
  call void @llvm.lifetime.end.p0(i64 12, ptr %24) #7
  call void @llvm.lifetime.end.p0(i64 52, ptr %23) #7
  call void @llvm.lifetime.start.p0(i64 24, ptr %25) #7
  call void @_ZNSt6vectorI5LightSaIS0_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %25) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr %26) #7
  call void @llvm.lifetime.start.p0(i64 12, ptr %27) #7
  invoke void @_ZN3vecILm3EfEC2Efff(ptr noundef nonnull align 4 dereferenceable(12) %27, float noundef -2.000000e+01, float noundef 2.000000e+01, float noundef 2.000000e+01)
          to label %46 unwind label %79

46:                                               ; preds = %45
  invoke void @_ZN5LightC2ERK3vecILm3EfEf(ptr noundef nonnull align 4 dereferenceable(16) %26, ptr noundef nonnull align 4 dereferenceable(12) %27, float noundef 1.500000e+00)
          to label %47 unwind label %79

47:                                               ; preds = %46
  invoke void @_ZNSt6vectorI5LightSaIS0_EE9push_backEOS0_(ptr noundef nonnull align 8 dereferenceable(24) %25, ptr noundef nonnull align 4 dereferenceable(16) %26)
          to label %48 unwind label %79

48:                                               ; preds = %47
  call void @llvm.lifetime.end.p0(i64 12, ptr %27) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %26) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr %28) #7
  call void @llvm.lifetime.start.p0(i64 12, ptr %29) #7
  invoke void @_ZN3vecILm3EfEC2Efff(ptr noundef nonnull align 4 dereferenceable(12) %29, float noundef 3.000000e+01, float noundef 5.000000e+01, float noundef -2.500000e+01)
          to label %49 unwind label %83

49:                                               ; preds = %48
  invoke void @_ZN5LightC2ERK3vecILm3EfEf(ptr noundef nonnull align 4 dereferenceable(16) %28, ptr noundef nonnull align 4 dereferenceable(12) %29, float noundef 0x3FFCCCCCC0000000)
          to label %50 unwind label %83

50:                                               ; preds = %49
  invoke void @_ZNSt6vectorI5LightSaIS0_EE9push_backEOS0_(ptr noundef nonnull align 8 dereferenceable(24) %25, ptr noundef nonnull align 4 dereferenceable(16) %28)
          to label %51 unwind label %83

51:                                               ; preds = %50
  call void @llvm.lifetime.end.p0(i64 12, ptr %29) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %28) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr %30) #7
  call void @llvm.lifetime.start.p0(i64 12, ptr %31) #7
  invoke void @_ZN3vecILm3EfEC2Efff(ptr noundef nonnull align 4 dereferenceable(12) %31, float noundef 3.000000e+01, float noundef 2.000000e+01, float noundef 3.000000e+01)
          to label %52 unwind label %87

52:                                               ; preds = %51
  invoke void @_ZN5LightC2ERK3vecILm3EfEf(ptr noundef nonnull align 4 dereferenceable(16) %30, ptr noundef nonnull align 4 dereferenceable(12) %31, float noundef 0x3FFB333340000000)
          to label %53 unwind label %87

53:                                               ; preds = %52
  invoke void @_ZNSt6vectorI5LightSaIS0_EE9push_backEOS0_(ptr noundef nonnull align 8 dereferenceable(24) %25, ptr noundef nonnull align 4 dereferenceable(16) %30)
          to label %54 unwind label %87

54:                                               ; preds = %53
  call void @llvm.lifetime.end.p0(i64 12, ptr %31) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %30) #7
  invoke void @GL_init(i32 noundef -2)
          to label %55 unwind label %91

55:                                               ; preds = %54
  %56 = load i32, ptr @FGA_mode, align 4, !tbaa !5
  %57 = icmp eq i32 %56, 1
  br i1 %57, label %58, label %112

58:                                               ; preds = %55
  call void @llvm.lifetime.start.p0(i64 4, ptr %32) #7
  store i32 0, ptr %32, align 4, !tbaa !5
  br label %59

59:                                               ; preds = %104, %58
  %60 = load i32, ptr %32, align 4, !tbaa !5
  %61 = icmp slt i32 %60, 256
  br i1 %61, label %95, label %62

62:                                               ; preds = %59
  call void @llvm.lifetime.end.p0(i64 4, ptr %32) #7
  br label %111

63:                                               ; preds = %35, %34, %0
  %64 = landingpad { ptr, i32 }
          cleanup
  %65 = extractvalue { ptr, i32 } %64, 0
  store ptr %65, ptr %17, align 8
  %66 = extractvalue { ptr, i32 } %64, 1
  store i32 %66, ptr %18, align 4
  call void @llvm.lifetime.end.p0(i64 12, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 52, ptr %15) #7
  br label %146

67:                                               ; preds = %38, %37, %36
  %68 = landingpad { ptr, i32 }
          cleanup
  %69 = extractvalue { ptr, i32 } %68, 0
  store ptr %69, ptr %17, align 8
  %70 = extractvalue { ptr, i32 } %68, 1
  store i32 %70, ptr %18, align 4
  call void @llvm.lifetime.end.p0(i64 12, ptr %20) #7
  call void @llvm.lifetime.end.p0(i64 52, ptr %19) #7
  br label %146

71:                                               ; preds = %41, %40, %39
  %72 = landingpad { ptr, i32 }
          cleanup
  %73 = extractvalue { ptr, i32 } %72, 0
  store ptr %73, ptr %17, align 8
  %74 = extractvalue { ptr, i32 } %72, 1
  store i32 %74, ptr %18, align 4
  call void @llvm.lifetime.end.p0(i64 12, ptr %22) #7
  call void @llvm.lifetime.end.p0(i64 52, ptr %21) #7
  br label %146

75:                                               ; preds = %44, %43, %42
  %76 = landingpad { ptr, i32 }
          cleanup
  %77 = extractvalue { ptr, i32 } %76, 0
  store ptr %77, ptr %17, align 8
  %78 = extractvalue { ptr, i32 } %76, 1
  store i32 %78, ptr %18, align 4
  call void @llvm.lifetime.end.p0(i64 12, ptr %24) #7
  call void @llvm.lifetime.end.p0(i64 52, ptr %23) #7
  br label %146

79:                                               ; preds = %47, %46, %45
  %80 = landingpad { ptr, i32 }
          cleanup
  %81 = extractvalue { ptr, i32 } %80, 0
  store ptr %81, ptr %17, align 8
  %82 = extractvalue { ptr, i32 } %80, 1
  store i32 %82, ptr %18, align 4
  call void @llvm.lifetime.end.p0(i64 12, ptr %27) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %26) #7
  br label %145

83:                                               ; preds = %50, %49, %48
  %84 = landingpad { ptr, i32 }
          cleanup
  %85 = extractvalue { ptr, i32 } %84, 0
  store ptr %85, ptr %17, align 8
  %86 = extractvalue { ptr, i32 } %84, 1
  store i32 %86, ptr %18, align 4
  call void @llvm.lifetime.end.p0(i64 12, ptr %29) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %28) #7
  br label %145

87:                                               ; preds = %53, %52, %51
  %88 = landingpad { ptr, i32 }
          cleanup
  %89 = extractvalue { ptr, i32 } %88, 0
  store ptr %89, ptr %17, align 8
  %90 = extractvalue { ptr, i32 } %88, 1
  store i32 %90, ptr %18, align 4
  call void @llvm.lifetime.end.p0(i64 12, ptr %31) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %30) #7
  br label %145

91:                                               ; preds = %142, %141, %54
  %92 = landingpad { ptr, i32 }
          cleanup
  %93 = extractvalue { ptr, i32 } %92, 0
  store ptr %93, ptr %17, align 8
  %94 = extractvalue { ptr, i32 } %92, 1
  store i32 %94, ptr %18, align 4
  br label %145

95:                                               ; preds = %59
  %96 = load i32, ptr %32, align 4, !tbaa !5
  %97 = load i32, ptr %32, align 4, !tbaa !5
  %98 = trunc i32 %97 to i8
  %99 = load i32, ptr %32, align 4, !tbaa !5
  %100 = trunc i32 %99 to i8
  %101 = load i32, ptr %32, align 4, !tbaa !5
  %102 = trunc i32 %101 to i8
  invoke void @_ZL14FGA_setpaletteihhh(i32 noundef %96, i8 noundef zeroext %98, i8 noundef zeroext %100, i8 noundef zeroext %102)
          to label %103 unwind label %107

103:                                              ; preds = %95
  br label %104

104:                                              ; preds = %103
  %105 = load i32, ptr %32, align 4, !tbaa !5
  %106 = add nsw i32 %105, 1
  store i32 %106, ptr %32, align 4, !tbaa !5
  br label %59, !llvm.loop !9

107:                                              ; preds = %95
  %108 = landingpad { ptr, i32 }
          cleanup
  %109 = extractvalue { ptr, i32 } %108, 0
  store ptr %109, ptr %17, align 8
  %110 = extractvalue { ptr, i32 } %108, 1
  store i32 %110, ptr %18, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %32) #7
  br label %145

111:                                              ; preds = %62
  br label %141

112:                                              ; preds = %55
  %113 = load i32, ptr @FGA_mode, align 4, !tbaa !5
  %114 = icmp eq i32 %113, 2
  br i1 %114, label %115, label %140

115:                                              ; preds = %112
  call void @llvm.lifetime.start.p0(i64 4, ptr %33) #7
  store i32 0, ptr %33, align 4, !tbaa !5
  br label %116

116:                                              ; preds = %132, %115
  %117 = load i32, ptr %33, align 4, !tbaa !5
  %118 = icmp slt i32 %117, 16
  br i1 %118, label %120, label %119

119:                                              ; preds = %116
  call void @llvm.lifetime.end.p0(i64 4, ptr %33) #7
  br label %139

120:                                              ; preds = %116
  %121 = load i32, ptr %33, align 4, !tbaa !5
  %122 = load i32, ptr %33, align 4, !tbaa !5
  %123 = shl i32 %122, 4
  %124 = trunc i32 %123 to i8
  %125 = load i32, ptr %33, align 4, !tbaa !5
  %126 = shl i32 %125, 4
  %127 = trunc i32 %126 to i8
  %128 = load i32, ptr %33, align 4, !tbaa !5
  %129 = shl i32 %128, 4
  %130 = trunc i32 %129 to i8
  invoke void @_ZL14FGA_setpaletteihhh(i32 noundef %121, i8 noundef zeroext %124, i8 noundef zeroext %127, i8 noundef zeroext %130)
          to label %131 unwind label %135

131:                                              ; preds = %120
  br label %132

132:                                              ; preds = %131
  %133 = load i32, ptr %33, align 4, !tbaa !5
  %134 = add nsw i32 %133, 1
  store i32 %134, ptr %33, align 4, !tbaa !5
  br label %116, !llvm.loop !11

135:                                              ; preds = %120
  %136 = landingpad { ptr, i32 }
          cleanup
  %137 = extractvalue { ptr, i32 } %136, 0
  store ptr %137, ptr %17, align 8
  %138 = extractvalue { ptr, i32 } %136, 1
  store i32 %138, ptr %18, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %33) #7
  br label %145

139:                                              ; preds = %119
  br label %140

140:                                              ; preds = %139, %112
  br label %141

141:                                              ; preds = %140, %111
  invoke void @GL_clear()
          to label %142 unwind label %91

142:                                              ; preds = %141
  invoke void @_Z6renderRKSt6vectorI6SphereSaIS0_EERKS_I5LightSaIS5_EE(ptr noundef nonnull align 8 dereferenceable(24) %14, ptr noundef nonnull align 8 dereferenceable(24) %25)
          to label %143 unwind label %91

143:                                              ; preds = %142
  store i32 0, ptr %1, align 4
  call void @_ZNSt6vectorI5LightSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %25) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %25) #7
  call void @_ZNSt6vectorI6SphereSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %14) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 36, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 36, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 36, ptr %5) #7
  call void @llvm.lifetime.end.p0(i64 36, ptr %2) #7
  %144 = load i32, ptr %1, align 4
  ret i32 %144

145:                                              ; preds = %135, %107, %91, %87, %83, %79
  call void @_ZNSt6vectorI5LightSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %25) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %25) #7
  br label %146

146:                                              ; preds = %145, %75, %71, %67, %63
  call void @_ZNSt6vectorI6SphereSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %14) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 36, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 36, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 36, ptr %5) #7
  call void @llvm.lifetime.end.p0(i64 36, ptr %2) #7
  br label %147

147:                                              ; preds = %146
  %148 = load ptr, ptr %17, align 8
  %149 = load i32, ptr %18, align 4
  %150 = insertvalue { ptr, i32 } poison, ptr %148, 0
  %151 = insertvalue { ptr, i32 } %150, i32 %149, 1
  resume { ptr, i32 } %151
}

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN8MaterialC2EfRK3vecILm4EfERKS0_ILm3EfEf(ptr noundef nonnull align 4 dereferenceable(36), float noundef, ptr noundef nonnull align 4 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(12), float noundef) unnamed_addr #1 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorI6SphereSaIS0_EE9push_backEOS0_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(52)) #4 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN6SphereC2ERK3vecILm3EfEfRK8Material(ptr noundef nonnull align 4 dereferenceable(52), ptr noundef nonnull align 4 dereferenceable(12), float noundef, ptr noundef nonnull align 4 dereferenceable(36)) unnamed_addr #1 align 2

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

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

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

declare void @GL_init(i32 noundef) #5

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden void @_ZL14FGA_setpaletteihhh(i32 noundef, i8 noundef zeroext, i8 noundef zeroext, i8 noundef zeroext) #6

declare void @GL_clear() #5

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

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 uwtable "min-legal-vector-width"="64" "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 norecurse 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 = { "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 #6 = { 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 #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}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%struct.Material = type { float, %struct.vec.0, %struct.vec, float }
%struct.vec.0 = type { float, float, float, float }
%struct.vec = type { float, float, float }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<Sphere, std::allocator<Sphere>>::_Vector_impl" }
%"struct.std::_Vector_base<Sphere, std::allocator<Sphere>>::_Vector_impl" = type { %"struct.std::_Vector_base<Sphere, std::allocator<Sphere>>::_Vector_impl_data" }
%"struct.std::_Vector_base<Sphere, std::allocator<Sphere>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%struct.Sphere = type { %struct.vec, float, %struct.Material }
%"class.std::vector.1" = type { %"struct.std::_Vector_base.2" }
%"struct.std::_Vector_base.2" = type { %"struct.std::_Vector_base<Light, std::allocator<Light>>::_Vector_impl" }
%"struct.std::_Vector_base<Light, std::allocator<Light>>::_Vector_impl" = type { %"struct.std::_Vector_base<Light, std::allocator<Light>>::_Vector_impl_data" }
%"struct.std::_Vector_base<Light, std::allocator<Light>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%struct.Light = type { %struct.vec, float }

@FGA_mode = external local_unnamed_addr global i32, align 4

; 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: mustprogress nounwind uwtable
declare dso_local void @_ZN3vecILm3EfEC2Efff(ptr noundef nonnull align 4 dereferenceable(12), float noundef, float noundef, float noundef) unnamed_addr #1 align 2

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #3 personality ptr @__gxx_personality_v0 {
  %1 = alloca %struct.Material, align 4
  %2 = alloca %struct.vec.0, align 4
  %3 = alloca %struct.vec, align 4
  %4 = alloca %struct.Material, align 4
  %5 = alloca %struct.vec.0, align 4
  %6 = alloca %struct.vec, align 4
  %7 = alloca %struct.Material, align 4
  %8 = alloca %struct.vec.0, align 4
  %9 = alloca %struct.vec, align 4
  %10 = alloca %struct.Material, align 4
  %11 = alloca %struct.vec.0, align 4
  %12 = alloca %struct.vec, align 4
  %13 = alloca %"class.std::vector", align 8
  %14 = alloca %struct.Sphere, align 4
  %15 = alloca %struct.vec, align 4
  %16 = alloca %struct.Sphere, align 4
  %17 = alloca %struct.vec, align 4
  %18 = alloca %struct.Sphere, align 4
  %19 = alloca %struct.vec, align 4
  %20 = alloca %struct.Sphere, align 4
  %21 = alloca %struct.vec, align 4
  %22 = alloca %"class.std::vector.1", align 8
  %23 = alloca %struct.Light, align 4
  %24 = alloca %struct.vec, align 4
  %25 = alloca %struct.Light, align 4
  %26 = alloca %struct.vec, align 4
  %27 = alloca %struct.Light, align 4
  %28 = alloca %struct.vec, align 4
  call void @llvm.lifetime.start.p0(i64 36, ptr nonnull %1) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %2) #7
  call void @_ZN3vecILm4EfEC2Effff(ptr noundef nonnull align 4 dereferenceable(16) %2, float noundef 0x3FE3333340000000, float noundef 0x3FD3333340000000, float noundef 0x3FB99999A0000000, float noundef 0.000000e+00)
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %3) #7
  call void @_ZN3vecILm3EfEC2Efff(ptr noundef nonnull align 4 dereferenceable(12) %3, float noundef 0x3FD99999A0000000, float noundef 0x3FD99999A0000000, float noundef 0x3FD3333340000000)
  call void @_ZN8MaterialC2EfRK3vecILm4EfERKS0_ILm3EfEf(ptr noundef nonnull align 4 dereferenceable(36) %1, float noundef 1.000000e+00, ptr noundef nonnull align 4 dereferenceable(16) %2, ptr noundef nonnull align 4 dereferenceable(12) %3, float noundef 5.000000e+01)
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %3) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %2) #7
  call void @llvm.lifetime.start.p0(i64 36, ptr nonnull %4) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #7
  call void @_ZN3vecILm4EfEC2Effff(ptr noundef nonnull align 4 dereferenceable(16) %5, float noundef 0.000000e+00, float noundef 5.000000e-01, float noundef 0x3FB99999A0000000, float noundef 0x3FE99999A0000000)
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %6) #7
  call void @_ZN3vecILm3EfEC2Efff(ptr noundef nonnull align 4 dereferenceable(12) %6, float noundef 0x3FE3333340000000, float noundef 0x3FE6666660000000, float noundef 0x3FE99999A0000000)
  call void @_ZN8MaterialC2EfRK3vecILm4EfERKS0_ILm3EfEf(ptr noundef nonnull align 4 dereferenceable(36) %4, float noundef 1.500000e+00, ptr noundef nonnull align 4 dereferenceable(16) %5, ptr noundef nonnull align 4 dereferenceable(12) %6, float noundef 1.250000e+02)
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #7
  call void @llvm.lifetime.start.p0(i64 36, ptr nonnull %7) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %8) #7
  call void @_ZN3vecILm4EfEC2Effff(ptr noundef nonnull align 4 dereferenceable(16) %8, float noundef 0x3FECCCCCC0000000, float noundef 0x3FB99999A0000000, float noundef 0.000000e+00, float noundef 0.000000e+00)
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %9) #7
  call void @_ZN3vecILm3EfEC2Efff(ptr noundef nonnull align 4 dereferenceable(12) %9, float noundef 0x3FD3333340000000, float noundef 0x3FB99999A0000000, float noundef 0x3FB99999A0000000)
  call void @_ZN8MaterialC2EfRK3vecILm4EfERKS0_ILm3EfEf(ptr noundef nonnull align 4 dereferenceable(36) %7, float noundef 1.000000e+00, ptr noundef nonnull align 4 dereferenceable(16) %8, ptr noundef nonnull align 4 dereferenceable(12) %9, float noundef 1.000000e+01)
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %9) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %8) #7
  call void @llvm.lifetime.start.p0(i64 36, ptr nonnull %10) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %11) #7
  call void @_ZN3vecILm4EfEC2Effff(ptr noundef nonnull align 4 dereferenceable(16) %11, float noundef 0.000000e+00, float noundef 1.000000e+01, float noundef 0x3FE99999A0000000, float noundef 0.000000e+00)
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %12) #7
  call void @_ZN3vecILm3EfEC2Efff(ptr noundef nonnull align 4 dereferenceable(12) %12, float noundef 1.000000e+00, float noundef 1.000000e+00, float noundef 1.000000e+00)
  call void @_ZN8MaterialC2EfRK3vecILm4EfERKS0_ILm3EfEf(ptr noundef nonnull align 4 dereferenceable(36) %10, float noundef 1.000000e+00, ptr noundef nonnull align 4 dereferenceable(16) %11, ptr noundef nonnull align 4 dereferenceable(12) %12, float noundef 1.425000e+03)
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %12) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %11) #7
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %13) #7
  call void @_ZNSt6vectorI6SphereSaIS0_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %13) #7
  call void @llvm.lifetime.start.p0(i64 52, ptr nonnull %14) #7
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %15) #7
  call void @_ZN3vecILm3EfEC2Efff(ptr noundef nonnull align 4 dereferenceable(12) %15, float noundef -3.000000e+00, float noundef 0.000000e+00, float noundef -1.600000e+01)
  call void @_ZN6SphereC2ERK3vecILm3EfEfRK8Material(ptr noundef nonnull align 4 dereferenceable(52) %14, ptr noundef nonnull align 4 dereferenceable(12) %15, float noundef 2.000000e+00, ptr noundef nonnull align 4 dereferenceable(36) %1)
  invoke void @_ZNSt6vectorI6SphereSaIS0_EE9push_backEOS0_(ptr noundef nonnull align 8 dereferenceable(24) %13, ptr noundef nonnull align 4 dereferenceable(52) %14)
          to label %29 unwind label %38

29:                                               ; preds = %0
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %15) #7
  call void @llvm.lifetime.end.p0(i64 52, ptr nonnull %14) #7
  call void @llvm.lifetime.start.p0(i64 52, ptr nonnull %16) #7
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %17) #7
  call void @_ZN3vecILm3EfEC2Efff(ptr noundef nonnull align 4 dereferenceable(12) %17, float noundef -1.000000e+00, float noundef -1.500000e+00, float noundef -1.200000e+01)
  call void @_ZN6SphereC2ERK3vecILm3EfEfRK8Material(ptr noundef nonnull align 4 dereferenceable(52) %16, ptr noundef nonnull align 4 dereferenceable(12) %17, float noundef 2.000000e+00, ptr noundef nonnull align 4 dereferenceable(36) %4)
  invoke void @_ZNSt6vectorI6SphereSaIS0_EE9push_backEOS0_(ptr noundef nonnull align 8 dereferenceable(24) %13, ptr noundef nonnull align 4 dereferenceable(52) %16)
          to label %30 unwind label %40

30:                                               ; preds = %29
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %17) #7
  call void @llvm.lifetime.end.p0(i64 52, ptr nonnull %16) #7
  call void @llvm.lifetime.start.p0(i64 52, ptr nonnull %18) #7
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %19) #7
  call void @_ZN3vecILm3EfEC2Efff(ptr noundef nonnull align 4 dereferenceable(12) %19, float noundef 1.500000e+00, float noundef -5.000000e-01, float noundef -1.800000e+01)
  call void @_ZN6SphereC2ERK3vecILm3EfEfRK8Material(ptr noundef nonnull align 4 dereferenceable(52) %18, ptr noundef nonnull align 4 dereferenceable(12) %19, float noundef 3.000000e+00, ptr noundef nonnull align 4 dereferenceable(36) %7)
  invoke void @_ZNSt6vectorI6SphereSaIS0_EE9push_backEOS0_(ptr noundef nonnull align 8 dereferenceable(24) %13, ptr noundef nonnull align 4 dereferenceable(52) %18)
          to label %31 unwind label %42

31:                                               ; preds = %30
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %19) #7
  call void @llvm.lifetime.end.p0(i64 52, ptr nonnull %18) #7
  call void @llvm.lifetime.start.p0(i64 52, ptr nonnull %20) #7
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %21) #7
  call void @_ZN3vecILm3EfEC2Efff(ptr noundef nonnull align 4 dereferenceable(12) %21, float noundef 7.000000e+00, float noundef 5.000000e+00, float noundef -1.800000e+01)
  call void @_ZN6SphereC2ERK3vecILm3EfEfRK8Material(ptr noundef nonnull align 4 dereferenceable(52) %20, ptr noundef nonnull align 4 dereferenceable(12) %21, float noundef 4.000000e+00, ptr noundef nonnull align 4 dereferenceable(36) %10)
  invoke void @_ZNSt6vectorI6SphereSaIS0_EE9push_backEOS0_(ptr noundef nonnull align 8 dereferenceable(24) %13, ptr noundef nonnull align 4 dereferenceable(52) %20)
          to label %32 unwind label %44

32:                                               ; preds = %31
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %21) #7
  call void @llvm.lifetime.end.p0(i64 52, ptr nonnull %20) #7
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %22) #7
  call void @_ZNSt6vectorI5LightSaIS0_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %22) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %23) #7
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %24) #7
  call void @_ZN3vecILm3EfEC2Efff(ptr noundef nonnull align 4 dereferenceable(12) %24, float noundef -2.000000e+01, float noundef 2.000000e+01, float noundef 2.000000e+01)
  call void @_ZN5LightC2ERK3vecILm3EfEf(ptr noundef nonnull align 4 dereferenceable(16) %23, ptr noundef nonnull align 4 dereferenceable(12) %24, float noundef 1.500000e+00)
  invoke void @_ZNSt6vectorI5LightSaIS0_EE9push_backEOS0_(ptr noundef nonnull align 8 dereferenceable(24) %22, ptr noundef nonnull align 4 dereferenceable(16) %23)
          to label %33 unwind label %46

33:                                               ; preds = %32
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %24) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %23) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %25) #7
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %26) #7
  call void @_ZN3vecILm3EfEC2Efff(ptr noundef nonnull align 4 dereferenceable(12) %26, float noundef 3.000000e+01, float noundef 5.000000e+01, float noundef -2.500000e+01)
  call void @_ZN5LightC2ERK3vecILm3EfEf(ptr noundef nonnull align 4 dereferenceable(16) %25, ptr noundef nonnull align 4 dereferenceable(12) %26, float noundef 0x3FFCCCCCC0000000)
  invoke void @_ZNSt6vectorI5LightSaIS0_EE9push_backEOS0_(ptr noundef nonnull align 8 dereferenceable(24) %22, ptr noundef nonnull align 4 dereferenceable(16) %25)
          to label %34 unwind label %48

34:                                               ; preds = %33
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %26) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %25) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %27) #7
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %28) #7
  call void @_ZN3vecILm3EfEC2Efff(ptr noundef nonnull align 4 dereferenceable(12) %28, float noundef 3.000000e+01, float noundef 2.000000e+01, float noundef 3.000000e+01)
  call void @_ZN5LightC2ERK3vecILm3EfEf(ptr noundef nonnull align 4 dereferenceable(16) %27, ptr noundef nonnull align 4 dereferenceable(12) %28, float noundef 0x3FFB333340000000)
  invoke void @_ZNSt6vectorI5LightSaIS0_EE9push_backEOS0_(ptr noundef nonnull align 8 dereferenceable(24) %22, ptr noundef nonnull align 4 dereferenceable(16) %27)
          to label %35 unwind label %50

35:                                               ; preds = %34
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %28) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %27) #7
  invoke void @GL_init(i32 noundef -2)
          to label %36 unwind label %52

36:                                               ; preds = %35
  %37 = load i32, ptr @FGA_mode, align 4, !tbaa !5
  switch i32 %37, label %.loopexit [
    i32 1, label %.preheader
    i32 2, label %.preheader21.preheader
  ]

.preheader21.preheader:                           ; preds = %36
  call void @_ZL14FGA_setpaletteihhh(i32 noundef 0, i8 noundef zeroext 0, i8 noundef zeroext 0, i8 noundef zeroext 0)
  call void @_ZL14FGA_setpaletteihhh(i32 noundef 1, i8 noundef zeroext 16, i8 noundef zeroext 16, i8 noundef zeroext 16)
  call void @_ZL14FGA_setpaletteihhh(i32 noundef 2, i8 noundef zeroext 32, i8 noundef zeroext 32, i8 noundef zeroext 32)
  call void @_ZL14FGA_setpaletteihhh(i32 noundef 3, i8 noundef zeroext 48, i8 noundef zeroext 48, i8 noundef zeroext 48)
  call void @_ZL14FGA_setpaletteihhh(i32 noundef 4, i8 noundef zeroext 64, i8 noundef zeroext 64, i8 noundef zeroext 64)
  call void @_ZL14FGA_setpaletteihhh(i32 noundef 5, i8 noundef zeroext 80, i8 noundef zeroext 80, i8 noundef zeroext 80)
  call void @_ZL14FGA_setpaletteihhh(i32 noundef 6, i8 noundef zeroext 96, i8 noundef zeroext 96, i8 noundef zeroext 96)
  call void @_ZL14FGA_setpaletteihhh(i32 noundef 7, i8 noundef zeroext 112, i8 noundef zeroext 112, i8 noundef zeroext 112)
  call void @_ZL14FGA_setpaletteihhh(i32 noundef 8, i8 noundef zeroext -128, i8 noundef zeroext -128, i8 noundef zeroext -128)
  call void @_ZL14FGA_setpaletteihhh(i32 noundef 9, i8 noundef zeroext -112, i8 noundef zeroext -112, i8 noundef zeroext -112)
  call void @_ZL14FGA_setpaletteihhh(i32 noundef 10, i8 noundef zeroext -96, i8 noundef zeroext -96, i8 noundef zeroext -96)
  call void @_ZL14FGA_setpaletteihhh(i32 noundef 11, i8 noundef zeroext -80, i8 noundef zeroext -80, i8 noundef zeroext -80)
  call void @_ZL14FGA_setpaletteihhh(i32 noundef 12, i8 noundef zeroext -64, i8 noundef zeroext -64, i8 noundef zeroext -64)
  call void @_ZL14FGA_setpaletteihhh(i32 noundef 13, i8 noundef zeroext -48, i8 noundef zeroext -48, i8 noundef zeroext -48)
  call void @_ZL14FGA_setpaletteihhh(i32 noundef 14, i8 noundef zeroext -32, i8 noundef zeroext -32, i8 noundef zeroext -32)
  call void @_ZL14FGA_setpaletteihhh(i32 noundef 15, i8 noundef zeroext -16, i8 noundef zeroext -16, i8 noundef zeroext -16)
  br label %.loopexit

38:                                               ; preds = %0
  %39 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %15) #7
  call void @llvm.lifetime.end.p0(i64 52, ptr nonnull %14) #7
  br label %59

40:                                               ; preds = %29
  %41 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %17) #7
  call void @llvm.lifetime.end.p0(i64 52, ptr nonnull %16) #7
  br label %59

42:                                               ; preds = %30
  %43 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %19) #7
  call void @llvm.lifetime.end.p0(i64 52, ptr nonnull %18) #7
  br label %59

44:                                               ; preds = %31
  %45 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %21) #7
  call void @llvm.lifetime.end.p0(i64 52, ptr nonnull %20) #7
  br label %59

46:                                               ; preds = %32
  %47 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %24) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %23) #7
  br label %58

48:                                               ; preds = %33
  %49 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %26) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %25) #7
  br label %58

50:                                               ; preds = %34
  %51 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %28) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %27) #7
  br label %58

52:                                               ; preds = %56, %.loopexit, %35
  %53 = landingpad { ptr, i32 }
          cleanup
  br label %58

.preheader:                                       ; preds = %36, %.preheader
  %.01424 = phi i32 [ %55, %.preheader ], [ 0, %36 ]
  %54 = trunc nuw i32 %.01424 to i8
  call void @_ZL14FGA_setpaletteihhh(i32 noundef %.01424, i8 noundef zeroext %54, i8 noundef zeroext %54, i8 noundef zeroext %54)
  %55 = add nuw nsw i32 %.01424, 1
  %exitcond.not = icmp eq i32 %55, 256
  br i1 %exitcond.not, label %.loopexit, label %.preheader, !llvm.loop !9

.loopexit:                                        ; preds = %.preheader, %.preheader21.preheader, %36
  invoke void @GL_clear()
          to label %56 unwind label %52

56:                                               ; preds = %.loopexit
  invoke void @_Z6renderRKSt6vectorI6SphereSaIS0_EERKS_I5LightSaIS5_EE(ptr noundef nonnull align 8 dereferenceable(24) %13, ptr noundef nonnull align 8 dereferenceable(24) %22)
          to label %57 unwind label %52

57:                                               ; preds = %56
  call void @_ZNSt6vectorI5LightSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %22) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %22) #7
  call void @_ZNSt6vectorI6SphereSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %13) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %13) #7
  call void @llvm.lifetime.end.p0(i64 36, ptr nonnull %10) #7
  call void @llvm.lifetime.end.p0(i64 36, ptr nonnull %7) #7
  call void @llvm.lifetime.end.p0(i64 36, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 36, ptr nonnull %1) #7
  ret i32 0

58:                                               ; preds = %52, %50, %48, %46
  %.pn = phi { ptr, i32 } [ %53, %52 ], [ %51, %50 ], [ %49, %48 ], [ %47, %46 ]
  call void @_ZNSt6vectorI5LightSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %22) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %22) #7
  br label %59

59:                                               ; preds = %58, %44, %42, %40, %38
  %.pn.pn = phi { ptr, i32 } [ %.pn, %58 ], [ %45, %44 ], [ %43, %42 ], [ %41, %40 ], [ %39, %38 ]
  call void @_ZNSt6vectorI6SphereSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %13) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %13) #7
  call void @llvm.lifetime.end.p0(i64 36, ptr nonnull %10) #7
  call void @llvm.lifetime.end.p0(i64 36, ptr nonnull %7) #7
  call void @llvm.lifetime.end.p0(i64 36, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 36, ptr nonnull %1) #7
  resume { ptr, i32 } %.pn.pn
}

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN8MaterialC2EfRK3vecILm4EfERKS0_ILm3EfEf(ptr noundef nonnull align 4 dereferenceable(36), float noundef, ptr noundef nonnull align 4 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(12), float noundef) unnamed_addr #1 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorI6SphereSaIS0_EE9push_backEOS0_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(52)) local_unnamed_addr #4 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN6SphereC2ERK3vecILm3EfEfRK8Material(ptr noundef nonnull align 4 dereferenceable(52), ptr noundef nonnull align 4 dereferenceable(12), float noundef, ptr noundef nonnull align 4 dereferenceable(36)) unnamed_addr #1 align 2

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

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

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

declare void @GL_init(i32 noundef) local_unnamed_addr #5

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden void @_ZL14FGA_setpaletteihhh(i32 noundef, i8 noundef zeroext, i8 noundef zeroext, i8 noundef zeroext) local_unnamed_addr #6

declare void @GL_clear() local_unnamed_addr #5

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

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 uwtable "min-legal-vector-width"="64" "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 norecurse 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 = { "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 #6 = { 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 #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}
!10 = !{!"llvm.loop.mustprogress"}


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