; LLVM IR from aap/librw :: src/engine.ll (ZN2rw6Engine4initEPNS_15MemoryFunctionsE)

; 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::MemoryFunctions" = type { ptr, ptr, ptr, ptr, ptr }
%"struct.rw::PluginList" = type { i32, i32, %"struct.rw::LinkList" }
%"struct.rw::LinkList" = type { %"struct.rw::LLLink" }
%"struct.rw::LLLink" = type { ptr, ptr }
%"struct.rw::Error" = type { i32, i32 }

@_ZN2rw6engineE = external dso_local global ptr, align 8
@_ZN2rw6Engine5stateE = external dso_local global i32, align 4
@_ZN2rw6Engine8memfuncsE = external dso_local global %"struct.rw::MemoryFunctions", align 8
@_ZN2rw6Driver9s_plglistE = external dso_local global [13 x %"struct.rw::PluginList"], align 16
@_ZN2rw11allocationsE = external dso_local global %"struct.rw::LinkList", align 8
@_ZN2rw20totalMemoryAllocatedE = external dso_local global i64, align 8
@stderr = external global ptr, align 8
@_ZN2rw15defaultMemfuncsE = external dso_local global %"struct.rw::MemoryFunctions", align 8
@.str.3 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [58 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [4 x i8], align 1
@_ZN2rw5Frame12numAllocatedE = external global i32, align 4
@_ZN2rw5Image12numAllocatedE = external global i32, align 4
@_ZN2rw6Raster12numAllocatedE = external global i32, align 4
@_ZN2rw7Texture12numAllocatedE = external global i32, align 4
@_ZN2rw13TexDictionary12numAllocatedE = external global i32, align 4
@_ZN2rw8Geometry12numAllocatedE = external global i32, align 4
@_ZN2rw8Material12numAllocatedE = external global i32, align 4
@_ZN2rw6Atomic12numAllocatedE = external global i32, align 4
@_ZN2rw5Light12numAllocatedE = external global i32, align 4
@_ZN2rw6Camera12numAllocatedE = external global i32, align 4
@_ZN2rw5Clump12numAllocatedE = external global i32, align 4
@_ZN2rw5World12numAllocatedE = external global i32, align 4

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN2rw12mustmalloc_hEmj(i64 noundef, i32 noundef) #0

; Function Attrs: nounwind
declare i32 @fprintf(ptr noundef, ptr noundef, ...) #2

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN2rw13mustrealloc_hEPvmj(ptr noundef, i64 noundef, i32 noundef) #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) #3

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN2rw6Engine4initEPNS_15MemoryFunctionsE(ptr noundef %0) #0 align 2 {
  %2 = alloca i32, align 4
  %3 = alloca ptr, align 8
  %4 = alloca %"struct.rw::Error", align 4
  %5 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  %6 = load ptr, ptr @_ZN2rw6engineE, align 8, !tbaa !5
  %7 = icmp ne ptr %6, null
  br i1 %7, label %11, label %8

8:                                                ; preds = %1
  %9 = load i32, ptr @_ZN2rw6Engine5stateE, align 4, !tbaa !9
  %10 = icmp ne i32 %9, 0
  br i1 %10, label %11, label %21

11:                                               ; preds = %8, %1
  br label %12

12:                                               ; preds = %11
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #6
  %13 = getelementptr inbounds %"struct.rw::Error", ptr %4, i32 0, i32 0
  store i32 0, ptr %13, align 4, !tbaa !11
  %14 = getelementptr inbounds %"struct.rw::Error", ptr %4, i32 0, i32 1
  store i32 -2147483641, ptr %14, align 4, !tbaa !14
  %15 = load ptr, ptr @stderr, align 8, !tbaa !5
  %16 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %15, ptr noundef @.str.3, ptr noundef @.str.4, i32 noundef 190) #6
  %17 = load ptr, ptr @stderr, align 8, !tbaa !5
  %18 = call noundef ptr (i32, ...) @_ZN2rw9dbgsprintEjz(i32 noundef -2147483641)
  %19 = call i32 (ptr, ptr, ...) @fprintf(ptr noundef %17, ptr noundef @.str.5, ptr noundef %18) #6
  call void @_ZN2rw8setErrorEPNS_5ErrorE(ptr noundef %4)
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #6
  br label %20

20:                                               ; preds = %12
  store i32 0, ptr %2, align 4
  br label %48

21:                                               ; preds = %8
  store i64 0, ptr @_ZN2rw20totalMemoryAllocatedE, align 8, !tbaa !15
  call void @_ZN2rw8LinkList4initEv(ptr noundef nonnull align 8 dereferenceable(16) @_ZN2rw11allocationsE)
  %22 = load ptr, ptr %3, align 8, !tbaa !5
  %23 = icmp ne ptr %22, null
  br i1 %23, label %24, label %26

24:                                               ; preds = %21
  %25 = load ptr, ptr %3, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 @_ZN2rw6Engine8memfuncsE, ptr align 8 %25, i64 40, i1 false), !tbaa.struct !17
  br label %27

26:                                               ; preds = %21
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 @_ZN2rw6Engine8memfuncsE, ptr align 8 @_ZN2rw15defaultMemfuncsE, i64 40, i1 false), !tbaa.struct !17
  br label %27

27:                                               ; preds = %26, %24
  %28 = load ptr, ptr getelementptr inbounds (%"struct.rw::MemoryFunctions", ptr @_ZN2rw6Engine8memfuncsE, i32 0, i32 3), align 8, !tbaa !18
  %29 = icmp eq ptr %28, null
  br i1 %29, label %30, label %31

30:                                               ; preds = %27
  store ptr @_ZN2rw12mustmalloc_hEmj, ptr getelementptr inbounds (%"struct.rw::MemoryFunctions", ptr @_ZN2rw6Engine8memfuncsE, i32 0, i32 3), align 8, !tbaa !18
  br label %31

31:                                               ; preds = %30, %27
  %32 = load ptr, ptr getelementptr inbounds (%"struct.rw::MemoryFunctions", ptr @_ZN2rw6Engine8memfuncsE, i32 0, i32 4), align 8, !tbaa !20
  %33 = icmp eq ptr %32, null
  br i1 %33, label %34, label %35

34:                                               ; preds = %31
  store ptr @_ZN2rw13mustrealloc_hEPvmj, ptr getelementptr inbounds (%"struct.rw::MemoryFunctions", ptr @_ZN2rw6Engine8memfuncsE, i32 0, i32 4), align 8, !tbaa !20
  br label %35

35:                                               ; preds = %34, %31
  call void @_ZN2rw10PluginList4openEv()
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  store i32 0, ptr %5, align 4, !tbaa !21
  br label %36

36:                                               ; preds = %44, %35
  %37 = load i32, ptr %5, align 4, !tbaa !21
  %38 = icmp ult i32 %37, 13
  br i1 %38, label %40, label %39

39:                                               ; preds = %36
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  br label %47

40:                                               ; preds = %36
  %41 = load i32, ptr %5, align 4, !tbaa !21
  %42 = zext i32 %41 to i64
  %43 = getelementptr inbounds [13 x %"struct.rw::PluginList"], ptr @_ZN2rw6Driver9s_plglistE, i64 0, i64 %42
  call void @_ZN2rw10PluginListC2Ei(ptr noundef nonnull align 8 dereferenceable(24) %43, i32 noundef 88)
  br label %44

44:                                               ; preds = %40
  %45 = load i32, ptr %5, align 4, !tbaa !21
  %46 = add i32 %45, 1
  store i32 %46, ptr %5, align 4, !tbaa !21
  br label %36, !llvm.loop !22

47:                                               ; preds = %39
  call void @_ZN2rw5Frame14registerModuleEv()
  call void @_ZN2rw5Image14registerModuleEv()
  call void @_ZN2rw6Raster14registerModuleEv()
  call void @_ZN2rw7Texture14registerModuleEv()
  store i32 0, ptr @_ZN2rw5Frame12numAllocatedE, align 4, !tbaa !21
  store i32 0, ptr @_ZN2rw5Image12numAllocatedE, align 4, !tbaa !21
  store i32 0, ptr @_ZN2rw6Raster12numAllocatedE, align 4, !tbaa !21
  store i32 0, ptr @_ZN2rw7Texture12numAllocatedE, align 4, !tbaa !21
  store i32 0, ptr @_ZN2rw13TexDictionary12numAllocatedE, align 4, !tbaa !21
  store i32 0, ptr @_ZN2rw8Geometry12numAllocatedE, align 4, !tbaa !21
  store i32 0, ptr @_ZN2rw8Material12numAllocatedE, align 4, !tbaa !21
  store i32 0, ptr @_ZN2rw6Atomic12numAllocatedE, align 4, !tbaa !21
  store i32 0, ptr @_ZN2rw5Light12numAllocatedE, align 4, !tbaa !21
  store i32 0, ptr @_ZN2rw6Camera12numAllocatedE, align 4, !tbaa !21
  store i32 0, ptr @_ZN2rw5Clump12numAllocatedE, align 4, !tbaa !21
  store i32 0, ptr @_ZN2rw5World12numAllocatedE, align 4, !tbaa !21
  call void @_ZN2rw3ps223registerPlatformPluginsEv()
  call void @_ZN2rw4xbox23registerPlatformPluginsEv()
  call void @_ZN2rw4d3d823registerPlatformPluginsEv()
  call void @_ZN2rw4d3d923registerPlatformPluginsEv()
  call void @_ZN2rw4wdgl23registerPlatformPluginsEv()
  call void @_ZN2rw3gl323registerPlatformPluginsEv()
  store i32 1, ptr @_ZN2rw6Engine5stateE, align 4, !tbaa !9
  store i32 1, ptr %2, align 4
  br label %48

48:                                               ; preds = %47, %20
  %49 = load i32, ptr %2, align 4
  ret i32 %49
}

declare noundef ptr @_ZN2rw9dbgsprintEjz(i32 noundef, ...) #4

declare void @_ZN2rw8setErrorEPNS_5ErrorE(ptr noundef) #4

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

declare void @_ZN2rw10PluginList4openEv() #4

declare void @_ZN2rw5Frame14registerModuleEv() #4

declare void @_ZN2rw5Image14registerModuleEv() #4

declare void @_ZN2rw6Raster14registerModuleEv() #4

declare void @_ZN2rw7Texture14registerModuleEv() #4

declare void @_ZN2rw3ps223registerPlatformPluginsEv() #4

declare void @_ZN2rw4xbox23registerPlatformPluginsEv() #4

declare void @_ZN2rw4d3d823registerPlatformPluginsEv() #4

declare void @_ZN2rw4d3d923registerPlatformPluginsEv() #4

declare void @_ZN2rw4wdgl23registerPlatformPluginsEv() #4

declare void @_ZN2rw3gl323registerPlatformPluginsEv() #4

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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nounwind "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 nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { "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 = { 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 #6 = { 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 = !{!"_ZTSN2rw6Engine5StateE", !7, i64 0}
!11 = !{!12, !13, i64 0}
!12 = !{!"_ZTSN2rw5ErrorE", !13, i64 0, !13, i64 4}
!13 = !{!"int", !7, i64 0}
!14 = !{!12, !13, i64 4}
!15 = !{!16, !16, i64 0}
!16 = !{!"long", !7, i64 0}
!17 = !{i64 0, i64 8, !5, i64 8, i64 8, !5, i64 16, i64 8, !5, i64 24, i64 8, !5, i64 32, i64 8, !5}
!18 = !{!19, !6, i64 24}
!19 = !{!"_ZTSN2rw15MemoryFunctionsE", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32}
!20 = !{!19, !6, i64 32}
!21 = !{!13, !13, i64 0}
!22 = distinct !{!22, !23}
!23 = !{!"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"

%"struct.rw::MemoryFunctions" = type { ptr, ptr, ptr, ptr, ptr }
%"struct.rw::PluginList" = type { i32, i32, %"struct.rw::LinkList" }
%"struct.rw::LinkList" = type { %"struct.rw::LLLink" }
%"struct.rw::LLLink" = type { ptr, ptr }
%"struct.rw::Error" = type { i32, i32 }

@_ZN2rw6engineE = external dso_local local_unnamed_addr global ptr, align 8
@_ZN2rw6Engine5stateE = external dso_local local_unnamed_addr global i32, align 4
@_ZN2rw6Engine8memfuncsE = external dso_local local_unnamed_addr global %"struct.rw::MemoryFunctions", align 8
@_ZN2rw6Driver9s_plglistE = external dso_local global [13 x %"struct.rw::PluginList"], align 16
@_ZN2rw11allocationsE = external dso_local global %"struct.rw::LinkList", align 8
@_ZN2rw20totalMemoryAllocatedE = external dso_local local_unnamed_addr global i64, align 8
@stderr = external local_unnamed_addr global ptr, align 8
@_ZN2rw15defaultMemfuncsE = external dso_local local_unnamed_addr global %"struct.rw::MemoryFunctions", align 8
@.str.3 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [58 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [4 x i8], align 1
@_ZN2rw5Frame12numAllocatedE = external local_unnamed_addr global i32, align 4
@_ZN2rw5Image12numAllocatedE = external local_unnamed_addr global i32, align 4
@_ZN2rw6Raster12numAllocatedE = external local_unnamed_addr global i32, align 4
@_ZN2rw7Texture12numAllocatedE = external local_unnamed_addr global i32, align 4
@_ZN2rw13TexDictionary12numAllocatedE = external local_unnamed_addr global i32, align 4
@_ZN2rw8Geometry12numAllocatedE = external local_unnamed_addr global i32, align 4
@_ZN2rw8Material12numAllocatedE = external local_unnamed_addr global i32, align 4
@_ZN2rw6Atomic12numAllocatedE = external local_unnamed_addr global i32, align 4
@_ZN2rw5Light12numAllocatedE = external local_unnamed_addr global i32, align 4
@_ZN2rw6Camera12numAllocatedE = external local_unnamed_addr global i32, align 4
@_ZN2rw5Clump12numAllocatedE = external local_unnamed_addr global i32, align 4
@_ZN2rw5World12numAllocatedE = external local_unnamed_addr global i32, align 4

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

; 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: mustprogress uwtable
declare dso_local noundef ptr @_ZN2rw12mustmalloc_hEmj(i64 noundef, i32 noundef) #0

; Function Attrs: nofree nounwind
declare noundef i32 @fprintf(ptr nocapture noundef, ptr nocapture noundef readonly, ...) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN2rw13mustrealloc_hEPvmj(ptr noundef, i64 noundef, i32 noundef) #0

; 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
define dso_local noundef range(i32 0, 2) i32 @_ZN2rw6Engine4initEPNS_15MemoryFunctionsE(ptr noundef readonly %0) local_unnamed_addr #0 align 2 {
  %2 = alloca %"struct.rw::Error", align 4
  %3 = load ptr, ptr @_ZN2rw6engineE, align 8, !tbaa !5
  %4 = icmp ne ptr %3, null
  %5 = load i32, ptr @_ZN2rw6Engine5stateE, align 4
  %6 = icmp ne i32 %5, 0
  %or.cond = select i1 %4, i1 true, i1 %6
  br i1 %or.cond, label %7, label %14

7:                                                ; preds = %1
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #6
  store i32 0, ptr %2, align 4, !tbaa !9
  %8 = getelementptr inbounds i8, ptr %2, i64 4
  store i32 -2147483641, ptr %8, align 4, !tbaa !12
  %9 = load ptr, ptr @stderr, align 8, !tbaa !5
  %10 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %9, ptr noundef nonnull @.str.3, ptr noundef nonnull @.str.4, i32 noundef 190) #7
  %11 = load ptr, ptr @stderr, align 8, !tbaa !5
  %12 = tail call noundef ptr (i32, ...) @_ZN2rw9dbgsprintEjz(i32 noundef -2147483641)
  %13 = tail call i32 (ptr, ptr, ...) @fprintf(ptr noundef %11, ptr noundef nonnull @.str.5, ptr noundef %12) #7
  call void @_ZN2rw8setErrorEPNS_5ErrorE(ptr noundef nonnull %2)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #6
  br label %26

14:                                               ; preds = %1
  store i64 0, ptr @_ZN2rw20totalMemoryAllocatedE, align 8, !tbaa !13
  tail call void @_ZN2rw8LinkList4initEv(ptr noundef nonnull align 8 dereferenceable(16) @_ZN2rw11allocationsE)
  %.not = icmp eq ptr %0, null
  br i1 %.not, label %16, label %15

15:                                               ; preds = %14
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(40) @_ZN2rw6Engine8memfuncsE, ptr noundef nonnull align 8 dereferenceable(40) %0, i64 40, i1 false), !tbaa.struct !15
  br label %17

16:                                               ; preds = %14
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 8 dereferenceable(40) @_ZN2rw6Engine8memfuncsE, ptr noundef nonnull align 8 dereferenceable(40) @_ZN2rw15defaultMemfuncsE, i64 40, i1 false), !tbaa.struct !15
  br label %17

17:                                               ; preds = %16, %15
  %18 = load ptr, ptr getelementptr inbounds (i8, ptr @_ZN2rw6Engine8memfuncsE, i64 24), align 8, !tbaa !16
  %19 = icmp eq ptr %18, null
  br i1 %19, label %20, label %21

20:                                               ; preds = %17
  store ptr @_ZN2rw12mustmalloc_hEmj, ptr getelementptr inbounds (i8, ptr @_ZN2rw6Engine8memfuncsE, i64 24), align 8, !tbaa !16
  br label %21

21:                                               ; preds = %20, %17
  %22 = load ptr, ptr getelementptr inbounds (i8, ptr @_ZN2rw6Engine8memfuncsE, i64 32), align 8, !tbaa !18
  %23 = icmp eq ptr %22, null
  br i1 %23, label %24, label %25

24:                                               ; preds = %21
  store ptr @_ZN2rw13mustrealloc_hEPvmj, ptr getelementptr inbounds (i8, ptr @_ZN2rw6Engine8memfuncsE, i64 32), align 8, !tbaa !18
  br label %25

25:                                               ; preds = %24, %21
  tail call void @_ZN2rw10PluginList4openEv()
  tail call void @_ZN2rw10PluginListC2Ei(ptr noundef nonnull align 8 dereferenceable(24) @_ZN2rw6Driver9s_plglistE, i32 noundef 88)
  tail call void @_ZN2rw10PluginListC2Ei(ptr noundef nonnull align 8 dereferenceable(24) getelementptr inbounds (i8, ptr @_ZN2rw6Driver9s_plglistE, i64 24), i32 noundef 88)
  tail call void @_ZN2rw10PluginListC2Ei(ptr noundef nonnull align 8 dereferenceable(24) getelementptr inbounds (i8, ptr @_ZN2rw6Driver9s_plglistE, i64 48), i32 noundef 88)
  tail call void @_ZN2rw10PluginListC2Ei(ptr noundef nonnull align 8 dereferenceable(24) getelementptr inbounds (i8, ptr @_ZN2rw6Driver9s_plglistE, i64 72), i32 noundef 88)
  tail call void @_ZN2rw10PluginListC2Ei(ptr noundef nonnull align 8 dereferenceable(24) getelementptr inbounds (i8, ptr @_ZN2rw6Driver9s_plglistE, i64 96), i32 noundef 88)
  tail call void @_ZN2rw10PluginListC2Ei(ptr noundef nonnull align 8 dereferenceable(24) getelementptr inbounds (i8, ptr @_ZN2rw6Driver9s_plglistE, i64 120), i32 noundef 88)
  tail call void @_ZN2rw10PluginListC2Ei(ptr noundef nonnull align 8 dereferenceable(24) getelementptr inbounds (i8, ptr @_ZN2rw6Driver9s_plglistE, i64 144), i32 noundef 88)
  tail call void @_ZN2rw10PluginListC2Ei(ptr noundef nonnull align 8 dereferenceable(24) getelementptr inbounds (i8, ptr @_ZN2rw6Driver9s_plglistE, i64 168), i32 noundef 88)
  tail call void @_ZN2rw10PluginListC2Ei(ptr noundef nonnull align 8 dereferenceable(24) getelementptr inbounds (i8, ptr @_ZN2rw6Driver9s_plglistE, i64 192), i32 noundef 88)
  tail call void @_ZN2rw10PluginListC2Ei(ptr noundef nonnull align 8 dereferenceable(24) getelementptr inbounds (i8, ptr @_ZN2rw6Driver9s_plglistE, i64 216), i32 noundef 88)
  tail call void @_ZN2rw10PluginListC2Ei(ptr noundef nonnull align 8 dereferenceable(24) getelementptr inbounds (i8, ptr @_ZN2rw6Driver9s_plglistE, i64 240), i32 noundef 88)
  tail call void @_ZN2rw10PluginListC2Ei(ptr noundef nonnull align 8 dereferenceable(24) getelementptr inbounds (i8, ptr @_ZN2rw6Driver9s_plglistE, i64 264), i32 noundef 88)
  tail call void @_ZN2rw10PluginListC2Ei(ptr noundef nonnull align 8 dereferenceable(24) getelementptr inbounds (i8, ptr @_ZN2rw6Driver9s_plglistE, i64 288), i32 noundef 88)
  tail call void @_ZN2rw5Frame14registerModuleEv()
  tail call void @_ZN2rw5Image14registerModuleEv()
  tail call void @_ZN2rw6Raster14registerModuleEv()
  tail call void @_ZN2rw7Texture14registerModuleEv()
  store i32 0, ptr @_ZN2rw5Frame12numAllocatedE, align 4, !tbaa !19
  store i32 0, ptr @_ZN2rw5Image12numAllocatedE, align 4, !tbaa !19
  store i32 0, ptr @_ZN2rw6Raster12numAllocatedE, align 4, !tbaa !19
  store i32 0, ptr @_ZN2rw7Texture12numAllocatedE, align 4, !tbaa !19
  store i32 0, ptr @_ZN2rw13TexDictionary12numAllocatedE, align 4, !tbaa !19
  store i32 0, ptr @_ZN2rw8Geometry12numAllocatedE, align 4, !tbaa !19
  store i32 0, ptr @_ZN2rw8Material12numAllocatedE, align 4, !tbaa !19
  store i32 0, ptr @_ZN2rw6Atomic12numAllocatedE, align 4, !tbaa !19
  store i32 0, ptr @_ZN2rw5Light12numAllocatedE, align 4, !tbaa !19
  store i32 0, ptr @_ZN2rw6Camera12numAllocatedE, align 4, !tbaa !19
  store i32 0, ptr @_ZN2rw5Clump12numAllocatedE, align 4, !tbaa !19
  store i32 0, ptr @_ZN2rw5World12numAllocatedE, align 4, !tbaa !19
  tail call void @_ZN2rw3ps223registerPlatformPluginsEv()
  tail call void @_ZN2rw4xbox23registerPlatformPluginsEv()
  tail call void @_ZN2rw4d3d823registerPlatformPluginsEv()
  tail call void @_ZN2rw4d3d923registerPlatformPluginsEv()
  tail call void @_ZN2rw4wdgl23registerPlatformPluginsEv()
  tail call void @_ZN2rw3gl323registerPlatformPluginsEv()
  store i32 1, ptr @_ZN2rw6Engine5stateE, align 4, !tbaa !20
  br label %26

26:                                               ; preds = %25, %7
  %.06 = phi i32 [ 0, %7 ], [ 1, %25 ]
  ret i32 %.06
}

declare noundef ptr @_ZN2rw9dbgsprintEjz(i32 noundef, ...) local_unnamed_addr #4

declare void @_ZN2rw8setErrorEPNS_5ErrorE(ptr noundef) local_unnamed_addr #4

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

declare void @_ZN2rw10PluginList4openEv() local_unnamed_addr #4

declare void @_ZN2rw5Frame14registerModuleEv() local_unnamed_addr #4

declare void @_ZN2rw5Image14registerModuleEv() local_unnamed_addr #4

declare void @_ZN2rw6Raster14registerModuleEv() local_unnamed_addr #4

declare void @_ZN2rw7Texture14registerModuleEv() local_unnamed_addr #4

declare void @_ZN2rw3ps223registerPlatformPluginsEv() local_unnamed_addr #4

declare void @_ZN2rw4xbox23registerPlatformPluginsEv() local_unnamed_addr #4

declare void @_ZN2rw4d3d823registerPlatformPluginsEv() local_unnamed_addr #4

declare void @_ZN2rw4d3d923registerPlatformPluginsEv() local_unnamed_addr #4

declare void @_ZN2rw4wdgl23registerPlatformPluginsEv() local_unnamed_addr #4

declare void @_ZN2rw3gl323registerPlatformPluginsEv() local_unnamed_addr #4

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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nofree nounwind "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 nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { "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 = { 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 #6 = { nounwind }
attributes #7 = { cold 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 0}
!10 = !{!"_ZTSN2rw5ErrorE", !11, i64 0, !11, i64 4}
!11 = !{!"int", !7, i64 0}
!12 = !{!10, !11, i64 4}
!13 = !{!14, !14, i64 0}
!14 = !{!"long", !7, i64 0}
!15 = !{i64 0, i64 8, !5, i64 8, i64 8, !5, i64 16, i64 8, !5, i64 24, i64 8, !5, i64 32, i64 8, !5}
!16 = !{!17, !6, i64 24}
!17 = !{!"_ZTSN2rw15MemoryFunctionsE", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32}
!18 = !{!17, !6, i64 32}
!19 = !{!11, !11, i64 0}
!20 = !{!21, !21, i64 0}
!21 = !{!"_ZTSN2rw6Engine5StateE", !7, i64 0}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,LoopRotatePass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass