; LLVM IR from Overload-Technologies/Overload :: Dependencies/assimp/code/Common/Base64.ll (ZN6Assimp6Base646DecodeEPKcmRPh)

; 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::__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 }

@.str = external hidden unnamed_addr constant [31 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [11 x i8], align 1
@_ZTI17DeadlyImportError = external dso_local constant { ptr, ptr, ptr }, align 8

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

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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i64 @_ZN6Assimp6Base646DecodeEPKcmRPh(ptr noundef %0, i64 noundef %1, ptr noundef nonnull align 8 dereferenceable(8) %2) #2 personality ptr @__gxx_personality_v0 {
  %4 = alloca i64, align 8
  %5 = alloca ptr, align 8
  %6 = alloca i64, align 8
  %7 = alloca ptr, align 8
  %8 = alloca %"class.std::__cxx11::basic_string", align 8
  %9 = alloca i64, align 8
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca %"class.std::allocator", align 1
  %13 = alloca i1, align 1
  %14 = alloca i32, align 4
  %15 = alloca i64, align 8
  %16 = alloca i64, align 8
  %17 = alloca i64, align 8
  %18 = alloca i8, align 1
  %19 = alloca i8, align 1
  %20 = alloca i8, align 1
  %21 = alloca i8, align 1
  %22 = alloca i8, align 1
  %23 = alloca i8, align 1
  %24 = alloca i8, align 1
  %25 = alloca i8, align 1
  store ptr %0, ptr %5, align 8, !tbaa !5
  store i64 %1, ptr %6, align 8, !tbaa !9
  store ptr %2, ptr %7, align 8, !tbaa !5
  %26 = load ptr, ptr %5, align 8, !tbaa !5
  %27 = icmp eq ptr %26, null
  br i1 %27, label %28, label %30

28:                                               ; preds = %3
  %29 = load ptr, ptr %7, align 8, !tbaa !5
  store ptr null, ptr %29, align 8, !tbaa !5
  store i64 0, ptr %4, align 8
  br label %237

30:                                               ; preds = %3
  %31 = load i64, ptr %6, align 8, !tbaa !9
  %32 = urem i64 %31, 4
  %33 = icmp ne i64 %32, 0
  br i1 %33, label %34, label %59

34:                                               ; preds = %30
  store i1 true, ptr %13, align 1
  %35 = call ptr @__cxa_allocate_exception(i64 16) #8
  call void @llvm.lifetime.start.p0(i64 32, ptr %8) #8
  %36 = load ptr, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #8
  store i64 32, ptr %9, align 8, !tbaa !9
  %37 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minImERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 8 dereferenceable(8) %6)
          to label %38 unwind label %42

38:                                               ; preds = %34
  %39 = load i64, ptr %37, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 1, ptr %12) #8
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %12) #8
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2EPKcmRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %8, ptr noundef %36, i64 noundef %39, ptr noundef nonnull align 1 dereferenceable(1) %12)
          to label %40 unwind label %46

40:                                               ; preds = %38
  invoke void @_ZN17DeadlyImportErrorC2IJRA31_KcNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERA11_S1_RmEEEDpOT_(ptr noundef nonnull align 8 dereferenceable(16) %35, ptr noundef nonnull align 1 dereferenceable(31) @.str, ptr noundef nonnull align 8 dereferenceable(32) %8, ptr noundef nonnull align 1 dereferenceable(11) @.str.1, ptr noundef nonnull align 8 dereferenceable(8) %6)
          to label %41 unwind label %50

41:                                               ; preds = %40
  store i1 false, ptr %13, align 1
  invoke void @__cxa_throw(ptr %35, ptr @_ZTI17DeadlyImportError, ptr @_ZNSt13runtime_errorD2Ev) #9
          to label %244 unwind label %50

42:                                               ; preds = %34
  %43 = landingpad { ptr, i32 }
          cleanup
  %44 = extractvalue { ptr, i32 } %43, 0
  store ptr %44, ptr %10, align 8
  %45 = extractvalue { ptr, i32 } %43, 1
  store i32 %45, ptr %11, align 4
  br label %55

46:                                               ; preds = %38
  %47 = landingpad { ptr, i32 }
          cleanup
  %48 = extractvalue { ptr, i32 } %47, 0
  store ptr %48, ptr %10, align 8
  %49 = extractvalue { ptr, i32 } %47, 1
  store i32 %49, ptr %11, align 4
  br label %54

