; LLVM IR from Overload-Technologies/Overload :: Dependencies/assimp/code/Common (Compression)

; 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.__gnu_cxx::__normal_iterator" = type { ptr }
%"class.Assimp::Compression" = type { ptr }
%"struct.Assimp::Compression::impl" = type <{ i8, [7 x i8], %struct.z_stream_s, i32, [4 x i8] }>
%struct.z_stream_s = type { ptr, i32, i64, ptr, i32, i64, ptr, ptr, ptr, ptr, ptr, i32, i64, i64 }

@.str = external hidden unnamed_addr constant [17 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [112 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [44 x i8], align 1
@_ZTI17DeadlyImportError = external dso_local constant { ptr, ptr, ptr }, align 8

declare i32 @__gxx_personality_v0(...)

declare void @_ZN6Assimp17aiAssertViolationEPKcS1_i(ptr noundef, ptr noundef, i32 noundef) #0

; Function Attrs: mustprogress uwtable
define dso_local noundef i64 @_ZN6Assimp11Compression10decompressEPKvmRSt6vectorIcSaIcEE(ptr noundef nonnull align 8 dereferenceable(8) %0, ptr noundef %1, i64 noundef %2, ptr noundef nonnull align 8 dereferenceable(24) %3) #1 align 2 personality ptr @__gxx_personality_v0 {
  %5 = alloca i64, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i64, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca i64, align 8
  %12 = alloca i32, align 4
  %13 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %14 = alloca ptr, align 8
  %15 = alloca i32, align 4
  %16 = alloca [32786 x i8], align 16
  %17 = alloca i64, align 8
  store ptr %0, ptr %6, align 8, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !5
  store i64 %2, ptr %8, align 8, !tbaa !9
  store ptr %3, ptr %9, align 8, !tbaa !5
  %18 = load ptr, ptr %6, align 8
  %19 = getelementptr inbounds %"class.Assimp::Compression", ptr %18, i32 0, i32 0
  %20 = load ptr, ptr %19, align 8, !tbaa !11
  %21 = icmp ne ptr %20, null
  br i1 %21, label %23, label %22

22:                                               ; preds = %4
  call void @_ZN6Assimp17aiAssertViolationEPKcS1_i(ptr noundef @.str, ptr noundef @.str.1, i32 noundef 134)
  br label %23

23:                                               ; preds = %22, %4
  %24 = phi i1 [ true, %4 ], [ false, %22 ]
  %25 = load ptr, ptr %7, align 8, !tbaa !5
  %26 = icmp eq ptr %25, null
  br i1 %26, label %30, label %27

27:                                               ; preds = %23
  %28 = load i64, ptr %8, align 8, !tbaa !9
  %29 = icmp eq i64 %28, 0
  br i1 %29, label %30, label %31

30:                                               ; preds = %27, %23
  store i64 0, ptr %5, align 8
  br label %146

31:                                               ; preds = %27
  %32 = load ptr, ptr %7, align 8, !tbaa !5
  %33 = getelementptr inbounds %"class.Assimp::Compression", ptr %18, i32 0, i32 0
  %34 = load ptr, ptr %33, align 8, !tbaa !11
  %35 = getelementptr inbounds %"struct.Assimp::Compression::impl", ptr %34, i32 0, i32 2
  %36 = getelementptr inbounds %struct.z_stream_s, ptr %35, i32 0, i32 0
  store ptr %32, ptr %36, align 8, !tbaa !13
  %37 = load i64, ptr %8, align 8, !tbaa !9
  %38 = trunc i64 %37 to i32
  %39 = getelementptr inbounds %"class.Assimp::Compression", ptr %18, i32 0, i32 0
  %40 = load ptr, ptr %39, align 8, !tbaa !11
  %41 = getelementptr inbounds %"struct.Assimp::Compression::impl", ptr %40, i32 0, i32 2
  %42 = getelementptr inbounds %struct.z_stream_s, ptr %41, i32 0, i32 1
  store i32 %38, ptr %42, align 8, !tbaa !19
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  store i32 0, ptr %10, align 4, !tbaa !20
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #7
  store i64 0, ptr %11, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  %43 = getelementptr inbounds %"class.Assimp::Compression", ptr %18, i32 0, i32 0
  %44 = load ptr, ptr %43, align 8, !tbaa !11
  %45 = getelementptr inbounds %"struct.Assimp::Compression::impl", ptr %44, i32 0, i32 3
  %46 = load i32, ptr %45, align 8, !tbaa !21
  %47 = call noundef i32 @_ZN6AssimpL12getFlushModeENS_11Compression9FlushModeE(i32 noundef %46)
  store i32 %47, ptr %12, align 4, !tbaa !20
  %48 = load i32, ptr %12, align 4, !tbaa !20
  %49 = icmp eq i32 %48, 4
  br i1 %49, label %50, label %89

50:                                               ; preds = %31
  %51 = load ptr, ptr %9, align 8, !tbaa !5
  %52 = call noundef i64 @_ZNKSt6vectorIcSaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %51) #7
  %53 = trunc i64 %52 to i32
  %54 = getelementptr inbounds %"class.Assimp::Compression", ptr %18, i32 0, i32 0
  %55 = load ptr, ptr %54, align 8, !tbaa !11
  %56 = getelementptr inbounds %"struct.Assimp::Compression::impl", ptr %55, i32 0, i32 2
  %57 = getelementptr inbounds %struct.z_stream_s, ptr %56, i32 0, i32 4
  store i32 %53, ptr %57, align 8, !tbaa !22
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #7
  %58 = load ptr, ptr %9, align 8, !tbaa !5
  %59 = call ptr @_ZNSt6vectorIcSaIcEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %58) #7
  %60 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %13, i32 0, i32 0
  store ptr %59, ptr %60, align 8
  %61 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPcSt6vectorIcSaIcEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %13) #7
  %62 = getelementptr inbounds %"class.Assimp::Compression", ptr %18, i32 0, i32 0
  %63 = load ptr, ptr %62, align 8, !tbaa !11
  %64 = getelementptr inbounds %"struct.Assimp::Compression::impl", ptr %63, i32 0, i32 2
  %65 = getelementptr inbounds %struct.z_stream_s, ptr %64, i32 0, i32 3
  store ptr %61, ptr %65, align 8, !tbaa !23
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  %66 = getelementptr inbounds %"class.Assimp::Compression", ptr %18, i32 0, i32 0
  %67 = load ptr, ptr %66, align 8, !tbaa !11
  %68 = getelementptr inbounds %"struct.Assimp::Compression::impl", ptr %67, i32 0, i32 2
  %69 = call i32 @inflate(ptr noundef %68, i32 noundef 4)
  store i32 %69, ptr %10, align 4, !tbaa !20
  %70 = load i32, ptr %10, align 4, !tbaa !20
  %71 = icmp ne i32 %70, 1
  br i1 %71, label %72, label %82

