; LLVM IR from SSBMTonberry/pocketlzma :: ref_spec/lzma1900/CPP/Common (CommandLineParser)

; 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.UString = type { ptr, i32, i32 }

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN18NCommandLineParser16SplitCommandLineERK7UStringRS0_S3_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) #0

; 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
define dso_local void @_ZN18NCommandLineParser16SplitCommandLineERK7UStringR13CObjectVectorIS0_E(ptr noundef nonnull align 8 dereferenceable(16) %0, ptr noundef nonnull align 8 dereferenceable(16) %1) #0 personality ptr @__gxx_personality_v0 {
  %3 = alloca ptr, align 8
  %4 = alloca ptr, align 8
  %5 = alloca %class.UString, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca %class.UString, align 8
  %9 = alloca %class.UString, align 8
  %10 = alloca i32, align 4
  store ptr %0, ptr %3, align 8, !tbaa !5
  store ptr %1, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr %5) #4
  %11 = load ptr, ptr %3, align 8, !tbaa !5
  call void @_ZN7UStringC1ERKS_(ptr noundef nonnull align 8 dereferenceable(16) %5, ptr noundef nonnull align 8 dereferenceable(16) %11)
  invoke void @_ZN7UString4TrimEv(ptr noundef nonnull align 8 dereferenceable(16) %5)
          to label %12 unwind label %24

12:                                               ; preds = %2
  %13 = load ptr, ptr %4, align 8, !tbaa !5
  invoke void @_ZN13CObjectVectorI7UStringE5ClearEv(ptr noundef nonnull align 8 dereferenceable(16) %13)
          to label %14 unwind label %24

14:                                               ; preds = %12
  br label %15

15:                                               ; preds = %49, %14
  call void @llvm.lifetime.start.p0(i64 16, ptr %8) #4
  invoke void @_ZN7UStringC1Ev(ptr noundef nonnull align 8 dereferenceable(16) %8)
          to label %16 unwind label %28

16:                                               ; preds = %15
  call void @llvm.lifetime.start.p0(i64 16, ptr %9) #4
  invoke void @_ZN7UStringC1Ev(ptr noundef nonnull align 8 dereferenceable(16) %9)
          to label %17 unwind label %32

17:                                               ; preds = %16
  %18 = invoke noundef zeroext i1 @_ZN18NCommandLineParser16SplitCommandLineERK7UStringRS0_S3_(ptr noundef nonnull align 8 dereferenceable(16) %5, ptr noundef nonnull align 8 dereferenceable(16) %8, ptr noundef nonnull align 8 dereferenceable(16) %9)
          to label %19 unwind label %36

19:                                               ; preds = %17
  br i1 %18, label %20, label %40

20:                                               ; preds = %19
  %21 = load ptr, ptr %4, align 8, !tbaa !5
  %22 = invoke noundef i32 @_ZN13CObjectVectorI7UStringE3AddERKS0_(ptr noundef nonnull align 8 dereferenceable(16) %21, ptr noundef nonnull align 8 dereferenceable(16) %8)
          to label %23 unwind label %36

23:                                               ; preds = %20
  br label %40

24:                                               ; preds = %12, %2
  %25 = landingpad { ptr, i32 }
          cleanup
  %26 = extractvalue { ptr, i32 } %25, 0
  store ptr %26, ptr %6, align 8
  %27 = extractvalue { ptr, i32 } %25, 1
  store i32 %27, ptr %7, align 4
  br label %53

28:                                               ; preds = %15
  %29 = landingpad { ptr, i32 }
          cleanup
  %30 = extractvalue { ptr, i32 } %29, 0
  store ptr %30, ptr %6, align 8
  %31 = extractvalue { ptr, i32 } %29, 1
  store i32 %31, ptr %7, align 4
  br label %51

32:                                               ; preds = %16
  %33 = landingpad { ptr, i32 }
          cleanup
  %34 = extractvalue { ptr, i32 } %33, 0
  store ptr %34, ptr %6, align 8
  %35 = extractvalue { ptr, i32 } %33, 1
  store i32 %35, ptr %7, align 4
  br label %50

36:                                               ; preds = %44, %40, %20, %17
  %37 = landingpad { ptr, i32 }
          cleanup
  %38 = extractvalue { ptr, i32 } %37, 0
  store ptr %38, ptr %6, align 8
  %39 = extractvalue { ptr, i32 } %37, 1
  store i32 %39, ptr %7, align 4
  call void @_ZN7UStringD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %9) #4
  br label %50

40:                                               ; preds = %23, %19
  %41 = invoke noundef zeroext i1 @_ZNK7UString7IsEmptyEv(ptr noundef nonnull align 8 dereferenceable(16) %9)
          to label %42 unwind label %36

42:                                               ; preds = %40
  br i1 %41, label %43, label %44

43:                                               ; preds = %42
  store i32 2, ptr %10, align 4
  br label %47

44:                                               ; preds = %42
  %45 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZN7UStringaSERKS_(ptr noundef nonnull align 8 dereferenceable(16) %5, ptr noundef nonnull align 8 dereferenceable(16) %9)
          to label %46 unwind label %36

46:                                               ; preds = %44
  store i32 0, ptr %10, align 4
  br label %47

47:                                               ; preds = %46, %43
  call void @_ZN7UStringD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %9) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr %9) #4
  call void @_ZN7UStringD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %8) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr %8) #4
  %48 = load i32, ptr %10, align 4
  switch i32 %48, label %59 [
    i32 0, label %49
    i32 2, label %52
  ]

49:                                               ; preds = %47
  br label %15, !llvm.loop !9

50:                                               ; preds = %36, %32
  call void @llvm.lifetime.end.p0(i64 16, ptr %9) #4
  call void @_ZN7UStringD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %8) #4
  br label %51

51:                                               ; preds = %50, %28
  call void @llvm.lifetime.end.p0(i64 16, ptr %8) #4
  br label %53

52:                                               ; preds = %47
  call void @_ZN7UStringD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %5) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr %5) #4
  ret void

53:                                               ; preds = %51, %24
  call void @_ZN7UStringD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %5) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr %5) #4
  br label %54

54:                                               ; preds = %53
  %55 = load ptr, ptr %6, align 8
  %56 = load i32, ptr %7, align 4
  %57 = insertvalue { ptr, i32 } poison, ptr %55, 0
  %58 = insertvalue { ptr, i32 } %57, i32 %56, 1
  resume { ptr, i32 } %58

59:                                               ; preds = %47
  unreachable
}

declare void @_ZN7UStringC1ERKS_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #2

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

declare i32 @__gxx_personality_v0(...)

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

declare void @_ZN7UStringC1Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_ZN13CObjectVectorI7UStringE3AddERKS0_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK7UString7IsEmptyEv(ptr noundef nonnull align 8 dereferenceable(16)) #3 align 2

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZN7UStringaSERKS_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) #2

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

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

%class.UString = type { ptr, i32, i32 }

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_ZN18NCommandLineParser16SplitCommandLineERK7UStringRS0_S3_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #0

; 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
define dso_local void @_ZN18NCommandLineParser16SplitCommandLineERK7UStringR13CObjectVectorIS0_E(ptr noundef nonnull align 8 dereferenceable(16) %0, ptr noundef nonnull align 8 dereferenceable(16) %1) local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %3 = alloca %class.UString, align 8
  %4 = alloca %class.UString, align 8
  %5 = alloca %class.UString, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %3) #4
  call void @_ZN7UStringC1ERKS_(ptr noundef nonnull align 8 dereferenceable(16) %3, ptr noundef nonnull align 8 dereferenceable(16) %0)
  call void @_ZN7UString4TrimEv(ptr noundef nonnull align 8 dereferenceable(16) %3)
  invoke void @_ZN13CObjectVectorI7UStringE5ClearEv(ptr noundef nonnull align 8 dereferenceable(16) %1)
          to label %.preheader unwind label %12

.preheader:                                       ; preds = %2, %24
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #4
  invoke void @_ZN7UStringC1Ev(ptr noundef nonnull align 8 dereferenceable(16) %4)
          to label %6 unwind label %14

6:                                                ; preds = %.preheader
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #4
  invoke void @_ZN7UStringC1Ev(ptr noundef nonnull align 8 dereferenceable(16) %5)
          to label %7 unwind label %16

7:                                                ; preds = %6
  %8 = invoke noundef zeroext i1 @_ZN18NCommandLineParser16SplitCommandLineERK7UStringRS0_S3_(ptr noundef nonnull align 8 dereferenceable(16) %3, ptr noundef nonnull align 8 dereferenceable(16) %4, ptr noundef nonnull align 8 dereferenceable(16) %5)
          to label %9 unwind label %18

9:                                                ; preds = %7
  br i1 %8, label %10, label %20

10:                                               ; preds = %9
  %11 = invoke noundef i32 @_ZN13CObjectVectorI7UStringE3AddERKS0_(ptr noundef nonnull align 8 dereferenceable(16) %1, ptr noundef nonnull align 8 dereferenceable(16) %4)
          to label %20 unwind label %18

12:                                               ; preds = %2
  %13 = landingpad { ptr, i32 }
          cleanup
  br label %27

14:                                               ; preds = %.preheader
  %15 = landingpad { ptr, i32 }
          cleanup
  br label %26

16:                                               ; preds = %6
  %17 = landingpad { ptr, i32 }
          cleanup
  br label %25

18:                                               ; preds = %22, %10, %7
  %19 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN7UStringD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %5) #4
  br label %25

20:                                               ; preds = %10, %9
  %21 = call noundef zeroext i1 @_ZNK7UString7IsEmptyEv(ptr noundef nonnull align 8 dereferenceable(16) %5)
  br i1 %21, label %.loopexit, label %22

22:                                               ; preds = %20
  %23 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZN7UStringaSERKS_(ptr noundef nonnull align 8 dereferenceable(16) %3, ptr noundef nonnull align 8 dereferenceable(16) %5)
          to label %24 unwind label %18

24:                                               ; preds = %22
  call void @_ZN7UStringD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %5) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #4
  call void @_ZN7UStringD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %4) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #4
  br label %.preheader

25:                                               ; preds = %18, %16
  %.pn = phi { ptr, i32 } [ %19, %18 ], [ %17, %16 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #4
  call void @_ZN7UStringD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %4) #4
  br label %26

26:                                               ; preds = %25, %14
  %.pn.pn = phi { ptr, i32 } [ %.pn, %25 ], [ %15, %14 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #4
  br label %27

.loopexit:                                        ; preds = %20
  call void @_ZN7UStringD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %5) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #4
  call void @_ZN7UStringD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %4) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #4
  call void @_ZN7UStringD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %3) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #4
  ret void

27:                                               ; preds = %26, %12
  %.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn, %26 ], [ %13, %12 ]
  call void @_ZN7UStringD2Ev(ptr noundef nonnull align 8 dereferenceable(16) %3) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #4
  resume { ptr, i32 } %.pn.pn.pn
}

declare void @_ZN7UStringC1ERKS_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #2

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

declare i32 @__gxx_personality_v0(...)

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

declare void @_ZN7UStringC1Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK7UString7IsEmptyEv(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #3 align 2

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZN7UStringaSERKS_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #2

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

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


; Effective O3 passes: GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopSimplifyPass,LoopUnrollPass,SCCPPass,SROAPass,SimplifyCFGPass