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

; 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.std::unique_ptr.8" = type { %"struct.std::__uniq_ptr_data.9" }
%"struct.std::__uniq_ptr_data.9" = type { %"class.std::__uniq_ptr_impl.10" }
%"class.std::__uniq_ptr_impl.10" = type { %"class.std::tuple.11" }
%"class.std::tuple.11" = type { %"struct.std::_Tuple_impl.12" }
%"struct.std::_Tuple_impl.12" = type { %"struct.std::_Head_base.15" }
%"struct.std::_Head_base.15" = type { ptr }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.std::allocator" = type { i8 }
%union.anon.24 = type { [4 x i32] }

@.str.1 = external hidden unnamed_addr constant [113 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [7 x i8], align 1

declare void @_ZN6Assimp17aiAssertViolationEPKcS1_i(ptr noundef, ptr noundef, i32 noundef) #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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #2 align 2

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

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN6Assimp12BaseImporter15CheckMagicTokenEPNS_8IOSystemERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPKvmjj(ptr noundef %0, ptr noundef nonnull align 8 dereferenceable(32) %1, ptr noundef %2, i64 noundef %3, i32 noundef %4, i32 noundef %5) #4 align 2 personality ptr @__gxx_personality_v0 {
  %7 = alloca i1, align 1
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i64, align 8
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca ptr, align 8
  %15 = alloca %"class.std::unique_ptr.8", align 8
  %16 = alloca %"class.std::__cxx11::basic_string", align 8
  %17 = alloca %"class.std::allocator", align 1
  %18 = alloca ptr, align 8
  %19 = alloca i32, align 4
  %20 = alloca %union.anon.24, align 4
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca i16, align 2
  %24 = 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 i64 %3, ptr %11, align 8, !tbaa !9
  store i32 %4, ptr %12, align 4, !tbaa !11
  store i32 %5, ptr %13, align 4, !tbaa !11
  %25 = load i32, ptr %13, align 4, !tbaa !11
  %26 = icmp ule i32 %25, 16
  br i1 %26, label %28, label %27

27:                                               ; preds = %6
  call void @_ZN6Assimp17aiAssertViolationEPKcS1_i(ptr noundef @.str.17, ptr noundef @.str.1, i32 noundef 306)
  br label %28

28:                                               ; preds = %27, %6
  %29 = phi i1 [ true, %6 ], [ false, %27 ]
  %30 = load ptr, ptr %10, align 8, !tbaa !5
  %31 = icmp ne ptr %30, null
  br i1 %31, label %33, label %32

32:                                               ; preds = %28
  call void @_ZN6Assimp17aiAssertViolationEPKcS1_i(ptr noundef @.str.18, ptr noundef @.str.1, i32 noundef 307)
  br label %33

33:                                               ; preds = %32, %28
  %34 = phi i1 [ true, %28 ], [ false, %32 ]
  %35 = load ptr, ptr %8, align 8, !tbaa !5
  %36 = icmp ne ptr %35, null
  br i1 %36, label %38, label %37

37:                                               ; preds = %33
  store i1 false, ptr %7, align 1
  br label %176

38:                                               ; preds = %33
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #7
  %39 = load ptr, ptr %10, align 8, !tbaa !5
  store ptr %39, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #7
  %40 = load ptr, ptr %8, align 8, !tbaa !5
  %41 = load ptr, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 32, ptr %16) #7
  call void @llvm.lifetime.start.p0(i64 1, ptr %17) #7
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %17) #7
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %16, ptr noundef @.str.13, ptr noundef nonnull align 1 dereferenceable(1) %17)
          to label %42 unwind label %68

42:                                               ; preds = %38
  %43 = invoke noundef ptr @_ZN6Assimp8IOSystem4OpenERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES8_(ptr noundef nonnull align 8 dereferenceable(32) %40, ptr noundef nonnull align 8 dereferenceable(32) %41, ptr noundef nonnull align 8 dereferenceable(32) %16)
          to label %44 unwind label %72