72:                                               ; preds = %50
  %73 = load i32, ptr %10, align 4, !tbaa !20
  %74 = icmp ne i32 %73, 0
  br i1 %74, label %75, label %82

75:                                               ; preds = %72
  %76 = call ptr @__cxa_allocate_exception(i64 16) #7
  invoke void @_ZN17DeadlyImportErrorC2IJRA12_KcRA44_S1_EEEDpOT_(ptr noundef nonnull align 8 dereferenceable(16) %76, ptr noundef nonnull align 1 dereferenceable(12) @.str.3, ptr noundef nonnull align 1 dereferenceable(44) @.str.4)
          to label %77 unwind label %78

77:                                               ; preds = %75
  call void @__cxa_throw(ptr %76, ptr @_ZTI17DeadlyImportError, ptr @_ZNSt13runtime_errorD2Ev) #8
  unreachable

78:                                               ; preds = %75
  %79 = landingpad { ptr, i32 }
          cleanup
  %80 = extractvalue { ptr, i32 } %79, 0
  store ptr %80, ptr %14, align 8
  %81 = extractvalue { ptr, i32 } %79, 1
  store i32 %81, ptr %15, align 4
  call void @__cxa_free_exception(ptr %76) #7
  br label %145

82:                                               ; preds = %72, %50
  %83 = getelementptr inbounds %"class.Assimp::Compression", ptr %18, i32 0, i32 0
  %84 = load ptr, ptr %83, align 8, !tbaa !11
  %85 = getelementptr inbounds %"struct.Assimp::Compression::impl", ptr %84, i32 0, i32 2
  %86 = getelementptr inbounds %struct.z_stream_s, ptr %85, i32 0, i32 4
  %87 = load i32, ptr %86, align 8, !tbaa !22
  %88 = zext i32 %87 to i64
  store i64 %88, ptr %11, align 8, !tbaa !9
  br label %143

89:                                               ; preds = %31
  br label %90

