; LLVM IR from The-Order-of-the-Simulation/Path-Tracing-Renderer :: cpu/main.ll (Z11renderImageR6bufferiiii)

; 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.vec2 = type { float, float }
%class.vec3 = type { float, float, float }

@ns = external dso_local global i32, align 4

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK4vec2dvEf(ptr dead_on_unwind noalias writable sret(%class.vec2) align 4, ptr noundef nonnull align 4 dereferenceable(8), float noundef) #0 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z9normalizeRK4vec3(ptr dead_on_unwind noalias writable sret(%class.vec3) align 4, ptr noundef nonnull align 4 dereferenceable(12)) #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK4vec3dvEf(ptr dead_on_unwind noalias writable sret(%class.vec3) align 4, ptr noundef nonnull align 4 dereferenceable(12), float noundef) #0 align 2

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

; 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: mustprogress uwtable
declare dso_local void @_ZNK4vec3plERKS_(ptr dead_on_unwind noalias writable sret(%class.vec3) align 4, ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) #0 align 2

; 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) #3

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK4vec2mlEf(ptr dead_on_unwind noalias writable sret(%class.vec2) align 4, ptr noundef nonnull align 4 dereferenceable(8), float noundef) #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z7tonemap4vec3f(ptr dead_on_unwind noalias writable sret(%class.vec3) align 4, ptr noundef, float noundef) #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z11pixelFilter4vec2(ptr dead_on_unwind noalias writable sret(%class.vec2) align 4, ptr noundef) #0

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z8radianceRK4vec3S1_(ptr dead_on_unwind noalias writable sret(%class.vec3) align 4, ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) #0

; Function Attrs: mustprogress uwtable
define dso_local void @_Z11renderImageR6bufferiiii(ptr noundef nonnull align 8 dereferenceable(16) %0, i32 noundef %1, i32 noundef %2, i32 noundef %3, i32 noundef %4) #0 {
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca %class.vec3, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca %class.vec3, align 4
  %17 = alloca i32, align 4
  %18 = alloca %class.vec2, align 4
  %19 = alloca %class.vec2, align 4
  %20 = alloca %class.vec2, align 4
  %21 = alloca %class.vec2, align 4
  %22 = alloca %class.vec2, align 4
  %23 = alloca %class.vec2, align 4
  %24 = alloca %class.vec2, align 4
  %25 = alloca i32, align 4
  %26 = alloca i32, align 4
  %27 = alloca %class.vec3, align 4
  %28 = alloca %class.vec3, align 4
  %29 = alloca %class.vec3, align 4
  %30 = alloca i8, align 1
  %31 = alloca %class.vec3, align 4
  %32 = alloca %class.vec3, align 4
  %33 = alloca %class.vec3, align 4
  %34 = alloca %class.vec3, align 4
  store ptr %0, ptr %6, align 8, !tbaa !5
  store i32 %1, ptr %7, align 4, !tbaa !9
  store i32 %2, ptr %8, align 4, !tbaa !9
  store i32 %3, ptr %9, align 4, !tbaa !9
  store i32 %4, ptr %10, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  call void @llvm.lifetime.start.p0(i64 12, ptr %12) #5
  call void @_ZN4vec3C2Efff(ptr noundef nonnull align 4 dereferenceable(12) %12, float noundef 0.000000e+00, float noundef 0.000000e+00, float noundef 2.000000e+00)
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  %35 = load i32, ptr %7, align 4, !tbaa !9
  store i32 %35, ptr %13, align 4, !tbaa !9
  br label %36

36:                                               ; preds = %96, %5
  %37 = load i32, ptr %13, align 4, !tbaa !9
  %38 = load i32, ptr %8, align 4, !tbaa !9
  %39 = icmp slt i32 %37, %38
  br i1 %39, label %41, label %40

40:                                               ; preds = %36
  store i32 2, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  br label %99

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

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

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

48:                                               ; preds = %43
  call void @llvm.lifetime.start.p0(i64 12, ptr %16) #5
  call void @_ZN4vec3C2Ev(ptr noundef nonnull align 4 dereferenceable(12) %16)
  %49 = load i32, ptr %13, align 4, !tbaa !9
  %50 = load i32, ptr %15, align 4, !tbaa !9
  %51 = mul nsw i32 %50, 640
  %52 = add nsw i32 %49, %51
  %53 = add nsw i32 %52, 1
  store i32 %53, ptr @ns, align 4, !tbaa !9
  store i32 0, ptr %11, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #5
  store i32 0, ptr %17, align 4, !tbaa !9
  br label %54

54:                                               ; preds = %83, %48
  %55 = load i32, ptr %17, align 4, !tbaa !9
  %56 = icmp slt i32 %55, 100
  br i1 %56, label %58, label %57

57:                                               ; preds = %54
  store i32 8, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #5
  br label %86

58:                                               ; preds = %54
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #5
  %59 = load i32, ptr %13, align 4, !tbaa !9
  %60 = sitofp i32 %59 to float
  %61 = load i32, ptr %15, align 4, !tbaa !9
  %62 = sitofp i32 %61 to float
  call void @_ZN4vec2C2Eff(ptr noundef nonnull align 4 dereferenceable(8) %22, float noundef %60, float noundef %62)
  call void @_Z11pixelFilter4vec2(ptr dead_on_unwind writable sret(%class.vec2) align 4 %21, ptr noundef %22)
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #5
  call void @_ZN4vec2C2Eff(ptr noundef nonnull align 4 dereferenceable(8) %24, float noundef 6.400000e+02, float noundef 4.800000e+02)
  call void @_ZNK4vec2mlEf(ptr dead_on_unwind writable sret(%class.vec2) align 4 %23, ptr noundef nonnull align 4 dereferenceable(8) %24, float noundef 5.000000e-01)
  call void @_ZNK4vec2miERKS_(ptr dead_on_unwind writable sret(%class.vec2) align 4 %20, ptr noundef nonnull align 4 dereferenceable(8) %21, ptr noundef nonnull align 4 dereferenceable(8) %23)
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #5
  store i32 640, ptr %25, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #5
  store i32 480, ptr %26, align 4, !tbaa !9
  %63 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %25, ptr noundef nonnull align 4 dereferenceable(4) %26)
  %64 = load i32, ptr %63, align 4, !tbaa !9
  %65 = sitofp i32 %64 to float
  call void @_ZNK4vec2dvEf(ptr dead_on_unwind writable sret(%class.vec2) align 4 %19, ptr noundef nonnull align 4 dereferenceable(8) %20, float noundef %65)
  call void @_ZNK4vec2mlEf(ptr dead_on_unwind writable sret(%class.vec2) align 4 %18, ptr noundef nonnull align 4 dereferenceable(8) %19, float noundef 2.000000e+00)
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #5
  call void @llvm.lifetime.start.p0(i64 12, ptr %27) #5
  call void @llvm.lifetime.start.p0(i64 12, ptr %28) #5
  %66 = getelementptr inbounds %class.vec2, ptr %18, i32 0, i32 0
  %67 = load float, ptr %66, align 4, !tbaa !11
  %68 = fmul float 1.000000e+00, %67
  %69 = getelementptr inbounds %class.vec2, ptr %18, i32 0, i32 1
  %70 = load float, ptr %69, align 4, !tbaa !14
  %71 = fneg float %70
  %72 = fmul float 1.000000e+00, %71
  call void @_ZN4vec3C2Efff(ptr noundef nonnull align 4 dereferenceable(12) %28, float noundef %68, float noundef %72, float noundef -1.000000e+00)
  call void @_Z9normalizeRK4vec3(ptr dead_on_unwind writable sret(%class.vec3) align 4 %27, ptr noundef nonnull align 4 dereferenceable(12) %28)
  call void @llvm.lifetime.end.p0(i64 12, ptr %28) #5
  call void @llvm.lifetime.start.p0(i64 12, ptr %29) #5
  call void @_Z8radianceRK4vec3S1_(ptr dead_on_unwind writable sret(%class.vec3) align 4 %29, ptr noundef nonnull align 4 dereferenceable(12) %12, ptr noundef nonnull align 4 dereferenceable(12) %27)
  call void @llvm.lifetime.start.p0(i64 1, ptr %30) #5
  %73 = getelementptr inbounds %class.vec3, ptr %29, i32 0, i32 0
  %74 = load float, ptr %73, align 4, !tbaa !15
  %75 = fcmp olt float %74, 0.000000e+00
  %76 = zext i1 %75 to i8
  store i8 %76, ptr %30, align 1, !tbaa !17
  %77 = load i8, ptr %30, align 1, !tbaa !17, !range !19, !noundef !20
  %78 = trunc i8 %77 to i1
  br i1 %78, label %82, label %79

79:                                               ; preds = %58
  call void @llvm.lifetime.start.p0(i64 12, ptr %31) #5
  call void @_ZNK4vec3plERKS_(ptr dead_on_unwind writable sret(%class.vec3) align 4 %31, ptr noundef nonnull align 4 dereferenceable(12) %16, ptr noundef nonnull align 4 dereferenceable(12) %29)
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %16, ptr align 4 %31, i64 12, i1 false), !tbaa.struct !21
  call void @llvm.lifetime.end.p0(i64 12, ptr %31) #5
  %80 = load i32, ptr %11, align 4, !tbaa !9
  %81 = add nsw i32 %80, 1
  store i32 %81, ptr %11, align 4, !tbaa !9
  br label %82

82:                                               ; preds = %79, %58
  call void @llvm.lifetime.end.p0(i64 1, ptr %30) #5
  call void @llvm.lifetime.end.p0(i64 12, ptr %29) #5
  call void @llvm.lifetime.end.p0(i64 12, ptr %27) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #5
  br label %83

83:                                               ; preds = %82
  %84 = load i32, ptr %17, align 4, !tbaa !9
  %85 = add nsw i32 %84, 1
  store i32 %85, ptr %17, align 4, !tbaa !9
  br label %54, !llvm.loop !23

86:                                               ; preds = %57
  call void @llvm.lifetime.start.p0(i64 12, ptr %32) #5
  %87 = load i32, ptr %11, align 4, !tbaa !9
  %88 = sitofp i32 %87 to float
  call void @_ZNK4vec3dvEf(ptr dead_on_unwind writable sret(%class.vec3) align 4 %32, ptr noundef nonnull align 4 dereferenceable(12) %16, float noundef %88)
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %16, ptr align 4 %32, i64 12, i1 false), !tbaa.struct !21
  call void @llvm.lifetime.end.p0(i64 12, ptr %32) #5
  call void @llvm.lifetime.start.p0(i64 12, ptr %33) #5
  call void @_ZN4vec3C2ERKS_(ptr noundef nonnull align 4 dereferenceable(12) %34, ptr noundef nonnull align 4 dereferenceable(12) %16)
  call void @_Z7tonemap4vec3f(ptr dead_on_unwind writable sret(%class.vec3) align 4 %33, ptr noundef %34, float noundef 1.000000e+00)
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %16, ptr align 4 %33, i64 12, i1 false), !tbaa.struct !21
  call void @llvm.lifetime.end.p0(i64 12, ptr %33) #5
  %89 = load ptr, ptr %6, align 8, !tbaa !5
  %90 = load i32, ptr %13, align 4, !tbaa !9
  %91 = load i32, ptr %15, align 4, !tbaa !9
  call void @_ZN6buffer9set_pixelEiiRK4vec3(ptr noundef nonnull align 8 dereferenceable(16) %89, i32 noundef %90, i32 noundef %91, ptr noundef nonnull align 4 dereferenceable(12) %16)
  call void @llvm.lifetime.end.p0(i64 12, ptr %16) #5
  br label %92

92:                                               ; preds = %86
  %93 = load i32, ptr %15, align 4, !tbaa !9
  %94 = add nsw i32 %93, 1
  store i32 %94, ptr %15, align 4, !tbaa !9
  br label %43, !llvm.loop !25

95:                                               ; preds = %47
  br label %96

96:                                               ; preds = %95
  %97 = load i32, ptr %13, align 4, !tbaa !9
  %98 = add nsw i32 %97, 1
  store i32 %98, ptr %13, align 4, !tbaa !9
  br label %36, !llvm.loop !26