50:                                               ; preds = %41, %40
  %51 = landingpad { ptr, i32 }
          cleanup
  %52 = extractvalue { ptr, i32 } %51, 0
  store ptr %52, ptr %10, align 8
  %53 = extractvalue { ptr, i32 } %51, 1
  store i32 %53, ptr %11, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %8) #8
  br label %54

54:                                               ; preds = %50, %46
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %12) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr %12) #8
  br label %55

55:                                               ; preds = %54, %42
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr %8) #8
  %56 = load i1, ptr %13, align 1
  br i1 %56, label %57, label %58

57:                                               ; preds = %55
  call void @__cxa_free_exception(ptr %35) #8
  br label %58

58:                                               ; preds = %57, %55
  br label %239

59:                                               ; preds = %30
  %60 = load i64, ptr %6, align 8, !tbaa !9
  %61 = icmp ult i64 %60, 4
  br i1 %61, label %62, label %64

62:                                               ; preds = %59
  %63 = load ptr, ptr %7, align 8, !tbaa !5
  store ptr null, ptr %63, align 8, !tbaa !5
  store i64 0, ptr %4, align 8
  br label %237

64:                                               ; preds = %59
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #8
  %65 = load ptr, ptr %5, align 8, !tbaa !5
  %66 = load i64, ptr %6, align 8, !tbaa !9
  %67 = sub i64 %66, 1
  %68 = getelementptr inbounds i8, ptr %65, i64 %67
  %69 = load i8, ptr %68, align 1, !tbaa !11
  %70 = sext i8 %69 to i32
  %71 = icmp eq i32 %70, 61
  %72 = zext i1 %71 to i32
  %73 = load ptr, ptr %5, align 8, !tbaa !5
  %74 = load i64, ptr %6, align 8, !tbaa !9
  %75 = sub i64 %74, 2
  %76 = getelementptr inbounds i8, ptr %73, i64 %75
  %77 = load i8, ptr %76, align 1, !tbaa !11
  %78 = sext i8 %77 to i32
  %79 = icmp eq i32 %78, 61
  %80 = zext i1 %79 to i32
  %81 = add nsw i32 %72, %80
  store i32 %81, ptr %14, align 4, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #8
  %82 = load i64, ptr %6, align 8, !tbaa !9
  %83 = mul i64 %82, 3
  %84 = udiv i64 %83, 4
  %85 = load i32, ptr %14, align 4, !tbaa !12
  %86 = sext i32 %85 to i64
  %87 = sub i64 %84, %86
  store i64 %87, ptr %15, align 8, !tbaa !9
  %88 = load i64, ptr %15, align 8, !tbaa !9
  %89 = call noalias noundef nonnull ptr @_Znam(i64 noundef %88) #10
  %90 = load ptr, ptr %7, align 8, !tbaa !5
  store ptr %89, ptr %90, align 8, !tbaa !5
  %91 = load ptr, ptr %7, align 8, !tbaa !5
  %92 = load ptr, ptr %91, align 8, !tbaa !5
  %93 = load i64, ptr %15, align 8, !tbaa !9
  call void @llvm.memset.p0.i64(ptr align 1 %92, i8 0, i64 %93, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #8
  store i64 0, ptr %17, align 8, !tbaa !9
  store i64 0, ptr %16, align 8, !tbaa !9
  br label %94

94:                                               ; preds = %161, %64
  %95 = load i64, ptr %16, align 8, !tbaa !9
  %96 = add i64 %95, 4
  %97 = load i64, ptr %6, align 8, !tbaa !9
  %98 = icmp ult i64 %96, %97
  br i1 %98, label %99, label %164

99:                                               ; preds = %94
  call void @llvm.lifetime.start.p0(i64 1, ptr %18) #8
  %100 = load ptr, ptr %5, align 8, !tbaa !5
  %101 = load i64, ptr %16, align 8, !tbaa !9
  %102 = getelementptr inbounds i8, ptr %100, i64 %101
  %103 = load i8, ptr %102, align 1, !tbaa !11
  %104 = call noundef zeroext i8 @_ZN6Assimp6Base6410DecodeCharEc(i8 noundef signext %103)
  store i8 %104, ptr %18, align 1, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 1, ptr %19) #8
  %105 = load ptr, ptr %5, align 8, !tbaa !5
  %106 = load i64, ptr %16, align 8, !tbaa !9
  %107 = add i64 %106, 1
  %108 = getelementptr inbounds i8, ptr %105, i64 %107
  %109 = load i8, ptr %108, align 1, !tbaa !11
  %110 = call noundef zeroext i8 @_ZN6Assimp6Base6410DecodeCharEc(i8 noundef signext %109)
  store i8 %110, ptr %19, align 1, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 1, ptr %20) #8
  %111 = load ptr, ptr %5, align 8, !tbaa !5
  %112 = load i64, ptr %16, align 8, !tbaa !9
  %113 = add i64 %112, 2
  %114 = getelementptr inbounds i8, ptr %111, i64 %113
  %115 = load i8, ptr %114, align 1, !tbaa !11
  %116 = call noundef zeroext i8 @_ZN6Assimp6Base6410DecodeCharEc(i8 noundef signext %115)
  store i8 %116, ptr %20, align 1, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 1, ptr %21) #8
  %117 = load ptr, ptr %5, align 8, !tbaa !5
  %118 = load i64, ptr %16, align 8, !tbaa !9
  %119 = add i64 %118, 3
  %120 = getelementptr inbounds i8, ptr %117, i64 %119
  %121 = load i8, ptr %120, align 1, !tbaa !11
  %122 = call noundef zeroext i8 @_ZN6Assimp6Base6410DecodeCharEc(i8 noundef signext %121)
  store i8 %122, ptr %21, align 1, !tbaa !11
  %123 = load i8, ptr %18, align 1, !tbaa !11
  %124 = zext i8 %123 to i32
  %125 = shl i32 %124, 2
  %126 = load i8, ptr %19, align 1, !tbaa !11
  %127 = zext i8 %126 to i32
  %128 = ashr i32 %127, 4
  %129 = or i32 %125, %128
  %130 = trunc i32 %129 to i8
  %131 = load ptr, ptr %7, align 8, !tbaa !5
  %132 = load ptr, ptr %131, align 8, !tbaa !5
  %133 = load i64, ptr %17, align 8, !tbaa !9
  %134 = add i64 %133, 1
  store i64 %134, ptr %17, align 8, !tbaa !9
  %135 = getelementptr inbounds i8, ptr %132, i64 %133
  store i8 %130, ptr %135, align 1, !tbaa !11
  %136 = load i8, ptr %19, align 1, !tbaa !11
  %137 = zext i8 %136 to i32
  %138 = shl i32 %137, 4
  %139 = load i8, ptr %20, align 1, !tbaa !11
  %140 = zext i8 %139 to i32
  %141 = ashr i32 %140, 2
  %142 = or i32 %138, %141
  %143 = trunc i32 %142 to i8
  %144 = load ptr, ptr %7, align 8, !tbaa !5
  %145 = load ptr, ptr %144, align 8, !tbaa !5
  %146 = load i64, ptr %17, align 8, !tbaa !9
  %147 = add i64 %146, 1
  store i64 %147, ptr %17, align 8, !tbaa !9
  %148 = getelementptr inbounds i8, ptr %145, i64 %146
  store i8 %143, ptr %148, align 1, !tbaa !11
  %149 = load i8, ptr %20, align 1, !tbaa !11
  %150 = zext i8 %149 to i32
  %151 = shl i32 %150, 6
  %152 = load i8, ptr %21, align 1, !tbaa !11
  %153 = zext i8 %152 to i32
  %154 = or i32 %151, %153
  %155 = trunc i32 %154 to i8
  %156 = load ptr, ptr %7, align 8, !tbaa !5
  %157 = load ptr, ptr %156, align 8, !tbaa !5
  %158 = load i64, ptr %17, align 8, !tbaa !9
  %159 = add i64 %158, 1
  store i64 %159, ptr %17, align 8, !tbaa !9
  %160 = getelementptr inbounds i8, ptr %157, i64 %158
  store i8 %155, ptr %160, align 1, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 1, ptr %21) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr %20) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr %19) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr %18) #8
  br label %161

161:                                              ; preds = %99
  %162 = load i64, ptr %16, align 8, !tbaa !9
  %163 = add i64 %162, 4
  store i64 %163, ptr %16, align 8, !tbaa !9
  br label %94, !llvm.loop !14

164:                                              ; preds = %94
  call void @llvm.lifetime.start.p0(i64 1, ptr %22) #8
  %165 = load ptr, ptr %5, align 8, !tbaa !5
  %166 = load i64, ptr %16, align 8, !tbaa !9
  %167 = getelementptr inbounds i8, ptr %165, i64 %166
  %168 = load i8, ptr %167, align 1, !tbaa !11
  %169 = call noundef zeroext i8 @_ZN6Assimp6Base6410DecodeCharEc(i8 noundef signext %168)
  store i8 %169, ptr %22, align 1, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 1, ptr %23) #8
  %170 = load ptr, ptr %5, align 8, !tbaa !5
  %171 = load i64, ptr %16, align 8, !tbaa !9
  %172 = add i64 %171, 1
  %173 = getelementptr inbounds i8, ptr %170, i64 %172
  %174 = load i8, ptr %173, align 1, !tbaa !11
  %175 = call noundef zeroext i8 @_ZN6Assimp6Base6410DecodeCharEc(i8 noundef signext %174)
  store i8 %175, ptr %23, align 1, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 1, ptr %24) #8
  %176 = load ptr, ptr %5, align 8, !tbaa !5
  %177 = load i64, ptr %16, align 8, !tbaa !9
  %178 = add i64 %177, 2
  %179 = getelementptr inbounds i8, ptr %176, i64 %178
  %180 = load i8, ptr %179, align 1, !tbaa !11
  %181 = call noundef zeroext i8 @_ZN6Assimp6Base6410DecodeCharEc(i8 noundef signext %180)
  store i8 %181, ptr %24, align 1, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 1, ptr %25) #8
  %182 = load ptr, ptr %5, align 8, !tbaa !5
  %183 = load i64, ptr %16, align 8, !tbaa !9
  %184 = add i64 %183, 3
  %185 = getelementptr inbounds i8, ptr %182, i64 %184
  %186 = load i8, ptr %185, align 1, !tbaa !11
  %187 = call noundef zeroext i8 @_ZN6Assimp6Base6410DecodeCharEc(i8 noundef signext %186)
  store i8 %187, ptr %25, align 1, !tbaa !11
  %188 = load i8, ptr %22, align 1, !tbaa !11
  %189 = zext i8 %188 to i32
  %190 = shl i32 %189, 2
  %191 = load i8, ptr %23, align 1, !tbaa !11
  %192 = zext i8 %191 to i32
  %193 = ashr i32 %192, 4
  %194 = or i32 %190, %193
  %195 = trunc i32 %194 to i8
  %196 = load ptr, ptr %7, align 8, !tbaa !5
  %197 = load ptr, ptr %196, align 8, !tbaa !5
  %198 = load i64, ptr %17, align 8, !tbaa !9
  %199 = add i64 %198, 1
  store i64 %199, ptr %17, align 8, !tbaa !9
  %200 = getelementptr inbounds i8, ptr %197, i64 %198
  store i8 %195, ptr %200, align 1, !tbaa !11
  %201 = load i8, ptr %24, align 1, !tbaa !11
  %202 = zext i8 %201 to i32
  %203 = icmp slt i32 %202, 64
  br i1 %203, label %204, label %218

204:                                              ; preds = %164
  %205 = load i8, ptr %23, align 1, !tbaa !11
  %206 = zext i8 %205 to i32
  %207 = shl i32 %206, 4
  %208 = load i8, ptr %24, align 1, !tbaa !11
  %209 = zext i8 %208 to i32
  %210 = ashr i32 %209, 2
  %211 = or i32 %207, %210
  %212 = trunc i32 %211 to i8
  %213 = load ptr, ptr %7, align 8, !tbaa !5
  %214 = load ptr, ptr %213, align 8, !tbaa !5
  %215 = load i64, ptr %17, align 8, !tbaa !9
  %216 = add i64 %215, 1
  store i64 %216, ptr %17, align 8, !tbaa !9
  %217 = getelementptr inbounds i8, ptr %214, i64 %215
  store i8 %212, ptr %217, align 1, !tbaa !11
  br label %218

218:                                              ; preds = %204, %164
  %219 = load i8, ptr %25, align 1, !tbaa !11
  %220 = zext i8 %219 to i32
  %221 = icmp slt i32 %220, 64
  br i1 %221, label %222, label %235

222:                                              ; preds = %218
  %223 = load i8, ptr %24, align 1, !tbaa !11
  %224 = zext i8 %223 to i32
  %225 = shl i32 %224, 6
  %226 = load i8, ptr %25, align 1, !tbaa !11
  %227 = zext i8 %226 to i32
  %228 = or i32 %225, %227
  %229 = trunc i32 %228 to i8
  %230 = load ptr, ptr %7, align 8, !tbaa !5
  %231 = load ptr, ptr %230, align 8, !tbaa !5
  %232 = load i64, ptr %17, align 8, !tbaa !9
  %233 = add i64 %232, 1
  store i64 %233, ptr %17, align 8, !tbaa !9
  %234 = getelementptr inbounds i8, ptr %231, i64 %232
  store i8 %229, ptr %234, align 1, !tbaa !11
  br label %235

235:                                              ; preds = %222, %218
  call void @llvm.lifetime.end.p0(i64 1, ptr %25) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr %24) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr %23) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr %22) #8
  %236 = load i64, ptr %15, align 8, !tbaa !9
  store i64 %236, ptr %4, align 8
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #8
  br label %237

237:                                              ; preds = %235, %62, %28
  %238 = load i64, ptr %4, align 8
  ret i64 %238

239:                                              ; preds = %58
  %240 = load ptr, ptr %10, align 8
  %241 = load i32, ptr %11, align 4
  %242 = insertvalue { ptr, i32 } poison, ptr %240, 0
  %243 = insertvalue { ptr, i32 } %242, i32 %241, 1
  resume { ptr, i32 } %243

244:                                              ; preds = %41
  unreachable
}

declare ptr @__cxa_allocate_exception(i64)

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

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

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

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

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

declare void @__cxa_throw(ptr, ptr, ptr)

declare void @__cxa_free_exception(ptr)

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znam(i64 noundef) #5

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef zeroext i8 @_ZN6Assimp6Base6410DecodeCharEc(i8 noundef signext) #7

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

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

!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 = !{!7, !7, i64 0}
!12 = !{!13, !13, i64 0}
!13 = !{!"int", !7, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"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::__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 }

@.str = external hidden unnamed_addr constant [31 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [11 x i8], align 1
@_ZTI17DeadlyImportError = external dso_local constant { ptr, ptr, ptr }, align 8

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

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

declare i32 @__gxx_personality_v0(...)

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

; Function Attrs: mustprogress uwtable
define dso_local noundef range(i64 -2, 4611686018427387904) i64 @_ZN6Assimp6Base646DecodeEPKcmRPh(ptr noundef %0, i64 noundef %1, ptr nocapture noundef nonnull align 8 dereferenceable(8) %2) local_unnamed_addr #2 personality ptr @__gxx_personality_v0 {
  %4 = alloca i64, align 8
  %5 = alloca %"class.std::__cxx11::basic_string", align 8
  %6 = alloca i64, align 8
  %7 = alloca %"class.std::allocator", align 1
  store i64 %1, ptr %4, align 8, !tbaa !5
  %8 = icmp eq ptr %0, null
  br i1 %8, label %9, label %10

9:                                                ; preds = %3
  store ptr null, ptr %2, align 8, !tbaa !9
  br label %108

10:                                               ; preds = %3
  %11 = and i64 %1, 3
  %.not = icmp eq i64 %11, 0
  br i1 %.not, label %22, label %12

12:                                               ; preds = %10
  %13 = tail call ptr @__cxa_allocate_exception(i64 16) #8
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %5) #8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #8
  store i64 32, ptr %6, align 8, !tbaa !5
  %14 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minImERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %4)
  %15 = load i64, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %7) #8
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %7) #8
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2EPKcmRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %5, ptr noundef nonnull %0, i64 noundef %15, ptr noundef nonnull align 1 dereferenceable(1) %7)
          to label %16 unwind label %.thread

16:                                               ; preds = %12
  invoke void @_ZN17DeadlyImportErrorC2IJRA31_KcNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERA11_S1_RmEEEDpOT_(ptr noundef nonnull align 8 dereferenceable(16) %13, ptr noundef nonnull align 1 dereferenceable(31) @.str, ptr noundef nonnull align 8 dereferenceable(32) %5, ptr noundef nonnull align 1 dereferenceable(11) @.str.1, ptr noundef nonnull align 8 dereferenceable(8) %4)
          to label %17 unwind label %19

17:                                               ; preds = %16
  invoke void @__cxa_throw(ptr nonnull %13, ptr nonnull @_ZTI17DeadlyImportError, ptr nonnull @_ZNSt13runtime_errorD2Ev) #9
          to label %110 unwind label %19