90:                                               ; preds = %139, %89
  call void @llvm.lifetime.start.p0(i64 32786, ptr %16) #7
  call void @llvm.memset.p0.i64(ptr align 16 %16, i8 0, i64 32786, i1 false)
  %91 = getelementptr inbounds %"class.Assimp::Compression", ptr %18, i32 0, i32 0
  %92 = load ptr, ptr %91, align 8, !tbaa !11
  %93 = getelementptr inbounds %"struct.Assimp::Compression::impl", ptr %92, i32 0, i32 2
  %94 = getelementptr inbounds %struct.z_stream_s, ptr %93, i32 0, i32 4
  store i32 32786, ptr %94, align 8, !tbaa !22
  %95 = getelementptr inbounds [32786 x i8], ptr %16, i64 0, i64 0
  %96 = getelementptr inbounds %"class.Assimp::Compression", ptr %18, i32 0, i32 0
  %97 = load ptr, ptr %96, align 8, !tbaa !11
  %98 = getelementptr inbounds %"struct.Assimp::Compression::impl", ptr %97, i32 0, i32 2
  %99 = getelementptr inbounds %struct.z_stream_s, ptr %98, i32 0, i32 3
  store ptr %95, ptr %99, align 8, !tbaa !23
  %100 = getelementptr inbounds %"class.Assimp::Compression", ptr %18, i32 0, i32 0
  %101 = load ptr, ptr %100, align 8, !tbaa !11
  %102 = getelementptr inbounds %"struct.Assimp::Compression::impl", ptr %101, i32 0, i32 2
  %103 = load i32, ptr %12, align 4, !tbaa !20
  %104 = call i32 @inflate(ptr noundef %102, i32 noundef %103)
  store i32 %104, ptr %10, align 4, !tbaa !20
  %105 = load i32, ptr %10, align 4, !tbaa !20
  %106 = icmp ne i32 %105, 1
  br i1 %106, label %107, label %117

107:                                              ; preds = %90
  %108 = load i32, ptr %10, align 4, !tbaa !20
  %109 = icmp ne i32 %108, 0
  br i1 %109, label %110, label %117

110:                                              ; preds = %107
  %111 = call ptr @__cxa_allocate_exception(i64 16) #7
  invoke void @_ZN17DeadlyImportErrorC2IJRA12_KcRA44_S1_EEEDpOT_(ptr noundef nonnull align 8 dereferenceable(16) %111, ptr noundef nonnull align 1 dereferenceable(12) @.str.3, ptr noundef nonnull align 1 dereferenceable(44) @.str.4)
          to label %112 unwind label %113

112:                                              ; preds = %110
  call void @__cxa_throw(ptr %111, ptr @_ZTI17DeadlyImportError, ptr @_ZNSt13runtime_errorD2Ev) #8
  unreachable

113:                                              ; preds = %110
  %114 = landingpad { ptr, i32 }
          cleanup
  %115 = extractvalue { ptr, i32 } %114, 0
  store ptr %115, ptr %14, align 8
  %116 = extractvalue { ptr, i32 } %114, 1
  store i32 %116, ptr %15, align 4
  call void @__cxa_free_exception(ptr %111) #7
  call void @llvm.lifetime.end.p0(i64 32786, ptr %16) #7
  br label %145

117:                                              ; preds = %107, %90
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #7
  %118 = getelementptr inbounds %"class.Assimp::Compression", ptr %18, i32 0, i32 0
  %119 = load ptr, ptr %118, align 8, !tbaa !11
  %120 = getelementptr inbounds %"struct.Assimp::Compression::impl", ptr %119, i32 0, i32 2
  %121 = getelementptr inbounds %struct.z_stream_s, ptr %120, i32 0, i32 4
  %122 = load i32, ptr %121, align 8, !tbaa !22
  %123 = zext i32 %122 to i64
  %124 = sub i64 32786, %123
  store i64 %124, ptr %17, align 8, !tbaa !9
  %125 = load i64, ptr %17, align 8, !tbaa !9
  %126 = load i64, ptr %11, align 8, !tbaa !9
  %127 = add i64 %126, %125
  store i64 %127, ptr %11, align 8, !tbaa !9
  %128 = load ptr, ptr %9, align 8, !tbaa !5
  %129 = load i64, ptr %11, align 8, !tbaa !9
  call void @_ZNSt6vectorIcSaIcEE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) %128, i64 noundef %129)
  %130 = load ptr, ptr %9, align 8, !tbaa !5
  %131 = call noundef ptr @_ZNSt6vectorIcSaIcEE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %130) #7
  %132 = load i64, ptr %11, align 8, !tbaa !9
  %133 = getelementptr inbounds i8, ptr %131, i64 %132
  %134 = load i64, ptr %17, align 8, !tbaa !9
  %135 = sub i64 0, %134
  %136 = getelementptr inbounds i8, ptr %133, i64 %135
  %137 = getelementptr inbounds [32786 x i8], ptr %16, i64 0, i64 0
  %138 = load i64, ptr %17, align 8, !tbaa !9
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %136, ptr align 16 %137, i64 %138, i1 false)
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 32786, ptr %16) #7
  br label %139

139:                                              ; preds = %117
  %140 = load i32, ptr %10, align 4, !tbaa !20
  %141 = icmp ne i32 %140, 1
  br i1 %141, label %90, label %142, !llvm.loop !24

142:                                              ; preds = %139
  br label %143

143:                                              ; preds = %142, %82
  %144 = load i64, ptr %11, align 8, !tbaa !9
  store i64 %144, ptr %5, align 8
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  br label %146

145:                                              ; preds = %113, %78
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  br label %148

146:                                              ; preds = %143, %30
  %147 = load i64, ptr %5, align 8
  ret i64 %147

148:                                              ; preds = %145
  %149 = load ptr, ptr %14, align 8
  %150 = load i32, ptr %15, align 4
  %151 = insertvalue { ptr, i32 } poison, ptr %149, 0
  %152 = insertvalue { ptr, i32 } %151, i32 %150, 1
  resume { ptr, i32 } %152
}

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

; Function Attrs: mustprogress uwtable
declare hidden noundef i32 @_ZN6AssimpL12getFlushModeENS_11Compression9FlushModeE(i32 noundef) #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorIcSaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) #3 align 2

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

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

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

declare i32 @inflate(ptr noundef, i32 noundef) #0

declare ptr @__cxa_allocate_exception(i64)

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN17DeadlyImportErrorC2IJRA12_KcRA44_S1_EEEDpOT_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 1 dereferenceable(12), ptr noundef nonnull align 1 dereferenceable(44)) unnamed_addr #1 align 2

declare void @__cxa_free_exception(ptr)

; Function Attrs: nounwind
declare void @_ZNSt13runtime_errorD2Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #4

declare void @__cxa_throw(ptr, ptr, ptr)

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #5

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIcSaIcEE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #1 align 2

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #6

attributes #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 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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 "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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #6 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #7 = { nounwind }
attributes #8 = { noreturn }