99:                                               ; preds = %40
  call void @llvm.lifetime.end.p0(i64 12, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  ret void
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK4vec2miERKS_(ptr dead_on_unwind noalias writable sret(%class.vec2) align 4, ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) #0 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #4

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

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

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

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


; 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.vec2 = type { float, float }
%class.vec3 = type { float, float, float }

@ns = external dso_local local_unnamed_addr global i32, align 4

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK4vec2dvEf(ptr dead_on_unwind noalias writable sret(%class.vec2) align 4, ptr noundef nonnull align 4 dereferenceable(8), float noundef) local_unnamed_addr #0 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z9normalizeRK4vec3(ptr dead_on_unwind noalias writable sret(%class.vec3) align 4, ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK4vec3dvEf(ptr dead_on_unwind noalias writable sret(%class.vec3) align 4, ptr noundef nonnull align 4 dereferenceable(12), float noundef) local_unnamed_addr #0 align 2

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK4vec3plERKS_(ptr dead_on_unwind noalias writable sret(%class.vec3) align 4, ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress 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) #3

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK4vec2mlEf(ptr dead_on_unwind noalias writable sret(%class.vec2) align 4, ptr noundef nonnull align 4 dereferenceable(8), float noundef) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z7tonemap4vec3f(ptr dead_on_unwind noalias writable sret(%class.vec3) align 4, ptr noundef, float noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z11pixelFilter4vec2(ptr dead_on_unwind noalias writable sret(%class.vec2) align 4, ptr noundef) local_unnamed_addr #0

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z8radianceRK4vec3S1_(ptr dead_on_unwind noalias writable sret(%class.vec3) align 4, ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
define dso_local void @_Z11renderImageR6bufferiiii(ptr noundef nonnull align 8 dereferenceable(16) %0, i32 noundef %1, i32 noundef %2, i32 noundef %3, i32 noundef %4) local_unnamed_addr #0 {
  %6 = alloca %class.vec3, align 4
  %7 = alloca %class.vec3, align 4
  %8 = alloca %class.vec2, align 4
  %9 = alloca %class.vec2, align 4
  %10 = alloca %class.vec2, align 4
  %11 = alloca %class.vec2, align 4
  %12 = alloca %class.vec2, align 4
  %13 = alloca %class.vec2, align 4
  %14 = alloca %class.vec2, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca %class.vec3, align 4
  %18 = alloca %class.vec3, align 4
  %19 = alloca %class.vec3, align 4
  %20 = alloca %class.vec3, align 4
  %21 = alloca %class.vec3, align 4
  %22 = alloca %class.vec3, align 4
  %23 = alloca %class.vec3, align 4
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %6) #5
  call void @_ZN4vec3C2Efff(ptr noundef nonnull align 4 dereferenceable(12) %6, float noundef 0.000000e+00, float noundef 0.000000e+00, float noundef 2.000000e+00)
  %24 = icmp slt i32 %1, %2
  br i1 %24, label %.preheader.lr.ph, label %._crit_edge26

.preheader.lr.ph:                                 ; preds = %5
  %25 = icmp slt i32 %3, %4
  %26 = getelementptr inbounds i8, ptr %8, i64 4
  br i1 %25, label %.preheader.us, label %._crit_edge26

.preheader.us:                                    ; preds = %.preheader.lr.ph, %._crit_edge.us
  %.02125.us = phi i32 [ %27, %._crit_edge.us ], [ %1, %.preheader.lr.ph ]
  %27 = add nsw i32 %.02125.us, 1
  %28 = sitofp i32 %.02125.us to float
  br label %29

29:                                               ; preds = %.preheader.us, %33
  %.02024.us = phi i32 [ %3, %.preheader.us ], [ %35, %33 ]
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %7) #5
  call void @_ZN4vec3C2Ev(ptr noundef nonnull align 4 dereferenceable(12) %7)
  %30 = mul nsw i32 %.02024.us, 640
  %31 = add i32 %27, %30
  store i32 %31, ptr @ns, align 4, !tbaa !5
  %32 = sitofp i32 %.02024.us to float
  br label %36

33:                                               ; preds = %47
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %21) #5
  %34 = sitofp i32 %.1.us to float
  call void @_ZNK4vec3dvEf(ptr dead_on_unwind nonnull writable sret(%class.vec3) align 4 %21, ptr noundef nonnull align 4 dereferenceable(12) %7, float noundef %34)
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %7, ptr noundef nonnull align 4 dereferenceable(12) %21, i64 12, i1 false), !tbaa.struct !9
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %21) #5
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %22) #5
  call void @_ZN4vec3C2ERKS_(ptr noundef nonnull align 4 dereferenceable(12) %23, ptr noundef nonnull align 4 dereferenceable(12) %7)
  call void @_Z7tonemap4vec3f(ptr dead_on_unwind nonnull writable sret(%class.vec3) align 4 %22, ptr noundef nonnull %23, float noundef 1.000000e+00)
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %7, ptr noundef nonnull align 4 dereferenceable(12) %22, i64 12, i1 false), !tbaa.struct !9
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %22) #5
  call void @_ZN6buffer9set_pixelEiiRK4vec3(ptr noundef nonnull align 8 dereferenceable(16) %0, i32 noundef %.02125.us, i32 noundef %.02024.us, ptr noundef nonnull align 4 dereferenceable(12) %7)
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %7) #5
  %35 = add i32 %.02024.us, 1
  %exitcond28.not = icmp eq i32 %35, %4
  br i1 %exitcond28.not, label %._crit_edge.us, label %29, !llvm.loop !12