.thread:                                          ; preds = %12
  %18 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %7) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %7) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #8
  br label %21

19:                                               ; preds = %16, %17
  %.061 = phi i1 [ false, %17 ], [ true, %16 ]
  %20 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %5) #8
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %7) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %7) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #8
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %5) #8
  br i1 %.061, label %21, label %109

21:                                               ; preds = %.thread, %19
  %.pn76 = phi { ptr, i32 } [ %18, %.thread ], [ %20, %19 ]
  call void @__cxa_free_exception(ptr %13) #8
  br label %109

22:                                               ; preds = %10
  %23 = icmp ult i64 %1, 4
  br i1 %23, label %24, label %25

24:                                               ; preds = %22
  store ptr null, ptr %2, align 8, !tbaa !9
  br label %108

25:                                               ; preds = %22
  %26 = getelementptr i8, ptr %0, i64 %1
  %27 = getelementptr i8, ptr %26, i64 -1
  %28 = load i8, ptr %27, align 1, !tbaa !11
  %29 = icmp eq i8 %28, 61
  %.neg = sext i1 %29 to i64
  %30 = getelementptr i8, ptr %26, i64 -2
  %31 = load i8, ptr %30, align 1, !tbaa !11
  %32 = icmp eq i8 %31, 61
  %.neg70 = sext i1 %32 to i64
  %33 = mul i64 %1, 3
  %34 = lshr exact i64 %33, 2
  %.neg71 = add nsw i64 %34, %.neg
  %35 = add nsw i64 %.neg71, %.neg70
  %36 = tail call noalias noundef nonnull ptr @_Znam(i64 noundef %35) #10
  store ptr %36, ptr %2, align 8, !tbaa !9
  tail call void @llvm.memset.p0.i64(ptr nonnull align 1 %36, i8 0, i64 %35, i1 false)
  %.not81 = icmp eq i64 %1, 4
  br i1 %.not81, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %25, %.lr.ph
  %37 = phi i64 [ %70, %.lr.ph ], [ 4, %25 ]
  %.06278 = phi i64 [ %37, %.lr.ph ], [ 0, %25 ]
  %.06377 = phi i64 [ %67, %.lr.ph ], [ 0, %25 ]
  %38 = getelementptr inbounds i8, ptr %0, i64 %.06278
  %39 = load i8, ptr %38, align 1, !tbaa !11
  %40 = tail call noundef zeroext i8 @_ZN6Assimp6Base6410DecodeCharEc(i8 noundef signext %39)
  %41 = or disjoint i64 %.06278, 1
  %42 = getelementptr inbounds i8, ptr %0, i64 %41
  %43 = load i8, ptr %42, align 1, !tbaa !11
  %44 = tail call noundef zeroext i8 @_ZN6Assimp6Base6410DecodeCharEc(i8 noundef signext %43)
  %45 = or disjoint i64 %.06278, 2
  %46 = getelementptr inbounds i8, ptr %0, i64 %45
  %47 = load i8, ptr %46, align 1, !tbaa !11
  %48 = tail call noundef zeroext i8 @_ZN6Assimp6Base6410DecodeCharEc(i8 noundef signext %47)
  %49 = or disjoint i64 %.06278, 3
  %50 = getelementptr inbounds i8, ptr %0, i64 %49
  %51 = load i8, ptr %50, align 1, !tbaa !11
  %52 = tail call noundef zeroext i8 @_ZN6Assimp6Base6410DecodeCharEc(i8 noundef signext %51)
  %53 = shl i8 %40, 2
  %54 = lshr i8 %44, 4
  %55 = or i8 %54, %53
  %56 = load ptr, ptr %2, align 8, !tbaa !9
  %57 = getelementptr inbounds i8, ptr %56, i64 %.06377
  store i8 %55, ptr %57, align 1, !tbaa !11
  %58 = shl i8 %44, 4
  %59 = lshr i8 %48, 2
  %60 = or i8 %59, %58
  %61 = load ptr, ptr %2, align 8, !tbaa !9
  %62 = getelementptr i8, ptr %61, i64 %.06377
  %63 = getelementptr i8, ptr %62, i64 1
  store i8 %60, ptr %63, align 1, !tbaa !11
  %64 = shl i8 %48, 6
  %65 = or i8 %52, %64
  %66 = load ptr, ptr %2, align 8, !tbaa !9
  %67 = add i64 %.06377, 3
  %68 = getelementptr i8, ptr %66, i64 %.06377
  %69 = getelementptr i8, ptr %68, i64 2
  store i8 %65, ptr %69, align 1, !tbaa !11
  %70 = add i64 %37, 4
  %71 = icmp ult i64 %70, %1
  br i1 %71, label %.lr.ph, label %._crit_edge, !llvm.loop !12

._crit_edge:                                      ; preds = %.lr.ph, %25
  %.063.lcssa = phi i64 [ 0, %25 ], [ %67, %.lr.ph ]
  %.062.lcssa = phi i64 [ 0, %25 ], [ %37, %.lr.ph ]
  %72 = getelementptr inbounds i8, ptr %0, i64 %.062.lcssa
  %73 = load i8, ptr %72, align 1, !tbaa !11
  %74 = tail call noundef zeroext i8 @_ZN6Assimp6Base6410DecodeCharEc(i8 noundef signext %73)
  %75 = or disjoint i64 %.062.lcssa, 1
  %76 = getelementptr inbounds i8, ptr %0, i64 %75
  %77 = load i8, ptr %76, align 1, !tbaa !11
  %78 = tail call noundef zeroext i8 @_ZN6Assimp6Base6410DecodeCharEc(i8 noundef signext %77)
  %79 = or disjoint i64 %.062.lcssa, 2
  %80 = getelementptr inbounds i8, ptr %0, i64 %79
  %81 = load i8, ptr %80, align 1, !tbaa !11
  %82 = tail call noundef zeroext i8 @_ZN6Assimp6Base6410DecodeCharEc(i8 noundef signext %81)
  %83 = or disjoint i64 %.062.lcssa, 3
  %84 = getelementptr inbounds i8, ptr %0, i64 %83
  %85 = load i8, ptr %84, align 1, !tbaa !11
  %86 = tail call noundef zeroext i8 @_ZN6Assimp6Base6410DecodeCharEc(i8 noundef signext %85)
  %87 = shl i8 %74, 2
  %88 = lshr i8 %78, 4
  %89 = or i8 %88, %87
  %90 = load ptr, ptr %2, align 8, !tbaa !9
  %91 = add i64 %.063.lcssa, 1
  %92 = getelementptr inbounds i8, ptr %90, i64 %.063.lcssa
  store i8 %89, ptr %92, align 1, !tbaa !11
  %93 = icmp ult i8 %82, 64
  br i1 %93, label %94, label %101

94:                                               ; preds = %._crit_edge
  %95 = shl i8 %78, 4
  %96 = lshr i8 %82, 2
  %97 = or disjoint i8 %96, %95
  %98 = load ptr, ptr %2, align 8, !tbaa !9
  %99 = add i64 %.063.lcssa, 2
  %100 = getelementptr inbounds i8, ptr %98, i64 %91
  store i8 %97, ptr %100, align 1, !tbaa !11
  br label %101

101:                                              ; preds = %94, %._crit_edge
  %.164 = phi i64 [ %99, %94 ], [ %91, %._crit_edge ]
  %102 = icmp ult i8 %86, 64
  br i1 %102, label %103, label %108

103:                                              ; preds = %101
  %104 = shl i8 %82, 6
  %105 = or disjoint i8 %86, %104
  %106 = load ptr, ptr %2, align 8, !tbaa !9
  %107 = getelementptr inbounds i8, ptr %106, i64 %.164
  store i8 %105, ptr %107, align 1, !tbaa !11
  br label %108

108:                                              ; preds = %101, %103, %24, %9
  %.0 = phi i64 [ 0, %9 ], [ 0, %24 ], [ %35, %103 ], [ %35, %101 ]
  ret i64 %.0

109:                                              ; preds = %19, %21
  %.pn75 = phi { ptr, i32 } [ %20, %19 ], [ %.pn76, %21 ]
  resume { ptr, i32 } %.pn75

110:                                              ; preds = %17
  unreachable
}

declare ptr @__cxa_allocate_exception(i64) local_unnamed_addr

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

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

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

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

; 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

declare void @__cxa_free_exception(ptr) local_unnamed_addr

; Function Attrs: nobuiltin allocsize(0)
declare noundef nonnull ptr @_Znam(i64 noundef) local_unnamed_addr #5

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef zeroext i8 @_ZN6Assimp6Base6410DecodeCharEc(i8 noundef signext) local_unnamed_addr #7

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

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

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

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


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