!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, !6, i64 0}
!12 = !{!"_ZTSN6Assimp11CompressionE", !6, i64 0}
!13 = !{!14, !6, i64 8}
!14 = !{!"_ZTSN6Assimp11Compression4implE", !15, i64 0, !16, i64 8, !18, i64 120}
!15 = !{!"bool", !7, i64 0}
!16 = !{!"_ZTS10z_stream_s", !6, i64 0, !17, i64 8, !10, i64 16, !6, i64 24, !17, i64 32, !10, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !17, i64 88, !10, i64 96, !10, i64 104}
!17 = !{!"int", !7, i64 0}
!18 = !{!"_ZTSN6Assimp11Compression9FlushModeE", !7, i64 0}
!19 = !{!14, !17, i64 16}
!20 = !{!17, !17, i64 0}
!21 = !{!14, !18, i64 120}
!22 = !{!14, !17, i64 40}
!23 = !{!14, !6, i64 32}
!24 = distinct !{!24, !25}
!25 = !{!"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.__gnu_cxx::__normal_iterator" = type { ptr }

@.str = external hidden unnamed_addr constant [17 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [112 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [44 x i8], align 1
@_ZTI17DeadlyImportError = external dso_local constant { ptr, ptr, ptr }, align 8

declare i32 @__gxx_personality_v0(...)

declare void @_ZN6Assimp17aiAssertViolationEPKcS1_i(ptr noundef, ptr noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
define dso_local noundef i64 @_ZN6Assimp11Compression10decompressEPKvmRSt6vectorIcSaIcEE(ptr nocapture noundef nonnull readonly align 8 dereferenceable(8) %0, ptr noundef %1, i64 noundef %2, ptr noundef nonnull align 8 dereferenceable(24) %3) local_unnamed_addr #1 align 2 personality ptr @__gxx_personality_v0 {
  %5 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %6 = alloca [32786 x i8], align 16
  %7 = load ptr, ptr %0, align 8, !tbaa !5
  %.not = icmp eq ptr %7, null
  br i1 %.not, label %8, label %9

8:                                                ; preds = %4
  tail call void @_ZN6Assimp17aiAssertViolationEPKcS1_i(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 134)
  br label %9

9:                                                ; preds = %8, %4
  %10 = icmp eq ptr %1, null
  %11 = icmp eq i64 %2, 0
  %or.cond = or i1 %10, %11
  br i1 %or.cond, label %.loopexit, label %12

12:                                               ; preds = %9
  %13 = load ptr, ptr %0, align 8, !tbaa !5
  %14 = getelementptr inbounds i8, ptr %13, i64 8
  store ptr %1, ptr %14, align 8, !tbaa !10
  %15 = trunc i64 %2 to i32
  %16 = getelementptr inbounds i8, ptr %13, i64 16
  store i32 %15, ptr %16, align 8, !tbaa !17
  %17 = getelementptr inbounds i8, ptr %13, i64 120
  %18 = load i32, ptr %17, align 8, !tbaa !18
  %19 = tail call noundef i32 @_ZN6AssimpL12getFlushModeENS_11Compression9FlushModeE(i32 noundef %18)
  %20 = icmp eq i32 %19, 4
  br i1 %20, label %21, label %.preheader

21:                                               ; preds = %12
  %22 = tail call noundef i64 @_ZNKSt6vectorIcSaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #7
  %23 = trunc i64 %22 to i32
  %24 = load ptr, ptr %0, align 8, !tbaa !5
  %25 = getelementptr inbounds i8, ptr %24, i64 40
  store i32 %23, ptr %25, align 8, !tbaa !19
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #7
  %26 = tail call ptr @_ZNSt6vectorIcSaIcEE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #7
  store ptr %26, ptr %5, align 8
  %27 = call noundef nonnull align 1 dereferenceable(1) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPcSt6vectorIcSaIcEEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %5) #7
  %28 = load ptr, ptr %0, align 8, !tbaa !5
  %29 = getelementptr inbounds i8, ptr %28, i64 32
  store ptr %27, ptr %29, align 8, !tbaa !20
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #7
  %30 = getelementptr inbounds i8, ptr %28, i64 8
  %31 = call i32 @inflate(ptr noundef nonnull %30, i32 noundef 4)
  %or.cond3 = icmp ugt i32 %31, 1
  br i1 %or.cond3, label %32, label %37

32:                                               ; preds = %21
  %33 = call ptr @__cxa_allocate_exception(i64 16) #7
  invoke void @_ZN17DeadlyImportErrorC2IJRA12_KcRA44_S1_EEEDpOT_(ptr noundef nonnull align 8 dereferenceable(16) %33, ptr noundef nonnull align 1 dereferenceable(12) @.str.3, ptr noundef nonnull align 1 dereferenceable(44) @.str.4)
          to label %34 unwind label %35

34:                                               ; preds = %32
  call void @__cxa_throw(ptr nonnull %33, ptr nonnull @_ZTI17DeadlyImportError, ptr nonnull @_ZNSt13runtime_errorD2Ev) #8
  unreachable

35:                                               ; preds = %32
  %36 = landingpad { ptr, i32 }
          cleanup
  call void @__cxa_free_exception(ptr %33) #7
  br label %61

37:                                               ; preds = %21
  %38 = load ptr, ptr %0, align 8, !tbaa !5
  %39 = getelementptr inbounds i8, ptr %38, i64 40
  %40 = load i32, ptr %39, align 8, !tbaa !19
  %41 = zext i32 %40 to i64
  br label %.loopexit

.preheader:                                       ; preds = %12, %52
  %.032 = phi i64 [ %58, %52 ], [ 0, %12 ]
  call void @llvm.lifetime.start.p0(i64 32786, ptr nonnull %6) #7
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(32786) %6, i8 0, i64 32786, i1 false)
  %42 = load ptr, ptr %0, align 8, !tbaa !5
  %43 = getelementptr inbounds i8, ptr %42, i64 40
  store i32 32786, ptr %43, align 8, !tbaa !19
  %44 = getelementptr inbounds i8, ptr %42, i64 32
  store ptr %6, ptr %44, align 8, !tbaa !20
  %45 = getelementptr inbounds i8, ptr %42, i64 8
  %46 = call i32 @inflate(ptr noundef nonnull %45, i32 noundef %19)
  %or.cond5 = icmp ugt i32 %46, 1
  br i1 %or.cond5, label %47, label %52

47:                                               ; preds = %.preheader
  %48 = call ptr @__cxa_allocate_exception(i64 16) #7
  invoke void @_ZN17DeadlyImportErrorC2IJRA12_KcRA44_S1_EEEDpOT_(ptr noundef nonnull align 8 dereferenceable(16) %48, ptr noundef nonnull align 1 dereferenceable(12) @.str.3, ptr noundef nonnull align 1 dereferenceable(44) @.str.4)
          to label %49 unwind label %50

49:                                               ; preds = %47
  call void @__cxa_throw(ptr nonnull %48, ptr nonnull @_ZTI17DeadlyImportError, ptr nonnull @_ZNSt13runtime_errorD2Ev) #8
  unreachable

50:                                               ; preds = %47
  %51 = landingpad { ptr, i32 }
          cleanup
  call void @__cxa_free_exception(ptr %48) #7
  call void @llvm.lifetime.end.p0(i64 32786, ptr nonnull %6) #7
  br label %61

52:                                               ; preds = %.preheader
  %.not35 = icmp eq i32 %46, 1
  %53 = load ptr, ptr %0, align 8, !tbaa !5
  %54 = getelementptr inbounds i8, ptr %53, i64 40
  %55 = load i32, ptr %54, align 8, !tbaa !19
  %56 = zext i32 %55 to i64
  %57 = sub nsw i64 32786, %56
  %58 = add i64 %57, %.032
  call void @_ZNSt6vectorIcSaIcEE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %58)
  %59 = call noundef ptr @_ZNSt6vectorIcSaIcEE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %3) #7
  %60 = getelementptr inbounds i8, ptr %59, i64 %.032
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %60, ptr nonnull align 16 %6, i64 %57, i1 false)
  call void @llvm.lifetime.end.p0(i64 32786, ptr nonnull %6) #7
  br i1 %.not35, label %.loopexit, label %.preheader, !llvm.loop !21

61:                                               ; preds = %50, %35
  %.pn = phi { ptr, i32 } [ %36, %35 ], [ %51, %50 ]
  resume { ptr, i32 } %.pn

.loopexit:                                        ; preds = %52, %37, %9
  %.0 = phi i64 [ 0, %9 ], [ %41, %37 ], [ %58, %52 ]
  ret i64 %.0
}

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

; Function Attrs: mustprogress uwtable
declare hidden noundef i32 @_ZN6AssimpL12getFlushModeENS_11Compression9FlushModeE(i32 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_ZNKSt6vectorIcSaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #3 align 2

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

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

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

declare i32 @inflate(ptr noundef, i32 noundef) local_unnamed_addr #0

declare ptr @__cxa_allocate_exception(i64) local_unnamed_addr

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN17DeadlyImportErrorC2IJRA12_KcRA44_S1_EEEDpOT_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 1 dereferenceable(12), ptr noundef nonnull align 1 dereferenceable(44)) unnamed_addr #1 align 2

declare void @__cxa_free_exception(ptr) local_unnamed_addr

; Function Attrs: nounwind
declare void @_ZNSt13runtime_errorD2Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #4

declare void @__cxa_throw(ptr, ptr, ptr) local_unnamed_addr

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #5

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIcSaIcEE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #1 align 2

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

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #6

attributes #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 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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 "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 nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #6 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #7 = { nounwind }
attributes #8 = { noreturn }

!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, !7, i64 0}
!6 = !{!"_ZTSN6Assimp11CompressionE", !7, i64 0}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!11, !7, i64 8}
!11 = !{!"_ZTSN6Assimp11Compression4implE", !12, i64 0, !13, i64 8, !16, i64 120}
!12 = !{!"bool", !8, i64 0}
!13 = !{!"_ZTS10z_stream_s", !7, i64 0, !14, i64 8, !15, i64 16, !7, i64 24, !14, i64 32, !15, i64 40, !7, i64 48, !7, i64 56, !7, i64 64, !7, i64 72, !7, i64 80, !14, i64 88, !15, i64 96, !15, i64 104}
!14 = !{!"int", !8, i64 0}
!15 = !{!"long", !8, i64 0}
!16 = !{!"_ZTSN6Assimp11Compression9FlushModeE", !8, i64 0}
!17 = !{!11, !14, i64 16}
!18 = !{!11, !16, i64 120}
!19 = !{!11, !14, i64 40}
!20 = !{!11, !7, i64 32}
!21 = distinct !{!21, !22}
!22 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass