; LLVM IR from SSBMTonberry/pocketlzma :: ref_spec/lzma1900/CPP/7zip/Compress (XzDecoder)

; 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.ISzAlloc = type { ptr, ptr }
%struct.CXzDecMtProps = type { i64, i64, i32, i32, i64, i64 }
%struct.CSeqInStreamWrap = type { %struct.ISeqInStream, ptr, i32, i64 }
%struct.ISeqInStream = type { ptr }
%struct.CSeqOutStreamWrap = type { %struct.ISeqOutStream, ptr, i32, i64 }
%struct.ISeqOutStream = type { ptr }
%struct.CCompressProgressWrap = type { %struct.ICompressProgress, ptr, i32 }
%struct.ICompressProgress = type { ptr }
%"struct.NCompress::NXz::CDecoder" = type { ptr, i32, i32, i64, i32, i8, %struct.CXzStatInfo }
%struct.CXzStatInfo = type { i8, i8, i8, i8, i8, i64, i64, i64, i64, i32, i32, i32, i32, i32 }

@g_Alloc = external global %struct.ISzAlloc, align 8
@g_MidAlloc = external global %struct.ISzAlloc, align 8

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN9NCompress3NXz8CDecoder6DecodeEP19ISequentialInStreamP20ISequentialOutStreamPKybP21ICompressProgressInfo(ptr noundef nonnull align 8 dereferenceable(96) %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, i1 noundef zeroext %4, ptr noundef %5) #0 align 2 {
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca i8, align 1
  %13 = alloca ptr, align 8
  %14 = alloca %struct.CXzDecMtProps, align 8
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i64, align 8
  %18 = alloca %struct.CSeqInStreamWrap, align 8
  %19 = alloca %struct.CSeqOutStreamWrap, align 8
  %20 = alloca %struct.CCompressProgressWrap, align 8
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  store ptr %0, ptr %8, align 8, !tbaa !5
  store ptr %1, ptr %9, align 8, !tbaa !5
  store ptr %2, ptr %10, align 8, !tbaa !5
  store ptr %3, ptr %11, align 8, !tbaa !5
  %23 = zext i1 %4 to i8
  store i8 %23, ptr %12, align 1, !tbaa !9
  store ptr %5, ptr %13, align 8, !tbaa !5
  %24 = load ptr, ptr %8, align 8
  %25 = getelementptr inbounds %"struct.NCompress::NXz::CDecoder", ptr %24, i32 0, i32 4
  store i32 0, ptr %25, align 8, !tbaa !11
  %26 = getelementptr inbounds %"struct.NCompress::NXz::CDecoder", ptr %24, i32 0, i32 5
  store i8 0, ptr %26, align 4, !tbaa !16
  %27 = getelementptr inbounds %"struct.NCompress::NXz::CDecoder", ptr %24, i32 0, i32 6
  call void @XzStatInfo_Clear(ptr noundef %27)
  %28 = getelementptr inbounds %"struct.NCompress::NXz::CDecoder", ptr %24, i32 0, i32 0
  %29 = load ptr, ptr %28, align 8, !tbaa !17
  %30 = icmp ne ptr %29, null
  br i1 %30, label %39, label %31

31:                                               ; preds = %6
  %32 = call ptr @XzDecMt_Create(ptr noundef @g_Alloc, ptr noundef @g_MidAlloc)
  %33 = getelementptr inbounds %"struct.NCompress::NXz::CDecoder", ptr %24, i32 0, i32 0
  store ptr %32, ptr %33, align 8, !tbaa !17
  %34 = getelementptr inbounds %"struct.NCompress::NXz::CDecoder", ptr %24, i32 0, i32 0
  %35 = load ptr, ptr %34, align 8, !tbaa !17
  %36 = icmp ne ptr %35, null
  br i1 %36, label %38, label %37

37:                                               ; preds = %31
  store i32 -2147024882, ptr %7, align 4
  br label %133

