; LLVM IR from BrunoLevy/learn-fpga :: LiteX/software/Tagl/Lib/dldlinker.ll (ZN9DLDLinkerC2Ei)

; 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.DLDLinker = type { %class.GraphicComponent, %class.Flags, ptr, ptr }
%class.GraphicComponent = type { ptr, i32, i32, [100 x %class.Flags], i32, %class.Flags, ptr, [8192 x i8] }
%class.Flags = type { i32 }

@_ZTV9DLDLinker = external dso_local unnamed_addr constant { [6 x ptr] }, align 8
@.str = external hidden unnamed_addr constant [10 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [8 x i8], align 1

declare i32 @__gxx_personality_v0(...)

; Function Attrs: nounwind
declare void @_ZN16GraphicComponentD2Ev(ptr noundef nonnull align 8 dereferenceable(8624)) unnamed_addr #0

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN9DLDLinkerC2Ei(ptr noundef nonnull align 8 dereferenceable(8648) %0, i32 noundef %1) unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca [300 x i8], align 16
  %10 = alloca [300 x i8], align 16
  store ptr %0, ptr %3, align 8, !tbaa !5
  store i32 %1, ptr %4, align 4, !tbaa !9
  %11 = load ptr, ptr %3, align 8
  call void @_ZN16GraphicComponentC2Ev(ptr noundef nonnull align 8 dereferenceable(8624) %11)
  store ptr getelementptr inbounds inrange(-16, 32) ({ [6 x ptr] }, ptr @_ZTV9DLDLinker, i32 0, i32 0, i32 2), ptr %11, align 8, !tbaa !11
  %12 = getelementptr inbounds %class.DLDLinker, ptr %11, i32 0, i32 1
  invoke void @_ZN5FlagsC2Ei(ptr noundef nonnull align 4 dereferenceable(4) %12, i32 noundef 0)
          to label %13 unwind label %35

13:                                               ; preds = %2
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #6
  %14 = getelementptr inbounds %class.GraphicComponent, ptr %11, i32 0, i32 6
  store ptr @.str, ptr %14, align 8, !tbaa !13
  %15 = load i32, ptr %4, align 4, !tbaa !9
  invoke void @_ZN16GraphicComponent7VerboseEi(ptr noundef nonnull align 8 dereferenceable(8624) %11, i32 noundef %15)
          to label %16 unwind label %39

16:                                               ; preds = %13
  %17 = call ptr @getenv(ptr noundef @.str.1) #6
  %18 = getelementptr inbounds %class.DLDLinker, ptr %11, i32 0, i32 2
  store ptr %17, ptr %18, align 8, !tbaa !16
  %19 = icmp ne ptr %17, null
  br i1 %19, label %43, label %20

20:                                               ; preds = %16
  %21 = invoke noundef nonnull align 8 dereferenceable(8624) ptr @_ZN16GraphicComponentixEi(ptr noundef nonnull align 8 dereferenceable(8624) %11, i32 noundef 2)
          to label %22 unwind label %39

22:                                               ; preds = %20
  %23 = invoke noundef nonnull align 8 dereferenceable(8624) ptr @_ZN16GraphicComponentlsEPKc(ptr noundef nonnull align 8 dereferenceable(8624) %21, ptr noundef @.str.2)
          to label %24 unwind label %39

24:                                               ; preds = %22
  %25 = invoke noundef nonnull align 8 dereferenceable(8624) ptr @_ZN16GraphicComponentixEi(ptr noundef nonnull align 8 dereferenceable(8624) %11, i32 noundef 2)
          to label %26 unwind label %39

26:                                               ; preds = %24
  %27 = invoke noundef nonnull align 8 dereferenceable(8624) ptr @_ZN16GraphicComponentlsEPKc(ptr noundef nonnull align 8 dereferenceable(8624) %25, ptr noundef @.str.3)
          to label %28 unwind label %39

28:                                               ; preds = %26
  %29 = invoke noundef nonnull align 8 dereferenceable(8624) ptr @_ZN16GraphicComponentlsEPKc(ptr noundef nonnull align 8 dereferenceable(8624) %27, ptr noundef @.str.4)
          to label %30 unwind label %39

30:                                               ; preds = %28
  %31 = invoke noundef nonnull align 8 dereferenceable(8624) ptr @_ZN16GraphicComponentlsEPKc(ptr noundef nonnull align 8 dereferenceable(8624) %29, ptr noundef @.str.5)
          to label %32 unwind label %39

32:                                               ; preds = %30
  %33 = call noalias ptr @strdup(ptr noundef @.str.4) #6
  %34 = getelementptr inbounds %class.DLDLinker, ptr %11, i32 0, i32 2
  store ptr %33, ptr %34, align 8, !tbaa !16
  br label %58

35:                                               ; preds = %2
  %36 = landingpad { ptr, i32 }
          cleanup
  %37 = extractvalue { ptr, i32 } %36, 0
  store ptr %37, ptr %5, align 8
  %38 = extractvalue { ptr, i32 } %36, 1
  store i32 %38, ptr %6, align 4
  br label %135

39:                                               ; preds = %97, %95, %90, %87, %85, %83, %81, %78, %74, %72, %66, %64, %58, %55, %51, %49, %43, %30, %28, %26, %24, %22, %20, %13
  %40 = landingpad { ptr, i32 }
          cleanup
  %41 = extractvalue { ptr, i32 } %40, 0
  store ptr %41, ptr %5, align 8
  %42 = extractvalue { ptr, i32 } %40, 1
  store i32 %42, ptr %6, align 4
  br label %134

43:                                               ; preds = %16
  %44 = getelementptr inbounds %class.DLDLinker, ptr %11, i32 0, i32 2
  %45 = load ptr, ptr %44, align 8, !tbaa !16
  %46 = call noalias ptr @strdup(ptr noundef %45) #6
  %47 = getelementptr inbounds %class.DLDLinker, ptr %11, i32 0, i32 2
  store ptr %46, ptr %47, align 8, !tbaa !16
  %48 = invoke noundef nonnull align 8 dereferenceable(8624) ptr @_ZN16GraphicComponentixEi(ptr noundef nonnull align 8 dereferenceable(8624) %11, i32 noundef 3)
          to label %49 unwind label %39

49:                                               ; preds = %43
  %50 = invoke noundef nonnull align 8 dereferenceable(8624) ptr @_ZN16GraphicComponentlsEPKc(ptr noundef nonnull align 8 dereferenceable(8624) %48, ptr noundef @.str.6)
          to label %51 unwind label %39

51:                                               ; preds = %49
  %52 = getelementptr inbounds %class.DLDLinker, ptr %11, i32 0, i32 2
  %53 = load ptr, ptr %52, align 8, !tbaa !16
  %54 = invoke noundef nonnull align 8 dereferenceable(8624) ptr @_ZN16GraphicComponentlsEPKc(ptr noundef nonnull align 8 dereferenceable(8624) %50, ptr noundef %53)
          to label %55 unwind label %39

55:                                               ; preds = %51
  %56 = invoke noundef nonnull align 8 dereferenceable(8624) ptr @_ZN16GraphicComponentlsEPKc(ptr noundef nonnull align 8 dereferenceable(8624) %54, ptr noundef @.str.5)
          to label %57 unwind label %39

57:                                               ; preds = %55
  br label %58

58:                                               ; preds = %57, %32
  %59 = getelementptr inbounds %class.DLDLinker, ptr %11, i32 0, i32 1
  invoke void @_ZN5Flags3SetEi(ptr noundef nonnull align 4 dereferenceable(4) %59, i32 noundef 1)
          to label %60 unwind label %39

60:                                               ; preds = %58
  %61 = call ptr @getenv(ptr noundef @.str.7) #6
  %62 = getelementptr inbounds %class.DLDLinker, ptr %11, i32 0, i32 3
  store ptr %61, ptr %62, align 8, !tbaa !18
  %63 = icmp ne ptr %61, null
  br i1 %63, label %64, label %81

64:                                               ; preds = %60
  %65 = getelementptr inbounds %class.DLDLinker, ptr %11, i32 0, i32 1
  invoke void @_ZN5Flags3SetEi(ptr noundef nonnull align 4 dereferenceable(4) %65, i32 noundef 2)
          to label %66 unwind label %39

66:                                               ; preds = %64
  %67 = getelementptr inbounds %class.DLDLinker, ptr %11, i32 0, i32 3
  %68 = load ptr, ptr %67, align 8, !tbaa !18
  %69 = call noalias ptr @strdup(ptr noundef %68) #6
  %70 = getelementptr inbounds %class.DLDLinker, ptr %11, i32 0, i32 3
  store ptr %69, ptr %70, align 8, !tbaa !18
  %71 = invoke noundef nonnull align 8 dereferenceable(8624) ptr @_ZN16GraphicComponentixEi(ptr noundef nonnull align 8 dereferenceable(8624) %11, i32 noundef 3)
          to label %72 unwind label %39

72:                                               ; preds = %66
  %73 = invoke noundef nonnull align 8 dereferenceable(8624) ptr @_ZN16GraphicComponentlsEPKc(ptr noundef nonnull align 8 dereferenceable(8624) %71, ptr noundef @.str.8)
          to label %74 unwind label %39

74:                                               ; preds = %72
  %75 = getelementptr inbounds %class.DLDLinker, ptr %11, i32 0, i32 3
  %76 = load ptr, ptr %75, align 8, !tbaa !18
  %77 = invoke noundef nonnull align 8 dereferenceable(8624) ptr @_ZN16GraphicComponentlsEPKc(ptr noundef nonnull align 8 dereferenceable(8624) %73, ptr noundef %76)
          to label %78 unwind label %39

78:                                               ; preds = %74
  %79 = invoke noundef nonnull align 8 dereferenceable(8624) ptr @_ZN16GraphicComponentlsEPKc(ptr noundef nonnull align 8 dereferenceable(8624) %77, ptr noundef @.str.5)
          to label %80 unwind label %39

80:                                               ; preds = %78
  br label %90

81:                                               ; preds = %60
  %82 = invoke noundef nonnull align 8 dereferenceable(8624) ptr @_ZN16GraphicComponentixEi(ptr noundef nonnull align 8 dereferenceable(8624) %11, i32 noundef 2)
          to label %83 unwind label %39

83:                                               ; preds = %81
  %84 = invoke noundef nonnull align 8 dereferenceable(8624) ptr @_ZN16GraphicComponentlsEPKc(ptr noundef nonnull align 8 dereferenceable(8624) %82, ptr noundef @.str.9)
          to label %85 unwind label %39

85:                                               ; preds = %83
  %86 = invoke noundef nonnull align 8 dereferenceable(8624) ptr @_ZN16GraphicComponentixEi(ptr noundef nonnull align 8 dereferenceable(8624) %11, i32 noundef 2)
          to label %87 unwind label %39

87:                                               ; preds = %85
  %88 = invoke noundef nonnull align 8 dereferenceable(8624) ptr @_ZN16GraphicComponentlsEPKc(ptr noundef nonnull align 8 dereferenceable(8624) %86, ptr noundef @.str.10)
          to label %89 unwind label %39

89:                                               ; preds = %87
  store i32 1, ptr %8, align 4
  br label %131

90:                                               ; preds = %80
  %91 = invoke noundef i32 @_ZN9DLDLinker4InitEv(ptr noundef nonnull align 8 dereferenceable(8648) %11)
          to label %92 unwind label %39

92:                                               ; preds = %90
  %93 = icmp ne i32 %91, 0
  br i1 %93, label %95, label %94

94:                                               ; preds = %92
  store i32 1, ptr %8, align 4
  br label %131

95:                                               ; preds = %92
  %96 = invoke noundef nonnull align 8 dereferenceable(8624) ptr @_ZN16GraphicComponentixEi(ptr noundef nonnull align 8 dereferenceable(8624) %11, i32 noundef 3)
          to label %97 unwind label %39

97:                                               ; preds = %95
  %98 = invoke noundef nonnull align 8 dereferenceable(8624) ptr @_ZN16GraphicComponentlsEPKc(ptr noundef nonnull align 8 dereferenceable(8624) %96, ptr noundef @.str.11)
          to label %99 unwind label %39

99:                                               ; preds = %97
  %100 = getelementptr inbounds %class.DLDLinker, ptr %11, i32 0, i32 3
  %101 = load ptr, ptr %100, align 8, !tbaa !18
  %102 = call ptr @strtok(ptr noundef %101, ptr noundef @.str.12) #6
  store ptr %102, ptr %7, align 8, !tbaa !5
  br label %103

103:                                              ; preds = %128, %99
  %104 = load ptr, ptr %7, align 8, !tbaa !5
  %105 = icmp ne ptr %104, null
  br i1 %105, label %106, label %130

106:                                              ; preds = %103
  call void @llvm.lifetime.start.p0(i64 300, ptr %9) #6
  call void @llvm.lifetime.start.p0(i64 300, ptr %10) #6
  %107 = getelementptr inbounds [300 x i8], ptr %9, i64 0, i64 0
  %108 = getelementptr inbounds %class.DLDLinker, ptr %11, i32 0, i32 2
  %109 = load ptr, ptr %108, align 8, !tbaa !16
  %110 = load ptr, ptr %7, align 8, !tbaa !5
  %111 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef %107, ptr noundef @.str.13, ptr noundef %109, ptr noundef %110) #6
  %112 = getelementptr inbounds [300 x i8], ptr %10, i64 0, i64 0
  %113 = load ptr, ptr %7, align 8, !tbaa !5
  %114 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef %112, ptr noundef @.str.14, ptr noundef %113) #6
  %115 = getelementptr inbounds [300 x i8], ptr %9, i64 0, i64 0
  %116 = invoke noundef i32 @_ZN9DLDLinker4LinkEPc(ptr noundef nonnull align 8 dereferenceable(8648) %11, ptr noundef %115)
          to label %117 unwind label %123

117:                                              ; preds = %106
  %118 = icmp ne i32 %116, 0
  br i1 %118, label %119, label %127

119:                                              ; preds = %117
  %120 = getelementptr inbounds [300 x i8], ptr %10, i64 0, i64 0
  %121 = invoke noundef i32 @_ZN9DLDLinker4CallEPc(ptr noundef nonnull align 8 dereferenceable(8648) %11, ptr noundef %120)
          to label %122 unwind label %123

122:                                              ; preds = %119
  br label %127

123:                                              ; preds = %119, %106
  %124 = landingpad { ptr, i32 }
          cleanup
  %125 = extractvalue { ptr, i32 } %124, 0
  store ptr %125, ptr %5, align 8
  %126 = extractvalue { ptr, i32 } %124, 1
  store i32 %126, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 300, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 300, ptr %9) #6
  br label %134

127:                                              ; preds = %122, %117
  call void @llvm.lifetime.end.p0(i64 300, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 300, ptr %9) #6
  br label %128

128:                                              ; preds = %127
  %129 = call ptr @strtok(ptr noundef null, ptr noundef @.str.12) #6
  store ptr %129, ptr %7, align 8, !tbaa !5
  br label %103, !llvm.loop !19

130:                                              ; preds = %103
  store i32 0, ptr %8, align 4
  br label %131

131:                                              ; preds = %130, %94, %89
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  %132 = load i32, ptr %8, align 4
  switch i32 %132, label %141 [
    i32 0, label %133
    i32 1, label %133
  ]

133:                                              ; preds = %131, %131
  ret void

134:                                              ; preds = %123, %39
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #6
  br label %135

135:                                              ; preds = %134, %35
  call void @_ZN16GraphicComponentD2Ev(ptr noundef nonnull align 8 dereferenceable(8624) %11) #6
  br label %136

136:                                              ; preds = %135
  %137 = load ptr, ptr %5, align 8
  %138 = load i32, ptr %6, align 4
  %139 = insertvalue { ptr, i32 } poison, ptr %137, 0
  %140 = insertvalue { ptr, i32 } %139, i32 %138, 1
  resume { ptr, i32 } %140

141:                                              ; preds = %131
  unreachable
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN16GraphicComponentC2Ev(ptr noundef nonnull align 8 dereferenceable(8624)) unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN5FlagsC2Ei(ptr noundef nonnull align 4 dereferenceable(4), i32 noundef) unnamed_addr #3 align 2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN16GraphicComponent7VerboseEi(ptr noundef nonnull align 8 dereferenceable(8624), i32 noundef) #3 align 2

; Function Attrs: nounwind
declare ptr @getenv(ptr noundef) #0

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8624) ptr @_ZN16GraphicComponentixEi(ptr noundef nonnull align 8 dereferenceable(8624), i32 noundef) #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8624) ptr @_ZN16GraphicComponentlsEPKc(ptr noundef nonnull align 8 dereferenceable(8624), ptr noundef) #2 align 2

; Function Attrs: nounwind
declare noalias ptr @strdup(ptr noundef) #0

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN5Flags3SetEi(ptr noundef nonnull align 4 dereferenceable(4), i32 noundef) #3 align 2

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

; Function Attrs: nounwind
declare ptr @strtok(ptr noundef, ptr noundef) #0

; Function Attrs: nounwind
declare i32 @sprintf(ptr noundef, ptr noundef, ...) #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN9DLDLinker4LinkEPc(ptr noundef nonnull align 8 dereferenceable(8648), ptr noundef) #5 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN9DLDLinker4CallEPc(ptr noundef nonnull align 8 dereferenceable(8648), ptr noundef) #1 align 2

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

attributes #0 = { 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 #1 = { 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 #2 = { inlinehint 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 = { 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 #4 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 = !{!"int", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"vtable pointer", !8, i64 0}
!13 = !{!14, !6, i64 424}
!14 = !{!"_ZTS16GraphicComponent", !10, i64 8, !10, i64 12, !7, i64 16, !10, i64 416, !15, i64 420, !6, i64 424, !7, i64 432}
!15 = !{!"_ZTS5Flags", !10, i64 0}
!16 = !{!17, !6, i64 8632}
!17 = !{!"_ZTS9DLDLinker", !14, i64 0, !15, i64 8624, !6, i64 8632, !6, i64 8640}
!18 = !{!17, !6, i64 8640}
!19 = distinct !{!19, !20}
!20 = !{!"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"

@_ZTV9DLDLinker = external dso_local unnamed_addr constant { [6 x ptr] }, align 8
@.str = external hidden unnamed_addr constant [10 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [16 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [18 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [28 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [2 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [8 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [8 x i8], align 1

declare i32 @__gxx_personality_v0(...)

; Function Attrs: nounwind
declare void @_ZN16GraphicComponentD2Ev(ptr noundef nonnull align 8 dereferenceable(8624)) unnamed_addr #0

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN9DLDLinkerC2Ei(ptr noundef nonnull align 8 dereferenceable(8648) %0, i32 noundef %1) unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %3 = alloca [300 x i8], align 16
  %4 = alloca [300 x i8], align 16
  tail call void @_ZN16GraphicComponentC2Ev(ptr noundef nonnull align 8 dereferenceable(8624) %0)
  store ptr getelementptr inbounds inrange(-16, 32) (i8, ptr @_ZTV9DLDLinker, i64 16), ptr %0, align 8, !tbaa !5
  %5 = getelementptr inbounds i8, ptr %0, i64 8624
  tail call void @_ZN5FlagsC2Ei(ptr noundef nonnull align 4 dereferenceable(4) %5, i32 noundef 0)
  %6 = getelementptr inbounds i8, ptr %0, i64 424
  store ptr @.str, ptr %6, align 8, !tbaa !8
  tail call void @_ZN16GraphicComponent7VerboseEi(ptr noundef nonnull align 8 dereferenceable(8624) %0, i32 noundef %1)
  %7 = tail call ptr @getenv(ptr noundef nonnull @.str.1) #10
  %8 = getelementptr inbounds i8, ptr %0, i64 8632
  store ptr %7, ptr %8, align 8, !tbaa !14
  %.not = icmp eq ptr %7, null
  br i1 %.not, label %9, label %25

9:                                                ; preds = %2
  %10 = invoke noundef nonnull align 8 dereferenceable(8624) ptr @_ZN16GraphicComponentixEi(ptr noundef nonnull align 8 dereferenceable(8624) %0, i32 noundef 2)
          to label %11 unwind label %23

11:                                               ; preds = %9
  %12 = invoke noundef nonnull align 8 dereferenceable(8624) ptr @_ZN16GraphicComponentlsEPKc(ptr noundef nonnull align 8 dereferenceable(8624) %10, ptr noundef nonnull @.str.2)
          to label %13 unwind label %23

13:                                               ; preds = %11
  %14 = invoke noundef nonnull align 8 dereferenceable(8624) ptr @_ZN16GraphicComponentixEi(ptr noundef nonnull align 8 dereferenceable(8624) %0, i32 noundef 2)
          to label %15 unwind label %23

15:                                               ; preds = %13
  %16 = invoke noundef nonnull align 8 dereferenceable(8624) ptr @_ZN16GraphicComponentlsEPKc(ptr noundef nonnull align 8 dereferenceable(8624) %14, ptr noundef nonnull @.str.3)
          to label %17 unwind label %23

17:                                               ; preds = %15
  %18 = invoke noundef nonnull align 8 dereferenceable(8624) ptr @_ZN16GraphicComponentlsEPKc(ptr noundef nonnull align 8 dereferenceable(8624) %16, ptr noundef nonnull @.str.4)
          to label %19 unwind label %23

19:                                               ; preds = %17
  %20 = invoke noundef nonnull align 8 dereferenceable(8624) ptr @_ZN16GraphicComponentlsEPKc(ptr noundef nonnull align 8 dereferenceable(8624) %18, ptr noundef nonnull @.str.5)
          to label %21 unwind label %23

21:                                               ; preds = %19
  %22 = tail call noalias ptr @strdup(ptr noundef nonnull @.str.4) #10
  store ptr %22, ptr %8, align 8, !tbaa !14
  br label %35

23:                                               ; preds = %62, %60, %57, %55, %53, %51, %49, %47, %44, %42, %38, %33, %30, %28, %25, %19, %17, %15, %13, %11, %9
  %24 = landingpad { ptr, i32 }
          cleanup
  br label %77

25:                                               ; preds = %2
  %26 = tail call noalias ptr @strdup(ptr noundef nonnull %7) #10
  store ptr %26, ptr %8, align 8, !tbaa !14
  %27 = invoke noundef nonnull align 8 dereferenceable(8624) ptr @_ZN16GraphicComponentixEi(ptr noundef nonnull align 8 dereferenceable(8624) %0, i32 noundef 3)
          to label %28 unwind label %23

28:                                               ; preds = %25
  %29 = invoke noundef nonnull align 8 dereferenceable(8624) ptr @_ZN16GraphicComponentlsEPKc(ptr noundef nonnull align 8 dereferenceable(8624) %27, ptr noundef nonnull @.str.6)
          to label %30 unwind label %23

30:                                               ; preds = %28
  %31 = load ptr, ptr %8, align 8, !tbaa !14
  %32 = invoke noundef nonnull align 8 dereferenceable(8624) ptr @_ZN16GraphicComponentlsEPKc(ptr noundef nonnull align 8 dereferenceable(8624) %29, ptr noundef %31)
          to label %33 unwind label %23

33:                                               ; preds = %30
  %34 = invoke noundef nonnull align 8 dereferenceable(8624) ptr @_ZN16GraphicComponentlsEPKc(ptr noundef nonnull align 8 dereferenceable(8624) %32, ptr noundef nonnull @.str.5)
          to label %35 unwind label %23

35:                                               ; preds = %33, %21
  tail call void @_ZN5Flags3SetEi(ptr noundef nonnull align 4 dereferenceable(4) %5, i32 noundef 1)
  %36 = tail call ptr @getenv(ptr noundef nonnull @.str.7) #10
  %37 = getelementptr inbounds i8, ptr %0, i64 8640
  store ptr %36, ptr %37, align 8, !tbaa !16
  %.not9 = icmp eq ptr %36, null
  br i1 %.not9, label %49, label %38

38:                                               ; preds = %35
  tail call void @_ZN5Flags3SetEi(ptr noundef nonnull align 4 dereferenceable(4) %5, i32 noundef 2)
  %39 = load ptr, ptr %37, align 8, !tbaa !16
  %40 = tail call noalias ptr @strdup(ptr noundef %39) #10
  store ptr %40, ptr %37, align 8, !tbaa !16
  %41 = invoke noundef nonnull align 8 dereferenceable(8624) ptr @_ZN16GraphicComponentixEi(ptr noundef nonnull align 8 dereferenceable(8624) %0, i32 noundef 3)
          to label %42 unwind label %23

42:                                               ; preds = %38
  %43 = invoke noundef nonnull align 8 dereferenceable(8624) ptr @_ZN16GraphicComponentlsEPKc(ptr noundef nonnull align 8 dereferenceable(8624) %41, ptr noundef nonnull @.str.8)
          to label %44 unwind label %23

44:                                               ; preds = %42
  %45 = load ptr, ptr %37, align 8, !tbaa !16
  %46 = invoke noundef nonnull align 8 dereferenceable(8624) ptr @_ZN16GraphicComponentlsEPKc(ptr noundef nonnull align 8 dereferenceable(8624) %43, ptr noundef %45)
          to label %47 unwind label %23

47:                                               ; preds = %44
  %48 = invoke noundef nonnull align 8 dereferenceable(8624) ptr @_ZN16GraphicComponentlsEPKc(ptr noundef nonnull align 8 dereferenceable(8624) %46, ptr noundef nonnull @.str.5)
          to label %57 unwind label %23

49:                                               ; preds = %35
  %50 = invoke noundef nonnull align 8 dereferenceable(8624) ptr @_ZN16GraphicComponentixEi(ptr noundef nonnull align 8 dereferenceable(8624) %0, i32 noundef 2)
          to label %51 unwind label %23

51:                                               ; preds = %49
  %52 = invoke noundef nonnull align 8 dereferenceable(8624) ptr @_ZN16GraphicComponentlsEPKc(ptr noundef nonnull align 8 dereferenceable(8624) %50, ptr noundef nonnull @.str.9)
          to label %53 unwind label %23

53:                                               ; preds = %51
  %54 = invoke noundef nonnull align 8 dereferenceable(8624) ptr @_ZN16GraphicComponentixEi(ptr noundef nonnull align 8 dereferenceable(8624) %0, i32 noundef 2)
          to label %55 unwind label %23

55:                                               ; preds = %53
  %56 = invoke noundef nonnull align 8 dereferenceable(8624) ptr @_ZN16GraphicComponentlsEPKc(ptr noundef nonnull align 8 dereferenceable(8624) %54, ptr noundef nonnull @.str.10)
          to label %.loopexit unwind label %23

57:                                               ; preds = %47
  %58 = invoke noundef i32 @_ZN9DLDLinker4InitEv(ptr noundef nonnull align 8 dereferenceable(8648) %0)
          to label %59 unwind label %23

59:                                               ; preds = %57
  %.not10 = icmp eq i32 %58, 0
  br i1 %.not10, label %.loopexit, label %60

60:                                               ; preds = %59
  %61 = invoke noundef nonnull align 8 dereferenceable(8624) ptr @_ZN16GraphicComponentixEi(ptr noundef nonnull align 8 dereferenceable(8624) %0, i32 noundef 3)
          to label %62 unwind label %23

62:                                               ; preds = %60
  %63 = invoke noundef nonnull align 8 dereferenceable(8624) ptr @_ZN16GraphicComponentlsEPKc(ptr noundef nonnull align 8 dereferenceable(8624) %61, ptr noundef nonnull @.str.11)
          to label %64 unwind label %23

64:                                               ; preds = %62
  %65 = load ptr, ptr %37, align 8, !tbaa !16
  %66 = tail call ptr @strtok(ptr noundef %65, ptr noundef nonnull @.str.12) #10
  %.not1114 = icmp eq ptr %66, null
  br i1 %.not1114, label %.loopexit, label %.lr.ph

.lr.ph:                                           ; preds = %64, %75
  %.015 = phi ptr [ %76, %75 ], [ %66, %64 ]
  call void @llvm.lifetime.start.p0(i64 300, ptr nonnull %3) #10
  call void @llvm.lifetime.start.p0(i64 300, ptr nonnull %4) #10
  %67 = load ptr, ptr %8, align 8, !tbaa !14
  %68 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %3, ptr noundef nonnull dereferenceable(1) @.str.13, ptr noundef %67, ptr noundef nonnull %.015) #10
  %69 = call i32 (ptr, ptr, ...) @sprintf(ptr noundef nonnull dereferenceable(1) %4, ptr noundef nonnull dereferenceable(1) @.str.14, ptr noundef nonnull %.015) #10
  %70 = call noundef i32 @_ZN9DLDLinker4LinkEPc(ptr noundef nonnull align 8 dereferenceable(8648) %0, ptr noundef nonnull %3)
  %.not12 = icmp eq i32 %70, 0
  br i1 %.not12, label %75, label %71

71:                                               ; preds = %.lr.ph
  %72 = invoke noundef i32 @_ZN9DLDLinker4CallEPc(ptr noundef nonnull align 8 dereferenceable(8648) %0, ptr noundef nonnull %4)
          to label %75 unwind label %73

73:                                               ; preds = %71
  %74 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 300, ptr nonnull %4) #10
  call void @llvm.lifetime.end.p0(i64 300, ptr nonnull %3) #10
  br label %77

75:                                               ; preds = %71, %.lr.ph
  call void @llvm.lifetime.end.p0(i64 300, ptr nonnull %4) #10
  call void @llvm.lifetime.end.p0(i64 300, ptr nonnull %3) #10
  %76 = call ptr @strtok(ptr noundef null, ptr noundef nonnull @.str.12) #10
  %.not11 = icmp eq ptr %76, null
  br i1 %.not11, label %.loopexit, label %.lr.ph, !llvm.loop !17

.loopexit:                                        ; preds = %75, %64, %59, %55
  ret void

77:                                               ; preds = %73, %23
  %.pn = phi { ptr, i32 } [ %74, %73 ], [ %24, %23 ]
  call void @_ZN16GraphicComponentD2Ev(ptr noundef nonnull align 8 dereferenceable(8624) %0) #10
  resume { ptr, i32 } %.pn
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN16GraphicComponentC2Ev(ptr noundef nonnull align 8 dereferenceable(8624)) unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN5FlagsC2Ei(ptr noundef nonnull align 4 dereferenceable(4), i32 noundef) unnamed_addr #3 align 2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN16GraphicComponent7VerboseEi(ptr noundef nonnull align 8 dereferenceable(8624), i32 noundef) local_unnamed_addr #3 align 2

; Function Attrs: nofree nounwind memory(read)
declare noundef ptr @getenv(ptr nocapture noundef) local_unnamed_addr #5

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8624) ptr @_ZN16GraphicComponentixEi(ptr noundef nonnull align 8 dereferenceable(8624), i32 noundef) local_unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8624) ptr @_ZN16GraphicComponentlsEPKc(ptr noundef nonnull align 8 dereferenceable(8624), ptr noundef) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: readwrite, inaccessiblemem: readwrite)
declare noalias ptr @strdup(ptr nocapture noundef readonly) local_unnamed_addr #6

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN5Flags3SetEi(ptr noundef nonnull align 4 dereferenceable(4), i32 noundef) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN9DLDLinker4InitEv(ptr noundef nonnull align 8 dereferenceable(8648)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nofree nounwind willreturn
declare ptr @strtok(ptr noundef, ptr nocapture noundef readonly) local_unnamed_addr #7

; Function Attrs: nofree nounwind
declare noundef i32 @sprintf(ptr noalias nocapture noundef writeonly, ptr nocapture noundef readonly, ...) local_unnamed_addr #8

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN9DLDLinker4LinkEPc(ptr noundef nonnull align 8 dereferenceable(8648), ptr noundef) local_unnamed_addr #9 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN9DLDLinker4CallEPc(ptr noundef nonnull align 8 dereferenceable(8648), ptr noundef) local_unnamed_addr #1 align 2

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

attributes #0 = { 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 #1 = { 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 #2 = { inlinehint 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 = { 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 #4 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { nofree nounwind memory(read) "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 = { mustprogress nofree nounwind willreturn memory(argmem: readwrite, inaccessiblemem: readwrite) "alloc-family"="malloc" "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 #7 = { mustprogress nofree nounwind willreturn "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 #8 = { 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 #9 = { 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 #10 = { 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 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !13, i64 424}
!9 = !{!"_ZTS16GraphicComponent", !10, i64 8, !10, i64 12, !11, i64 16, !10, i64 416, !12, i64 420, !13, i64 424, !11, i64 432}
!10 = !{!"int", !11, i64 0}
!11 = !{!"omnipotent char", !7, i64 0}
!12 = !{!"_ZTS5Flags", !10, i64 0}
!13 = !{!"any pointer", !11, i64 0}
!14 = !{!15, !13, i64 8632}
!15 = !{!"_ZTS9DLDLinker", !9, i64 0, !12, i64 8624, !13, i64 8632, !13, i64 8640}
!16 = !{!15, !13, i64 8640}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass