; LLVM IR from mncoppola/rpef :: utilities_src/squashfs2.1/lzma/C/7zip/Compress/LZMA_Lib (ZLib)

; 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.CMyComPtr = type { ptr }
%class.CMyComPtr.0 = type { ptr }
%class.CMyComPtr.5 = type { ptr }

@.str.1 = external hidden unnamed_addr constant [5 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: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znwm(i64 noundef) #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN15CInMemoryStreamC2EPKhy(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef, i64 noundef) unnamed_addr #2 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) #3

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN16COutMemoryStreamC2EPhy(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef, i64 noundef) unnamed_addr #4 align 2

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

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

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

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local i32 @uncompress(ptr noundef %0, ptr noundef %1, ptr noundef %2, i64 noundef %3) #2 personality ptr @__gxx_personality_v0 {
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i64, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca %class.CMyComPtr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca %class.CMyComPtr.0, align 8
  %16 = alloca ptr, align 8
  %17 = alloca %class.CMyComPtr.5, align 8
  %18 = alloca i32, align 4
  %19 = alloca i64, align 8
  store ptr %0, ptr %6, align 8, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !5
  store ptr %2, ptr %8, align 8, !tbaa !5
  store i64 %3, ptr %9, align 8, !tbaa !9
  %20 = load ptr, ptr %8, align 8, !tbaa !5
  %21 = call i32 @strncmp(ptr noundef %20, ptr noundef @.str.1, i64 noundef 4) #6
  %22 = icmp eq i32 %21, 0
  br i1 %22, label %23, label %28

23:                                               ; preds = %4
  %24 = load ptr, ptr %8, align 8, !tbaa !5
  %25 = getelementptr inbounds i8, ptr %24, i64 4
  store ptr %25, ptr %8, align 8, !tbaa !5
  %26 = load i64, ptr %9, align 8, !tbaa !9
  %27 = sub i64 %26, 4
  store i64 %27, ptr %9, align 8, !tbaa !9
  br label %28

28:                                               ; preds = %23, %4
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #7
  %29 = call noalias noundef nonnull ptr @_Znwm(i64 noundef 48) #8
  %30 = load ptr, ptr %8, align 8, !tbaa !5
  %31 = load i64, ptr %9, align 8, !tbaa !9
  invoke void @_ZN15CInMemoryStreamC2EPKhy(ptr noundef nonnull align 8 dereferenceable(48) %29, ptr noundef %30, i64 noundef %31)
          to label %32 unwind label %55

32:                                               ; preds = %28
  store ptr %29, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #7
  %33 = load ptr, ptr %10, align 8, !tbaa !5
  call void @_ZN9CMyComPtrI19ISequentialInStreamEC2EPS0_(ptr noundef nonnull align 8 dereferenceable(8) %13, ptr noundef %33)
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #7
  %34 = invoke noalias noundef nonnull ptr @_Znwm(i64 noundef 48) #8
          to label %35 unwind label %59

35:                                               ; preds = %32
  %36 = load ptr, ptr %6, align 8, !tbaa !5
  %37 = load ptr, ptr %7, align 8, !tbaa !5
  %38 = load i64, ptr %37, align 8, !tbaa !9
  invoke void @_ZN16COutMemoryStreamC2EPhy(ptr noundef nonnull align 8 dereferenceable(48) %34, ptr noundef %36, i64 noundef %38)
          to label %39 unwind label %63

39:                                               ; preds = %35
  store ptr %34, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #7
  %40 = load ptr, ptr %14, align 8, !tbaa !5
  invoke void @_ZN9CMyComPtrI20ISequentialOutStreamEC2EPS0_(ptr noundef nonnull align 8 dereferenceable(8) %15, ptr noundef %40)
          to label %41 unwind label %67

41:                                               ; preds = %39
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #7
  %42 = invoke noalias noundef nonnull ptr @_Znwm(i64 noundef 7592) #8
          to label %43 unwind label %71

43:                                               ; preds = %41
  invoke void @_ZN9NCompress5NLZMA8CDecoderC2Ev(ptr noundef nonnull align 8 dereferenceable(7585) %42)
          to label %44 unwind label %75

44:                                               ; preds = %43
  store ptr %42, ptr %16, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #7
  %45 = load ptr, ptr %16, align 8, !tbaa !5
  invoke void @_ZN9CMyComPtrI14ICompressCoderEC2EPS0_(ptr noundef nonnull align 8 dereferenceable(8) %17, ptr noundef %45)
          to label %46 unwind label %79

46:                                               ; preds = %44
  %47 = load ptr, ptr %16, align 8, !tbaa !5
  %48 = load ptr, ptr %47, align 8, !tbaa !11
  %49 = getelementptr inbounds ptr, ptr %48, i64 6
  %50 = load ptr, ptr %49, align 8
  %51 = invoke noundef i32 %50(ptr noundef nonnull align 8 dereferenceable(7585) %47, i32 noundef 3, i32 noundef 0, i32 noundef 2, i32 noundef 8388608)
          to label %52 unwind label %83

52:                                               ; preds = %46
  %53 = icmp ne i32 %51, 0
  br i1 %53, label %54, label %87

54:                                               ; preds = %52
  store i32 -3, ptr %5, align 4
  store i32 1, ptr %18, align 4
  br label %117

55:                                               ; preds = %28
  %56 = landingpad { ptr, i32 }
          cleanup
  %57 = extractvalue { ptr, i32 } %56, 0
  store ptr %57, ptr %11, align 8
  %58 = extractvalue { ptr, i32 } %56, 1
  store i32 %58, ptr %12, align 4
  call void @_ZdlPvm(ptr noundef %29, i64 noundef 48) #9
  br label %124

59:                                               ; preds = %32
  %60 = landingpad { ptr, i32 }
          cleanup
  %61 = extractvalue { ptr, i32 } %60, 0
  store ptr %61, ptr %11, align 8
  %62 = extractvalue { ptr, i32 } %60, 1
  store i32 %62, ptr %12, align 4
  br label %123

63:                                               ; preds = %35
  %64 = landingpad { ptr, i32 }
          cleanup
  %65 = extractvalue { ptr, i32 } %64, 0
  store ptr %65, ptr %11, align 8
  %66 = extractvalue { ptr, i32 } %64, 1
  store i32 %66, ptr %12, align 4
  call void @_ZdlPvm(ptr noundef %34, i64 noundef 48) #9
  br label %123

67:                                               ; preds = %39
  %68 = landingpad { ptr, i32 }
          cleanup
  %69 = extractvalue { ptr, i32 } %68, 0
  store ptr %69, ptr %11, align 8
  %70 = extractvalue { ptr, i32 } %68, 1
  store i32 %70, ptr %12, align 4
  br label %122

71:                                               ; preds = %41
  %72 = landingpad { ptr, i32 }
          cleanup
  %73 = extractvalue { ptr, i32 } %72, 0
  store ptr %73, ptr %11, align 8
  %74 = extractvalue { ptr, i32 } %72, 1
  store i32 %74, ptr %12, align 4
  br label %121

75:                                               ; preds = %43
  %76 = landingpad { ptr, i32 }
          cleanup
  %77 = extractvalue { ptr, i32 } %76, 0
  store ptr %77, ptr %11, align 8
  %78 = extractvalue { ptr, i32 } %76, 1
  store i32 %78, ptr %12, align 4
  call void @_ZdlPvm(ptr noundef %42, i64 noundef 7592) #9
  br label %121

79:                                               ; preds = %44
  %80 = landingpad { ptr, i32 }
          cleanup
  %81 = extractvalue { ptr, i32 } %80, 0
  store ptr %81, ptr %11, align 8
  %82 = extractvalue { ptr, i32 } %80, 1
  store i32 %82, ptr %12, align 4
  br label %120

83:                                               ; preds = %46
  %84 = landingpad { ptr, i32 }
          cleanup
  %85 = extractvalue { ptr, i32 } %84, 0
  store ptr %85, ptr %11, align 8
  %86 = extractvalue { ptr, i32 } %84, 1
  store i32 %86, ptr %12, align 4
  br label %119

87:                                               ; preds = %52
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #7
  %88 = load ptr, ptr %7, align 8, !tbaa !5
  %89 = load i64, ptr %88, align 8, !tbaa !9
  store i64 %89, ptr %19, align 8, !tbaa !13
  %90 = invoke noundef ptr @_ZNK9CMyComPtrI14ICompressCoderEptEv(ptr noundef nonnull align 8 dereferenceable(8) %17)
          to label %91 unwind label %103

91:                                               ; preds = %87
  %92 = invoke noundef ptr @_ZNK9CMyComPtrI19ISequentialInStreamEcvPS0_Ev(ptr noundef nonnull align 8 dereferenceable(8) %13)
          to label %93 unwind label %103

93:                                               ; preds = %91
  %94 = invoke noundef ptr @_ZNK9CMyComPtrI20ISequentialOutStreamEcvPS0_Ev(ptr noundef nonnull align 8 dereferenceable(8) %15)
          to label %95 unwind label %103

95:                                               ; preds = %93
  %96 = load ptr, ptr %90, align 8, !tbaa !11
  %97 = getelementptr inbounds ptr, ptr %96, i64 3
  %98 = load ptr, ptr %97, align 8
  %99 = invoke noundef i32 %98(ptr noundef nonnull align 8 dereferenceable(8) %90, ptr noundef %92, ptr noundef %94, ptr noundef null, ptr noundef %19, ptr noundef null)
          to label %100 unwind label %103

100:                                              ; preds = %95
  %101 = icmp ne i32 %99, 0
  br i1 %101, label %102, label %107

102:                                              ; preds = %100
  store i32 -3, ptr %5, align 4
  store i32 1, ptr %18, align 4
  br label %116

103:                                              ; preds = %107, %95, %93, %91, %87
  %104 = landingpad { ptr, i32 }
          cleanup
  %105 = extractvalue { ptr, i32 } %104, 0
  store ptr %105, ptr %11, align 8
  %106 = extractvalue { ptr, i32 } %104, 1
  store i32 %106, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #7
  br label %119

107:                                              ; preds = %100
  %108 = load ptr, ptr %14, align 8, !tbaa !5
  %109 = load ptr, ptr %108, align 8, !tbaa !11
  %110 = getelementptr inbounds ptr, ptr %109, i64 4
  %111 = load ptr, ptr %110, align 8
  %112 = invoke noundef i32 %111(ptr noundef nonnull align 8 dereferenceable(48) %108, i64 noundef 0, i32 noundef 2, ptr noundef %19)
          to label %113 unwind label %103

113:                                              ; preds = %107
  %114 = load i64, ptr %19, align 8, !tbaa !13
  %115 = load ptr, ptr %7, align 8, !tbaa !5
  store i64 %114, ptr %115, align 8, !tbaa !9
  store i32 0, ptr %5, align 4
  store i32 1, ptr %18, align 4
  br label %116

116:                                              ; preds = %113, %102
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #7
  br label %117

117:                                              ; preds = %116, %54
  call void @_ZN9CMyComPtrI14ICompressCoderED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %17) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  call void @_ZN9CMyComPtrI20ISequentialOutStreamED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %15) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  call void @_ZN9CMyComPtrI19ISequentialInStreamED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %13) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  %118 = load i32, ptr %5, align 4
  ret i32 %118

