; LLVM IR from aap/librw :: src/world.ll (ZN2rw5World15enumerateLightsEPNS_11WorldLightsE)

; 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.rw::WorldLights" = type { i32, %"struct.rw::RGBAf", i32, ptr, i32, ptr }
%"struct.rw::RGBAf" = type { float, float, float, float }
%"struct.rw::World" = type { %"struct.rw::Object", %"struct.rw::LinkList", %"struct.rw::LinkList", %"struct.rw::LinkList" }
%"struct.rw::Object" = type { i8, i8, i8, i8, ptr }
%"struct.rw::LinkList" = type { %"struct.rw::LLLink" }
%"struct.rw::LLLink" = type { ptr, ptr }
%"struct.rw::Light" = type { %"struct.rw::ObjectWithFrame", float, %"struct.rw::RGBAf", float, %"struct.rw::LLLink", ptr, %"struct.rw::LLLink", ptr, ptr }
%"struct.rw::ObjectWithFrame" = type { %"struct.rw::Object", %"struct.rw::LLLink", ptr }

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN2rw5Light7getTypeEv(ptr noundef nonnull align 8 dereferenceable(120)) #1 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN2rw5Light9fromWorldEPNS_6LLLinkE(ptr noundef) #1 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN2rw5World15enumerateLightsEPNS_11WorldLightsE(ptr noundef nonnull align 8 dereferenceable(64) %0, ptr noundef %1) #2 align 2 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %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 i32, align 4
  %13 = alloca ptr, align 8
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  %14 = load ptr, ptr %3, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #3
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #3
  %15 = load ptr, ptr %4, align 8, !tbaa !5
  %16 = getelementptr inbounds %"struct.rw::WorldLights", ptr %15, i32 0, i32 2
  %17 = load i32, ptr %16, align 4, !tbaa !9
  store i32 %17, ptr %5, align 4, !tbaa !14
  %18 = load ptr, ptr %4, align 8, !tbaa !5
  %19 = getelementptr inbounds %"struct.rw::WorldLights", ptr %18, i32 0, i32 4
  %20 = load i32, ptr %19, align 8, !tbaa !15
  store i32 %20, ptr %6, align 4, !tbaa !14
  %21 = load ptr, ptr %4, align 8, !tbaa !5
  %22 = getelementptr inbounds %"struct.rw::WorldLights", ptr %21, i32 0, i32 2
  store i32 0, ptr %22, align 4, !tbaa !9
  %23 = load ptr, ptr %4, align 8, !tbaa !5
  %24 = getelementptr inbounds %"struct.rw::WorldLights", ptr %23, i32 0, i32 4
  store i32 0, ptr %24, align 8, !tbaa !15
  %25 = load ptr, ptr %4, align 8, !tbaa !5
  %26 = getelementptr inbounds %"struct.rw::WorldLights", ptr %25, i32 0, i32 0
  store i32 0, ptr %26, align 8, !tbaa !16
  %27 = load ptr, ptr %4, align 8, !tbaa !5
  %28 = getelementptr inbounds %"struct.rw::WorldLights", ptr %27, i32 0, i32 1
  %29 = getelementptr inbounds %"struct.rw::RGBAf", ptr %28, i32 0, i32 0
  store float 0.000000e+00, ptr %29, align 4, !tbaa !17
  %30 = load ptr, ptr %4, align 8, !tbaa !5
  %31 = getelementptr inbounds %"struct.rw::WorldLights", ptr %30, i32 0, i32 1
  %32 = getelementptr inbounds %"struct.rw::RGBAf", ptr %31, i32 0, i32 1
  store float 0.000000e+00, ptr %32, align 4, !tbaa !18
  %33 = load ptr, ptr %4, align 8, !tbaa !5
  %34 = getelementptr inbounds %"struct.rw::WorldLights", ptr %33, i32 0, i32 1
  %35 = getelementptr inbounds %"struct.rw::RGBAf", ptr %34, i32 0, i32 2
  store float 0.000000e+00, ptr %35, align 4, !tbaa !19
  %36 = load ptr, ptr %4, align 8, !tbaa !5
  %37 = getelementptr inbounds %"struct.rw::WorldLights", ptr %36, i32 0, i32 1
  %38 = getelementptr inbounds %"struct.rw::RGBAf", ptr %37, i32 0, i32 3
  store float 1.000000e+00, ptr %38, align 4, !tbaa !20
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #3
  store ptr null, ptr %7, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #3
  %39 = getelementptr inbounds %"struct.rw::World", ptr %14, i32 0, i32 2
  %40 = getelementptr inbounds %"struct.rw::LinkList", ptr %39, i32 0, i32 0
  %41 = getelementptr inbounds %"struct.rw::LLLink", ptr %40, i32 0, i32 0
  %42 = load ptr, ptr %41, align 8, !tbaa !21
  store ptr %42, ptr %8, align 8, !tbaa !5
  br label %43

