; LLVM IR from filipwasil/fillwave :: src/flf/loaders/textureloader (TextureFactory)

; 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.anon = type { i32 }
%"class.std::unique_ptr" = type { %"struct.std::__uniq_ptr_data" }
%"struct.std::__uniq_ptr_data" = type { %"class.std::__uniq_ptr_impl" }
%"class.std::__uniq_ptr_impl" = type { %"class.std::tuple" }
%"class.std::tuple" = type { %"struct.std::_Tuple_impl" }
%"struct.std::_Tuple_impl" = type { %"struct.std::_Tuple_impl.0", %"struct.std::_Head_base.1" }
%"struct.std::_Tuple_impl.0" = type { %"struct.std::_Head_base" }
%"struct.std::_Head_base" = type { ptr }
%"struct.std::_Head_base.1" = type { ptr }
%"struct.flw::flc::TextureConfig" = type { %"struct.flw::flc::TextureConfig::Header", %"struct.flw::flc::TextureConfig::Content", i32, %"class.std::unique_ptr", %"class.std::vector" }
%"struct.flw::flc::TextureConfig::Header" = type { i32, i32, i32, i32, i32, i32 }
%"struct.flw::flc::TextureConfig::Content" = type { i32, i8, i8, i32, i32 }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<flw::flc::TextureConfig::Mipmap, flw::AllocatorStack<flw::flc::TextureConfig::Mipmap>>::_Vector_impl" }
%"struct.std::_Vector_base<flw::flc::TextureConfig::Mipmap, flw::AllocatorStack<flw::flc::TextureConfig::Mipmap>>::_Vector_impl" = type { %"class.flw::AllocatorStack", %"struct.std::_Vector_base<flw::flc::TextureConfig::Mipmap, flw::AllocatorStack<flw::flc::TextureConfig::Mipmap>>::_Vector_impl_data" }
%"class.flw::AllocatorStack" = type { %"struct.std::array" }
%"struct.std::array" = type { [32 x %"struct.flw::flc::TextureConfig::Mipmap"] }
%"struct.flw::flc::TextureConfig::Mipmap" = type { i32, i32, i32, i32, %"class.std::unique_ptr" }
%"struct.std::_Vector_base<flw::flc::TextureConfig::Mipmap, flw::AllocatorStack<flw::flc::TextureConfig::Mipmap>>::_Vector_impl_data" = type { ptr, ptr, ptr }

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

declare i32 @__gxx_personality_v0(...)

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

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

declare void @_ZN3flw3flc13TextureConfigC1Ev(ptr noundef nonnull align 8 dereferenceable(1112)) unnamed_addr #2

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