38:                                               ; preds = %31
  br label %39

39:                                               ; preds = %38, %6
  call void @llvm.lifetime.start.p0(i64 40, ptr %14) #5
  call void @XzDecMtProps_Init(ptr noundef %14)
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #5
  store i32 0, ptr %15, align 4, !tbaa !18
  %40 = getelementptr inbounds %struct.CXzDecMtProps, ptr %14, i32 0, i32 3
  store i32 1, ptr %40, align 4, !tbaa !19
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #5
  %41 = getelementptr inbounds %"struct.NCompress::NXz::CDecoder", ptr %24, i32 0, i32 2
  %42 = load i32, ptr %41, align 4, !tbaa !22
  store i32 %42, ptr %16, align 4, !tbaa !18
  %43 = getelementptr inbounds %"struct.NCompress::NXz::CDecoder", ptr %24, i32 0, i32 1
  %44 = load i32, ptr %43, align 8, !tbaa !23
  %45 = icmp ne i32 %44, 0
  br i1 %45, label %46, label %63

46:                                               ; preds = %39
  %47 = load i32, ptr %16, align 4, !tbaa !18
  %48 = icmp ugt i32 %47, 1
  br i1 %48, label %49, label %63

49:                                               ; preds = %46
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #5
  %50 = getelementptr inbounds %"struct.NCompress::NXz::CDecoder", ptr %24, i32 0, i32 3
  %51 = load i64, ptr %50, align 8, !tbaa !24
  store i64 %51, ptr %17, align 8, !tbaa !25
  %52 = load i64, ptr %17, align 8, !tbaa !25
  %53 = getelementptr inbounds %"struct.NCompress::NXz::CDecoder", ptr %24, i32 0, i32 3
  %54 = load i64, ptr %53, align 8, !tbaa !24
  %55 = icmp ne i64 %52, %54
  br i1 %55, label %56, label %57

56:                                               ; preds = %49
  store i64 -1, ptr %17, align 8, !tbaa !25
  br label %57

57:                                               ; preds = %56, %49
  %58 = load i64, ptr %17, align 8, !tbaa !25
  %59 = getelementptr inbounds %struct.CXzDecMtProps, ptr %14, i32 0, i32 5
  store i64 %58, ptr %59, align 8, !tbaa !26
  %60 = load i32, ptr %16, align 4, !tbaa !18
  %61 = icmp ugt i32 %60, 1
  %62 = zext i1 %61 to i32
  store i32 %62, ptr %15, align 4, !tbaa !18
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  br label %63

63:                                               ; preds = %57, %46, %39
  %64 = load i32, ptr %16, align 4, !tbaa !18
  %65 = getelementptr inbounds %struct.CXzDecMtProps, ptr %14, i32 0, i32 3
  store i32 %64, ptr %65, align 4, !tbaa !19
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  call void @llvm.lifetime.start.p0(i64 32, ptr %18) #5
  call void @llvm.lifetime.start.p0(i64 32, ptr %19) #5
  call void @llvm.lifetime.start.p0(i64 24, ptr %20) #5
  %66 = load ptr, ptr %9, align 8, !tbaa !5
  call void @_ZN16CSeqInStreamWrap4InitEP19ISequentialInStream(ptr noundef nonnull align 8 dereferenceable(32) %18, ptr noundef %66) #5
  %67 = load ptr, ptr %10, align 8, !tbaa !5
  call void @_ZN17CSeqOutStreamWrap4InitEP20ISequentialOutStream(ptr noundef nonnull align 8 dereferenceable(32) %19, ptr noundef %67) #5
  %68 = load ptr, ptr %13, align 8, !tbaa !5
  call void @_ZN21CCompressProgressWrap4InitEP21ICompressProgressInfo(ptr noundef nonnull align 8 dereferenceable(24) %20, ptr noundef %68) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #5
  %69 = getelementptr inbounds %"struct.NCompress::NXz::CDecoder", ptr %24, i32 0, i32 0
  %70 = load ptr, ptr %69, align 8, !tbaa !17
  %71 = load ptr, ptr %11, align 8, !tbaa !5
  %72 = load i8, ptr %12, align 1, !tbaa !9, !range !27, !noundef !28
  %73 = trunc i8 %72 to i1
  %74 = zext i1 %73 to i32
  %75 = getelementptr inbounds %struct.CSeqOutStreamWrap, ptr %19, i32 0, i32 0
  %76 = getelementptr inbounds %struct.CSeqInStreamWrap, ptr %18, i32 0, i32 0
  %77 = getelementptr inbounds %"struct.NCompress::NXz::CDecoder", ptr %24, i32 0, i32 6
  %78 = load ptr, ptr %13, align 8, !tbaa !5
  %79 = icmp ne ptr %78, null
  br i1 %79, label %80, label %82

80:                                               ; preds = %63
  %81 = getelementptr inbounds %struct.CCompressProgressWrap, ptr %20, i32 0, i32 0
  br label %83

82:                                               ; preds = %63
  br label %83

83:                                               ; preds = %82, %80
  %84 = phi ptr [ %81, %80 ], [ null, %82 ]
  %85 = call i32 @XzDecMt_Decode(ptr noundef %70, ptr noundef %14, ptr noundef %71, i32 noundef %74, ptr noundef %75, ptr noundef %76, ptr noundef %77, ptr noundef %15, ptr noundef %84)
  store i32 %85, ptr %21, align 4, !tbaa !18
  %86 = load i32, ptr %21, align 4, !tbaa !18
  %87 = getelementptr inbounds %"struct.NCompress::NXz::CDecoder", ptr %24, i32 0, i32 4
  store i32 %86, ptr %87, align 8, !tbaa !11
  %88 = getelementptr inbounds %struct.CSeqOutStreamWrap, ptr %19, i32 0, i32 2
  %89 = load i32, ptr %88, align 8, !tbaa !29
  %90 = icmp ne i32 %89, 0
  br i1 %90, label %91, label %94

91:                                               ; preds = %83
  %92 = getelementptr inbounds %struct.CSeqOutStreamWrap, ptr %19, i32 0, i32 2
  %93 = load i32, ptr %92, align 8, !tbaa !29
  store i32 %93, ptr %7, align 4
  store i32 1, ptr %22, align 4
  br label %132

94:                                               ; preds = %83
  %95 = getelementptr inbounds %struct.CCompressProgressWrap, ptr %20, i32 0, i32 2
  %96 = load i32, ptr %95, align 8, !tbaa !32
  %97 = icmp ne i32 %96, 0
  br i1 %97, label %98, label %101

98:                                               ; preds = %94
  %99 = getelementptr inbounds %struct.CCompressProgressWrap, ptr %20, i32 0, i32 2
  %100 = load i32, ptr %99, align 8, !tbaa !32
  store i32 %100, ptr %7, align 4
  store i32 1, ptr %22, align 4
  br label %132

101:                                              ; preds = %94
  %102 = getelementptr inbounds %struct.CSeqInStreamWrap, ptr %18, i32 0, i32 2
  %103 = load i32, ptr %102, align 8, !tbaa !35
  %104 = icmp ne i32 %103, 0
  br i1 %104, label %105, label %111

105:                                              ; preds = %101
  %106 = load i32, ptr %21, align 4, !tbaa !18
  %107 = icmp eq i32 %106, 8
  br i1 %107, label %108, label %111

108:                                              ; preds = %105
  %109 = getelementptr inbounds %struct.CSeqInStreamWrap, ptr %18, i32 0, i32 2
  %110 = load i32, ptr %109, align 8, !tbaa !35
  store i32 %110, ptr %7, align 4
  store i32 1, ptr %22, align 4
  br label %132

111:                                              ; preds = %105, %101
  %112 = getelementptr inbounds %"struct.NCompress::NXz::CDecoder", ptr %24, i32 0, i32 5
  store i8 1, ptr %112, align 4, !tbaa !16
  %113 = load i32, ptr %21, align 4, !tbaa !18
  %114 = icmp eq i32 %113, 0
  br i1 %114, label %115, label %129

115:                                              ; preds = %111
  %116 = load i8, ptr %12, align 1, !tbaa !9, !range !27, !noundef !28
  %117 = trunc i8 %116 to i1
  br i1 %117, label %118, label %129

118:                                              ; preds = %115
  %119 = load ptr, ptr %11, align 8, !tbaa !5
  %120 = icmp ne ptr %119, null
  br i1 %120, label %121, label %128

121:                                              ; preds = %118
  %122 = load ptr, ptr %11, align 8, !tbaa !5
  %123 = load i64, ptr %122, align 8, !tbaa !38
  %124 = getelementptr inbounds %struct.CSeqOutStreamWrap, ptr %19, i32 0, i32 3
  %125 = load i64, ptr %124, align 8, !tbaa !39
  %126 = icmp ne i64 %123, %125
  br i1 %126, label %127, label %128

127:                                              ; preds = %121
  store i32 1, ptr %21, align 4, !tbaa !18
  br label %128

128:                                              ; preds = %127, %121, %118
  br label %129

129:                                              ; preds = %128, %115, %111
  %130 = load i32, ptr %21, align 4, !tbaa !18
  %131 = call noundef i32 @_ZN9NCompress3NXzL18SResToHRESULT_CodeEi(i32 noundef %130) #5
  store i32 %131, ptr %7, align 4
  store i32 1, ptr %22, align 4
  br label %132

132:                                              ; preds = %129, %108, %98, %91
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %20) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %19) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 40, ptr %14) #5
  br label %133

133:                                              ; preds = %132, %37
  %134 = load i32, ptr %7, align 4
  ret i32 %134
}

declare void @XzStatInfo_Clear(ptr noundef) #1

declare ptr @XzDecMt_Create(ptr noundef, ptr noundef) #1

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

declare void @XzDecMtProps_Init(ptr noundef) #1

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

; Function Attrs: nounwind
declare void @_ZN16CSeqInStreamWrap4InitEP19ISequentialInStream(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef) #3

; Function Attrs: nounwind
declare void @_ZN17CSeqOutStreamWrap4InitEP20ISequentialOutStream(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef) #3

; Function Attrs: nounwind
declare void @_ZN21CCompressProgressWrap4InitEP21ICompressProgressInfo(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef) #3

declare i32 @XzDecMt_Decode(ptr noundef, ptr noundef, ptr noundef, i32 noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) #1

; Function Attrs: mustprogress nounwind uwtable
declare hidden noundef i32 @_ZN9NCompress3NXzL18SResToHRESULT_CodeEi(i32 noundef) #4

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

!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 = !{!"bool", !7, i64 0}
!11 = !{!12, !13, i64 24}
!12 = !{!"_ZTSN9NCompress3NXz8CDecoderE", !6, i64 0, !13, i64 8, !13, i64 12, !14, i64 16, !13, i64 24, !10, i64 28, !15, i64 32}
!13 = !{!"int", !7, i64 0}
!14 = !{!"long long", !7, i64 0}
!15 = !{!"_ZTS11CXzStatInfo", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3, !7, i64 4, !14, i64 8, !14, i64 16, !14, i64 24, !14, i64 32, !13, i64 40, !13, i64 44, !13, i64 48, !13, i64 52, !13, i64 56}
!16 = !{!12, !10, i64 28}
!17 = !{!12, !6, i64 0}
!18 = !{!13, !13, i64 0}
!19 = !{!20, !13, i64 20}
!20 = !{!"_ZTS13CXzDecMtProps", !21, i64 0, !21, i64 8, !13, i64 16, !13, i64 20, !21, i64 24, !21, i64 32}
!21 = !{!"long", !7, i64 0}
!22 = !{!12, !13, i64 12}
!23 = !{!12, !13, i64 8}
!24 = !{!12, !14, i64 16}
!25 = !{!21, !21, i64 0}
!26 = !{!20, !21, i64 32}
!27 = !{i8 0, i8 2}
!28 = !{}
!29 = !{!30, !13, i64 16}
!30 = !{!"_ZTS17CSeqOutStreamWrap", !31, i64 0, !6, i64 8, !13, i64 16, !14, i64 24}
!31 = !{!"_ZTS13ISeqOutStream", !6, i64 0}
!32 = !{!33, !13, i64 16}
!33 = !{!"_ZTS21CCompressProgressWrap", !34, i64 0, !6, i64 8, !13, i64 16}
!34 = !{!"_ZTS17ICompressProgress", !6, i64 0}
!35 = !{!36, !13, i64 16}
!36 = !{!"_ZTS16CSeqInStreamWrap", !37, i64 0, !6, i64 8, !13, i64 16, !14, i64 24}
!37 = !{!"_ZTS12ISeqInStream", !6, i64 0}
!38 = !{!14, !14, i64 0}
!39 = !{!30, !14, i64 24}


; 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.ISzAlloc = type { ptr, ptr }
%struct.CXzDecMtProps = type { i64, i64, i32, i32, i64, i64 }
%struct.CSeqInStreamWrap = type { %struct.ISeqInStream, ptr, i32, i64 }
%struct.ISeqInStream = type { ptr }
%struct.CSeqOutStreamWrap = type { %struct.ISeqOutStream, ptr, i32, i64 }
%struct.ISeqOutStream = type { ptr }
%struct.CCompressProgressWrap = type { %struct.ICompressProgress, ptr, i32 }
%struct.ICompressProgress = type { ptr }

@g_Alloc = external global %struct.ISzAlloc, align 8
@g_MidAlloc = external global %struct.ISzAlloc, align 8

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN9NCompress3NXz8CDecoder6DecodeEP19ISequentialInStreamP20ISequentialOutStreamPKybP21ICompressProgressInfo(ptr noundef nonnull align 8 dereferenceable(96) %0, ptr noundef %1, ptr noundef %2, ptr noundef %3, i1 noundef zeroext %4, ptr noundef %5) local_unnamed_addr #0 align 2 {
  %7 = alloca %struct.CXzDecMtProps, align 8
  %8 = alloca i32, align 4
  %9 = alloca %struct.CSeqInStreamWrap, align 8
  %10 = alloca %struct.CSeqOutStreamWrap, align 8
  %11 = alloca %struct.CCompressProgressWrap, align 8
  %12 = getelementptr inbounds i8, ptr %0, i64 24
  store i32 0, ptr %12, align 8, !tbaa !5
  %13 = getelementptr inbounds i8, ptr %0, i64 28
  store i8 0, ptr %13, align 4, !tbaa !14
  %14 = getelementptr inbounds i8, ptr %0, i64 32
  tail call void @XzStatInfo_Clear(ptr noundef nonnull %14)
  %15 = load ptr, ptr %0, align 8, !tbaa !15
  %.not = icmp eq ptr %15, null
  br i1 %.not, label %16, label %18

16:                                               ; preds = %6
  %17 = tail call ptr @XzDecMt_Create(ptr noundef nonnull @g_Alloc, ptr noundef nonnull @g_MidAlloc)
  store ptr %17, ptr %0, align 8, !tbaa !15
  %.not31 = icmp eq ptr %17, null
  br i1 %.not31, label %56, label %18

18:                                               ; preds = %16, %6
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %7) #5
  call void @XzDecMtProps_Init(ptr noundef nonnull %7)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #5
  store i32 0, ptr %8, align 4, !tbaa !16
  %19 = getelementptr inbounds i8, ptr %7, i64 20
  %20 = getelementptr inbounds i8, ptr %0, i64 12
  %21 = load i32, ptr %20, align 4, !tbaa !17
  %22 = getelementptr inbounds i8, ptr %0, i64 8
  %23 = load i32, ptr %22, align 8, !tbaa !18
  %24 = icmp ne i32 %23, 0
  %25 = icmp ugt i32 %21, 1
  %or.cond = select i1 %24, i1 %25, i1 false
  br i1 %or.cond, label %26, label %30

26:                                               ; preds = %18
  %27 = getelementptr inbounds i8, ptr %0, i64 16
  %28 = load i64, ptr %27, align 8, !tbaa !19
  %29 = getelementptr inbounds i8, ptr %7, i64 32
  store i64 %28, ptr %29, align 8, !tbaa !20
  store i32 1, ptr %8, align 4, !tbaa !16
  br label %30

30:                                               ; preds = %26, %18
  store i32 %21, ptr %19, align 4, !tbaa !23
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %9) #5
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %10) #5
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %11) #5
  call void @_ZN16CSeqInStreamWrap4InitEP19ISequentialInStream(ptr noundef nonnull align 8 dereferenceable(32) %9, ptr noundef %1) #5
  call void @_ZN17CSeqOutStreamWrap4InitEP20ISequentialOutStream(ptr noundef nonnull align 8 dereferenceable(32) %10, ptr noundef %2) #5
  call void @_ZN21CCompressProgressWrap4InitEP21ICompressProgressInfo(ptr noundef nonnull align 8 dereferenceable(24) %11, ptr noundef %5) #5
  %31 = load ptr, ptr %0, align 8, !tbaa !15
  %32 = zext i1 %4 to i32
  %.not32 = icmp eq ptr %5, null
  %33 = select i1 %.not32, ptr null, ptr %11
  %34 = call i32 @XzDecMt_Decode(ptr noundef %31, ptr noundef nonnull %7, ptr noundef %3, i32 noundef %32, ptr noundef nonnull %10, ptr noundef nonnull %9, ptr noundef nonnull %14, ptr noundef nonnull %8, ptr noundef %33)
  store i32 %34, ptr %12, align 8, !tbaa !5
  %35 = getelementptr inbounds i8, ptr %10, i64 16
  %36 = load i32, ptr %35, align 8, !tbaa !24
  %.not33 = icmp eq i32 %36, 0
  br i1 %.not33, label %37, label %55

37:                                               ; preds = %30
  %38 = getelementptr inbounds i8, ptr %11, i64 16
  %39 = load i32, ptr %38, align 8, !tbaa !27
  %.not34 = icmp eq i32 %39, 0
  br i1 %.not34, label %40, label %55

40:                                               ; preds = %37
  %41 = getelementptr inbounds i8, ptr %9, i64 16
  %42 = load i32, ptr %41, align 8, !tbaa !30
  %43 = icmp ne i32 %42, 0
  %44 = icmp eq i32 %34, 8
  %or.cond3 = select i1 %43, i1 %44, i1 false
  br i1 %or.cond3, label %55, label %45

45:                                               ; preds = %40
  store i8 1, ptr %13, align 4, !tbaa !14
  %46 = icmp eq i32 %34, 0
  br i1 %46, label %47, label %53

47:                                               ; preds = %45
  %48 = icmp ne ptr %3, null
  %or.cond5 = and i1 %48, %4
  br i1 %or.cond5, label %49, label %53

49:                                               ; preds = %47
  %50 = load i64, ptr %3, align 8, !tbaa !33
  %51 = getelementptr inbounds i8, ptr %10, i64 24
  %52 = load i64, ptr %51, align 8, !tbaa !34
  %.not35 = icmp ne i64 %50, %52
  %spec.select = zext i1 %.not35 to i32
  br label %53

53:                                               ; preds = %49, %47, %45
  %.0 = phi i32 [ 0, %47 ], [ %34, %45 ], [ %spec.select, %49 ]
  %54 = call noundef i32 @_ZN9NCompress3NXzL18SResToHRESULT_CodeEi(i32 noundef %.0) #5
  br label %55

55:                                               ; preds = %40, %37, %30, %53
  %.024 = phi i32 [ %54, %53 ], [ %36, %30 ], [ %39, %37 ], [ %42, %40 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %11) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %10) #5
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %9) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #5
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %7) #5
  br label %56

56:                                               ; preds = %16, %55
  %.1 = phi i32 [ %.024, %55 ], [ -2147024882, %16 ]
  ret i32 %.1
}

declare void @XzStatInfo_Clear(ptr noundef) local_unnamed_addr #1

declare ptr @XzDecMt_Create(ptr noundef, ptr noundef) local_unnamed_addr #1

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

declare void @XzDecMtProps_Init(ptr noundef) local_unnamed_addr #1

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

; Function Attrs: nounwind
declare void @_ZN16CSeqInStreamWrap4InitEP19ISequentialInStream(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef) local_unnamed_addr #3

; Function Attrs: nounwind
declare void @_ZN17CSeqOutStreamWrap4InitEP20ISequentialOutStream(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef) local_unnamed_addr #3

; Function Attrs: nounwind
declare void @_ZN21CCompressProgressWrap4InitEP21ICompressProgressInfo(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef) local_unnamed_addr #3

declare i32 @XzDecMt_Decode(ptr noundef, ptr noundef, ptr noundef, i32 noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef, ptr noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
declare hidden noundef i32 @_ZN9NCompress3NXzL18SResToHRESULT_CodeEi(i32 noundef) local_unnamed_addr #4

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

!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, !10, i64 24}
!6 = !{!"_ZTSN9NCompress3NXz8CDecoderE", !7, i64 0, !10, i64 8, !10, i64 12, !11, i64 16, !10, i64 24, !12, i64 28, !13, i64 32}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!"long long", !8, i64 0}
!12 = !{!"bool", !8, i64 0}
!13 = !{!"_ZTS11CXzStatInfo", !8, i64 0, !8, i64 1, !8, i64 2, !8, i64 3, !8, i64 4, !11, i64 8, !11, i64 16, !11, i64 24, !11, i64 32, !10, i64 40, !10, i64 44, !10, i64 48, !10, i64 52, !10, i64 56}
!14 = !{!6, !12, i64 28}
!15 = !{!6, !7, i64 0}
!16 = !{!10, !10, i64 0}
!17 = !{!6, !10, i64 12}
!18 = !{!6, !10, i64 8}
!19 = !{!6, !11, i64 16}
!20 = !{!21, !22, i64 32}
!21 = !{!"_ZTS13CXzDecMtProps", !22, i64 0, !22, i64 8, !10, i64 16, !10, i64 20, !22, i64 24, !22, i64 32}
!22 = !{!"long", !8, i64 0}
!23 = !{!21, !10, i64 20}
!24 = !{!25, !10, i64 16}
!25 = !{!"_ZTS17CSeqOutStreamWrap", !26, i64 0, !7, i64 8, !10, i64 16, !11, i64 24}
!26 = !{!"_ZTS13ISeqOutStream", !7, i64 0}
!27 = !{!28, !10, i64 16}
!28 = !{!"_ZTS21CCompressProgressWrap", !29, i64 0, !7, i64 8, !10, i64 16}
!29 = !{!"_ZTS17ICompressProgress", !7, i64 0}
!30 = !{!31, !10, i64 16}
!31 = !{!"_ZTS16CSeqInStreamWrap", !32, i64 0, !7, i64 8, !10, i64 16, !11, i64 24}
!32 = !{!"_ZTS12ISeqInStream", !7, i64 0}
!33 = !{!11, !11, i64 0}
!34 = !{!25, !11, i64 24}


; Effective O3 passes: DSEPass,EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,SROAPass,SimplifyCFGPass,TailCallElimPass