119:                                              ; preds = %103, %83
  call void @_ZN9CMyComPtrI14ICompressCoderED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %17) #7
  br label %120

120:                                              ; preds = %119, %79
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  br label %121

121:                                              ; preds = %120, %75, %71
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  call void @_ZN9CMyComPtrI20ISequentialOutStreamED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %15) #7
  br label %122

122:                                              ; preds = %121, %67
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  br label %123

123:                                              ; preds = %122, %63, %59
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  call void @_ZN9CMyComPtrI19ISequentialInStreamED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %13) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  br label %124

124:                                              ; preds = %123, %55
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  br label %125

125:                                              ; preds = %124
  %126 = load ptr, ptr %11, align 8
  %127 = load i32, ptr %12, align 4
  %128 = insertvalue { ptr, i32 } poison, ptr %126, 0
  %129 = insertvalue { ptr, i32 } %128, i32 %127, 1
  resume { ptr, i32 } %129
}

; Function Attrs: nounwind willreturn memory(read)
declare i32 @strncmp(ptr noundef, ptr noundef, i64 noundef) #5

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nobuiltin allocsize(0) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nobuiltin 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 #4 = { 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 #5 = { nounwind willreturn 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 = { nounwind willreturn memory(read) }
attributes #7 = { nounwind }
attributes #8 = { builtin allocsize(0) }
attributes #9 = { builtin 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 = !{!"long", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"vtable pointer", !8, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"long long", !7, i64 0}


; 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.CMyComPtr = type { ptr }
%class.CMyComPtr.0 = type { ptr }
%class.CMyComPtr.5 = type { ptr }

@.str.1 = external hidden unnamed_addr constant [5 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: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znwm(i64 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN15CInMemoryStreamC2EPKhy(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef, i64 noundef) unnamed_addr #2 align 2

declare i32 @__gxx_personality_v0(...)

; Function Attrs: nobuiltin nounwind
declare void @_ZdlPvm(ptr noundef, i64 noundef) local_unnamed_addr #3

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN16COutMemoryStreamC2EPhy(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef, i64 noundef) unnamed_addr #4 align 2

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

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

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

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local range(i32 -3, 1) i32 @uncompress(ptr noundef %0, ptr nocapture noundef %1, ptr noundef %2, i64 noundef %3) local_unnamed_addr #2 personality ptr @__gxx_personality_v0 {
  %5 = alloca %class.CMyComPtr, align 8
  %6 = alloca %class.CMyComPtr.0, align 8
  %7 = alloca %class.CMyComPtr.5, align 8
  %8 = alloca i64, align 8
  %9 = tail call i32 @strncmp(ptr noundef nonnull dereferenceable(1) %2, ptr noundef nonnull dereferenceable(1) @.str.1, i64 noundef 4) #6
  %10 = icmp eq i32 %9, 0
  %11 = add i64 %3, -4
  %.025 = select i1 %10, i64 %11, i64 %3
  %.016.idx = select i1 %10, i64 4, i64 0
  %.016 = getelementptr inbounds i8, ptr %2, i64 %.016.idx
  %12 = tail call noalias noundef nonnull dereferenceable(48) ptr @_Znwm(i64 noundef 48) #7
  invoke void @_ZN15CInMemoryStreamC2EPKhy(ptr noundef nonnull align 8 dereferenceable(48) %12, ptr noundef %.016, i64 noundef %.025)
          to label %13 unwind label %27

13:                                               ; preds = %4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #8
  call void @_ZN9CMyComPtrI19ISequentialInStreamEC2EPS0_(ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull %12)
  %14 = invoke noalias noundef nonnull dereferenceable(48) ptr @_Znwm(i64 noundef 48) #7
          to label %15 unwind label %29

15:                                               ; preds = %13
  %16 = load i64, ptr %1, align 8, !tbaa !5
  call void @_ZN16COutMemoryStreamC2EPhy(ptr noundef nonnull align 8 dereferenceable(48) %14, ptr noundef %0, i64 noundef %16)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #8
  invoke void @_ZN9CMyComPtrI20ISequentialOutStreamEC2EPS0_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull %14)
          to label %17 unwind label %31

17:                                               ; preds = %15
  %18 = invoke noalias noundef nonnull dereferenceable(7592) ptr @_Znwm(i64 noundef 7592) #7
          to label %19 unwind label %33

19:                                               ; preds = %17
  invoke void @_ZN9NCompress5NLZMA8CDecoderC2Ev(ptr noundef nonnull align 8 dereferenceable(7585) %18)
          to label %20 unwind label %35

20:                                               ; preds = %19
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #8
  invoke void @_ZN9CMyComPtrI14ICompressCoderEC2EPS0_(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull %18)
          to label %21 unwind label %37

21:                                               ; preds = %20
  %22 = load ptr, ptr %18, align 8, !tbaa !9
  %23 = getelementptr inbounds i8, ptr %22, i64 48
  %24 = load ptr, ptr %23, align 8
  %25 = invoke noundef i32 %24(ptr noundef nonnull align 8 dereferenceable(7585) %18, i32 noundef 3, i32 noundef 0, i32 noundef 2, i32 noundef 8388608)
          to label %26 unwind label %39

26:                                               ; preds = %21
  %.not = icmp eq i32 %25, 0
  br i1 %.not, label %41, label %61

27:                                               ; preds = %4
  %28 = landingpad { ptr, i32 }
          cleanup
  tail call void @_ZdlPvm(ptr noundef nonnull %12, i64 noundef 48) #9
  br label %67

29:                                               ; preds = %13
  %30 = landingpad { ptr, i32 }
          cleanup
  br label %66

31:                                               ; preds = %15
  %32 = landingpad { ptr, i32 }
          cleanup
  br label %65

33:                                               ; preds = %17
  %34 = landingpad { ptr, i32 }
          cleanup
  br label %64

35:                                               ; preds = %19
  %36 = landingpad { ptr, i32 }
          cleanup
  call void @_ZdlPvm(ptr noundef nonnull %18, i64 noundef 7592) #9
  br label %64

37:                                               ; preds = %20
  %38 = landingpad { ptr, i32 }
          cleanup
  br label %63

39:                                               ; preds = %21
  %40 = landingpad { ptr, i32 }
          cleanup
  br label %62

41:                                               ; preds = %26
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #8
  %42 = load i64, ptr %1, align 8, !tbaa !5
  store i64 %42, ptr %8, align 8, !tbaa !11
  %43 = call noundef ptr @_ZNK9CMyComPtrI14ICompressCoderEptEv(ptr noundef nonnull align 8 dereferenceable(8) %7)
  %44 = call noundef ptr @_ZNK9CMyComPtrI19ISequentialInStreamEcvPS0_Ev(ptr noundef nonnull align 8 dereferenceable(8) %5)
  %45 = call noundef ptr @_ZNK9CMyComPtrI20ISequentialOutStreamEcvPS0_Ev(ptr noundef nonnull align 8 dereferenceable(8) %6)
  %46 = load ptr, ptr %43, align 8, !tbaa !9
  %47 = getelementptr inbounds i8, ptr %46, i64 24
  %48 = load ptr, ptr %47, align 8
  %49 = invoke noundef i32 %48(ptr noundef nonnull align 8 dereferenceable(8) %43, ptr noundef %44, ptr noundef %45, ptr noundef null, ptr noundef nonnull %8, ptr noundef null)
          to label %50 unwind label %51

50:                                               ; preds = %41
  %.not26 = icmp eq i32 %49, 0
  br i1 %.not26, label %53, label %60

51:                                               ; preds = %53, %41
  %52 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #8
  br label %62

53:                                               ; preds = %50
  %54 = load ptr, ptr %14, align 8, !tbaa !9
  %55 = getelementptr inbounds i8, ptr %54, i64 32
  %56 = load ptr, ptr %55, align 8
  %57 = invoke noundef i32 %56(ptr noundef nonnull align 8 dereferenceable(48) %14, i64 noundef 0, i32 noundef 2, ptr noundef nonnull %8)
          to label %58 unwind label %51

58:                                               ; preds = %53
  %59 = load i64, ptr %8, align 8, !tbaa !11
  store i64 %59, ptr %1, align 8, !tbaa !5
  br label %60

60:                                               ; preds = %50, %58
  %.0 = phi i32 [ 0, %58 ], [ -3, %50 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #8
  br label %61

61:                                               ; preds = %26, %60
  %.1 = phi i32 [ %.0, %60 ], [ -3, %26 ]
  call void @_ZN9CMyComPtrI14ICompressCoderED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %7) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #8
  call void @_ZN9CMyComPtrI20ISequentialOutStreamED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %6) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #8
  call void @_ZN9CMyComPtrI19ISequentialInStreamED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %5) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #8
  ret i32 %.1

62:                                               ; preds = %51, %39
  %.pn = phi { ptr, i32 } [ %52, %51 ], [ %40, %39 ]
  call void @_ZN9CMyComPtrI14ICompressCoderED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %7) #8
  br label %63

63:                                               ; preds = %62, %37
  %.pn.pn = phi { ptr, i32 } [ %.pn, %62 ], [ %38, %37 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #8
  br label %64

64:                                               ; preds = %63, %35, %33
  %.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn, %63 ], [ %36, %35 ], [ %34, %33 ]
  call void @_ZN9CMyComPtrI20ISequentialOutStreamED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %6) #8
  br label %65

65:                                               ; preds = %64, %31
  %.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn.pn, %64 ], [ %32, %31 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #8
  br label %66

66:                                               ; preds = %65, %29
  %.pn.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn.pn.pn, %65 ], [ %30, %29 ]
  call void @_ZN9CMyComPtrI19ISequentialInStreamED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %5) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #8
  br label %67

67:                                               ; preds = %66, %27
  %.pn.pn.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn.pn.pn.pn, %66 ], [ %28, %27 ]
  resume { ptr, i32 } %.pn.pn.pn.pn.pn.pn
}

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i32 @strncmp(ptr nocapture noundef, ptr nocapture noundef, i64 noundef) local_unnamed_addr #5

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nobuiltin allocsize(0) "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nobuiltin 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 #4 = { 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 #5 = { mustprogress nofree nounwind willreturn memory(argmem: 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 = { nounwind willreturn memory(read) }
attributes #7 = { builtin allocsize(0) }
attributes #8 = { nounwind }
attributes #9 = { builtin 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 = !{!"long", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"vtable pointer", !8, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"long long", !7, i64 0}


; Effective O3 passes: CorrelatedValuePropagationPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass