; LLVM IR from Lut1n/ImpGears :: src/ImpGears/Graphics (Rasterizer)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.imp::Vec3" = type { %"class.imp::Vec.base", [4 x i8] }
%"class.imp::Vec.base" = type <{ %"class.imp::Object", [3 x float] }>
%"class.imp::Object" = type { ptr, %"class.std::shared_ptr" }
%"class.std::shared_ptr" = type { %"class.std::__shared_ptr" }
%"class.std::__shared_ptr" = type { ptr, %"class.std::__shared_count" }
%"class.std::__shared_count" = type { ptr }
%"struct.imp::Varyings" = type { %"class.std::map.18", %"class.std::vector", ptr }
%"class.std::map.18" = type { %"class.std::_Rb_tree.19" }
%"class.std::_Rb_tree.19" = type { %"struct.std::_Rb_tree<std::__cxx11::basic_string<char>, std::pair<const std::__cxx11::basic_string<char>, int>, std::_Select1st<std::pair<const std::__cxx11::basic_string<char>, int>>, std::less<std::__cxx11::basic_string<char>>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<std::__cxx11::basic_string<char>, std::pair<const std::__cxx11::basic_string<char>, int>, std::_Select1st<std::pair<const std::__cxx11::basic_string<char>, int>>, std::less<std::__cxx11::basic_string<char>>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = 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 }
%"class.imp::Rasterizer" = type { %"class.imp::Object", %"class.std::map.24", %"class.std::vector.30", %"class.std::vector.30", %"struct.imp::UniformMap", %"class.imp::Vec4", %"class.std::shared_ptr.35" }
%"class.std::map.24" = type { %"class.std::_Rb_tree.25" }
%"class.std::_Rb_tree.25" = type { %"struct.std::_Rb_tree<int, std::pair<const int, std::shared_ptr<imp::Image>>, std::_Select1st<std::pair<const int, std::shared_ptr<imp::Image>>>, std::less<int>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<int, std::pair<const int, std::shared_ptr<imp::Image>>, std::_Select1st<std::pair<const int, std::shared_ptr<imp::Image>>>, std::less<int>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"class.std::vector.30" = type { %"struct.std::_Vector_base.31" }
%"struct.std::_Vector_base.31" = type { %"struct.std::_Vector_base<imp::Varyings, std::allocator<imp::Varyings>>::_Vector_impl" }
%"struct.std::_Vector_base<imp::Varyings, std::allocator<imp::Varyings>>::_Vector_impl" = type { %"struct.std::_Vector_base<imp::Varyings, std::allocator<imp::Varyings>>::_Vector_impl_data" }
%"struct.std::_Vector_base<imp::Varyings, std::allocator<imp::Varyings>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.imp::UniformMap" = type { %"class.std::map", %"class.imp::Matrix3", %"class.imp::Matrix4", %"class.imp::Vec3", %"class.imp::Vec4", %"class.std::shared_ptr.2" }
%"class.std::map" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<std::__cxx11::basic_string<char>, std::pair<const std::__cxx11::basic_string<char>, std::shared_ptr<imp::Uniform>>, std::_Select1st<std::pair<const std::__cxx11::basic_string<char>, std::shared_ptr<imp::Uniform>>>, std::less<std::__cxx11::basic_string<char>>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<std::__cxx11::basic_string<char>, std::pair<const std::__cxx11::basic_string<char>, std::shared_ptr<imp::Uniform>>, std::_Select1st<std::pair<const std::__cxx11::basic_string<char>, std::shared_ptr<imp::Uniform>>>, std::less<std::__cxx11::basic_string<char>>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"class.imp::Matrix3" = type { %"class.imp::Matrix.base", [4 x i8] }
%"class.imp::Matrix.base" = type <{ %"class.imp::Object", [9 x float] }>
%"class.imp::Matrix4" = type { %"class.imp::Matrix.0" }
%"class.imp::Matrix.0" = type { %"class.imp::Object", [16 x float] }
%"class.std::shared_ptr.2" = type { %"class.std::__shared_ptr.3" }
%"class.std::__shared_ptr.3" = type { ptr, %"class.std::__shared_count" }
%"class.imp::Vec4" = type { %"class.imp::Vec.1" }
%"class.imp::Vec.1" = type { %"class.imp::Object", [4 x float] }
%"class.std::shared_ptr.35" = type { %"class.std::__shared_ptr.36" }
%"class.std::__shared_ptr.36" = type { ptr, %"class.std::__shared_count" }

; 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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3imp8Varyings3mixERKS0_S2_f(ptr noundef nonnull align 8 dereferenceable(80), ptr noundef nonnull align 8 dereferenceable(80), ptr noundef nonnull align 8 dereferenceable(80), float noundef) #1 align 2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNKSt19__shared_ptr_accessIN3imp12FragCallbackELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1)) #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3imp4Vec3C2Efff(ptr noundef nonnull align 8 dereferenceable(36), float noundef, float noundef, float noundef) unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN3imp4Vec3C2ERKS0_(ptr noundef nonnull align 8 dereferenceable(36), ptr noundef nonnull align 8 dereferenceable(36)) unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef float @_ZN3imp5clampIfEET_S1_S1_S1_(float noundef, float noundef, float noundef) #3

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3imp10Rasterizer5hLineERKNS_4Vec3ES3_RKNS_8VaryingsES6_(ptr noundef nonnull align 8 dereferenceable(472) %0, ptr noundef nonnull align 8 dereferenceable(36) %1, ptr noundef nonnull align 8 dereferenceable(36) %2, ptr noundef nonnull align 8 dereferenceable(80) %3, ptr noundef nonnull align 8 dereferenceable(80) %4) #1 align 2 personality ptr @__gxx_personality_v0 {
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca [2 x %"class.imp::Vec3"], align 16
  %16 = alloca ptr, align 8
  %17 = alloca i32, align 4
  %18 = alloca %"struct.imp::Varyings", align 8
  %19 = alloca i32, align 4
  %20 = alloca float, align 4
  %21 = alloca %"class.imp::Vec3", align 8
  store ptr %0, ptr %6, align 8, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !5
  store ptr %2, ptr %8, align 8, !tbaa !5
  store ptr %3, ptr %9, align 8, !tbaa !5
  store ptr %4, ptr %10, align 8, !tbaa !5
  %22 = load ptr, ptr %6, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #4
  %23 = load ptr, ptr %9, align 8, !tbaa !5
  store ptr %23, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #4
  %24 = load ptr, ptr %10, align 8, !tbaa !5
  store ptr %24, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #4
  store i32 0, ptr %13, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #4
  store i32 1, ptr %14, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 80, ptr %15) #4
  %25 = load ptr, ptr %7, align 8, !tbaa !5
  call void @_ZN3imp4Vec3C2ERKS0_(ptr noundef nonnull align 8 dereferenceable(36) %15, ptr noundef nonnull align 8 dereferenceable(36) %25) #4
  %26 = getelementptr inbounds %"class.imp::Vec3", ptr %15, i64 1
  %27 = load ptr, ptr %8, align 8, !tbaa !5
  call void @_ZN3imp4Vec3C2ERKS0_(ptr noundef nonnull align 8 dereferenceable(36) %26, ptr noundef nonnull align 8 dereferenceable(36) %27) #4
  %28 = load i32, ptr %13, align 4, !tbaa !9
  %29 = sext i32 %28 to i64
  %30 = getelementptr inbounds [2 x %"class.imp::Vec3"], ptr %15, i64 0, i64 %29
  %31 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN3imp4Vec31xEv(ptr noundef nonnull align 8 dereferenceable(36) %30)
          to label %32 unwind label %44

32:                                               ; preds = %5
  %33 = load float, ptr %31, align 4, !tbaa !11
  %34 = load i32, ptr %14, align 4, !tbaa !9
  %35 = sext i32 %34 to i64
  %36 = getelementptr inbounds [2 x %"class.imp::Vec3"], ptr %15, i64 0, i64 %35
  %37 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN3imp4Vec31xEv(ptr noundef nonnull align 8 dereferenceable(36) %36)
          to label %38 unwind label %44

38:                                               ; preds = %32
  %39 = load float, ptr %37, align 4, !tbaa !11
  %40 = fcmp ogt float %33, %39
  br i1 %40, label %41, label %48

41:                                               ; preds = %38
  store i32 1, ptr %13, align 4, !tbaa !9
  store i32 0, ptr %14, align 4, !tbaa !9
  %42 = load ptr, ptr %10, align 8, !tbaa !5
  store ptr %42, ptr %11, align 8, !tbaa !5
  %43 = load ptr, ptr %9, align 8, !tbaa !5
  store ptr %43, ptr %12, align 8, !tbaa !5
  br label %48

44:                                               ; preds = %32, %5
  %45 = landingpad { ptr, i32 }
          cleanup
  %46 = extractvalue { ptr, i32 } %45, 0
  store ptr %46, ptr %16, align 8
  %47 = extractvalue { ptr, i32 } %45, 1
  store i32 %47, ptr %17, align 4
  br label %148

48:                                               ; preds = %41, %38
  call void @llvm.lifetime.start.p0(i64 80, ptr %18) #4
  call void @_ZN3imp8VaryingsC2Ev(ptr noundef nonnull align 8 dereferenceable(80) %18) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #4
  %49 = load i32, ptr %13, align 4, !tbaa !9
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds [2 x %"class.imp::Vec3"], ptr %15, i64 0, i64 %50
  %52 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN3imp4Vec31xEv(ptr noundef nonnull align 8 dereferenceable(36) %51)
          to label %53 unwind label %72

53:                                               ; preds = %48
  %54 = load float, ptr %52, align 4, !tbaa !11
  %55 = invoke noundef float @_ZSt5floorf(float noundef %54)
          to label %56 unwind label %72

56:                                               ; preds = %53
  %57 = fptosi float %55 to i32
  store i32 %57, ptr %19, align 4, !tbaa !9
  br label %58

58:                                               ; preds = %122, %56
  %59 = load i32, ptr %19, align 4, !tbaa !9
  %60 = sitofp i32 %59 to float
  %61 = load i32, ptr %14, align 4, !tbaa !9
  %62 = sext i32 %61 to i64
  %63 = getelementptr inbounds [2 x %"class.imp::Vec3"], ptr %15, i64 0, i64 %62
  %64 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN3imp4Vec31xEv(ptr noundef nonnull align 8 dereferenceable(36) %63)
          to label %65 unwind label %72

65:                                               ; preds = %58
  %66 = load float, ptr %64, align 4, !tbaa !11
  %67 = invoke noundef float @_ZSt5floorf(float noundef %66)
          to label %68 unwind label %72

68:                                               ; preds = %65
  %69 = fadd float %67, 1.000000e+00
  %70 = fcmp olt float %60, %69
  br i1 %70, label %76, label %71

71:                                               ; preds = %68
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #4
  br label %140

72:                                               ; preds = %65, %58, %53, %48
  %73 = landingpad { ptr, i32 }
          cleanup
  %74 = extractvalue { ptr, i32 } %73, 0
  store ptr %74, ptr %16, align 8
  %75 = extractvalue { ptr, i32 } %73, 1
  store i32 %75, ptr %17, align 4
  br label %139

76:                                               ; preds = %68
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #4
  %77 = load i32, ptr %13, align 4, !tbaa !9
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds [2 x %"class.imp::Vec3"], ptr %15, i64 0, i64 %78
  %80 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN3imp4Vec31xEv(ptr noundef nonnull align 8 dereferenceable(36) %79)
          to label %81 unwind label %125

81:                                               ; preds = %76
  %82 = load float, ptr %80, align 4, !tbaa !11
  %83 = load i32, ptr %14, align 4, !tbaa !9
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds [2 x %"class.imp::Vec3"], ptr %15, i64 0, i64 %84
  %86 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN3imp4Vec31xEv(ptr noundef nonnull align 8 dereferenceable(36) %85)
          to label %87 unwind label %125

87:                                               ; preds = %81
  %88 = load float, ptr %86, align 4, !tbaa !11
  %89 = load i32, ptr %19, align 4, !tbaa !9
  %90 = sitofp i32 %89 to float
  %91 = invoke noundef float @_ZN3imp10linearstepIfEET_S1_S1_S1_(float noundef %82, float noundef %88, float noundef %90)
          to label %92 unwind label %125

92:                                               ; preds = %87
  %93 = invoke noundef float @_ZN3imp5clampIfEET_S1_S1_S1_(float noundef %91, float noundef 0.000000e+00, float noundef 1.000000e+00)
          to label %94 unwind label %125

94:                                               ; preds = %92
  store float %93, ptr %20, align 4, !tbaa !11
  %95 = load ptr, ptr %11, align 8, !tbaa !5
  %96 = load ptr, ptr %12, align 8, !tbaa !5
  %97 = load float, ptr %20, align 4, !tbaa !11
  invoke void @_ZN3imp8Varyings3mixERKS0_S2_f(ptr noundef nonnull align 8 dereferenceable(80) %18, ptr noundef nonnull align 8 dereferenceable(80) %95, ptr noundef nonnull align 8 dereferenceable(80) %96, float noundef %97)
          to label %98 unwind label %125

98:                                               ; preds = %94
  %99 = getelementptr inbounds %"class.imp::Rasterizer", ptr %22, i32 0, i32 6
  %100 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3imp12FragCallbackELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %99) #4
  %101 = getelementptr inbounds %"class.imp::Rasterizer", ptr %22, i32 0, i32 1
  call void @llvm.lifetime.start.p0(i64 40, ptr %21) #4
  %102 = load i32, ptr %19, align 4, !tbaa !9
  %103 = sitofp i32 %102 to float
  %104 = load i32, ptr %13, align 4, !tbaa !9
  %105 = sext i32 %104 to i64
  %106 = getelementptr inbounds [2 x %"class.imp::Vec3"], ptr %15, i64 0, i64 %105
  %107 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN3imp4Vec31yEv(ptr noundef nonnull align 8 dereferenceable(36) %106)
          to label %108 unwind label %129

108:                                              ; preds = %98
  %109 = load float, ptr %107, align 4, !tbaa !11
  %110 = load i32, ptr %13, align 4, !tbaa !9
  %111 = sext i32 %110 to i64
  %112 = getelementptr inbounds [2 x %"class.imp::Vec3"], ptr %15, i64 0, i64 %111
  %113 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZN3imp4Vec31zEv(ptr noundef nonnull align 8 dereferenceable(36) %112)
          to label %114 unwind label %129

114:                                              ; preds = %108
  %115 = load float, ptr %113, align 4, !tbaa !11
  invoke void @_ZN3imp4Vec3C2Efff(ptr noundef nonnull align 8 dereferenceable(36) %21, float noundef %103, float noundef %109, float noundef %115)
          to label %116 unwind label %129

116:                                              ; preds = %114
  %117 = getelementptr inbounds %"class.imp::Rasterizer", ptr %22, i32 0, i32 4
  %118 = load ptr, ptr %100, align 8, !tbaa !13
  %119 = getelementptr inbounds ptr, ptr %118, i64 3
  %120 = load ptr, ptr %119, align 8
  invoke void %120(ptr noundef nonnull align 8 dereferenceable(24) %100, ptr noundef nonnull align 8 dereferenceable(48) %101, ptr noundef nonnull align 8 dereferenceable(36) %21, ptr noundef nonnull align 8 dereferenceable(296) %117, ptr noundef nonnull align 8 dereferenceable(80) %18)
          to label %121 unwind label %133

121:                                              ; preds = %116
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(36) %21) #4
  call void @llvm.lifetime.end.p0(i64 40, ptr %21) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #4
  br label %122

122:                                              ; preds = %121
  %123 = load i32, ptr %19, align 4, !tbaa !9
  %124 = add nsw i32 %123, 1
  store i32 %124, ptr %19, align 4, !tbaa !9
  br label %58, !llvm.loop !15

125:                                              ; preds = %94, %92, %87, %81, %76
  %126 = landingpad { ptr, i32 }
          cleanup
  %127 = extractvalue { ptr, i32 } %126, 0
  store ptr %127, ptr %16, align 8
  %128 = extractvalue { ptr, i32 } %126, 1
  store i32 %128, ptr %17, align 4
  br label %138

129:                                              ; preds = %114, %108, %98
  %130 = landingpad { ptr, i32 }
          cleanup
  %131 = extractvalue { ptr, i32 } %130, 0
  store ptr %131, ptr %16, align 8
  %132 = extractvalue { ptr, i32 } %130, 1
  store i32 %132, ptr %17, align 4
  br label %137

133:                                              ; preds = %116
  %134 = landingpad { ptr, i32 }
          cleanup
  %135 = extractvalue { ptr, i32 } %134, 0
  store ptr %135, ptr %16, align 8
  %136 = extractvalue { ptr, i32 } %134, 1
  store i32 %136, ptr %17, align 4
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(36) %21) #4
  br label %137

137:                                              ; preds = %133, %129
  call void @llvm.lifetime.end.p0(i64 40, ptr %21) #4
  br label %138

138:                                              ; preds = %137, %125
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #4
  br label %139

139:                                              ; preds = %138, %72
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #4
  call void @_ZN3imp8VaryingsD2Ev(ptr noundef nonnull align 8 dereferenceable(80) %18) #4
  call void @llvm.lifetime.end.p0(i64 80, ptr %18) #4
  br label %148

140:                                              ; preds = %71
  call void @_ZN3imp8VaryingsD2Ev(ptr noundef nonnull align 8 dereferenceable(80) %18) #4
  call void @llvm.lifetime.end.p0(i64 80, ptr %18) #4
  %141 = getelementptr inbounds [2 x %"class.imp::Vec3"], ptr %15, i32 0, i32 0
  %142 = getelementptr inbounds %"class.imp::Vec3", ptr %141, i64 2
  br label %143

143:                                              ; preds = %143, %140
  %144 = phi ptr [ %142, %140 ], [ %145, %143 ]
  %145 = getelementptr inbounds %"class.imp::Vec3", ptr %144, i64 -1
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(36) %145) #4
  %146 = icmp eq ptr %145, %141
  br i1 %146, label %147, label %143

147:                                              ; preds = %143
  call void @llvm.lifetime.end.p0(i64 80, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  ret void

148:                                              ; preds = %139, %44
  %149 = getelementptr inbounds [2 x %"class.imp::Vec3"], ptr %15, i32 0, i32 0
  %150 = getelementptr inbounds %"class.imp::Vec3", ptr %149, i64 2
  br label %151

151:                                              ; preds = %151, %148
  %152 = phi ptr [ %150, %148 ], [ %153, %151 ]
  %153 = getelementptr inbounds %"class.imp::Vec3", ptr %152, i64 -1
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(36) %153) #4
  %154 = icmp eq ptr %153, %149
  br i1 %154, label %155, label %151

155:                                              ; preds = %151
  call void @llvm.lifetime.end.p0(i64 80, ptr %15) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #4
  br label %156

156:                                              ; preds = %155
  %157 = load ptr, ptr %16, align 8
  %158 = load i32, ptr %17, align 4
  %159 = insertvalue { ptr, i32 } poison, ptr %157, 0
  %160 = insertvalue { ptr, i32 } %159, i32 %158, 1
  resume { ptr, i32 } %160
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZN3imp4Vec31xEv(ptr noundef nonnull align 8 dereferenceable(36)) #3 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_ZSt5floorf(float noundef) #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef float @_ZN3imp10linearstepIfEET_S1_S1_S1_(float noundef, float noundef, float noundef) #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZN3imp4Vec31yEv(ptr noundef nonnull align 8 dereferenceable(36)) #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZN3imp4Vec31zEv(ptr noundef nonnull align 8 dereferenceable(36)) #3 align 2

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 #3 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"float", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"vtable pointer", !8, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}


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

%"class.imp::Vec3" = type { %"class.imp::Vec.base", [4 x i8] }
%"class.imp::Vec.base" = type <{ %"class.imp::Object", [3 x float] }>
%"class.imp::Object" = type { ptr, %"class.std::shared_ptr" }
%"class.std::shared_ptr" = type { %"class.std::__shared_ptr" }
%"class.std::__shared_ptr" = type { ptr, %"class.std::__shared_count" }
%"class.std::__shared_count" = type { ptr }
%"struct.imp::Varyings" = type { %"class.std::map.18", %"class.std::vector", ptr }
%"class.std::map.18" = type { %"class.std::_Rb_tree.19" }
%"class.std::_Rb_tree.19" = type { %"struct.std::_Rb_tree<std::__cxx11::basic_string<char>, std::pair<const std::__cxx11::basic_string<char>, int>, std::_Select1st<std::pair<const std::__cxx11::basic_string<char>, int>>, std::less<std::__cxx11::basic_string<char>>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<std::__cxx11::basic_string<char>, std::pair<const std::__cxx11::basic_string<char>, int>, std::_Select1st<std::pair<const std::__cxx11::basic_string<char>, int>>, std::less<std::__cxx11::basic_string<char>>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = 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 }

; 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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3imp8Varyings3mixERKS0_S2_f(ptr noundef nonnull align 8 dereferenceable(80), ptr noundef nonnull align 8 dereferenceable(80), ptr noundef nonnull align 8 dereferenceable(80), float noundef) local_unnamed_addr #1 align 2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNKSt19__shared_ptr_accessIN3imp12FragCallbackELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN3imp4Vec3C2Efff(ptr noundef nonnull align 8 dereferenceable(36), float noundef, float noundef, float noundef) unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN3imp4Vec3C2ERKS0_(ptr noundef nonnull align 8 dereferenceable(36), ptr noundef nonnull align 8 dereferenceable(36)) unnamed_addr #2 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef float @_ZN3imp5clampIfEET_S1_S1_S1_(float noundef, float noundef, float noundef) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3imp10Rasterizer5hLineERKNS_4Vec3ES3_RKNS_8VaryingsES6_(ptr noundef nonnull align 8 dereferenceable(472) %0, ptr noundef nonnull align 8 dereferenceable(36) %1, ptr noundef nonnull align 8 dereferenceable(36) %2, ptr noundef nonnull align 8 dereferenceable(80) %3, ptr noundef nonnull align 8 dereferenceable(80) %4) local_unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %6 = alloca [2 x %"class.imp::Vec3"], align 16
  %7 = alloca %"struct.imp::Varyings", align 8
  %8 = alloca %"class.imp::Vec3", align 8
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %6) #4
  call void @_ZN3imp4Vec3C2ERKS0_(ptr noundef nonnull align 8 dereferenceable(36) %6, ptr noundef nonnull align 8 dereferenceable(36) %1) #4
  %9 = getelementptr inbounds i8, ptr %6, i64 40
  call void @_ZN3imp4Vec3C2ERKS0_(ptr noundef nonnull align 8 dereferenceable(36) %9, ptr noundef nonnull align 8 dereferenceable(36) %2) #4
  %10 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN3imp4Vec31xEv(ptr noundef nonnull align 8 dereferenceable(36) %6)
  %11 = load float, ptr %10, align 4, !tbaa !5
  %12 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN3imp4Vec31xEv(ptr noundef nonnull align 8 dereferenceable(36) %9)
  %13 = load float, ptr %12, align 4, !tbaa !5
  %14 = fcmp ogt float %11, %13
  br i1 %14, label %15, label %16

15:                                               ; preds = %5
  br label %16

16:                                               ; preds = %15, %5
  %.029 = phi ptr [ %3, %15 ], [ %4, %5 ]
  %.028.sroa.phi = phi ptr [ %9, %15 ], [ %6, %5 ]
  %.027.sroa.phi = phi ptr [ %6, %15 ], [ %9, %5 ]
  %.0 = phi ptr [ %4, %15 ], [ %3, %5 ]
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %7) #4
  call void @_ZN3imp8VaryingsC2Ev(ptr noundef nonnull align 8 dereferenceable(80) %7) #4
  %17 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN3imp4Vec31xEv(ptr noundef nonnull align 8 dereferenceable(36) %.028.sroa.phi)
  %18 = load float, ptr %17, align 4, !tbaa !5
  %19 = call noundef float @_ZSt5floorf(float noundef %18)
  %20 = fptosi float %19 to i32
  %21 = sitofp i32 %20 to float
  %22 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN3imp4Vec31xEv(ptr noundef nonnull align 8 dereferenceable(36) %.027.sroa.phi)
  %23 = load float, ptr %22, align 4, !tbaa !5
  %24 = call noundef float @_ZSt5floorf(float noundef %23)
  %25 = fadd float %24, 1.000000e+00
  %26 = fcmp ogt float %25, %21
  br i1 %26, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %16
  %27 = getelementptr inbounds i8, ptr %0, i64 456
  %28 = getelementptr inbounds i8, ptr %0, i64 24
  %29 = getelementptr inbounds i8, ptr %0, i64 120
  br label %31

._crit_edge:                                      ; preds = %49, %16
  call void @_ZN3imp8VaryingsD2Ev(ptr noundef nonnull align 8 dereferenceable(80) %7) #4
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %7) #4
  %30 = getelementptr inbounds i8, ptr %6, i64 40
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(36) %30) #4
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(36) %6) #4
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %6) #4
  ret void

31:                                               ; preds = %.lr.ph, %49
  %32 = phi float [ %21, %.lr.ph ], [ %51, %49 ]
  %.02337 = phi i32 [ %20, %.lr.ph ], [ %50, %49 ]
  %33 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN3imp4Vec31xEv(ptr noundef nonnull align 8 dereferenceable(36) %.028.sroa.phi)
  %34 = load float, ptr %33, align 4, !tbaa !5
  %35 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN3imp4Vec31xEv(ptr noundef nonnull align 8 dereferenceable(36) %.027.sroa.phi)
  %36 = load float, ptr %35, align 4, !tbaa !5
  %37 = call noundef float @_ZN3imp10linearstepIfEET_S1_S1_S1_(float noundef %34, float noundef %36, float noundef %32)
  %38 = call noundef float @_ZN3imp5clampIfEET_S1_S1_S1_(float noundef %37, float noundef 0.000000e+00, float noundef 1.000000e+00)
  invoke void @_ZN3imp8Varyings3mixERKS0_S2_f(ptr noundef nonnull align 8 dereferenceable(80) %7, ptr noundef nonnull align 8 dereferenceable(80) %.0, ptr noundef nonnull align 8 dereferenceable(80) %.029, float noundef %38)
          to label %39 unwind label %57

39:                                               ; preds = %31
  %40 = call noundef ptr @_ZNKSt19__shared_ptr_accessIN3imp12FragCallbackELN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %27) #4
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %8) #4
  %41 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN3imp4Vec31yEv(ptr noundef nonnull align 8 dereferenceable(36) %.028.sroa.phi)
  %42 = load float, ptr %41, align 4, !tbaa !5
  %43 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN3imp4Vec31zEv(ptr noundef nonnull align 8 dereferenceable(36) %.028.sroa.phi)
  %44 = load float, ptr %43, align 4, !tbaa !5
  invoke void @_ZN3imp4Vec3C2Efff(ptr noundef nonnull align 8 dereferenceable(36) %8, float noundef %32, float noundef %42, float noundef %44)
          to label %45 unwind label %59

45:                                               ; preds = %39
  %46 = load ptr, ptr %40, align 8, !tbaa !9
  %47 = getelementptr inbounds i8, ptr %46, i64 24
  %48 = load ptr, ptr %47, align 8
  invoke void %48(ptr noundef nonnull align 8 dereferenceable(24) %40, ptr noundef nonnull align 8 dereferenceable(48) %28, ptr noundef nonnull align 8 dereferenceable(36) %8, ptr noundef nonnull align 8 dereferenceable(296) %29, ptr noundef nonnull align 8 dereferenceable(80) %7)
          to label %49 unwind label %61

49:                                               ; preds = %45
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(36) %8) #4
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %8) #4
  %50 = add nsw i32 %.02337, 1
  %51 = sitofp i32 %50 to float
  %52 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZN3imp4Vec31xEv(ptr noundef nonnull align 8 dereferenceable(36) %.027.sroa.phi)
  %53 = load float, ptr %52, align 4, !tbaa !5
  %54 = call noundef float @_ZSt5floorf(float noundef %53)
  %55 = fadd float %54, 1.000000e+00
  %56 = fcmp ogt float %55, %51
  br i1 %56, label %31, label %._crit_edge, !llvm.loop !11

57:                                               ; preds = %31
  %58 = landingpad { ptr, i32 }
          cleanup
  br label %64

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

61:                                               ; preds = %45
  %62 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(36) %8) #4
  br label %63

63:                                               ; preds = %61, %59
  %.pn = phi { ptr, i32 } [ %62, %61 ], [ %60, %59 ]
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %8) #4
  br label %64

64:                                               ; preds = %63, %57
  %.pn.pn = phi { ptr, i32 } [ %.pn, %63 ], [ %58, %57 ]
  call void @_ZN3imp8VaryingsD2Ev(ptr noundef nonnull align 8 dereferenceable(80) %7) #4
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %7) #4
  %65 = getelementptr inbounds i8, ptr %6, i64 40
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(36) %65) #4
  call void @_ZN3imp6ObjectD2Ev(ptr noundef nonnull align 8 dereferenceable(36) %6) #4
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %6) #4
  resume { ptr, i32 } %.pn.pn
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZN3imp4Vec31xEv(ptr noundef nonnull align 8 dereferenceable(36)) local_unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef float @_ZSt5floorf(float noundef) local_unnamed_addr #2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef float @_ZN3imp10linearstepIfEET_S1_S1_S1_(float noundef, float noundef, float noundef) local_unnamed_addr #3

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZN3imp4Vec31yEv(ptr noundef nonnull align 8 dereferenceable(36)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZN3imp4Vec31zEv(ptr noundef nonnull align 8 dereferenceable(36)) local_unnamed_addr #3 align 2

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 #3 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 = !{!"float", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"vtable pointer", !8, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}


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