36:                                               ; preds = %47, %29
  %.023.us = phi i32 [ 0, %29 ], [ %.1.us, %47 ]
  %.01922.us = phi i32 [ 0, %29 ], [ %48, %47 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #5
  call void @_ZN4vec2C2Eff(ptr noundef nonnull align 4 dereferenceable(8) %12, float noundef %28, float noundef %32)
  call void @_Z11pixelFilter4vec2(ptr dead_on_unwind nonnull writable sret(%class.vec2) align 4 %11, ptr noundef nonnull %12)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %13) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %14) #5
  call void @_ZN4vec2C2Eff(ptr noundef nonnull align 4 dereferenceable(8) %14, float noundef 6.400000e+02, float noundef 4.800000e+02)
  call void @_ZNK4vec2mlEf(ptr dead_on_unwind nonnull writable sret(%class.vec2) align 4 %13, ptr noundef nonnull align 4 dereferenceable(8) %14, float noundef 5.000000e-01)
  call void @_ZNK4vec2miERKS_(ptr dead_on_unwind nonnull writable sret(%class.vec2) align 4 %10, ptr noundef nonnull align 4 dereferenceable(8) %11, ptr noundef nonnull align 4 dereferenceable(8) %13)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %15) #5
  store i32 640, ptr %15, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %16) #5
  store i32 480, ptr %16, align 4, !tbaa !5
  %37 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %15, ptr noundef nonnull align 4 dereferenceable(4) %16)
  %38 = load i32, ptr %37, align 4, !tbaa !5
  %39 = sitofp i32 %38 to float
  call void @_ZNK4vec2dvEf(ptr dead_on_unwind nonnull writable sret(%class.vec2) align 4 %9, ptr noundef nonnull align 4 dereferenceable(8) %10, float noundef %39)
  call void @_ZNK4vec2mlEf(ptr dead_on_unwind nonnull writable sret(%class.vec2) align 4 %8, ptr noundef nonnull align 4 dereferenceable(8) %9, float noundef 2.000000e+00)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %16) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %15) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #5
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %17) #5
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %18) #5
  %40 = load float, ptr %8, align 4, !tbaa !14
  %41 = load float, ptr %26, align 4, !tbaa !16
  %42 = fneg float %41
  call void @_ZN4vec3C2Efff(ptr noundef nonnull align 4 dereferenceable(12) %18, float noundef %40, float noundef %42, float noundef -1.000000e+00)
  call void @_Z9normalizeRK4vec3(ptr dead_on_unwind nonnull writable sret(%class.vec3) align 4 %17, ptr noundef nonnull align 4 dereferenceable(12) %18)
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %18) #5
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %19) #5
  call void @_Z8radianceRK4vec3S1_(ptr dead_on_unwind nonnull writable sret(%class.vec3) align 4 %19, ptr noundef nonnull align 4 dereferenceable(12) %6, ptr noundef nonnull align 4 dereferenceable(12) %17)
  %43 = load float, ptr %19, align 4, !tbaa !17
  %44 = fcmp olt float %43, 0.000000e+00
  br i1 %44, label %47, label %45

45:                                               ; preds = %36
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %20) #5
  call void @_ZNK4vec3plERKS_(ptr dead_on_unwind nonnull writable sret(%class.vec3) align 4 %20, ptr noundef nonnull align 4 dereferenceable(12) %7, ptr noundef nonnull align 4 dereferenceable(12) %19)
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(12) %7, ptr noundef nonnull align 4 dereferenceable(12) %20, i64 12, i1 false), !tbaa.struct !9
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %20) #5
  %46 = add nsw i32 %.023.us, 1
  br label %47

47:                                               ; preds = %45, %36
  %.1.us = phi i32 [ %.023.us, %36 ], [ %46, %45 ]
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %19) #5
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %17) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #5
  %48 = add nuw nsw i32 %.01922.us, 1
  %exitcond.not = icmp eq i32 %48, 100
  br i1 %exitcond.not, label %33, label %36, !llvm.loop !19

._crit_edge.us:                                   ; preds = %33
  %exitcond29.not = icmp eq i32 %27, %2
  br i1 %exitcond29.not, label %._crit_edge26, label %.preheader.us, !llvm.loop !20

._crit_edge26:                                    ; preds = %._crit_edge.us, %.preheader.lr.ph, %5
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %6) #5
  ret void
}

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNK4vec2miERKS_(ptr dead_on_unwind noalias writable sret(%class.vec2) align 4, ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #0 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #4

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

attributes #0 = { 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 #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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 #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 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{i64 0, i64 4, !10, i64 4, i64 4, !10, i64 8, i64 4, !10}
!10 = !{!11, !11, i64 0}
!11 = !{!"float", !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = !{!15, !11, i64 0}
!15 = !{!"_ZTS4vec2", !11, i64 0, !11, i64 4}
!16 = !{!15, !11, i64 4}
!17 = !{!18, !11, i64 0}
!18 = !{!"_ZTS4vec3", !11, i64 0, !11, i64 4, !11, i64 8}
!19 = distinct !{!19, !13}
!20 = distinct !{!20, !13}


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