43:                                               ; preds = %114, %2
  %44 = load ptr, ptr %8, align 8, !tbaa !5
  %45 = getelementptr inbounds %"struct.rw::LLLink", ptr %44, i32 0, i32 0
  %46 = load ptr, ptr %45, align 8, !tbaa !26
  store ptr %46, ptr %7, align 8, !tbaa !5
  %47 = load ptr, ptr %8, align 8, !tbaa !5
  %48 = getelementptr inbounds %"struct.rw::World", ptr %14, i32 0, i32 2
  %49 = call noundef ptr @_ZN2rw8LinkList3endEv(ptr noundef nonnull align 8 dereferenceable(16) %48)
  %50 = icmp ne ptr %47, %49
  br i1 %50, label %52, label %51

51:                                               ; preds = %43
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #3
  br label %116

52:                                               ; preds = %43
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #3
  %53 = load ptr, ptr %8, align 8, !tbaa !5
  %54 = call noundef ptr @_ZN2rw5Light9fromWorldEPNS_6LLLinkE(ptr noundef %53)
  store ptr %54, ptr %9, align 8, !tbaa !5
  %55 = load ptr, ptr %9, align 8, !tbaa !5
  %56 = call noundef i32 @_ZN2rw5Light7getTypeEv(ptr noundef nonnull align 8 dereferenceable(120) %55)
  %57 = icmp eq i32 %56, 2
  br i1 %57, label %58, label %90

58:                                               ; preds = %52
  %59 = load ptr, ptr %9, align 8, !tbaa !5
  %60 = getelementptr inbounds %"struct.rw::Light", ptr %59, i32 0, i32 2
  %61 = getelementptr inbounds %"struct.rw::RGBAf", ptr %60, i32 0, i32 0
  %62 = load float, ptr %61, align 4, !tbaa !27
  %63 = load ptr, ptr %4, align 8, !tbaa !5
  %64 = getelementptr inbounds %"struct.rw::WorldLights", ptr %63, i32 0, i32 1
  %65 = getelementptr inbounds %"struct.rw::RGBAf", ptr %64, i32 0, i32 0
  %66 = load float, ptr %65, align 4, !tbaa !17
  %67 = fadd float %66, %62
  store float %67, ptr %65, align 4, !tbaa !17
  %68 = load ptr, ptr %9, align 8, !tbaa !5
  %69 = getelementptr inbounds %"struct.rw::Light", ptr %68, i32 0, i32 2
  %70 = getelementptr inbounds %"struct.rw::RGBAf", ptr %69, i32 0, i32 1
  %71 = load float, ptr %70, align 4, !tbaa !30
  %72 = load ptr, ptr %4, align 8, !tbaa !5
  %73 = getelementptr inbounds %"struct.rw::WorldLights", ptr %72, i32 0, i32 1
  %74 = getelementptr inbounds %"struct.rw::RGBAf", ptr %73, i32 0, i32 1
  %75 = load float, ptr %74, align 4, !tbaa !18
  %76 = fadd float %75, %71
  store float %76, ptr %74, align 4, !tbaa !18
  %77 = load ptr, ptr %9, align 8, !tbaa !5
  %78 = getelementptr inbounds %"struct.rw::Light", ptr %77, i32 0, i32 2
  %79 = getelementptr inbounds %"struct.rw::RGBAf", ptr %78, i32 0, i32 2
  %80 = load float, ptr %79, align 4, !tbaa !31
  %81 = load ptr, ptr %4, align 8, !tbaa !5
  %82 = getelementptr inbounds %"struct.rw::WorldLights", ptr %81, i32 0, i32 1
  %83 = getelementptr inbounds %"struct.rw::RGBAf", ptr %82, i32 0, i32 2
  %84 = load float, ptr %83, align 4, !tbaa !19
  %85 = fadd float %84, %80
  store float %85, ptr %83, align 4, !tbaa !19
  %86 = load ptr, ptr %4, align 8, !tbaa !5
  %87 = getelementptr inbounds %"struct.rw::WorldLights", ptr %86, i32 0, i32 0
  %88 = load i32, ptr %87, align 8, !tbaa !16
  %89 = add nsw i32 %88, 1
  store i32 %89, ptr %87, align 8, !tbaa !16
  br label %113

90:                                               ; preds = %52
  %91 = load ptr, ptr %9, align 8, !tbaa !5
  %92 = call noundef i32 @_ZN2rw5Light7getTypeEv(ptr noundef nonnull align 8 dereferenceable(120) %91)
  %93 = icmp eq i32 %92, 1
  br i1 %93, label %94, label %112

94:                                               ; preds = %90
  %95 = load ptr, ptr %4, align 8, !tbaa !5
  %96 = getelementptr inbounds %"struct.rw::WorldLights", ptr %95, i32 0, i32 2
  %97 = load i32, ptr %96, align 4, !tbaa !9
  %98 = load i32, ptr %5, align 4, !tbaa !14
  %99 = icmp slt i32 %97, %98
  br i1 %99, label %100, label %111

100:                                              ; preds = %94
  %101 = load ptr, ptr %9, align 8, !tbaa !5
  %102 = load ptr, ptr %4, align 8, !tbaa !5
  %103 = getelementptr inbounds %"struct.rw::WorldLights", ptr %102, i32 0, i32 3
  %104 = load ptr, ptr %103, align 8, !tbaa !32
  %105 = load ptr, ptr %4, align 8, !tbaa !5
  %106 = getelementptr inbounds %"struct.rw::WorldLights", ptr %105, i32 0, i32 2
  %107 = load i32, ptr %106, align 4, !tbaa !9
  %108 = add nsw i32 %107, 1
  store i32 %108, ptr %106, align 4, !tbaa !9
  %109 = sext i32 %107 to i64
  %110 = getelementptr inbounds ptr, ptr %104, i64 %109
  store ptr %101, ptr %110, align 8, !tbaa !5
  br label %111

111:                                              ; preds = %100, %94
  br label %112

112:                                              ; preds = %111, %90
  br label %113

113:                                              ; preds = %112, %58
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #3
  br label %114

114:                                              ; preds = %113
  %115 = load ptr, ptr %7, align 8, !tbaa !5
  store ptr %115, ptr %8, align 8, !tbaa !5
  br label %43, !llvm.loop !33

116:                                              ; preds = %51
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #3
  store ptr null, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #3
  %117 = getelementptr inbounds %"struct.rw::World", ptr %14, i32 0, i32 1
  %118 = getelementptr inbounds %"struct.rw::LinkList", ptr %117, i32 0, i32 0
  %119 = getelementptr inbounds %"struct.rw::LLLink", ptr %118, i32 0, i32 0
  %120 = load ptr, ptr %119, align 8, !tbaa !35
  store ptr %120, ptr %11, align 8, !tbaa !5
  br label %121

121:                                              ; preds = %150, %116
  %122 = load ptr, ptr %11, align 8, !tbaa !5
  %123 = getelementptr inbounds %"struct.rw::LLLink", ptr %122, i32 0, i32 0
  %124 = load ptr, ptr %123, align 8, !tbaa !26
  store ptr %124, ptr %10, align 8, !tbaa !5
  %125 = load ptr, ptr %11, align 8, !tbaa !5
  %126 = getelementptr inbounds %"struct.rw::World", ptr %14, i32 0, i32 1
  %127 = call noundef ptr @_ZN2rw8LinkList3endEv(ptr noundef nonnull align 8 dereferenceable(16) %126)
  %128 = icmp ne ptr %125, %127
  br i1 %128, label %130, label %129

129:                                              ; preds = %121
  store i32 5, ptr %12, align 4
  br label %152

130:                                              ; preds = %121
  %131 = load ptr, ptr %4, align 8, !tbaa !5
  %132 = getelementptr inbounds %"struct.rw::WorldLights", ptr %131, i32 0, i32 4
  %133 = load i32, ptr %132, align 8, !tbaa !15
  %134 = load i32, ptr %6, align 4, !tbaa !14
  %135 = icmp sge i32 %133, %134
  br i1 %135, label %136, label %137

136:                                              ; preds = %130
  store i32 1, ptr %12, align 4
  br label %152

137:                                              ; preds = %130
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #3
  %138 = load ptr, ptr %11, align 8, !tbaa !5
  %139 = call noundef ptr @_ZN2rw5Light9fromWorldEPNS_6LLLinkE(ptr noundef %138)
  store ptr %139, ptr %13, align 8, !tbaa !5
  %140 = load ptr, ptr %13, align 8, !tbaa !5
  %141 = load ptr, ptr %4, align 8, !tbaa !5
  %142 = getelementptr inbounds %"struct.rw::WorldLights", ptr %141, i32 0, i32 5
  %143 = load ptr, ptr %142, align 8, !tbaa !36
  %144 = load ptr, ptr %4, align 8, !tbaa !5
  %145 = getelementptr inbounds %"struct.rw::WorldLights", ptr %144, i32 0, i32 4
  %146 = load i32, ptr %145, align 8, !tbaa !15
  %147 = add nsw i32 %146, 1
  store i32 %147, ptr %145, align 8, !tbaa !15
  %148 = sext i32 %146 to i64
  %149 = getelementptr inbounds ptr, ptr %143, i64 %148
  store ptr %140, ptr %149, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #3
  br label %150

150:                                              ; preds = %137
  %151 = load ptr, ptr %10, align 8, !tbaa !5
  store ptr %151, ptr %11, align 8, !tbaa !5
  br label %121, !llvm.loop !37

152:                                              ; preds = %136, %129
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #3
  %153 = load i32, ptr %12, align 4
  switch i32 %153, label %155 [
    i32 5, label %154
  ]

154:                                              ; preds = %152
  store i32 0, ptr %12, align 4
  br label %155

155:                                              ; preds = %154, %152
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #3
  %156 = load i32, ptr %12, align 4
  switch i32 %156, label %158 [
    i32 0, label %157
    i32 1, label %157
  ]

157:                                              ; preds = %155, %155
  ret void

158:                                              ; preds = %155
  unreachable
}

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress uwtable "min-legal-vector-width"="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 = { 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, !11, i64 20}
!10 = !{!"_ZTSN2rw11WorldLightsE", !11, i64 0, !12, i64 4, !11, i64 20, !6, i64 24, !11, i64 32, !6, i64 40}
!11 = !{!"int", !7, i64 0}
!12 = !{!"_ZTSN2rw5RGBAfE", !13, i64 0, !13, i64 4, !13, i64 8, !13, i64 12}
!13 = !{!"float", !7, i64 0}
!14 = !{!11, !11, i64 0}
!15 = !{!10, !11, i64 32}
!16 = !{!10, !11, i64 0}
!17 = !{!10, !13, i64 4}
!18 = !{!10, !13, i64 8}
!19 = !{!10, !13, i64 12}
!20 = !{!10, !13, i64 16}
!21 = !{!22, !6, i64 32}
!22 = !{!"_ZTSN2rw5WorldE", !23, i64 0, !24, i64 16, !24, i64 32, !24, i64 48}
!23 = !{!"_ZTSN2rw6ObjectE", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !6, i64 8}
!24 = !{!"_ZTSN2rw8LinkListE", !25, i64 0}
!25 = !{!"_ZTSN2rw6LLLinkE", !6, i64 0, !6, i64 8}
!26 = !{!25, !6, i64 0}
!27 = !{!28, !13, i64 44}
!28 = !{!"_ZTSN2rw5LightE", !29, i64 0, !13, i64 40, !12, i64 44, !13, i64 60, !25, i64 64, !6, i64 80, !25, i64 88, !6, i64 104, !6, i64 112}
!29 = !{!"_ZTSN2rw15ObjectWithFrameE", !23, i64 0, !25, i64 16, !6, i64 32}
!30 = !{!28, !13, i64 48}
!31 = !{!28, !13, i64 52}
!32 = !{!10, !6, i64 24}
!33 = distinct !{!33, !34}
!34 = !{!"llvm.loop.mustprogress"}
!35 = !{!22, !6, i64 16}
!36 = !{!10, !6, i64 40}
!37 = distinct !{!37, !34}


; 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"

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN2rw5Light7getTypeEv(ptr noundef nonnull align 8 dereferenceable(120)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN2rw8LinkList3endEv(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZN2rw5Light9fromWorldEPNS_6LLLinkE(ptr noundef) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZN2rw5World15enumerateLightsEPNS_11WorldLightsE(ptr noundef nonnull align 8 dereferenceable(64) %0, ptr nocapture noundef %1) local_unnamed_addr #0 align 2 {
  %3 = getelementptr inbounds i8, ptr %1, i64 20
  %4 = load i32, ptr %3, align 4, !tbaa !5
  %5 = getelementptr inbounds i8, ptr %1, i64 32
  %6 = load i32, ptr %5, align 8, !tbaa !13
  store i32 0, ptr %3, align 4, !tbaa !5
  store i32 0, ptr %5, align 8, !tbaa !13
  %7 = getelementptr inbounds i8, ptr %1, i64 4
  %8 = getelementptr inbounds i8, ptr %1, i64 12
  %9 = getelementptr inbounds i8, ptr %1, i64 16
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(16) %1, i8 0, i64 16, i1 false)
  store float 1.000000e+00, ptr %9, align 4, !tbaa !14
  %10 = getelementptr inbounds i8, ptr %0, i64 32
  %11 = load ptr, ptr %10, align 8, !tbaa !15
  %12 = load ptr, ptr %11, align 8, !tbaa !20
  %13 = tail call noundef ptr @_ZN2rw8LinkList3endEv(ptr noundef nonnull align 8 dereferenceable(16) %10)
  %.not42 = icmp eq ptr %11, %13
  br i1 %.not42, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %2
  %14 = getelementptr inbounds i8, ptr %1, i64 24
  br label %20

._crit_edge:                                      ; preds = %47, %2
  %15 = getelementptr inbounds i8, ptr %0, i64 16
  %16 = load ptr, ptr %15, align 8, !tbaa !21
  %17 = load ptr, ptr %16, align 8, !tbaa !20
  %18 = tail call noundef ptr @_ZN2rw8LinkList3endEv(ptr noundef nonnull align 8 dereferenceable(16) %15)
  %.not4044 = icmp eq ptr %16, %18
  br i1 %.not4044, label %._crit_edge48, label %.lr.ph47

.lr.ph47:                                         ; preds = %._crit_edge
  %19 = getelementptr inbounds i8, ptr %1, i64 40
  br label %50

20:                                               ; preds = %.lr.ph, %47
  %21 = phi ptr [ %12, %.lr.ph ], [ %48, %47 ]
  %.03843 = phi ptr [ %11, %.lr.ph ], [ %21, %47 ]
  %22 = tail call noundef ptr @_ZN2rw5Light9fromWorldEPNS_6LLLinkE(ptr noundef nonnull %.03843)
  %23 = tail call noundef i32 @_ZN2rw5Light7getTypeEv(ptr noundef nonnull align 8 dereferenceable(120) %22)
  %24 = icmp eq i32 %23, 2
  br i1 %24, label %25, label %36

25:                                               ; preds = %20
  %26 = getelementptr inbounds i8, ptr %22, i64 44
  %27 = load <2 x float>, ptr %26, align 4, !tbaa !22
  %28 = load <2 x float>, ptr %7, align 4, !tbaa !22
  %29 = fadd <2 x float> %27, %28
  store <2 x float> %29, ptr %7, align 4, !tbaa !22
  %30 = getelementptr inbounds i8, ptr %22, i64 52
  %31 = load float, ptr %30, align 4, !tbaa !23
  %32 = load float, ptr %8, align 4, !tbaa !26
  %33 = fadd float %31, %32
  store float %33, ptr %8, align 4, !tbaa !26
  %34 = load i32, ptr %1, align 8, !tbaa !27
  %35 = add nsw i32 %34, 1
  store i32 %35, ptr %1, align 8, !tbaa !27
  br label %47

36:                                               ; preds = %20
  %37 = tail call noundef i32 @_ZN2rw5Light7getTypeEv(ptr noundef nonnull align 8 dereferenceable(120) %22)
  %38 = icmp eq i32 %37, 1
  br i1 %38, label %39, label %47

39:                                               ; preds = %36
  %40 = load i32, ptr %3, align 4, !tbaa !5
  %41 = icmp slt i32 %40, %4
  br i1 %41, label %42, label %47

42:                                               ; preds = %39
  %43 = load ptr, ptr %14, align 8, !tbaa !28
  %44 = add nsw i32 %40, 1
  store i32 %44, ptr %3, align 4, !tbaa !5
  %45 = sext i32 %40 to i64
  %46 = getelementptr inbounds ptr, ptr %43, i64 %45
  store ptr %22, ptr %46, align 8, !tbaa !29
  br label %47

47:                                               ; preds = %36, %42, %39, %25
  %48 = load ptr, ptr %21, align 8, !tbaa !20
  %49 = tail call noundef ptr @_ZN2rw8LinkList3endEv(ptr noundef nonnull align 8 dereferenceable(16) %10)
  %.not = icmp eq ptr %21, %49
  br i1 %.not, label %._crit_edge, label %20, !llvm.loop !30

50:                                               ; preds = %.lr.ph47, %53
  %51 = phi ptr [ %17, %.lr.ph47 ], [ %60, %53 ]
  %.03745 = phi ptr [ %16, %.lr.ph47 ], [ %51, %53 ]
  %52 = load i32, ptr %5, align 8, !tbaa !13
  %.not41 = icmp slt i32 %52, %6
  br i1 %.not41, label %53, label %._crit_edge48

53:                                               ; preds = %50
  %54 = tail call noundef ptr @_ZN2rw5Light9fromWorldEPNS_6LLLinkE(ptr noundef nonnull %.03745)
  %55 = load ptr, ptr %19, align 8, !tbaa !32
  %56 = load i32, ptr %5, align 8, !tbaa !13
  %57 = add nsw i32 %56, 1
  store i32 %57, ptr %5, align 8, !tbaa !13
  %58 = sext i32 %56 to i64
  %59 = getelementptr inbounds ptr, ptr %55, i64 %58
  store ptr %54, ptr %59, align 8, !tbaa !29
  %60 = load ptr, ptr %51, align 8, !tbaa !20
  %61 = tail call noundef ptr @_ZN2rw8LinkList3endEv(ptr noundef nonnull align 8 dereferenceable(16) %15)
  %.not40 = icmp eq ptr %51, %61
  br i1 %.not40, label %._crit_edge48, label %50, !llvm.loop !33

._crit_edge48:                                    ; preds = %53, %50, %._crit_edge
  ret void
}

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #1

attributes #0 = { 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 #1 = { nocallback nofree nounwind willreturn memory(argmem: write) }

!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, !7, i64 20}
!6 = !{!"_ZTSN2rw11WorldLightsE", !7, i64 0, !10, i64 4, !7, i64 20, !12, i64 24, !7, i64 32, !12, i64 40}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"_ZTSN2rw5RGBAfE", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12}
!11 = !{!"float", !8, i64 0}
!12 = !{!"any pointer", !8, i64 0}
!13 = !{!6, !7, i64 32}
!14 = !{!6, !11, i64 16}
!15 = !{!16, !12, i64 32}
!16 = !{!"_ZTSN2rw5WorldE", !17, i64 0, !18, i64 16, !18, i64 32, !18, i64 48}
!17 = !{!"_ZTSN2rw6ObjectE", !8, i64 0, !8, i64 1, !8, i64 2, !8, i64 3, !12, i64 8}
!18 = !{!"_ZTSN2rw8LinkListE", !19, i64 0}
!19 = !{!"_ZTSN2rw6LLLinkE", !12, i64 0, !12, i64 8}
!20 = !{!19, !12, i64 0}
!21 = !{!16, !12, i64 16}
!22 = !{!11, !11, i64 0}
!23 = !{!24, !11, i64 52}
!24 = !{!"_ZTSN2rw5LightE", !25, i64 0, !11, i64 40, !10, i64 44, !11, i64 60, !19, i64 64, !12, i64 80, !19, i64 88, !12, i64 104, !12, i64 112}
!25 = !{!"_ZTSN2rw15ObjectWithFrameE", !17, i64 0, !19, i64 16, !12, i64 32}
!26 = !{!6, !11, i64 12}
!27 = !{!6, !7, i64 0}
!28 = !{!6, !12, i64 24}
!29 = !{!12, !12, i64 0}
!30 = distinct !{!30, !31}
!31 = !{!"llvm.loop.mustprogress"}
!32 = !{!6, !12, i64 40}
!33 = distinct !{!33, !31}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,MemCpyOptPass,PostOrderFunctionAttrsPass,ReassociatePass,SLPVectorizerPass,SROAPass,SimplifyCFGPass,TailCallElimPass