44:                                               ; preds = %42
  call void @_ZNSt10unique_ptrIN6Assimp8IOStreamESt14default_deleteIS1_EEC2IS3_vEEPS1_(ptr noundef nonnull align 8 dereferenceable(8) %15, ptr noundef %43) #7
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %16) #7
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %17) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %16) #7
  %45 = call noundef zeroext i1 @_ZNKSt10unique_ptrIN6Assimp8IOStreamESt14default_deleteIS1_EEcvbEv(ptr noundef nonnull align 8 dereferenceable(8) %15) #7
  br i1 %45, label %46, label %172

46:                                               ; preds = %44
  %47 = call noundef ptr @_ZNKSt10unique_ptrIN6Assimp8IOStreamESt14default_deleteIS1_EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %15) #7
  %48 = load i32, ptr %12, align 4, !tbaa !11
  %49 = zext i32 %48 to i64
  %50 = load ptr, ptr %47, align 8, !tbaa !13
  %51 = getelementptr inbounds ptr, ptr %50, i64 4
  %52 = load ptr, ptr %51, align 8
  %53 = invoke noundef i32 %52(ptr noundef nonnull align 8 dereferenceable(8) %47, i64 noundef %49, i32 noundef 0)
          to label %54 unwind label %77

54:                                               ; preds = %46
  call void @llvm.lifetime.start.p0(i64 16, ptr %20) #7
  %55 = load i32, ptr %13, align 4, !tbaa !11
  %56 = zext i32 %55 to i64
  %57 = call noundef ptr @_ZNKSt10unique_ptrIN6Assimp8IOStreamESt14default_deleteIS1_EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %15) #7
  %58 = getelementptr inbounds [16 x i8], ptr %20, i64 0, i64 0
  %59 = load i32, ptr %13, align 4, !tbaa !11
  %60 = zext i32 %59 to i64
  %61 = load ptr, ptr %57, align 8, !tbaa !13
  %62 = getelementptr inbounds ptr, ptr %61, i64 2
  %63 = load ptr, ptr %62, align 8
  %64 = invoke noundef i64 %63(ptr noundef nonnull align 8 dereferenceable(8) %57, ptr noundef %58, i64 noundef 1, i64 noundef %60)
          to label %65 unwind label %81

65:                                               ; preds = %54
  %66 = icmp ne i64 %56, %64
  br i1 %66, label %67, label %85

67:                                               ; preds = %65
  store i1 false, ptr %7, align 1
  store i32 1, ptr %21, align 4
  br label %168

68:                                               ; preds = %38
  %69 = landingpad { ptr, i32 }
          cleanup
  %70 = extractvalue { ptr, i32 } %69, 0
  store ptr %70, ptr %18, align 8
  %71 = extractvalue { ptr, i32 } %69, 1
  store i32 %71, ptr %19, align 4
  br label %76

72:                                               ; preds = %42
  %73 = landingpad { ptr, i32 }
          cleanup
  %74 = extractvalue { ptr, i32 } %73, 0
  store ptr %74, ptr %18, align 8
  %75 = extractvalue { ptr, i32 } %73, 1
  store i32 %75, ptr %19, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %16) #7
  br label %76

76:                                               ; preds = %72, %68
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %17) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 32, ptr %16) #7
  br label %175

77:                                               ; preds = %46
  %78 = landingpad { ptr, i32 }
          cleanup
  %79 = extractvalue { ptr, i32 } %78, 0
  store ptr %79, ptr %18, align 8
  %80 = extractvalue { ptr, i32 } %78, 1
  store i32 %80, ptr %19, align 4
  br label %174

81:                                               ; preds = %54
  %82 = landingpad { ptr, i32 }
          cleanup
  %83 = extractvalue { ptr, i32 } %82, 0
  store ptr %83, ptr %18, align 8
  %84 = extractvalue { ptr, i32 } %82, 1
  store i32 %84, ptr %19, align 4
  br label %171

85:                                               ; preds = %65
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #7
  store i32 0, ptr %22, align 4, !tbaa !11
  br label %86

86:                                               ; preds = %161, %85
  %87 = load i32, ptr %22, align 4, !tbaa !11
  %88 = zext i32 %87 to i64
  %89 = load i64, ptr %11, align 8, !tbaa !9
  %90 = icmp ult i64 %88, %89
  br i1 %90, label %92, label %91

91:                                               ; preds = %86
  store i32 2, ptr %21, align 4
  br label %164

92:                                               ; preds = %86
  %93 = load i32, ptr %13, align 4, !tbaa !11
  %94 = icmp eq i32 2, %93
  br i1 %94, label %95, label %121

95:                                               ; preds = %92
  call void @llvm.lifetime.start.p0(i64 2, ptr %23) #7
  %96 = load ptr, ptr %14, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 2 %23, ptr align 1 %96, i64 2, i1 false)
  %97 = getelementptr inbounds [8 x i16], ptr %20, i64 0, i64 0
  %98 = load i16, ptr %97, align 4, !tbaa !15
  %99 = zext i16 %98 to i32
  %100 = load i16, ptr %23, align 2, !tbaa !16
  %101 = zext i16 %100 to i32
  %102 = icmp eq i32 %99, %101
  br i1 %102, label %112, label %103

103:                                              ; preds = %95
  %104 = getelementptr inbounds [8 x i16], ptr %20, i64 0, i64 0
  %105 = load i16, ptr %104, align 4, !tbaa !15
  %106 = zext i16 %105 to i32
  %107 = load i16, ptr %23, align 2, !tbaa !16
  %108 = invoke noundef zeroext i16 @_ZN6Assimp8ByteSwap7SwappedItEET_S2_(i16 noundef zeroext %107)
          to label %109 unwind label %113

109:                                              ; preds = %103
  %110 = zext i16 %108 to i32
  %111 = icmp eq i32 %106, %110
  br i1 %111, label %112, label %117

112:                                              ; preds = %109, %95
  store i1 true, ptr %7, align 1
  store i32 1, ptr %21, align 4
  br label %118

113:                                              ; preds = %103
  %114 = landingpad { ptr, i32 }
          cleanup
  %115 = extractvalue { ptr, i32 } %114, 0
  store ptr %115, ptr %18, align 8
  %116 = extractvalue { ptr, i32 } %114, 1
  store i32 %116, ptr %19, align 4
  call void @llvm.lifetime.end.p0(i64 2, ptr %23) #7
  br label %166

117:                                              ; preds = %109
  store i32 0, ptr %21, align 4
  br label %118

118:                                              ; preds = %117, %112
  call void @llvm.lifetime.end.p0(i64 2, ptr %23) #7
  %119 = load i32, ptr %21, align 4
  switch i32 %119, label %164 [
    i32 0, label %120
  ]

120:                                              ; preds = %118
  br label %156

121:                                              ; preds = %92
  %122 = load i32, ptr %13, align 4, !tbaa !11
  %123 = icmp eq i32 4, %122
  br i1 %123, label %124, label %146

124:                                              ; preds = %121
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #7
  %125 = load ptr, ptr %14, align 8, !tbaa !5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %24, ptr align 1 %125, i64 4, i1 false)
  %126 = getelementptr inbounds [4 x i32], ptr %20, i64 0, i64 0
  %127 = load i32, ptr %126, align 4, !tbaa !15
  %128 = load i32, ptr %24, align 4, !tbaa !11
  %129 = icmp eq i32 %127, %128
  br i1 %129, label %137, label %130

130:                                              ; preds = %124
  %131 = getelementptr inbounds [4 x i32], ptr %20, i64 0, i64 0
  %132 = load i32, ptr %131, align 4, !tbaa !15
  %133 = load i32, ptr %24, align 4, !tbaa !11
  %134 = invoke noundef i32 @_ZN6Assimp8ByteSwap7SwappedIjEET_S2_(i32 noundef %133)
          to label %135 unwind label %138

135:                                              ; preds = %130
  %136 = icmp eq i32 %132, %134
  br i1 %136, label %137, label %142

137:                                              ; preds = %135, %124
  store i1 true, ptr %7, align 1
  store i32 1, ptr %21, align 4
  br label %143

138:                                              ; preds = %130
  %139 = landingpad { ptr, i32 }
          cleanup
  %140 = extractvalue { ptr, i32 } %139, 0
  store ptr %140, ptr %18, align 8
  %141 = extractvalue { ptr, i32 } %139, 1
  store i32 %141, ptr %19, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #7
  br label %166

142:                                              ; preds = %135
  store i32 0, ptr %21, align 4
  br label %143

143:                                              ; preds = %142, %137
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #7
  %144 = load i32, ptr %21, align 4
  switch i32 %144, label %164 [
    i32 0, label %145
  ]

145:                                              ; preds = %143
  br label %155

146:                                              ; preds = %121
  %147 = load ptr, ptr %14, align 8, !tbaa !5
  %148 = getelementptr inbounds [16 x i8], ptr %20, i64 0, i64 0
  %149 = load i32, ptr %13, align 4, !tbaa !11
  %150 = zext i32 %149 to i64
  %151 = call i32 @memcmp(ptr noundef %147, ptr noundef %148, i64 noundef %150) #8
  %152 = icmp ne i32 %151, 0
  br i1 %152, label %154, label %153

153:                                              ; preds = %146
  store i1 true, ptr %7, align 1
  store i32 1, ptr %21, align 4
  br label %164

154:                                              ; preds = %146
  br label %155

155:                                              ; preds = %154, %145
  br label %156

156:                                              ; preds = %155, %120
  %157 = load i32, ptr %13, align 4, !tbaa !11
  %158 = load ptr, ptr %14, align 8, !tbaa !5
  %159 = zext i32 %157 to i64
  %160 = getelementptr inbounds i8, ptr %158, i64 %159
  store ptr %160, ptr %14, align 8, !tbaa !5
  br label %161

161:                                              ; preds = %156
  %162 = load i32, ptr %22, align 4, !tbaa !11
  %163 = add i32 %162, 1
  store i32 %163, ptr %22, align 4, !tbaa !11
  br label %86, !llvm.loop !18

164:                                              ; preds = %153, %143, %118, %91
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #7
  %165 = load i32, ptr %21, align 4
  switch i32 %165, label %168 [
    i32 2, label %167
  ]

166:                                              ; preds = %138, %113
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #7
  br label %171

167:                                              ; preds = %164
  store i32 0, ptr %21, align 4
  br label %168

168:                                              ; preds = %167, %164, %67
  call void @llvm.lifetime.end.p0(i64 16, ptr %20) #7
  %169 = load i32, ptr %21, align 4
  switch i32 %169, label %173 [
    i32 0, label %170
  ]

170:                                              ; preds = %168
  br label %172

171:                                              ; preds = %166, %81
  call void @llvm.lifetime.end.p0(i64 16, ptr %20) #7
  br label %174

172:                                              ; preds = %170, %44
  store i1 false, ptr %7, align 1
  store i32 1, ptr %21, align 4
  br label %173

173:                                              ; preds = %172, %168
  call void @_ZNSt10unique_ptrIN6Assimp8IOStreamESt14default_deleteIS1_EED2Ev(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
  br label %176

174:                                              ; preds = %171, %77
  call void @_ZNSt10unique_ptrIN6Assimp8IOStreamESt14default_deleteIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %15) #7
  br label %175

175:                                              ; preds = %174, %76
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  br label %178

176:                                              ; preds = %173, %37
  %177 = load i1, ptr %7, align 1
  ret i1 %177

178:                                              ; preds = %175
  %179 = load ptr, ptr %18, align 8
  %180 = load i32, ptr %19, align 4
  %181 = insertvalue { ptr, i32 } poison, ptr %179, 0
  %182 = insertvalue { ptr, i32 } %181, i32 %180, 1
  resume { ptr, i32 } %182
}

; 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) #5

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef zeroext i16 @_ZN6Assimp8ByteSwap7SwappedItEET_S2_(i16 noundef zeroext) #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_ZN6Assimp8ByteSwap7SwappedIjEET_S2_(i32 noundef) #3 align 2

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

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

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

!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 = !{!"int", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"vtable pointer", !8, i64 0}
!15 = !{!7, !7, i64 0}
!16 = !{!17, !17, i64 0}
!17 = !{!"short", !7, i64 0}
!18 = distinct !{!18, !19}
!19 = !{!"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.std::unique_ptr.8" = type { %"struct.std::__uniq_ptr_data.9" }
%"struct.std::__uniq_ptr_data.9" = type { %"class.std::__uniq_ptr_impl.10" }
%"class.std::__uniq_ptr_impl.10" = type { %"class.std::tuple.11" }
%"class.std::tuple.11" = type { %"struct.std::_Tuple_impl.12" }
%"struct.std::_Tuple_impl.12" = type { %"struct.std::_Head_base.15" }
%"struct.std::_Head_base.15" = type { ptr }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.std::allocator" = type { i8 }
%union.anon.24 = type { [4 x i32] }

@.str.1 = external hidden unnamed_addr constant [113 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.17 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.18 = external hidden unnamed_addr constant [7 x i8], align 1

declare void @_ZN6Assimp17aiAssertViolationEPKcS1_i(ptr noundef, ptr noundef, i32 noundef) 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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #2 align 2

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

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

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

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN6Assimp12BaseImporter15CheckMagicTokenEPNS_8IOSystemERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEPKvmjj(ptr noundef %0, ptr noundef nonnull align 8 dereferenceable(32) %1, ptr noundef readonly %2, i64 noundef %3, i32 noundef %4, i32 noundef %5) local_unnamed_addr #4 align 2 personality ptr @__gxx_personality_v0 {
  %7 = alloca %"class.std::unique_ptr.8", align 8
  %8 = alloca %"class.std::__cxx11::basic_string", align 8
  %9 = alloca %"class.std::allocator", align 1
  %10 = alloca %union.anon.24, align 4
  %11 = icmp ult i32 %5, 17
  br i1 %11, label %13, label %12

12:                                               ; preds = %6
  tail call void @_ZN6Assimp17aiAssertViolationEPKcS1_i(ptr noundef nonnull @.str.17, ptr noundef nonnull @.str.1, i32 noundef 306)
  br label %13

13:                                               ; preds = %12, %6
  %.not = icmp eq ptr %2, null
  br i1 %.not, label %14, label %15

14:                                               ; preds = %13
  tail call void @_ZN6Assimp17aiAssertViolationEPKcS1_i(ptr noundef nonnull @.str.18, ptr noundef nonnull @.str.1, i32 noundef 307)
  br label %15

15:                                               ; preds = %14, %13
  %.not55 = icmp eq ptr %0, null
  br i1 %.not55, label %72, label %16

16:                                               ; preds = %15
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #6
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %8) #6
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %9) #6
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %9) #6
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %8, ptr noundef nonnull @.str.13, ptr noundef nonnull align 1 dereferenceable(1) %9)
          to label %17 unwind label %56

17:                                               ; preds = %16
  %18 = invoke noundef ptr @_ZN6Assimp8IOSystem4OpenERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES8_(ptr noundef nonnull align 8 dereferenceable(32) %0, ptr noundef nonnull align 8 dereferenceable(32) %1, ptr noundef nonnull align 8 dereferenceable(32) %8)
          to label %19 unwind label %58

19:                                               ; preds = %17
  call void @_ZNSt10unique_ptrIN6Assimp8IOStreamESt14default_deleteIS1_EEC2IS3_vEEPS1_(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef %18) #6
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %8) #6
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %9) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %9) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %8) #6
  %20 = call noundef zeroext i1 @_ZNKSt10unique_ptrIN6Assimp8IOStreamESt14default_deleteIS1_EEcvbEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #6
  br i1 %20, label %21, label %69

21:                                               ; preds = %19
  %22 = call noundef ptr @_ZNKSt10unique_ptrIN6Assimp8IOStreamESt14default_deleteIS1_EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #6
  %23 = zext i32 %4 to i64
  %24 = load ptr, ptr %22, align 8, !tbaa !5
  %25 = getelementptr inbounds i8, ptr %24, i64 32
  %26 = load ptr, ptr %25, align 8
  %27 = invoke noundef i32 %26(ptr noundef nonnull align 8 dereferenceable(8) %22, i64 noundef %23, i32 noundef 0)
          to label %28 unwind label %61

28:                                               ; preds = %21
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %10) #6
  %29 = zext i32 %5 to i64
  %30 = call noundef ptr @_ZNKSt10unique_ptrIN6Assimp8IOStreamESt14default_deleteIS1_EEptEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #6
  %31 = load ptr, ptr %30, align 8, !tbaa !5
  %32 = getelementptr inbounds i8, ptr %31, i64 16
  %33 = load ptr, ptr %32, align 8
  %34 = invoke noundef i64 %33(ptr noundef nonnull align 8 dereferenceable(8) %30, ptr noundef nonnull %10, i64 noundef 1, i64 noundef %29)
          to label %35 unwind label %63

35:                                               ; preds = %28
  %.not57 = icmp eq i64 %34, %29
  br i1 %.not57, label %.preheader, label %.critedge68

.preheader:                                       ; preds = %35
  %.not64.not71.not = icmp eq i64 %3, 0
  br i1 %.not64.not71.not, label %.critedge70, label %.lr.ph

.lr.ph:                                           ; preds = %.preheader
  switch i32 %5, label %.lr.ph.split [
    i32 2, label %.lr.ph.split.us
    i32 4, label %.lr.ph.split.us76
  ]

.lr.ph.split.us:                                  ; preds = %.lr.ph, %.critedge.us
  %.03473.us = phi ptr [ %42, %.critedge.us ], [ %2, %.lr.ph ]
  %.03572.us = phi i32 [ %43, %.critedge.us ], [ 0, %.lr.ph ]
  %.0.copyload5.us = load i16, ptr %.03473.us, align 1
  %36 = load i16, ptr %10, align 4, !tbaa !8
  %37 = icmp eq i16 %36, %.0.copyload5.us
  br i1 %37, label %.split.us, label %38

38:                                               ; preds = %.lr.ph.split.us
  %39 = invoke noundef zeroext i16 @_ZN6Assimp8ByteSwap7SwappedItEET_S2_(i16 noundef zeroext %.0.copyload5.us)
          to label %40 unwind label %.split75.us

40:                                               ; preds = %38
  %41 = icmp eq i16 %36, %39
  br i1 %41, label %.split.us, label %.critedge.us

.critedge.us:                                     ; preds = %40
  %42 = getelementptr inbounds i8, ptr %.03473.us, i64 %29
  %43 = add i32 %.03572.us, 1
  %44 = zext i32 %43 to i64
  %.not64.not.us = icmp ult i64 %44, %3
  br i1 %.not64.not.us, label %.lr.ph.split.us, label %.critedge70, !llvm.loop !10

.split75.us:                                      ; preds = %38
  %45 = landingpad { ptr, i32 }
          cleanup
  br label %68

.lr.ph.split.us76:                                ; preds = %.lr.ph, %.critedge.us79
  %.03473.us77 = phi ptr [ %52, %.critedge.us79 ], [ %2, %.lr.ph ]
  %.03572.us78 = phi i32 [ %53, %.critedge.us79 ], [ 0, %.lr.ph ]
  %.0.copyload.us = load i32, ptr %.03473.us77, align 1
  %46 = load i32, ptr %10, align 4, !tbaa !8
  %47 = icmp eq i32 %46, %.0.copyload.us
  br i1 %47, label %.split.us, label %48

48:                                               ; preds = %.lr.ph.split.us76
  %49 = invoke noundef i32 @_ZN6Assimp8ByteSwap7SwappedIjEET_S2_(i32 noundef %.0.copyload.us)
          to label %50 unwind label %.split82.us

50:                                               ; preds = %48
  %51 = icmp eq i32 %46, %49
  br i1 %51, label %.split.us, label %.critedge.us79

.critedge.us79:                                   ; preds = %50
  %52 = getelementptr inbounds i8, ptr %.03473.us77, i64 %29
  %53 = add i32 %.03572.us78, 1
  %54 = zext i32 %53 to i64
  %.not64.not.us80 = icmp ult i64 %54, %3
  br i1 %.not64.not.us80, label %.lr.ph.split.us76, label %.critedge70, !llvm.loop !10

.split82.us:                                      ; preds = %48
  %55 = landingpad { ptr, i32 }
          cleanup
  br label %68

56:                                               ; preds = %16
  %57 = landingpad { ptr, i32 }
          cleanup
  br label %60

58:                                               ; preds = %17
  %59 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %8) #6
  br label %60

60:                                               ; preds = %58, %56
  %.pn = phi { ptr, i32 } [ %59, %58 ], [ %57, %56 ]
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %9) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %9) #6
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %8) #6
  br label %71

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

63:                                               ; preds = %28
  %64 = landingpad { ptr, i32 }
          cleanup
  br label %68

.lr.ph.split:                                     ; preds = %.lr.ph, %.critedge
  %.03473 = phi ptr [ %65, %.critedge ], [ %2, %.lr.ph ]
  %.03572 = phi i32 [ %66, %.critedge ], [ 0, %.lr.ph ]
  %bcmp = call i32 @bcmp(ptr %.03473, ptr nonnull %10, i64 %29)
  %.not58 = icmp eq i32 %bcmp, 0
  br i1 %.not58, label %.split.us, label %.critedge

.critedge:                                        ; preds = %.lr.ph.split
  %65 = getelementptr inbounds i8, ptr %.03473, i64 %29
  %66 = add i32 %.03572, 1
  %67 = zext i32 %66 to i64
  %.not64.not = icmp ult i64 %67, %3
  br i1 %.not64.not, label %.lr.ph.split, label %.critedge70, !llvm.loop !10

.split.us:                                        ; preds = %50, %.lr.ph.split.us76, %.lr.ph.split.us, %40, %.lr.ph.split
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %10) #6
  br label %69

68:                                               ; preds = %.split75.us, %.split82.us, %63
  %.pn59.pn = phi { ptr, i32 } [ %64, %63 ], [ %45, %.split75.us ], [ %55, %.split82.us ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %10) #6
  br label %70

.critedge70:                                      ; preds = %.critedge.us79, %.critedge.us, %.critedge, %.preheader
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %10) #6
  br label %69

.critedge68:                                      ; preds = %35
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %10) #6
  br label %69

69:                                               ; preds = %19, %.critedge70, %.split.us, %.critedge68
  %.6 = phi i1 [ true, %.split.us ], [ false, %.critedge68 ], [ false, %.critedge70 ], [ false, %19 ]
  call void @_ZNSt10unique_ptrIN6Assimp8IOStreamESt14default_deleteIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #6
  br label %72

70:                                               ; preds = %68, %61
  %.pn59.pn.pn = phi { ptr, i32 } [ %.pn59.pn, %68 ], [ %62, %61 ]
  call void @_ZNSt10unique_ptrIN6Assimp8IOStreamESt14default_deleteIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(8) %7) #6
  br label %71

71:                                               ; preds = %70, %60
  %.pn59.pn.pn.pn = phi { ptr, i32 } [ %.pn59.pn.pn, %70 ], [ %.pn, %60 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #6
  resume { ptr, i32 } %.pn59.pn.pn.pn

72:                                               ; preds = %15, %69
  %.7 = phi i1 [ %.6, %69 ], [ false, %15 ]
  ret i1 %.7
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef zeroext i16 @_ZN6Assimp8ByteSwap7SwappedItEET_S2_(i16 noundef zeroext) local_unnamed_addr #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_ZN6Assimp8ByteSwap7SwappedIjEET_S2_(i32 noundef) local_unnamed_addr #3 align 2

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

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

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

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"omnipotent char", !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}


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