; Function Attrs: mustprogress uwtable
define dso_local noundef ptr @_ZN3flw3flf14TextureFactory25loadVirtualFileCheckboardEjjhhhj(i32 noundef %0, i32 noundef %1, i8 noundef zeroext %2, i8 noundef zeroext %3, i8 noundef zeroext %4, i32 noundef %5) #4 align 2 personality ptr @__gxx_personality_v0 {
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i8, align 1
  %10 = alloca i8, align 1
  %11 = alloca i8, align 1
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca %class.anon, align 4
  %15 = alloca i32, align 4
  %16 = alloca ptr, align 8
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca ptr, align 8
  %22 = alloca ptr, align 8
  %23 = alloca i32, align 4
  %24 = alloca %"class.std::unique_ptr", align 8
  store i32 %0, ptr %7, align 4, !tbaa !5
  store i32 %1, ptr %8, align 4, !tbaa !5
  store i8 %2, ptr %9, align 1, !tbaa !9
  store i8 %3, ptr %10, align 1, !tbaa !9
  store i8 %4, ptr %11, align 1, !tbaa !9
  store i32 %5, ptr %12, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #7
  %25 = getelementptr inbounds %class.anon, ptr %14, i32 0, i32 0
  %26 = load i32, ptr %12, align 4, !tbaa !5
  store i32 %26, ptr %25, align 4, !tbaa !10
  %27 = call noundef i32 @"_ZZN3flw3flf14TextureFactory25loadVirtualFileCheckboardEjjhhhjENK3$_0clEv"(ptr noundef nonnull align 4 dereferenceable(4) %14)
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  store i32 %27, ptr %13, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #7
  %28 = load i32, ptr %13, align 4, !tbaa !5
  %29 = load i32, ptr %7, align 4, !tbaa !5
  %30 = mul i32 %28, %29
  %31 = load i32, ptr %8, align 4, !tbaa !5
  %32 = mul i32 %30, %31
  %33 = zext i32 %32 to i64
  %34 = mul i64 %33, 1
  %35 = trunc i64 %34 to i32
  store i32 %35, ptr %15, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #7
  %36 = load i32, ptr %15, align 4, !tbaa !5
  %37 = sext i32 %36 to i64
  %38 = call noalias noundef nonnull ptr @_Znam(i64 noundef %37) #8
  store ptr %38, ptr %16, align 8, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #7
  store i32 0, ptr %18, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #7
  store i32 0, ptr %19, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #7
  store i32 0, ptr %20, align 4, !tbaa !5
  store i32 0, ptr %17, align 4, !tbaa !5
  br label %39

39:                                               ; preds = %109, %6
  %40 = load i32, ptr %17, align 4, !tbaa !5
  %41 = load i32, ptr %15, align 4, !tbaa !5
  %42 = icmp slt i32 %40, %41
  br i1 %42, label %43, label %113

43:                                               ; preds = %39
  %44 = load i32, ptr %17, align 4, !tbaa !5
  %45 = load i32, ptr %7, align 4, !tbaa !5
  %46 = load i32, ptr %13, align 4, !tbaa !5
  %47 = mul i32 %45, %46
  %48 = mul i32 %47, 8
  %49 = urem i32 %44, %48
  %50 = icmp eq i32 %49, 0
  br i1 %50, label %51, label %64

51:                                               ; preds = %43
  %52 = load i8, ptr %9, align 1, !tbaa !9
  %53 = zext i8 %52 to i32
  %54 = load i32, ptr %18, align 4, !tbaa !5
  %55 = xor i32 %54, %53
  store i32 %55, ptr %18, align 4, !tbaa !5
  %56 = load i8, ptr %10, align 1, !tbaa !9
  %57 = zext i8 %56 to i32
  %58 = load i32, ptr %19, align 4, !tbaa !5
  %59 = xor i32 %58, %57
  store i32 %59, ptr %19, align 4, !tbaa !5
  %60 = load i8, ptr %11, align 1, !tbaa !9
  %61 = zext i8 %60 to i32
  %62 = load i32, ptr %20, align 4, !tbaa !5
  %63 = xor i32 %62, %61
  store i32 %63, ptr %20, align 4, !tbaa !5
  br label %64

64:                                               ; preds = %51, %43
  %65 = load i32, ptr %17, align 4, !tbaa !5
  %66 = load i32, ptr %13, align 4, !tbaa !5
  %67 = mul nsw i32 %66, 8
  %68 = srem i32 %65, %67
  %69 = icmp eq i32 %68, 0
  br i1 %69, label %70, label %83

70:                                               ; preds = %64
  %71 = load i8, ptr %9, align 1, !tbaa !9
  %72 = zext i8 %71 to i32
  %73 = load i32, ptr %18, align 4, !tbaa !5
  %74 = xor i32 %73, %72
  store i32 %74, ptr %18, align 4, !tbaa !5
  %75 = load i8, ptr %10, align 1, !tbaa !9
  %76 = zext i8 %75 to i32
  %77 = load i32, ptr %19, align 4, !tbaa !5
  %78 = xor i32 %77, %76
  store i32 %78, ptr %19, align 4, !tbaa !5
  %79 = load i8, ptr %11, align 1, !tbaa !9
  %80 = zext i8 %79 to i32
  %81 = load i32, ptr %20, align 4, !tbaa !5
  %82 = xor i32 %81, %80
  store i32 %82, ptr %20, align 4, !tbaa !5
  br label %83

83:                                               ; preds = %70, %64
  %84 = load i32, ptr %18, align 4, !tbaa !5
  %85 = trunc i32 %84 to i8
  %86 = load ptr, ptr %16, align 8, !tbaa !12
  %87 = load i32, ptr %17, align 4, !tbaa !5
  %88 = sext i32 %87 to i64
  %89 = getelementptr inbounds i8, ptr %86, i64 %88
  store i8 %85, ptr %89, align 1, !tbaa !9
  %90 = load i32, ptr %19, align 4, !tbaa !5
  %91 = trunc i32 %90 to i8
  %92 = load ptr, ptr %16, align 8, !tbaa !12
  %93 = load i32, ptr %17, align 4, !tbaa !5
  %94 = add nsw i32 %93, 1
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds i8, ptr %92, i64 %95
  store i8 %91, ptr %96, align 1, !tbaa !9
  %97 = load i32, ptr %20, align 4, !tbaa !5
  %98 = trunc i32 %97 to i8
  %99 = load ptr, ptr %16, align 8, !tbaa !12
  %100 = load i32, ptr %17, align 4, !tbaa !5
  %101 = add nsw i32 %100, 2
  %102 = sext i32 %101 to i64
  %103 = getelementptr inbounds i8, ptr %99, i64 %102
  store i8 %98, ptr %103, align 1, !tbaa !9
  %104 = load ptr, ptr %16, align 8, !tbaa !12
  %105 = load i32, ptr %17, align 4, !tbaa !5
  %106 = add nsw i32 %105, 3
  %107 = sext i32 %106 to i64
  %108 = getelementptr inbounds i8, ptr %104, i64 %107
  store i8 1, ptr %108, align 1, !tbaa !9
  br label %109

109:                                              ; preds = %83
  %110 = load i32, ptr %13, align 4, !tbaa !5
  %111 = load i32, ptr %17, align 4, !tbaa !5
  %112 = add nsw i32 %111, %110
  store i32 %112, ptr %17, align 4, !tbaa !5
  br label %39, !llvm.loop !14

113:                                              ; preds = %39
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #7
  %114 = call noalias noundef nonnull ptr @_Znwm(i64 noundef 1112) #8
  invoke void @_ZN3flw3flc13TextureConfigC1Ev(ptr noundef nonnull align 8 dereferenceable(1112) %114)
          to label %115 unwind label %154

115:                                              ; preds = %113
  store ptr %114, ptr %21, align 8, !tbaa !12
  %116 = load i32, ptr %12, align 4, !tbaa !5
  %117 = load ptr, ptr %21, align 8, !tbaa !12
  %118 = getelementptr inbounds %"struct.flw::flc::TextureConfig", ptr %117, i32 0, i32 0
  %119 = getelementptr inbounds %"struct.flw::flc::TextureConfig::Header", ptr %118, i32 0, i32 4
  store i32 %116, ptr %119, align 8, !tbaa !16
  %120 = load i32, ptr %12, align 4, !tbaa !5
  %121 = load ptr, ptr %21, align 8, !tbaa !12
  %122 = getelementptr inbounds %"struct.flw::flc::TextureConfig", ptr %121, i32 0, i32 0
  %123 = getelementptr inbounds %"struct.flw::flc::TextureConfig::Header", ptr %122, i32 0, i32 0
  store i32 %120, ptr %123, align 8, !tbaa !35
  %124 = load i32, ptr %7, align 4, !tbaa !5
  %125 = load ptr, ptr %21, align 8, !tbaa !12
  %126 = getelementptr inbounds %"struct.flw::flc::TextureConfig", ptr %125, i32 0, i32 0
  %127 = getelementptr inbounds %"struct.flw::flc::TextureConfig::Header", ptr %126, i32 0, i32 2
  store i32 %124, ptr %127, align 8, !tbaa !36
  %128 = load i32, ptr %8, align 4, !tbaa !5
  %129 = load ptr, ptr %21, align 8, !tbaa !12
  %130 = getelementptr inbounds %"struct.flw::flc::TextureConfig", ptr %129, i32 0, i32 0
  %131 = getelementptr inbounds %"struct.flw::flc::TextureConfig::Header", ptr %130, i32 0, i32 1
  store i32 %128, ptr %131, align 4, !tbaa !37
  %132 = load ptr, ptr %21, align 8, !tbaa !12
  %133 = getelementptr inbounds %"struct.flw::flc::TextureConfig", ptr %132, i32 0, i32 0
  %134 = getelementptr inbounds %"struct.flw::flc::TextureConfig::Header", ptr %133, i32 0, i32 3
  store i32 5121, ptr %134, align 4, !tbaa !38
  %135 = load ptr, ptr %21, align 8, !tbaa !12
  %136 = getelementptr inbounds %"struct.flw::flc::TextureConfig", ptr %135, i32 0, i32 1
  %137 = getelementptr inbounds %"struct.flw::flc::TextureConfig::Content", ptr %136, i32 0, i32 1
  store i8 1, ptr %137, align 4, !tbaa !39
  %138 = load ptr, ptr %21, align 8, !tbaa !12
  %139 = getelementptr inbounds %"struct.flw::flc::TextureConfig", ptr %138, i32 0, i32 1
  %140 = getelementptr inbounds %"struct.flw::flc::TextureConfig::Content", ptr %139, i32 0, i32 0
  store i32 0, ptr %140, align 8, !tbaa !40
  %141 = load ptr, ptr %21, align 8, !tbaa !12
  %142 = getelementptr inbounds %"struct.flw::flc::TextureConfig", ptr %141, i32 0, i32 1
  %143 = getelementptr inbounds %"struct.flw::flc::TextureConfig::Content", ptr %142, i32 0, i32 2
  store i8 0, ptr %143, align 1, !tbaa !41
  %144 = load ptr, ptr %21, align 8, !tbaa !12
  %145 = getelementptr inbounds %"struct.flw::flc::TextureConfig", ptr %144, i32 0, i32 1
  %146 = getelementptr inbounds %"struct.flw::flc::TextureConfig::Content", ptr %145, i32 0, i32 3
  store i32 0, ptr %146, align 8, !tbaa !42
  call void @llvm.lifetime.start.p0(i64 16, ptr %24) #7
  %147 = load ptr, ptr %16, align 8, !tbaa !12
  call void @_ZN3flw25make_pu_with_no_ownershipIhEESt10unique_ptrIT_PFvPS2_EES3_(ptr dead_on_unwind writable sret(%"class.std::unique_ptr") align 8 %24, ptr noundef %147)
  %148 = load ptr, ptr %21, align 8, !tbaa !12
  %149 = getelementptr inbounds %"struct.flw::flc::TextureConfig", ptr %148, i32 0, i32 3
  %150 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt10unique_ptrIhPFvPhEEaSEOS3_(ptr noundef nonnull align 8 dereferenceable(16) %149, ptr noundef nonnull align 8 dereferenceable(16) %24) #7
  call void @_ZNSt10unique_ptrIhPFvPhEED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %24) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %24) #7
  %151 = load ptr, ptr %21, align 8, !tbaa !12
  %152 = getelementptr inbounds %"struct.flw::flc::TextureConfig", ptr %151, i32 0, i32 2
  store i32 2, ptr %152, align 8, !tbaa !43
  %153 = load ptr, ptr %21, align 8, !tbaa !12
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  ret ptr %153

154:                                              ; preds = %113
  %155 = landingpad { ptr, i32 }
          cleanup
  %156 = extractvalue { ptr, i32 } %155, 0
  store ptr %156, ptr %22, align 8
  %157 = extractvalue { ptr, i32 } %155, 1
  store i32 %157, ptr %23, align 4
  call void @_ZdlPvm(ptr noundef %114, i64 noundef 1112) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  br label %158

158:                                              ; preds = %154
  %159 = load ptr, ptr %22, align 8
  %160 = load i32, ptr %23, align 4
  %161 = insertvalue { ptr, i32 } poison, ptr %159, 0
  %162 = insertvalue { ptr, i32 } %161, i32 %160, 1
  resume { ptr, i32 } %162
}

; Function Attrs: inlinehint mustprogress uwtable
declare hidden noundef i32 @"_ZZN3flw3flf14TextureFactory25loadVirtualFileCheckboardEjjhhhjENK3$_0clEv"(ptr noundef nonnull align 4 dereferenceable(4)) #5 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3flw25make_pu_with_no_ownershipIhEESt10unique_ptrIT_PFvPS2_EES3_(ptr dead_on_unwind noalias writable sret(%"class.std::unique_ptr") align 8, ptr noundef) #6

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

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = !{!11, !6, i64 0}
!11 = !{!"_ZTSZN3flw3flf14TextureFactory25loadVirtualFileCheckboardEjjhhhjE3$_0", !6, i64 0}
!12 = !{!13, !13, i64 0}
!13 = !{!"any pointer", !7, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = !{!17, !6, i64 16}
!17 = !{!"_ZTSN3flw3flc13TextureConfigE", !18, i64 0, !19, i64 24, !20, i64 40, !21, i64 48, !29, i64 64}
!18 = !{!"_ZTSN3flw3flc13TextureConfig6HeaderE", !6, i64 0, !6, i64 4, !6, i64 8, !6, i64 12, !6, i64 16, !6, i64 20}
!19 = !{!"_ZTSN3flw3flc13TextureConfig7ContentE", !6, i64 0, !7, i64 4, !7, i64 5, !6, i64 8, !6, i64 12}
!20 = !{!"_ZTSN3flw3flc17EMemoryAllocationE", !7, i64 0}
!21 = !{!"_ZTSSt10unique_ptrIhPFvPhEE", !22, i64 0}
!22 = !{!"_ZTSSt15__uniq_ptr_dataIhPFvPhELb1ELb1EE", !23, i64 0}
!23 = !{!"_ZTSSt15__uniq_ptr_implIhPFvPhEE", !24, i64 0}
!24 = !{!"_ZTSSt5tupleIJPhPFvS0_EEE", !25, i64 0}
!25 = !{!"_ZTSSt11_Tuple_implILm0EJPhPFvS0_EEE", !26, i64 0, !28, i64 8}
!26 = !{!"_ZTSSt11_Tuple_implILm1EJPFvPhEEE", !27, i64 0}
!27 = !{!"_ZTSSt10_Head_baseILm1EPFvPhELb0EE", !13, i64 0}
!28 = !{!"_ZTSSt10_Head_baseILm0EPhLb0EE", !13, i64 0}
!29 = !{!"_ZTSSt6vectorIN3flw3flc13TextureConfig6MipmapENS0_14AllocatorStackIS3_EEE", !30, i64 0}
!30 = !{!"_ZTSSt12_Vector_baseIN3flw3flc13TextureConfig6MipmapENS0_14AllocatorStackIS3_EEE", !31, i64 0}
!31 = !{!"_ZTSNSt12_Vector_baseIN3flw3flc13TextureConfig6MipmapENS0_14AllocatorStackIS3_EEE12_Vector_implE", !32, i64 0, !34, i64 1024}
!32 = !{!"_ZTSN3flw14AllocatorStackINS_3flc13TextureConfig6MipmapEEE", !33, i64 0}
!33 = !{!"_ZTSSt5arrayIN3flw3flc13TextureConfig6MipmapELm32EE", !7, i64 0}
!34 = !{!"_ZTSNSt12_Vector_baseIN3flw3flc13TextureConfig6MipmapENS0_14AllocatorStackIS3_EEE17_Vector_impl_dataE", !13, i64 0, !13, i64 8, !13, i64 16}
!35 = !{!17, !6, i64 0}
!36 = !{!17, !6, i64 8}
!37 = !{!17, !6, i64 4}
!38 = !{!17, !6, i64 12}
!39 = !{!17, !7, i64 28}
!40 = !{!17, !6, i64 24}
!41 = !{!17, !7, i64 29}
!42 = !{!17, !6, i64 32}
!43 = !{!17, !20, i64 40}


; 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.anon = type { i32 }
%"class.std::unique_ptr" = type { %"struct.std::__uniq_ptr_data" }
%"struct.std::__uniq_ptr_data" = type { %"class.std::__uniq_ptr_impl" }
%"class.std::__uniq_ptr_impl" = type { %"class.std::tuple" }
%"class.std::tuple" = type { %"struct.std::_Tuple_impl" }
%"struct.std::_Tuple_impl" = type { %"struct.std::_Tuple_impl.0", %"struct.std::_Head_base.1" }
%"struct.std::_Tuple_impl.0" = type { %"struct.std::_Head_base" }
%"struct.std::_Head_base" = type { ptr }
%"struct.std::_Head_base.1" = type { ptr }

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

declare i32 @__gxx_personality_v0(...)

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

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

declare void @_ZN3flw3flc13TextureConfigC1Ev(ptr noundef nonnull align 8 dereferenceable(1112)) unnamed_addr #2

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

; Function Attrs: mustprogress uwtable
define dso_local noundef nonnull ptr @_ZN3flw3flf14TextureFactory25loadVirtualFileCheckboardEjjhhhj(i32 noundef %0, i32 noundef %1, i8 noundef zeroext %2, i8 noundef zeroext %3, i8 noundef zeroext %4, i32 noundef %5) local_unnamed_addr #4 align 2 personality ptr @__gxx_personality_v0 {
  %7 = alloca %class.anon, align 4
  %8 = alloca %"class.std::unique_ptr", align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #7
  store i32 %5, ptr %7, align 4, !tbaa !5
  %9 = call noundef i32 @"_ZZN3flw3flf14TextureFactory25loadVirtualFileCheckboardEjjhhhjENK3$_0clEv"(ptr noundef nonnull align 4 dereferenceable(4) %7)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #7
  %10 = mul i32 %9, %0
  %11 = mul i32 %10, %1
  %12 = sext i32 %11 to i64
  %13 = call noalias noundef nonnull ptr @_Znam(i64 noundef %12) #8
  %14 = icmp sgt i32 %11, 0
  br i1 %14, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %6
  %15 = shl i32 %10, 3
  %16 = shl nsw i32 %9, 3
  %17 = sext i32 %9 to i64
  br label %18

18:                                               ; preds = %.lr.ph, %18
  %indvars.iv = phi i64 [ 0, %.lr.ph ], [ %indvars.iv.next, %18 ]
  %.05564 = phi i8 [ 0, %.lr.ph ], [ %.2, %18 ]
  %.05663 = phi i8 [ 0, %.lr.ph ], [ %.258, %18 ]
  %.05962 = phi i8 [ 0, %.lr.ph ], [ %.261, %18 ]
  %19 = trunc nsw i64 %indvars.iv to i32
  %20 = urem i32 %19, %15
  %21 = icmp eq i32 %20, 0
  %22 = select i1 %21, i8 %4, i8 0
  %.160 = xor i8 %.05962, %22
  %23 = select i1 %21, i8 %3, i8 0
  %.157 = xor i8 %.05663, %23
  %24 = select i1 %21, i8 %2, i8 0
  %.1 = xor i8 %.05564, %24
  %25 = srem i32 %19, %16
  %26 = icmp eq i32 %25, 0
  %27 = select i1 %26, i8 %4, i8 0
  %.261 = xor i8 %.160, %27
  %28 = select i1 %26, i8 %3, i8 0
  %.258 = xor i8 %.157, %28
  %29 = select i1 %26, i8 %2, i8 0
  %.2 = xor i8 %.1, %29
  %30 = getelementptr inbounds i8, ptr %13, i64 %indvars.iv
  store i8 %.2, ptr %30, align 1, !tbaa !10
  %31 = getelementptr i8, ptr %30, i64 1
  store i8 %.258, ptr %31, align 1, !tbaa !10
  %32 = getelementptr i8, ptr %30, i64 2
  store i8 %.261, ptr %32, align 1, !tbaa !10
  %33 = getelementptr i8, ptr %30, i64 3
  store i8 1, ptr %33, align 1, !tbaa !10
  %indvars.iv.next = add nsw i64 %indvars.iv, %17
  %34 = icmp slt i64 %indvars.iv.next, %12
  br i1 %34, label %18, label %._crit_edge, !llvm.loop !11

._crit_edge:                                      ; preds = %18, %6
  %35 = call noalias noundef nonnull dereferenceable(1112) ptr @_Znwm(i64 noundef 1112) #8
  invoke void @_ZN3flw3flc13TextureConfigC1Ev(ptr noundef nonnull align 8 dereferenceable(1112) %35)
          to label %36 unwind label %48

36:                                               ; preds = %._crit_edge
  %37 = getelementptr inbounds i8, ptr %35, i64 16
  store i32 %5, ptr %37, align 8, !tbaa !13
  store i32 %5, ptr %35, align 8, !tbaa !33
  %38 = getelementptr inbounds i8, ptr %35, i64 8
  store i32 %0, ptr %38, align 8, !tbaa !34
  %39 = getelementptr inbounds i8, ptr %35, i64 4
  store i32 %1, ptr %39, align 4, !tbaa !35
  %40 = getelementptr inbounds i8, ptr %35, i64 12
  store i32 5121, ptr %40, align 4, !tbaa !36
  %41 = getelementptr inbounds i8, ptr %35, i64 24
  %42 = getelementptr inbounds i8, ptr %35, i64 28
  store i8 1, ptr %42, align 4, !tbaa !37
  store i32 0, ptr %41, align 8, !tbaa !38
  %43 = getelementptr inbounds i8, ptr %35, i64 29
  store i8 0, ptr %43, align 1, !tbaa !39
  %44 = getelementptr inbounds i8, ptr %35, i64 32
  store i32 0, ptr %44, align 8, !tbaa !40
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %8) #7
  call void @_ZN3flw25make_pu_with_no_ownershipIhEESt10unique_ptrIT_PFvPS2_EES3_(ptr dead_on_unwind nonnull writable sret(%"class.std::unique_ptr") align 8 %8, ptr noundef nonnull %13)
  %45 = getelementptr inbounds i8, ptr %35, i64 48
  %46 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt10unique_ptrIhPFvPhEEaSEOS3_(ptr noundef nonnull align 8 dereferenceable(16) %45, ptr noundef nonnull align 8 dereferenceable(16) %8) #7
  call void @_ZNSt10unique_ptrIhPFvPhEED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %8) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %8) #7
  %47 = getelementptr inbounds i8, ptr %35, i64 40
  store i32 2, ptr %47, align 8, !tbaa !41
  ret ptr %35

48:                                               ; preds = %._crit_edge
  %49 = landingpad { ptr, i32 }
          cleanup
  call void @_ZdlPvm(ptr noundef nonnull %35, i64 noundef 1112) #9
  resume { ptr, i32 } %49
}

; Function Attrs: inlinehint mustprogress uwtable
declare hidden noundef i32 @"_ZZN3flw3flf14TextureFactory25loadVirtualFileCheckboardEjjhhhjENK3$_0clEv"(ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #5 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN3flw25make_pu_with_no_ownershipIhEESt10unique_ptrIT_PFvPS2_EES3_(ptr dead_on_unwind noalias writable sret(%"class.std::unique_ptr") align 8, ptr noundef) local_unnamed_addr #6

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

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !7, i64 0}
!6 = !{!"_ZTSZN3flw3flf14TextureFactory25loadVirtualFileCheckboardEjjhhhjE3$_0", !7, i64 0}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!8, !8, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!14, !7, i64 16}
!14 = !{!"_ZTSN3flw3flc13TextureConfigE", !15, i64 0, !16, i64 24, !17, i64 40, !18, i64 48, !27, i64 64}
!15 = !{!"_ZTSN3flw3flc13TextureConfig6HeaderE", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !7, i64 16, !7, i64 20}
!16 = !{!"_ZTSN3flw3flc13TextureConfig7ContentE", !7, i64 0, !8, i64 4, !8, i64 5, !7, i64 8, !7, i64 12}
!17 = !{!"_ZTSN3flw3flc17EMemoryAllocationE", !8, i64 0}
!18 = !{!"_ZTSSt10unique_ptrIhPFvPhEE", !19, i64 0}
!19 = !{!"_ZTSSt15__uniq_ptr_dataIhPFvPhELb1ELb1EE", !20, i64 0}
!20 = !{!"_ZTSSt15__uniq_ptr_implIhPFvPhEE", !21, i64 0}
!21 = !{!"_ZTSSt5tupleIJPhPFvS0_EEE", !22, i64 0}
!22 = !{!"_ZTSSt11_Tuple_implILm0EJPhPFvS0_EEE", !23, i64 0, !26, i64 8}
!23 = !{!"_ZTSSt11_Tuple_implILm1EJPFvPhEEE", !24, i64 0}
!24 = !{!"_ZTSSt10_Head_baseILm1EPFvPhELb0EE", !25, i64 0}
!25 = !{!"any pointer", !8, i64 0}
!26 = !{!"_ZTSSt10_Head_baseILm0EPhLb0EE", !25, i64 0}
!27 = !{!"_ZTSSt6vectorIN3flw3flc13TextureConfig6MipmapENS0_14AllocatorStackIS3_EEE", !28, i64 0}
!28 = !{!"_ZTSSt12_Vector_baseIN3flw3flc13TextureConfig6MipmapENS0_14AllocatorStackIS3_EEE", !29, i64 0}
!29 = !{!"_ZTSNSt12_Vector_baseIN3flw3flc13TextureConfig6MipmapENS0_14AllocatorStackIS3_EEE12_Vector_implE", !30, i64 0, !32, i64 1024}
!30 = !{!"_ZTSN3flw14AllocatorStackINS_3flc13TextureConfig6MipmapEEE", !31, i64 0}
!31 = !{!"_ZTSSt5arrayIN3flw3flc13TextureConfig6MipmapELm32EE", !8, i64 0}
!32 = !{!"_ZTSNSt12_Vector_baseIN3flw3flc13TextureConfig6MipmapENS0_14AllocatorStackIS3_EEE17_Vector_impl_dataE", !25, i64 0, !25, i64 8, !25, i64 16}
!33 = !{!14, !7, i64 0}
!34 = !{!14, !7, i64 8}
!35 = !{!14, !7, i64 4}
!36 = !{!14, !7, i64 12}
!37 = !{!14, !8, i64 28}
!38 = !{!14, !7, i64 24}
!39 = !{!14, !8, i64 29}
!40 = !{!14, !7, i64 32}
!41 = !{!14, !17, i64 40}


; Effective O3 passes: AggressiveInstCombinePass,CorrelatedValuePropagationPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass