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

; 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::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 }
%"struct.rw::Engine" = type { ptr, ptr, %"struct.rw::LinkList", %"struct.rw::FileFunctions", [13 x ptr], %"struct.rw::Device", ptr }
%"struct.rw::FileFunctions" = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%"struct.rw::Device" = type { float, float, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }

@_ZN2rw6engineE = external dso_local global ptr, align 8
@_ZN2rw6Engine9s_plglistE = external dso_local global %"struct.rw::PluginList", align 8
@_ZN2rw6Engine5stateE = external dso_local global i32, align 4
@_ZN2rw6Driver9s_plglistE = external dso_local global [13 x %"struct.rw::PluginList"], align 16
@stderr = external global ptr, 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
@.str.8 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [4 x i8], align 1

; 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: nounwind
declare i32 @fprintf(ptr noundef, ptr noundef, ...) #1

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

declare void @_ZN2rw8setErrorEPNS_5ErrorE(ptr noundef) #2

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

6:                                                ; preds = %0
  %7 = load i32, ptr @_ZN2rw6Engine5stateE, align 4, !tbaa !9
  %8 = icmp ne i32 %7, 2
  br i1 %8, label %9, label %19

9:                                                ; preds = %6, %0
  br label %10

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

18:                                               ; preds = %10
  store i32 0, ptr %1, align 4
  br label %52

19:                                               ; preds = %6
  %20 = load ptr, ptr @_ZN2rw6engineE, align 8, !tbaa !5
  %21 = getelementptr inbounds %"struct.rw::Engine", ptr %20, i32 0, i32 5
  %22 = getelementptr inbounds %"struct.rw::Device", ptr %21, i32 0, i32 17
  %23 = load ptr, ptr %22, align 8, !tbaa !15
  %24 = call noundef i32 %23(i32 noundef 0, ptr noundef null, i32 noundef 0)
  %25 = load ptr, ptr @_ZN2rw6engineE, align 8, !tbaa !5
  call void @_ZN2rw10PluginList9constructEPv(ptr noundef nonnull align 8 dereferenceable(24) @_ZN2rw6Engine9s_plglistE, ptr noundef %25)
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #4
  store i32 0, ptr %3, align 4, !tbaa !22
  br label %26

26:                                               ; preds = %40, %19
  %27 = load i32, ptr %3, align 4, !tbaa !22
  %28 = icmp ult i32 %27, 13
  br i1 %28, label %30, label %29

29:                                               ; preds = %26
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #4
  br label %43

30:                                               ; preds = %26
  %31 = load i32, ptr %3, align 4, !tbaa !22
  %32 = zext i32 %31 to i64
  %33 = getelementptr inbounds [13 x %"struct.rw::PluginList"], ptr @_ZN2rw6Driver9s_plglistE, i64 0, i64 %32
  %34 = load ptr, ptr @_ZN2rw6engineE, align 8, !tbaa !5
  %35 = getelementptr inbounds %"struct.rw::Engine", ptr %34, i32 0, i32 4
  %36 = load i32, ptr %3, align 4, !tbaa !22
  %37 = zext i32 %36 to i64
  %38 = getelementptr inbounds [13 x ptr], ptr %35, i64 0, i64 %37
  %39 = load ptr, ptr %38, align 8, !tbaa !5
  call void @_ZN2rw10PluginList9constructEPv(ptr noundef nonnull align 8 dereferenceable(24) %33, ptr noundef %39)
  br label %40

40:                                               ; preds = %30
  %41 = load i32, ptr %3, align 4, !tbaa !22
  %42 = add i32 %41, 1
  store i32 %42, ptr %3, align 4, !tbaa !22
  br label %26, !llvm.loop !23

43:                                               ; preds = %29
  %44 = load ptr, ptr @_ZN2rw6engineE, align 8, !tbaa !5
  %45 = getelementptr inbounds %"struct.rw::Engine", ptr %44, i32 0, i32 5
  %46 = getelementptr inbounds %"struct.rw::Device", ptr %45, i32 0, i32 17
  %47 = load ptr, ptr %46, align 8, !tbaa !15
  %48 = call noundef i32 %47(i32 noundef 4, ptr noundef null, i32 noundef 0)
  %49 = call noundef i32 @_ZN2rw5Image18registerFileFormatEPKcPFPS0_S2_EPFvS3_S2_E(ptr noundef @.str.8, ptr noundef @_ZN2rw7readTGAEPKc, ptr noundef @_ZN2rw8writeTGAEPNS_5ImageEPKc)
  %50 = call noundef i32 @_ZN2rw5Image18registerFileFormatEPKcPFPS0_S2_EPFvS3_S2_E(ptr noundef @.str.9, ptr noundef @_ZN2rw7readBMPEPKc, ptr noundef @_ZN2rw8writeBMPEPNS_5ImageEPKc)
  %51 = call noundef i32 @_ZN2rw5Image18registerFileFormatEPKcPFPS0_S2_EPFvS3_S2_E(ptr noundef @.str.10, ptr noundef @_ZN2rw7readPNGEPKc, ptr noundef @_ZN2rw8writePNGEPNS_5ImageEPKc)
  store i32 3, ptr @_ZN2rw6Engine5stateE, align 4, !tbaa !9
  store i32 1, ptr %1, align 4
  br label %52

52:                                               ; preds = %43, %18
  %53 = load i32, ptr %1, align 4
  ret i32 %53
}

declare void @_ZN2rw10PluginList9constructEPv(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef) #2

declare noundef i32 @_ZN2rw5Image18registerFileFormatEPKcPFPS0_S2_EPFvS3_S2_E(ptr noundef, ptr noundef, ptr noundef) #2

declare noundef ptr @_ZN2rw7readTGAEPKc(ptr noundef) #2

declare void @_ZN2rw8writeTGAEPNS_5ImageEPKc(ptr noundef, ptr noundef) #2

declare noundef ptr @_ZN2rw7readBMPEPKc(ptr noundef) #2

declare void @_ZN2rw8writeBMPEPNS_5ImageEPKc(ptr noundef, ptr noundef) #2

declare noundef ptr @_ZN2rw7readPNGEPKc(ptr noundef) #2

declare void @_ZN2rw8writePNGEPNS_5ImageEPKc(ptr noundef, ptr noundef) #2

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { "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 uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"_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, !6, i64 320}
!16 = !{!"_ZTSN2rw6EngineE", !6, i64 0, !6, i64 8, !17, i64 16, !19, i64 32, !7, i64 88, !20, i64 192, !6, i64 328}
!17 = !{!"_ZTSN2rw8LinkListE", !18, i64 0}
!18 = !{!"_ZTSN2rw6LLLinkE", !6, i64 0, !6, i64 8}
!19 = !{!"_ZTSN2rw13FileFunctionsE", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48}
!20 = !{!"_ZTSN2rw6DeviceE", !21, i64 0, !21, i64 4, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !6, i64 120, !6, i64 128}
!21 = !{!"float", !7, i64 0}
!22 = !{!13, !13, i64 0}
!23 = distinct !{!23, !24}
!24 = !{!"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::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
@_ZN2rw6Engine9s_plglistE = external dso_local global %"struct.rw::PluginList", align 8
@_ZN2rw6Engine5stateE = external dso_local local_unnamed_addr global i32, align 4
@_ZN2rw6Driver9s_plglistE = external dso_local global [13 x %"struct.rw::PluginList"], align 16
@stderr = external local_unnamed_addr global ptr, 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
@.str.8 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [4 x i8], align 1

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

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

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

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

declare void @_ZN2rw8setErrorEPNS_5ErrorE(ptr noundef) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
define dso_local noundef range(i32 0, 2) i32 @_ZN2rw6Engine5startEv() local_unnamed_addr #3 align 2 {
  %1 = alloca %"struct.rw::Error", align 4
  %2 = load ptr, ptr @_ZN2rw6engineE, align 8, !tbaa !5
  %3 = icmp eq ptr %2, null
  %4 = load i32, ptr @_ZN2rw6Engine5stateE, align 4
  %5 = icmp ne i32 %4, 2
  %or.cond = select i1 %3, i1 true, i1 %5
  br i1 %or.cond, label %6, label %13

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

13:                                               ; preds = %0
  %14 = getelementptr inbounds i8, ptr %2, i64 320
  %15 = load ptr, ptr %14, align 8, !tbaa !13
  %16 = tail call noundef i32 %15(i32 noundef 0, ptr noundef null, i32 noundef 0)
  %17 = load ptr, ptr @_ZN2rw6engineE, align 8, !tbaa !5
  tail call void @_ZN2rw10PluginList9constructEPv(ptr noundef nonnull align 8 dereferenceable(24) @_ZN2rw6Engine9s_plglistE, ptr noundef %17)
  %18 = load ptr, ptr @_ZN2rw6engineE, align 8, !tbaa !5
  %19 = getelementptr inbounds i8, ptr %18, i64 88
  %20 = load ptr, ptr %19, align 8, !tbaa !5
  tail call void @_ZN2rw10PluginList9constructEPv(ptr noundef nonnull align 8 dereferenceable(24) @_ZN2rw6Driver9s_plglistE, ptr noundef %20)
  %21 = load ptr, ptr @_ZN2rw6engineE, align 8, !tbaa !5
  %22 = getelementptr inbounds i8, ptr %21, i64 96
  %23 = load ptr, ptr %22, align 8, !tbaa !5
  tail call void @_ZN2rw10PluginList9constructEPv(ptr noundef nonnull align 8 dereferenceable(24) getelementptr inbounds (i8, ptr @_ZN2rw6Driver9s_plglistE, i64 24), ptr noundef %23)
  %24 = load ptr, ptr @_ZN2rw6engineE, align 8, !tbaa !5
  %25 = getelementptr inbounds i8, ptr %24, i64 104
  %26 = load ptr, ptr %25, align 8, !tbaa !5
  tail call void @_ZN2rw10PluginList9constructEPv(ptr noundef nonnull align 8 dereferenceable(24) getelementptr inbounds (i8, ptr @_ZN2rw6Driver9s_plglistE, i64 48), ptr noundef %26)
  %27 = load ptr, ptr @_ZN2rw6engineE, align 8, !tbaa !5
  %28 = getelementptr inbounds i8, ptr %27, i64 112
  %29 = load ptr, ptr %28, align 8, !tbaa !5
  tail call void @_ZN2rw10PluginList9constructEPv(ptr noundef nonnull align 8 dereferenceable(24) getelementptr inbounds (i8, ptr @_ZN2rw6Driver9s_plglistE, i64 72), ptr noundef %29)
  %30 = load ptr, ptr @_ZN2rw6engineE, align 8, !tbaa !5
  %31 = getelementptr inbounds i8, ptr %30, i64 120
  %32 = load ptr, ptr %31, align 8, !tbaa !5
  tail call void @_ZN2rw10PluginList9constructEPv(ptr noundef nonnull align 8 dereferenceable(24) getelementptr inbounds (i8, ptr @_ZN2rw6Driver9s_plglistE, i64 96), ptr noundef %32)
  %33 = load ptr, ptr @_ZN2rw6engineE, align 8, !tbaa !5
  %34 = getelementptr inbounds i8, ptr %33, i64 128
  %35 = load ptr, ptr %34, align 8, !tbaa !5
  tail call void @_ZN2rw10PluginList9constructEPv(ptr noundef nonnull align 8 dereferenceable(24) getelementptr inbounds (i8, ptr @_ZN2rw6Driver9s_plglistE, i64 120), ptr noundef %35)
  %36 = load ptr, ptr @_ZN2rw6engineE, align 8, !tbaa !5
  %37 = getelementptr inbounds i8, ptr %36, i64 136
  %38 = load ptr, ptr %37, align 8, !tbaa !5
  tail call void @_ZN2rw10PluginList9constructEPv(ptr noundef nonnull align 8 dereferenceable(24) getelementptr inbounds (i8, ptr @_ZN2rw6Driver9s_plglistE, i64 144), ptr noundef %38)
  %39 = load ptr, ptr @_ZN2rw6engineE, align 8, !tbaa !5
  %40 = getelementptr inbounds i8, ptr %39, i64 144
  %41 = load ptr, ptr %40, align 8, !tbaa !5
  tail call void @_ZN2rw10PluginList9constructEPv(ptr noundef nonnull align 8 dereferenceable(24) getelementptr inbounds (i8, ptr @_ZN2rw6Driver9s_plglistE, i64 168), ptr noundef %41)
  %42 = load ptr, ptr @_ZN2rw6engineE, align 8, !tbaa !5
  %43 = getelementptr inbounds i8, ptr %42, i64 152
  %44 = load ptr, ptr %43, align 8, !tbaa !5
  tail call void @_ZN2rw10PluginList9constructEPv(ptr noundef nonnull align 8 dereferenceable(24) getelementptr inbounds (i8, ptr @_ZN2rw6Driver9s_plglistE, i64 192), ptr noundef %44)
  %45 = load ptr, ptr @_ZN2rw6engineE, align 8, !tbaa !5
  %46 = getelementptr inbounds i8, ptr %45, i64 160
  %47 = load ptr, ptr %46, align 8, !tbaa !5
  tail call void @_ZN2rw10PluginList9constructEPv(ptr noundef nonnull align 8 dereferenceable(24) getelementptr inbounds (i8, ptr @_ZN2rw6Driver9s_plglistE, i64 216), ptr noundef %47)
  %48 = load ptr, ptr @_ZN2rw6engineE, align 8, !tbaa !5
  %49 = getelementptr inbounds i8, ptr %48, i64 168
  %50 = load ptr, ptr %49, align 8, !tbaa !5
  tail call void @_ZN2rw10PluginList9constructEPv(ptr noundef nonnull align 8 dereferenceable(24) getelementptr inbounds (i8, ptr @_ZN2rw6Driver9s_plglistE, i64 240), ptr noundef %50)
  %51 = load ptr, ptr @_ZN2rw6engineE, align 8, !tbaa !5
  %52 = getelementptr inbounds i8, ptr %51, i64 176
  %53 = load ptr, ptr %52, align 8, !tbaa !5
  tail call void @_ZN2rw10PluginList9constructEPv(ptr noundef nonnull align 8 dereferenceable(24) getelementptr inbounds (i8, ptr @_ZN2rw6Driver9s_plglistE, i64 264), ptr noundef %53)
  %54 = load ptr, ptr @_ZN2rw6engineE, align 8, !tbaa !5
  %55 = getelementptr inbounds i8, ptr %54, i64 184
  %56 = load ptr, ptr %55, align 8, !tbaa !5
  tail call void @_ZN2rw10PluginList9constructEPv(ptr noundef nonnull align 8 dereferenceable(24) getelementptr inbounds (i8, ptr @_ZN2rw6Driver9s_plglistE, i64 288), ptr noundef %56)
  %57 = load ptr, ptr @_ZN2rw6engineE, align 8, !tbaa !5
  %58 = getelementptr inbounds i8, ptr %57, i64 320
  %59 = load ptr, ptr %58, align 8, !tbaa !13
  %60 = tail call noundef i32 %59(i32 noundef 4, ptr noundef null, i32 noundef 0)
  %61 = tail call noundef i32 @_ZN2rw5Image18registerFileFormatEPKcPFPS0_S2_EPFvS3_S2_E(ptr noundef nonnull @.str.8, ptr noundef nonnull @_ZN2rw7readTGAEPKc, ptr noundef nonnull @_ZN2rw8writeTGAEPNS_5ImageEPKc)
  %62 = tail call noundef i32 @_ZN2rw5Image18registerFileFormatEPKcPFPS0_S2_EPFvS3_S2_E(ptr noundef nonnull @.str.9, ptr noundef nonnull @_ZN2rw7readBMPEPKc, ptr noundef nonnull @_ZN2rw8writeBMPEPNS_5ImageEPKc)
  %63 = tail call noundef i32 @_ZN2rw5Image18registerFileFormatEPKcPFPS0_S2_EPFvS3_S2_E(ptr noundef nonnull @.str.10, ptr noundef nonnull @_ZN2rw7readPNGEPKc, ptr noundef nonnull @_ZN2rw8writePNGEPNS_5ImageEPKc)
  store i32 3, ptr @_ZN2rw6Engine5stateE, align 4, !tbaa !20
  br label %64

64:                                               ; preds = %13, %6
  %.06 = phi i32 [ 0, %6 ], [ 1, %13 ]
  ret i32 %.06
}

declare void @_ZN2rw10PluginList9constructEPv(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef) local_unnamed_addr #2

declare noundef i32 @_ZN2rw5Image18registerFileFormatEPKcPFPS0_S2_EPFvS3_S2_E(ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #2

declare noundef ptr @_ZN2rw7readTGAEPKc(ptr noundef) #2

declare void @_ZN2rw8writeTGAEPNS_5ImageEPKc(ptr noundef, ptr noundef) #2

declare noundef ptr @_ZN2rw7readBMPEPKc(ptr noundef) #2

declare void @_ZN2rw8writeBMPEPNS_5ImageEPKc(ptr noundef, ptr noundef) #2

declare noundef ptr @_ZN2rw7readPNGEPKc(ptr noundef) #2

declare void @_ZN2rw8writePNGEPNS_5ImageEPKc(ptr noundef, ptr noundef) #2

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { "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 uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }
attributes #5 = { 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, !6, i64 320}
!14 = !{!"_ZTSN2rw6EngineE", !6, i64 0, !6, i64 8, !15, i64 16, !17, i64 32, !7, i64 88, !18, i64 192, !6, i64 328}
!15 = !{!"_ZTSN2rw8LinkListE", !16, i64 0}
!16 = !{!"_ZTSN2rw6LLLinkE", !6, i64 0, !6, i64 8}
!17 = !{!"_ZTSN2rw13FileFunctionsE", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48}
!18 = !{!"_ZTSN2rw6DeviceE", !19, i64 0, !19, i64 4, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !6, i64 120, !6, i64 128}
!19 = !{!"float", !7, i64 0}
!20 = !{!21, !21, i64 0}
!21 = !{!"_ZTSN2rw6Engine5StateE", !7, i64 0}


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