; LLVM IR from bhaskar0120/simple-render :: main (render)

; 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.Scene = type { [256 x %struct.Shape], i64, %struct.Vector, %struct.Vector, [3 x i8] }
%struct.Shape = type { %struct.Vector, %struct.Vector, float, float, float, [3 x i8], ptr, ptr }
%struct.Vector = type { float, float, float }

; Function Attrs: nounwind uwtable
declare dso_local float @dot(<2 x float>, float, <2 x float>, float) #0

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

; Function Attrs: nounwind uwtable
declare dso_local { <2 x float>, float } @normalize(<2 x float>, float) #0

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

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

; Function Attrs: nounwind uwtable
declare dso_local { <2 x float>, float } @sub(<2 x float>, float, <2 x float>, float) #0

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

; Function Attrs: nounwind uwtable
declare dso_local zeroext i1 @in_shadow(ptr noundef byval(%struct.Scene) align 8, <2 x float>, float) #0

; Function Attrs: nounwind uwtable
declare dso_local { <2 x float>, float } @get_intersection(ptr noundef byval(%struct.Scene) align 8, <2 x float>, float, ptr noundef) #0

; Function Attrs: nounwind uwtable
define dso_local void @render(ptr noundef %0, i32 noundef %1, i32 noundef %2, ptr noundef byval(%struct.Scene) align 8 %3) #0 {
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca float, align 4
  %12 = alloca float, align 4
  %13 = alloca %struct.Vector, align 4
  %14 = alloca %struct.Vector, align 4
  %15 = alloca %struct.Vector, align 4
  %16 = alloca { <2 x float>, float }, align 4
  %17 = alloca { <2 x float>, float }, align 4
  %18 = alloca { <2 x float>, float }, align 8
  %19 = alloca { <2 x float>, float }, align 4
  %20 = alloca { <2 x float>, float }, align 8
  %21 = alloca %struct.Vector, align 4
  %22 = alloca %struct.Vector, align 4
  %23 = alloca { <2 x float>, float }, align 4
  %24 = alloca { <2 x float>, float }, align 8
  %25 = alloca { <2 x float>, float }, align 4
  %26 = alloca float, align 4
  %27 = alloca %struct.Vector, align 4
  %28 = alloca %struct.Vector, align 4
  %29 = alloca { <2 x float>, float }, align 8
  %30 = alloca { <2 x float>, float }, align 4
  %31 = alloca { <2 x float>, float }, align 8
  %32 = alloca { <2 x float>, float }, align 4
  %33 = alloca { <2 x float>, float }, align 8
  %34 = alloca { <2 x float>, float }, align 4
  %35 = alloca { <2 x float>, float }, align 4
  %36 = alloca i32, align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store i32 %1, ptr %6, align 4, !tbaa !9
  store i32 %2, ptr %7, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  store i32 0, ptr %8, align 4, !tbaa !9
  br label %37

37:                                               ; preds = %290, %4
  %38 = load i32, ptr %8, align 4, !tbaa !9
  %39 = load i32, ptr %6, align 4, !tbaa !9
  %40 = icmp slt i32 %38, %39
  br i1 %40, label %42, label %41

41:                                               ; preds = %37
  store i32 2, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  br label %293

42:                                               ; preds = %37
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  store i32 0, ptr %10, align 4, !tbaa !9
  br label %43

43:                                               ; preds = %286, %42
  %44 = load i32, ptr %10, align 4, !tbaa !9
  %45 = load i32, ptr %7, align 4, !tbaa !9
  %46 = icmp slt i32 %44, %45
  br i1 %46, label %48, label %47

47:                                               ; preds = %43
  store i32 5, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  br label %289

48:                                               ; preds = %43
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  %49 = load i32, ptr %10, align 4, !tbaa !9
  %50 = sitofp i32 %49 to float
  %51 = load i32, ptr %7, align 4, !tbaa !9
  %52 = sitofp i32 %51 to float
  %53 = fdiv float %50, %52
  %54 = fpext float %53 to double
  %55 = fsub double %54, 5.000000e-01
  %56 = fptrunc double %55 to float
  store float %56, ptr %11, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  %57 = load i32, ptr %8, align 4, !tbaa !9
  %58 = sitofp i32 %57 to float
  %59 = load i32, ptr %6, align 4, !tbaa !9
  %60 = sitofp i32 %59 to float
  %61 = fdiv float %58, %60
  %62 = fpext float %61 to double
  %63 = fsub double %62, 5.000000e-01
  %64 = fptrunc double %63 to float
  store float %64, ptr %12, align 4, !tbaa !11
  %65 = load i32, ptr %7, align 4, !tbaa !9
  %66 = sitofp i32 %65 to float
  %67 = load i32, ptr %6, align 4, !tbaa !9
  %68 = sitofp i32 %67 to float
  %69 = fdiv float %66, %68
  %70 = load float, ptr %11, align 4, !tbaa !11
  %71 = fmul float %70, %69
  store float %71, ptr %11, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 12, ptr %13) #5
  %72 = getelementptr inbounds %struct.Vector, ptr %15, i32 0, i32 0
  %73 = load float, ptr %11, align 4, !tbaa !11
  store float %73, ptr %72, align 4, !tbaa !13
  %74 = getelementptr inbounds %struct.Vector, ptr %15, i32 0, i32 1
  %75 = load float, ptr %12, align 4, !tbaa !11
  store float %75, ptr %74, align 4, !tbaa !15
  %76 = getelementptr inbounds %struct.Vector, ptr %15, i32 0, i32 2
  store float 1.000000e+00, ptr %76, align 4, !tbaa !16
  %77 = getelementptr inbounds %struct.Scene, ptr %3, i32 0, i32 3
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %16, ptr align 4 %15, i64 12, i1 false)
  %78 = getelementptr inbounds { <2 x float>, float }, ptr %16, i32 0, i32 0
  %79 = load <2 x float>, ptr %78, align 4
  %80 = getelementptr inbounds { <2 x float>, float }, ptr %16, i32 0, i32 1
  %81 = load float, ptr %80, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %17, ptr align 4 %77, i64 12, i1 false)
  %82 = getelementptr inbounds { <2 x float>, float }, ptr %17, i32 0, i32 0
  %83 = load <2 x float>, ptr %82, align 4
  %84 = getelementptr inbounds { <2 x float>, float }, ptr %17, i32 0, i32 1
  %85 = load float, ptr %84, align 4
  %86 = call { <2 x float>, float } @sub(<2 x float> %79, float %81, <2 x float> %83, float %85)
  store { <2 x float>, float } %86, ptr %18, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %14, ptr align 8 %18, i64 12, i1 false)
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %19, ptr align 4 %14, i64 12, i1 false)
  %87 = getelementptr inbounds { <2 x float>, float }, ptr %19, i32 0, i32 0
  %88 = load <2 x float>, ptr %87, align 4
  %89 = getelementptr inbounds { <2 x float>, float }, ptr %19, i32 0, i32 1
  %90 = load float, ptr %89, align 4
  %91 = call { <2 x float>, float } @normalize(<2 x float> %88, float %90)
  store { <2 x float>, float } %91, ptr %20, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %13, ptr align 8 %20, i64 12, i1 false)
  call void @llvm.lifetime.start.p0(i64 12, ptr %21) #5
  call void @llvm.lifetime.start.p0(i64 12, ptr %22) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %23, ptr align 4 %13, i64 12, i1 false)
  %92 = getelementptr inbounds { <2 x float>, float }, ptr %23, i32 0, i32 0
  %93 = load <2 x float>, ptr %92, align 4
  %94 = getelementptr inbounds { <2 x float>, float }, ptr %23, i32 0, i32 1
  %95 = load float, ptr %94, align 4
  %96 = call { <2 x float>, float } @get_intersection(ptr noundef byval(%struct.Scene) align 8 %3, <2 x float> %93, float %95, ptr noundef %21)
  store { <2 x float>, float } %96, ptr %24, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %22, ptr align 8 %24, i64 12, i1 false)
  %97 = getelementptr inbounds %struct.Vector, ptr %22, i32 0, i32 0
  %98 = load float, ptr %97, align 4, !tbaa !13
  %99 = fsub float 1.000000e+02, %98
  %100 = fpext float %99 to double
  %101 = call double @llvm.fabs.f64(double %100)
  %102 = fcmp olt double %101, 1.000000e-03
  br i1 %102, label %117, label %103

103:                                              ; preds = %48
  %104 = getelementptr inbounds %struct.Vector, ptr %22, i32 0, i32 1
  %105 = load float, ptr %104, align 4, !tbaa !15
  %106 = fsub float 1.000000e+02, %105
  %107 = fpext float %106 to double
  %108 = call double @llvm.fabs.f64(double %107)
  %109 = fcmp olt double %108, 1.000000e-03
  br i1 %109, label %117, label %110

110:                                              ; preds = %103
  %111 = getelementptr inbounds %struct.Vector, ptr %22, i32 0, i32 2
  %112 = load float, ptr %111, align 4, !tbaa !16
  %113 = fsub float 1.000000e+02, %112
  %114 = fpext float %113 to double
  %115 = call double @llvm.fabs.f64(double %114)
  %116 = fcmp olt double %115, 1.000000e-03
  br i1 %116, label %117, label %166

117:                                              ; preds = %110, %103, %48
  %118 = getelementptr inbounds %struct.Scene, ptr %3, i32 0, i32 4
  %119 = getelementptr inbounds [3 x i8], ptr %118, i64 0, i64 0
  %120 = load i8, ptr %119, align 8, !tbaa !17
  %121 = load ptr, ptr %5, align 8, !tbaa !5
  %122 = load i32, ptr %6, align 4, !tbaa !9
  %123 = load i32, ptr %8, align 4, !tbaa !9
  %124 = sub nsw i32 %122, %123
  %125 = sub nsw i32 %124, 1
  %126 = load i32, ptr %7, align 4, !tbaa !9
  %127 = mul nsw i32 %125, %126
  %128 = load i32, ptr %10, align 4, !tbaa !9
  %129 = add nsw i32 %127, %128
  %130 = mul nsw i32 %129, 3
  %131 = add nsw i32 %130, 0
  %132 = sext i32 %131 to i64
  %133 = getelementptr inbounds i8, ptr %121, i64 %132
  store i8 %120, ptr %133, align 1, !tbaa !17
  %134 = getelementptr inbounds %struct.Scene, ptr %3, i32 0, i32 4
  %135 = getelementptr inbounds [3 x i8], ptr %134, i64 0, i64 1
  %136 = load i8, ptr %135, align 1, !tbaa !17
  %137 = load ptr, ptr %5, align 8, !tbaa !5
  %138 = load i32, ptr %6, align 4, !tbaa !9
  %139 = load i32, ptr %8, align 4, !tbaa !9
  %140 = sub nsw i32 %138, %139
  %141 = sub nsw i32 %140, 1
  %142 = load i32, ptr %7, align 4, !tbaa !9
  %143 = mul nsw i32 %141, %142
  %144 = load i32, ptr %10, align 4, !tbaa !9
  %145 = add nsw i32 %143, %144
  %146 = mul nsw i32 %145, 3
  %147 = add nsw i32 %146, 1
  %148 = sext i32 %147 to i64
  %149 = getelementptr inbounds i8, ptr %137, i64 %148
  store i8 %136, ptr %149, align 1, !tbaa !17
  %150 = getelementptr inbounds %struct.Scene, ptr %3, i32 0, i32 4
  %151 = getelementptr inbounds [3 x i8], ptr %150, i64 0, i64 2
  %152 = load i8, ptr %151, align 2, !tbaa !17
  %153 = load ptr, ptr %5, align 8, !tbaa !5
  %154 = load i32, ptr %6, align 4, !tbaa !9
  %155 = load i32, ptr %8, align 4, !tbaa !9
  %156 = sub nsw i32 %154, %155
  %157 = sub nsw i32 %156, 1
  %158 = load i32, ptr %7, align 4, !tbaa !9
  %159 = mul nsw i32 %157, %158
  %160 = load i32, ptr %10, align 4, !tbaa !9
  %161 = add nsw i32 %159, %160
  %162 = mul nsw i32 %161, 3
  %163 = add nsw i32 %162, 2
  %164 = sext i32 %163 to i64
  %165 = getelementptr inbounds i8, ptr %153, i64 %164
  store i8 %152, ptr %165, align 1, !tbaa !17
  store i32 7, ptr %9, align 4
  br label %283

166:                                              ; preds = %110
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %25, ptr align 4 %22, i64 12, i1 false)
  %167 = getelementptr inbounds { <2 x float>, float }, ptr %25, i32 0, i32 0
  %168 = load <2 x float>, ptr %167, align 4
  %169 = getelementptr inbounds { <2 x float>, float }, ptr %25, i32 0, i32 1
  %170 = load float, ptr %169, align 4
  %171 = call zeroext i1 @in_shadow(ptr noundef byval(%struct.Scene) align 8 %3, <2 x float> %168, float %170)
  br i1 %171, label %172, label %212

172:                                              ; preds = %166
  %173 = load ptr, ptr %5, align 8, !tbaa !5
  %174 = load i32, ptr %6, align 4, !tbaa !9
  %175 = load i32, ptr %8, align 4, !tbaa !9
  %176 = sub nsw i32 %174, %175
  %177 = sub nsw i32 %176, 1
  %178 = load i32, ptr %7, align 4, !tbaa !9
  %179 = mul nsw i32 %177, %178
  %180 = load i32, ptr %10, align 4, !tbaa !9
  %181 = add nsw i32 %179, %180
  %182 = mul nsw i32 %181, 3
  %183 = add nsw i32 %182, 2
  %184 = sext i32 %183 to i64
  %185 = getelementptr inbounds i8, ptr %173, i64 %184
  store i8 0, ptr %185, align 1, !tbaa !17
  %186 = load ptr, ptr %5, align 8, !tbaa !5
  %187 = load i32, ptr %6, align 4, !tbaa !9
  %188 = load i32, ptr %8, align 4, !tbaa !9
  %189 = sub nsw i32 %187, %188
  %190 = sub nsw i32 %189, 1
  %191 = load i32, ptr %7, align 4, !tbaa !9
  %192 = mul nsw i32 %190, %191
  %193 = load i32, ptr %10, align 4, !tbaa !9
  %194 = add nsw i32 %192, %193
  %195 = mul nsw i32 %194, 3
  %196 = add nsw i32 %195, 1
  %197 = sext i32 %196 to i64
  %198 = getelementptr inbounds i8, ptr %186, i64 %197
  store i8 0, ptr %198, align 1, !tbaa !17
  %199 = load ptr, ptr %5, align 8, !tbaa !5
  %200 = load i32, ptr %6, align 4, !tbaa !9
  %201 = load i32, ptr %8, align 4, !tbaa !9
  %202 = sub nsw i32 %200, %201
  %203 = sub nsw i32 %202, 1
  %204 = load i32, ptr %7, align 4, !tbaa !9
  %205 = mul nsw i32 %203, %204
  %206 = load i32, ptr %10, align 4, !tbaa !9
  %207 = add nsw i32 %205, %206
  %208 = mul nsw i32 %207, 3
  %209 = add nsw i32 %208, 0
  %210 = sext i32 %209 to i64
  %211 = getelementptr inbounds i8, ptr %199, i64 %210
  store i8 0, ptr %211, align 1, !tbaa !17
  store i32 7, ptr %9, align 4
  br label %283

212:                                              ; preds = %166
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #5
  %213 = getelementptr inbounds %struct.Scene, ptr %3, i32 0, i32 2
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %29, ptr align 8 %213, i64 12, i1 false)
  %214 = getelementptr inbounds { <2 x float>, float }, ptr %29, i32 0, i32 0
  %215 = load <2 x float>, ptr %214, align 8
  %216 = getelementptr inbounds { <2 x float>, float }, ptr %29, i32 0, i32 1
  %217 = load float, ptr %216, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %30, ptr align 4 %22, i64 12, i1 false)
  %218 = getelementptr inbounds { <2 x float>, float }, ptr %30, i32 0, i32 0
  %219 = load <2 x float>, ptr %218, align 4
  %220 = getelementptr inbounds { <2 x float>, float }, ptr %30, i32 0, i32 1
  %221 = load float, ptr %220, align 4
  %222 = call { <2 x float>, float } @sub(<2 x float> %215, float %217, <2 x float> %219, float %221)
  store { <2 x float>, float } %222, ptr %31, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %28, ptr align 8 %31, i64 12, i1 false)
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %32, ptr align 4 %28, i64 12, i1 false)
  %223 = getelementptr inbounds { <2 x float>, float }, ptr %32, i32 0, i32 0
  %224 = load <2 x float>, ptr %223, align 4
  %225 = getelementptr inbounds { <2 x float>, float }, ptr %32, i32 0, i32 1
  %226 = load float, ptr %225, align 4
  %227 = call { <2 x float>, float } @normalize(<2 x float> %224, float %226)
  store { <2 x float>, float } %227, ptr %33, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %27, ptr align 8 %33, i64 12, i1 false)
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %34, ptr align 4 %21, i64 12, i1 false)
  %228 = getelementptr inbounds { <2 x float>, float }, ptr %34, i32 0, i32 0
  %229 = load <2 x float>, ptr %228, align 4
  %230 = getelementptr inbounds { <2 x float>, float }, ptr %34, i32 0, i32 1
  %231 = load float, ptr %230, align 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %35, ptr align 4 %27, i64 12, i1 false)
  %232 = getelementptr inbounds { <2 x float>, float }, ptr %35, i32 0, i32 0
  %233 = load <2 x float>, ptr %232, align 4
  %234 = getelementptr inbounds { <2 x float>, float }, ptr %35, i32 0, i32 1
  %235 = load float, ptr %234, align 4
  %236 = call float @dot(<2 x float> %229, float %231, <2 x float> %233, float %235)
  store float %236, ptr %26, align 4, !tbaa !11
  %237 = load float, ptr %26, align 4, !tbaa !11
  %238 = call float @clamp(float noundef %237, float noundef 0.000000e+00, float noundef 1.000000e+00)
  store float %238, ptr %26, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %36) #5
  %239 = load float, ptr %26, align 4, !tbaa !11
  %240 = fmul float %239, 2.550000e+02
  %241 = fptosi float %240 to i32
  store i32 %241, ptr %36, align 4, !tbaa !9
  %242 = load i32, ptr %36, align 4, !tbaa !9
  %243 = trunc i32 %242 to i8
  %244 = load ptr, ptr %5, align 8, !tbaa !5
  %245 = load i32, ptr %6, align 4, !tbaa !9
  %246 = load i32, ptr %8, align 4, !tbaa !9
  %247 = sub nsw i32 %245, %246
  %248 = sub nsw i32 %247, 1
  %249 = load i32, ptr %7, align 4, !tbaa !9
  %250 = mul nsw i32 %248, %249
  %251 = load i32, ptr %10, align 4, !tbaa !9
  %252 = add nsw i32 %250, %251
  %253 = mul nsw i32 %252, 3
  %254 = add nsw i32 %253, 2
  %255 = sext i32 %254 to i64
  %256 = getelementptr inbounds i8, ptr %244, i64 %255
  store i8 %243, ptr %256, align 1, !tbaa !17
  %257 = load ptr, ptr %5, align 8, !tbaa !5
  %258 = load i32, ptr %6, align 4, !tbaa !9
  %259 = load i32, ptr %8, align 4, !tbaa !9
  %260 = sub nsw i32 %258, %259
  %261 = sub nsw i32 %260, 1
  %262 = load i32, ptr %7, align 4, !tbaa !9
  %263 = mul nsw i32 %261, %262
  %264 = load i32, ptr %10, align 4, !tbaa !9
  %265 = add nsw i32 %263, %264
  %266 = mul nsw i32 %265, 3
  %267 = add nsw i32 %266, 1
  %268 = sext i32 %267 to i64
  %269 = getelementptr inbounds i8, ptr %257, i64 %268
  store i8 %243, ptr %269, align 1, !tbaa !17
  %270 = load ptr, ptr %5, align 8, !tbaa !5
  %271 = load i32, ptr %6, align 4, !tbaa !9
  %272 = load i32, ptr %8, align 4, !tbaa !9
  %273 = sub nsw i32 %271, %272
  %274 = sub nsw i32 %273, 1
  %275 = load i32, ptr %7, align 4, !tbaa !9
  %276 = mul nsw i32 %274, %275
  %277 = load i32, ptr %10, align 4, !tbaa !9
  %278 = add nsw i32 %276, %277
  %279 = mul nsw i32 %278, 3
  %280 = add nsw i32 %279, 0
  %281 = sext i32 %280 to i64
  %282 = getelementptr inbounds i8, ptr %270, i64 %281
  store i8 %243, ptr %282, align 1, !tbaa !17
  call void @llvm.lifetime.end.p0(i64 4, ptr %36) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #5
  store i32 0, ptr %9, align 4
  br label %283

283:                                              ; preds = %212, %172, %117
  call void @llvm.lifetime.end.p0(i64 12, ptr %22) #5
  call void @llvm.lifetime.end.p0(i64 12, ptr %21) #5
  call void @llvm.lifetime.end.p0(i64 12, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  %284 = load i32, ptr %9, align 4
  switch i32 %284, label %294 [
    i32 0, label %285
    i32 7, label %286
  ]

285:                                              ; preds = %283
  br label %286

286:                                              ; preds = %285, %283
  %287 = load i32, ptr %10, align 4, !tbaa !9
  %288 = add nsw i32 %287, 1
  store i32 %288, ptr %10, align 4, !tbaa !9
  br label %43, !llvm.loop !18

289:                                              ; preds = %47
  br label %290

290:                                              ; preds = %289
  %291 = load i32, ptr %8, align 4, !tbaa !9
  %292 = add nsw i32 %291, 1
  store i32 %292, ptr %8, align 4, !tbaa !9
  br label %37, !llvm.loop !20

293:                                              ; preds = %41
  ret void

294:                                              ; preds = %283
  unreachable
}

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare double @llvm.fabs.f64(double) #4

attributes #0 = { nounwind 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 #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { 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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }

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

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


; 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.Scene = type { [256 x %struct.Shape], i64, %struct.Vector, %struct.Vector, [3 x i8] }
%struct.Shape = type { %struct.Vector, %struct.Vector, float, float, float, [3 x i8], ptr, ptr }
%struct.Vector = type { float, float, float }

; Function Attrs: nounwind uwtable
declare dso_local float @dot(<2 x float>, float, <2 x float>, float) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local { <2 x float>, float } @normalize(<2 x float>, float) local_unnamed_addr #0

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

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

; Function Attrs: nounwind uwtable
declare dso_local { <2 x float>, float } @sub(<2 x float>, float, <2 x float>, float) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local float @clamp(float noundef, float noundef, float noundef) local_unnamed_addr #2

; Function Attrs: nounwind uwtable
declare dso_local zeroext i1 @in_shadow(ptr noundef byval(%struct.Scene) align 8, <2 x float>, float) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local { <2 x float>, float } @get_intersection(ptr noundef byval(%struct.Scene) align 8, <2 x float>, float, ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
define dso_local void @render(ptr nocapture noundef writeonly %0, i32 noundef %1, i32 noundef %2, ptr noundef byval(%struct.Scene) align 8 %3) local_unnamed_addr #0 {
  %5 = alloca %struct.Vector, align 8
  %6 = icmp sgt i32 %1, 0
  br i1 %6, label %.preheader.lr.ph, label %._crit_edge115

.preheader.lr.ph:                                 ; preds = %4
  %7 = icmp sgt i32 %2, 0
  %8 = sitofp i32 %2 to float
  %9 = uitofp nneg i32 %1 to float
  %10 = fdiv float %8, %9
  %11 = getelementptr inbounds i8, ptr %3, i64 14356
  %.sroa.242.0..sroa_idx = getelementptr inbounds i8, ptr %3, i64 14364
  %12 = getelementptr inbounds i8, ptr %3, i64 14344
  %.sroa.214.0..sroa_idx = getelementptr inbounds i8, ptr %3, i64 14352
  %.sroa.22.0..sroa_idx = getelementptr inbounds i8, ptr %5, i64 8
  %13 = getelementptr inbounds i8, ptr %3, i64 14368
  %14 = getelementptr inbounds i8, ptr %3, i64 14369
  %15 = getelementptr inbounds i8, ptr %3, i64 14370
  br i1 %7, label %.preheader.us.preheader, label %._crit_edge115

.preheader.us.preheader:                          ; preds = %.preheader.lr.ph
  %16 = zext nneg i32 %1 to i64
  %17 = zext nneg i32 %2 to i64
  %wide.trip.count121 = zext nneg i32 %1 to i64
  %wide.trip.count = zext nneg i32 %2 to i64
  br label %.preheader.us

.preheader.us:                                    ; preds = %.preheader.us.preheader, %._crit_edge.us
  %indvars.iv118 = phi i64 [ 0, %.preheader.us.preheader ], [ %indvars.iv.next119, %._crit_edge.us ]
  %18 = trunc nuw nsw i64 %indvars.iv118 to i32
  %19 = uitofp nneg i32 %18 to float
  %20 = fdiv float %19, %9
  %21 = fadd float %20, -5.000000e-01
  %22 = xor i64 %indvars.iv118, -1
  %23 = add nsw i64 %22, %16
  %24 = mul nsw i64 %23, %17
  br label %25

25:                                               ; preds = %.preheader.us, %78
  %indvars.iv = phi i64 [ 0, %.preheader.us ], [ %indvars.iv.next, %78 ]
  %26 = trunc nuw nsw i64 %indvars.iv to i32
  %27 = uitofp nneg i32 %26 to float
  %28 = fdiv float %27, %8
  %29 = fadd float %28, -5.000000e-01
  %30 = fmul float %10, %29
  %.sroa.045.0.vec.insert.us = insertelement <2 x float> poison, float %30, i64 0
  %.sroa.045.4.vec.insert.us = insertelement <2 x float> %.sroa.045.0.vec.insert.us, float %21, i64 1
  %.sroa.041.0.copyload.us = load <2 x float>, ptr %11, align 4
  %.sroa.242.0.copyload.us = load float, ptr %.sroa.242.0..sroa_idx, align 4
  %31 = call { <2 x float>, float } @sub(<2 x float> %.sroa.045.4.vec.insert.us, float 1.000000e+00, <2 x float> %.sroa.041.0.copyload.us, float %.sroa.242.0.copyload.us)
  %.fca.0.extract37.us = extractvalue { <2 x float>, float } %31, 0
  %.fca.1.extract38.us = extractvalue { <2 x float>, float } %31, 1
  %32 = call { <2 x float>, float } @normalize(<2 x float> %.fca.0.extract37.us, float %.fca.1.extract38.us)
  %.fca.0.extract31.us = extractvalue { <2 x float>, float } %32, 0
  %.fca.1.extract32.us = extractvalue { <2 x float>, float } %32, 1
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %5) #4
  %33 = call { <2 x float>, float } @get_intersection(ptr noundef nonnull byval(%struct.Scene) align 8 %3, <2 x float> %.fca.0.extract31.us, float %.fca.1.extract32.us, ptr noundef nonnull %5)
  %.fca.0.extract22.us = extractvalue { <2 x float>, float } %33, 0
  %.fca.1.extract23.us = extractvalue { <2 x float>, float } %33, 1
  %.sroa.028.0.vec.extract.us = extractelement <2 x float> %.fca.0.extract22.us, i64 0
  %34 = fsub float 1.000000e+02, %.sroa.028.0.vec.extract.us
  %35 = call float @llvm.fabs.f32(float %34)
  %36 = fpext float %35 to double
  %37 = fcmp olt double %36, 1.000000e-03
  br i1 %37, label %69, label %38

38:                                               ; preds = %25
  %.sroa.028.4.vec.extract.us = extractelement <2 x float> %.fca.0.extract22.us, i64 1
  %39 = fsub float 1.000000e+02, %.sroa.028.4.vec.extract.us
  %40 = call float @llvm.fabs.f32(float %39)
  %41 = fpext float %40 to double
  %42 = fcmp olt double %41, 1.000000e-03
  br i1 %42, label %69, label %43

43:                                               ; preds = %38
  %44 = fsub float 1.000000e+02, %.fca.1.extract23.us
  %45 = call float @llvm.fabs.f32(float %44)
  %46 = fpext float %45 to double
  %47 = fcmp olt double %46, 1.000000e-03
  br i1 %47, label %69, label %48

48:                                               ; preds = %43
  %49 = call zeroext i1 @in_shadow(ptr noundef nonnull byval(%struct.Scene) align 8 %3, <2 x float> %.fca.0.extract22.us, float %.fca.1.extract23.us)
  br i1 %49, label %63, label %50

50:                                               ; preds = %48
  %.sroa.013.0.copyload.us = load <2 x float>, ptr %12, align 8
  %.sroa.214.0.copyload.us = load float, ptr %.sroa.214.0..sroa_idx, align 8
  %51 = call { <2 x float>, float } @sub(<2 x float> %.sroa.013.0.copyload.us, float %.sroa.214.0.copyload.us, <2 x float> %.fca.0.extract22.us, float %.fca.1.extract23.us)
  %.fca.0.extract7.us = extractvalue { <2 x float>, float } %51, 0
  %.fca.1.extract8.us = extractvalue { <2 x float>, float } %51, 1
  %52 = call { <2 x float>, float } @normalize(<2 x float> %.fca.0.extract7.us, float %.fca.1.extract8.us)
  %.fca.0.extract.us = extractvalue { <2 x float>, float } %52, 0
  %.fca.1.extract.us = extractvalue { <2 x float>, float } %52, 1
  %.sroa.01.0.copyload.us = load <2 x float>, ptr %5, align 8
  %.sroa.22.0.copyload.us = load float, ptr %.sroa.22.0..sroa_idx, align 8
  %53 = call float @dot(<2 x float> %.sroa.01.0.copyload.us, float %.sroa.22.0.copyload.us, <2 x float> %.fca.0.extract.us, float %.fca.1.extract.us)
  %54 = call float @clamp(float noundef %53, float noundef 0.000000e+00, float noundef 1.000000e+00)
  %55 = fmul float %54, 2.550000e+02
  %56 = fptosi float %55 to i32
  %57 = trunc i32 %56 to i8
  %58 = add nsw i64 %indvars.iv, %24
  %59 = mul nsw i64 %58, 3
  %60 = getelementptr i8, ptr %0, i64 %59
  %61 = getelementptr i8, ptr %60, i64 2
  store i8 %57, ptr %61, align 1, !tbaa !5
  %62 = getelementptr i8, ptr %60, i64 1
  store i8 %57, ptr %62, align 1, !tbaa !5
  store i8 %57, ptr %60, align 1, !tbaa !5
  br label %78

63:                                               ; preds = %48
  %64 = add nsw i64 %indvars.iv, %24
  %65 = mul nsw i64 %64, 3
  %66 = getelementptr i8, ptr %0, i64 %65
  %67 = getelementptr i8, ptr %66, i64 2
  store i8 0, ptr %67, align 1, !tbaa !5
  %68 = getelementptr i8, ptr %66, i64 1
  store i8 0, ptr %68, align 1, !tbaa !5
  store i8 0, ptr %66, align 1, !tbaa !5
  br label %78

69:                                               ; preds = %43, %38, %25
  %70 = load i8, ptr %13, align 8, !tbaa !5
  %71 = add nsw i64 %indvars.iv, %24
  %72 = mul nsw i64 %71, 3
  %73 = getelementptr inbounds i8, ptr %0, i64 %72
  store i8 %70, ptr %73, align 1, !tbaa !5
  %74 = load i8, ptr %14, align 1, !tbaa !5
  %75 = getelementptr i8, ptr %73, i64 1
  store i8 %74, ptr %75, align 1, !tbaa !5
  %76 = load i8, ptr %15, align 2, !tbaa !5
  %77 = getelementptr i8, ptr %73, i64 2
  store i8 %76, ptr %77, align 1, !tbaa !5
  br label %78

78:                                               ; preds = %69, %63, %50
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %5) #4
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge.us, label %25, !llvm.loop !8

._crit_edge.us:                                   ; preds = %78
  %indvars.iv.next119 = add nuw nsw i64 %indvars.iv118, 1
  %exitcond122.not = icmp eq i64 %indvars.iv.next119, %wide.trip.count121
  br i1 %exitcond122.not, label %._crit_edge115, label %.preheader.us, !llvm.loop !10

._crit_edge115:                                   ; preds = %._crit_edge.us, %.preheader.lr.ph, %4
  ret void
}

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare float @llvm.fabs.f32(float) #3

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


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