; LLVM IR from filipwasil/fillwave :: ext/nv_helpers_gl (nv_dds)

; 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::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"struct.nv_dds::DDS_HEADER" = type { i32, i32, i32, i32, i32, i32, i32, [11 x i32], %"struct.nv_dds::DDS_PIXELFORMAT", i32, i32, [3 x i32] }
%"struct.nv_dds::DDS_PIXELFORMAT" = type { i32, i32, i32, i32, i32, i32, i32, i32 }
%"class.nv_dds::CTexture" = type { %"class.nv_dds::CSurface", %"class.std::deque.0" }
%"class.nv_dds::CSurface" = type { ptr, i32, i32, i32, i32, ptr }
%"class.std::deque.0" = type { %"class.std::_Deque_base.1" }
%"class.std::_Deque_base.1" = type { %"struct.std::_Deque_base<nv_dds::CSurface, std::allocator<nv_dds::CSurface>>::_Deque_impl" }
%"struct.std::_Deque_base<nv_dds::CSurface, std::allocator<nv_dds::CSurface>>::_Deque_impl" = type { %"struct.std::_Deque_base<nv_dds::CSurface, std::allocator<nv_dds::CSurface>>::_Deque_impl_data" }
%"struct.std::_Deque_base<nv_dds::CSurface, std::allocator<nv_dds::CSurface>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator.5", %"struct.std::_Deque_iterator.5" }
%"struct.std::_Deque_iterator.5" = type { ptr, ptr, ptr, ptr }
%"class.nv_dds::CDDSImage" = type { i32, i32, i32, i32, i8, %"class.std::deque" }
%"class.std::deque" = type { %"class.std::_Deque_base" }
%"class.std::_Deque_base" = type { %"struct.std::_Deque_base<nv_dds::CTexture, std::allocator<nv_dds::CTexture>>::_Deque_impl" }
%"struct.std::_Deque_base<nv_dds::CTexture, std::allocator<nv_dds::CTexture>>::_Deque_impl" = type { %"struct.std::_Deque_base<nv_dds::CTexture, std::allocator<nv_dds::CTexture>>::_Deque_impl_data" }
%"struct.std::_Deque_base<nv_dds::CTexture, std::allocator<nv_dds::CTexture>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator", %"struct.std::_Deque_iterator" }
%"struct.std::_Deque_iterator" = type { ptr, ptr, ptr, ptr }

@.str.1 = external hidden unnamed_addr constant [82 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [23 x i8], align 1
@__PRETTY_FUNCTION__._ZN6nv_dds9CDDSImage4loadENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEb = external hidden unnamed_addr constant [43 x i8], align 1
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str.12 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [15 x i8], align 1

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #0

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z17comps2internalfmti(i32 noundef) #2

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN6nv_dds9CDDSImage4loadENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEb(ptr noundef nonnull align 8 dereferenceable(104) %0, ptr noundef %1, i1 noundef zeroext %2) #3 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca i1, align 1
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i8, align 1
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca [4 x i8], align 1
  %11 = alloca i64, align 8
  %12 = alloca %"struct.nv_dds::DDS_HEADER", align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca { i64, i64 }, align 8
  %17 = alloca i32, align 4
  %18 = alloca %"class.nv_dds::CTexture", align 8
  %19 = alloca ptr, align 8
  %20 = alloca i32, align 4
  %21 = alloca ptr, align 8
  %22 = alloca i32, align 4
  %23 = alloca ptr, align 8
  %24 = alloca i32, align 4
  %25 = alloca i32, align 4
  %26 = alloca i32, align 4
  %27 = alloca i32, align 4
  %28 = alloca i32, align 4
  %29 = alloca %"class.nv_dds::CSurface", align 8
  %30 = alloca ptr, align 8
  %31 = alloca ptr, align 8
  %32 = alloca %"class.nv_dds::CTexture", align 8
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  %33 = zext i1 %2 to i8
  store i8 %33, ptr %7, align 1, !tbaa !9
  %34 = load ptr, ptr %5, align 8
  %35 = call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6lengthEv(ptr noundef nonnull align 8 dereferenceable(32) %1) #10
  %36 = icmp ne i64 %35, 0
  br i1 %36, label %37, label %38

37:                                               ; preds = %3
  br label %40

38:                                               ; preds = %3
  call void @__assert_fail(ptr noundef @.str.11, ptr noundef @.str.1, i32 noundef 324, ptr noundef @__PRETTY_FUNCTION__._ZN6nv_dds9CDDSImage4loadENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEb) #11
  unreachable

39:                                               ; No predecessors!
  br label %40

40:                                               ; preds = %39, %37
  %41 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.12)
  %42 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %41, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @_ZN6nv_dds9CDDSImage5clearEv(ptr noundef nonnull align 8 dereferenceable(104) %34)
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #10
  %43 = call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %1) #10
  %44 = call noalias ptr @fopen(ptr noundef %43, ptr noundef @.str.13)
  store ptr %44, ptr %8, align 8, !tbaa !5
  %45 = load ptr, ptr %8, align 8, !tbaa !5
  %46 = icmp eq ptr %45, null
  br i1 %46, label %47, label %48

47:                                               ; preds = %40
  store i1 false, ptr %4, align 1
  store i32 1, ptr %9, align 4
  br label %422

48:                                               ; preds = %40
  %49 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.14)
  %50 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %49, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #10
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #10
  %51 = getelementptr inbounds [4 x i8], ptr %10, i64 0, i64 0
  %52 = load ptr, ptr %8, align 8, !tbaa !5
  %53 = call i64 @fread(ptr noundef %51, i64 noundef 1, i64 noundef 4, ptr noundef %52)
  store i64 %53, ptr %11, align 8, !tbaa !11
  %54 = getelementptr inbounds [4 x i8], ptr %10, i64 0, i64 0
  %55 = call i32 @strncmp(ptr noundef %54, ptr noundef @.str.15, i64 noundef 4) #12
  %56 = icmp ne i32 %55, 0
  br i1 %56, label %57, label %60

57:                                               ; preds = %48
  %58 = load ptr, ptr %8, align 8, !tbaa !5
  %59 = call i32 @fclose(ptr noundef %58)
  store i1 false, ptr %4, align 1
  store i32 1, ptr %9, align 4
  br label %421

60:                                               ; preds = %48
  %61 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.16)
  %62 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %61, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.start.p0(i64 124, ptr %12) #10
  %63 = load ptr, ptr %8, align 8, !tbaa !5
  %64 = call i64 @fread(ptr noundef %12, i64 noundef 124, i64 noundef 1, ptr noundef %63)
  store i64 %64, ptr %11, align 8, !tbaa !11
  %65 = getelementptr inbounds %"struct.nv_dds::DDS_HEADER", ptr %12, i32 0, i32 0
  call void @_ZN6nv_dds9CDDSImage11swap_endianEPv(ptr noundef nonnull align 8 dereferenceable(104) %34, ptr noundef %65)
  %66 = getelementptr inbounds %"struct.nv_dds::DDS_HEADER", ptr %12, i32 0, i32 1
  call void @_ZN6nv_dds9CDDSImage11swap_endianEPv(ptr noundef nonnull align 8 dereferenceable(104) %34, ptr noundef %66)
  %67 = getelementptr inbounds %"struct.nv_dds::DDS_HEADER", ptr %12, i32 0, i32 2
  call void @_ZN6nv_dds9CDDSImage11swap_endianEPv(ptr noundef nonnull align 8 dereferenceable(104) %34, ptr noundef %67)
  %68 = getelementptr inbounds %"struct.nv_dds::DDS_HEADER", ptr %12, i32 0, i32 3
  call void @_ZN6nv_dds9CDDSImage11swap_endianEPv(ptr noundef nonnull align 8 dereferenceable(104) %34, ptr noundef %68)
  %69 = getelementptr inbounds %"struct.nv_dds::DDS_HEADER", ptr %12, i32 0, i32 4
  call void @_ZN6nv_dds9CDDSImage11swap_endianEPv(ptr noundef nonnull align 8 dereferenceable(104) %34, ptr noundef %69)
  %70 = getelementptr inbounds %"struct.nv_dds::DDS_HEADER", ptr %12, i32 0, i32 6
  call void @_ZN6nv_dds9CDDSImage11swap_endianEPv(ptr noundef nonnull align 8 dereferenceable(104) %34, ptr noundef %70)
  %71 = getelementptr inbounds %"struct.nv_dds::DDS_HEADER", ptr %12, i32 0, i32 8
  %72 = getelementptr inbounds %"struct.nv_dds::DDS_PIXELFORMAT", ptr %71, i32 0, i32 0
  call void @_ZN6nv_dds9CDDSImage11swap_endianEPv(ptr noundef nonnull align 8 dereferenceable(104) %34, ptr noundef %72)
  %73 = getelementptr inbounds %"struct.nv_dds::DDS_HEADER", ptr %12, i32 0, i32 8
  %74 = getelementptr inbounds %"struct.nv_dds::DDS_PIXELFORMAT", ptr %73, i32 0, i32 1
  call void @_ZN6nv_dds9CDDSImage11swap_endianEPv(ptr noundef nonnull align 8 dereferenceable(104) %34, ptr noundef %74)
  %75 = getelementptr inbounds %"struct.nv_dds::DDS_HEADER", ptr %12, i32 0, i32 8
  %76 = getelementptr inbounds %"struct.nv_dds::DDS_PIXELFORMAT", ptr %75, i32 0, i32 2
  call void @_ZN6nv_dds9CDDSImage11swap_endianEPv(ptr noundef nonnull align 8 dereferenceable(104) %34, ptr noundef %76)
  %77 = getelementptr inbounds %"struct.nv_dds::DDS_HEADER", ptr %12, i32 0, i32 8
  %78 = getelementptr inbounds %"struct.nv_dds::DDS_PIXELFORMAT", ptr %77, i32 0, i32 3
  call void @_ZN6nv_dds9CDDSImage11swap_endianEPv(ptr noundef nonnull align 8 dereferenceable(104) %34, ptr noundef %78)
  %79 = getelementptr inbounds %"struct.nv_dds::DDS_HEADER", ptr %12, i32 0, i32 9
  call void @_ZN6nv_dds9CDDSImage11swap_endianEPv(ptr noundef nonnull align 8 dereferenceable(104) %34, ptr noundef %79)
  %80 = getelementptr inbounds %"struct.nv_dds::DDS_HEADER", ptr %12, i32 0, i32 10
  call void @_ZN6nv_dds9CDDSImage11swap_endianEPv(ptr noundef nonnull align 8 dereferenceable(104) %34, ptr noundef %80)
  %81 = getelementptr inbounds %"class.nv_dds::CDDSImage", ptr %34, i32 0, i32 3
  store i32 1, ptr %81, align 4, !tbaa !13
  %82 = getelementptr inbounds %"struct.nv_dds::DDS_HEADER", ptr %12, i32 0, i32 10
  %83 = load i32, ptr %82, align 4, !tbaa !22
  %84 = and i32 %83, 512
  %85 = icmp ne i32 %84, 0
  br i1 %85, label %86, label %88

86:                                               ; preds = %60
  %87 = getelementptr inbounds %"class.nv_dds::CDDSImage", ptr %34, i32 0, i32 3
  store i32 3, ptr %87, align 4, !tbaa !13
  br label %88

88:                                               ; preds = %86, %60
  %89 = getelementptr inbounds %"struct.nv_dds::DDS_HEADER", ptr %12, i32 0, i32 10
  %90 = load i32, ptr %89, align 4, !tbaa !22
  %91 = and i32 %90, 2097152
  %92 = icmp ne i32 %91, 0
  br i1 %92, label %93, label %99

93:                                               ; preds = %88
  %94 = getelementptr inbounds %"struct.nv_dds::DDS_HEADER", ptr %12, i32 0, i32 5
  %95 = load i32, ptr %94, align 4, !tbaa !25
  %96 = icmp ugt i32 %95, 0
  br i1 %96, label %97, label %99

97:                                               ; preds = %93
  %98 = getelementptr inbounds %"class.nv_dds::CDDSImage", ptr %34, i32 0, i32 3
  store i32 2, ptr %98, align 4, !tbaa !13
  br label %99

99:                                               ; preds = %97, %93, %88
  %100 = getelementptr inbounds %"struct.nv_dds::DDS_HEADER", ptr %12, i32 0, i32 8
  %101 = getelementptr inbounds %"struct.nv_dds::DDS_PIXELFORMAT", ptr %100, i32 0, i32 1
  %102 = load i32, ptr %101, align 4, !tbaa !26
  %103 = and i32 %102, 4
  %104 = icmp ne i32 %103, 0
  br i1 %104, label %105, label %131

105:                                              ; preds = %99
  %106 = getelementptr inbounds %"struct.nv_dds::DDS_HEADER", ptr %12, i32 0, i32 8
  %107 = getelementptr inbounds %"struct.nv_dds::DDS_PIXELFORMAT", ptr %106, i32 0, i32 2
  %108 = load i32, ptr %107, align 4, !tbaa !27
  switch i32 %108, label %127 [
    i32 827611204, label %109
    i32 861165636, label %115
    i32 894720068, label %121
  ]

109:                                              ; preds = %105
  %110 = getelementptr inbounds %"class.nv_dds::CDDSImage", ptr %34, i32 0, i32 0
  store i32 33777, ptr %110, align 8, !tbaa !28
  %111 = getelementptr inbounds %"class.nv_dds::CDDSImage", ptr %34, i32 0, i32 2
  store i32 3, ptr %111, align 8, !tbaa !29
  %112 = getelementptr inbounds %"class.nv_dds::CDDSImage", ptr %34, i32 0, i32 0
  %113 = load i32, ptr %112, align 8, !tbaa !28
  %114 = getelementptr inbounds %"class.nv_dds::CDDSImage", ptr %34, i32 0, i32 1
  store i32 %113, ptr %114, align 4, !tbaa !30
  br label %130

115:                                              ; preds = %105
  %116 = getelementptr inbounds %"class.nv_dds::CDDSImage", ptr %34, i32 0, i32 0
  store i32 33778, ptr %116, align 8, !tbaa !28
  %117 = getelementptr inbounds %"class.nv_dds::CDDSImage", ptr %34, i32 0, i32 2
  store i32 4, ptr %117, align 8, !tbaa !29
  %118 = getelementptr inbounds %"class.nv_dds::CDDSImage", ptr %34, i32 0, i32 0
  %119 = load i32, ptr %118, align 8, !tbaa !28
  %120 = getelementptr inbounds %"class.nv_dds::CDDSImage", ptr %34, i32 0, i32 1
  store i32 %119, ptr %120, align 4, !tbaa !30
  br label %130

121:                                              ; preds = %105
  %122 = getelementptr inbounds %"class.nv_dds::CDDSImage", ptr %34, i32 0, i32 0
  store i32 33779, ptr %122, align 8, !tbaa !28
  %123 = getelementptr inbounds %"class.nv_dds::CDDSImage", ptr %34, i32 0, i32 2
  store i32 4, ptr %123, align 8, !tbaa !29
  %124 = getelementptr inbounds %"class.nv_dds::CDDSImage", ptr %34, i32 0, i32 0
  %125 = load i32, ptr %124, align 8, !tbaa !28
  %126 = getelementptr inbounds %"class.nv_dds::CDDSImage", ptr %34, i32 0, i32 1
  store i32 %125, ptr %126, align 4, !tbaa !30
  br label %130

127:                                              ; preds = %105
  %128 = load ptr, ptr %8, align 8, !tbaa !5
  %129 = call i32 @fclose(ptr noundef %128)
  store i1 false, ptr %4, align 1
  store i32 1, ptr %9, align 4
  br label %420

130:                                              ; preds = %121, %115, %109
  br label %201

131:                                              ; preds = %99
  %132 = getelementptr inbounds %"struct.nv_dds::DDS_HEADER", ptr %12, i32 0, i32 8
  %133 = getelementptr inbounds %"struct.nv_dds::DDS_PIXELFORMAT", ptr %132, i32 0, i32 1
  %134 = load i32, ptr %133, align 4, !tbaa !26
  %135 = icmp eq i32 %134, 65
  br i1 %135, label %136, label %148

136:                                              ; preds = %131
  %137 = getelementptr inbounds %"struct.nv_dds::DDS_HEADER", ptr %12, i32 0, i32 8
  %138 = getelementptr inbounds %"struct.nv_dds::DDS_PIXELFORMAT", ptr %137, i32 0, i32 3
  %139 = load i32, ptr %138, align 4, !tbaa !31
  %140 = icmp eq i32 %139, 32
  br i1 %140, label %141, label %148

141:                                              ; preds = %136
  %142 = getelementptr inbounds %"class.nv_dds::CDDSImage", ptr %34, i32 0, i32 0
  store i32 32993, ptr %142, align 8, !tbaa !28
  %143 = getelementptr inbounds %"class.nv_dds::CDDSImage", ptr %34, i32 0, i32 2
  store i32 4, ptr %143, align 8, !tbaa !29
  %144 = getelementptr inbounds %"class.nv_dds::CDDSImage", ptr %34, i32 0, i32 2
  %145 = load i32, ptr %144, align 8, !tbaa !29
  %146 = call noundef i32 @_Z17comps2internalfmti(i32 noundef %145)
  %147 = getelementptr inbounds %"class.nv_dds::CDDSImage", ptr %34, i32 0, i32 1
  store i32 %146, ptr %147, align 4, !tbaa !30
  br label %200

148:                                              ; preds = %136, %131
  %149 = getelementptr inbounds %"struct.nv_dds::DDS_HEADER", ptr %12, i32 0, i32 8
  %150 = getelementptr inbounds %"struct.nv_dds::DDS_PIXELFORMAT", ptr %149, i32 0, i32 1
  %151 = load i32, ptr %150, align 4, !tbaa !26
  %152 = icmp eq i32 %151, 64
  br i1 %152, label %153, label %165

153:                                              ; preds = %148
  %154 = getelementptr inbounds %"struct.nv_dds::DDS_HEADER", ptr %12, i32 0, i32 8
  %155 = getelementptr inbounds %"struct.nv_dds::DDS_PIXELFORMAT", ptr %154, i32 0, i32 3
  %156 = load i32, ptr %155, align 4, !tbaa !31
  %157 = icmp eq i32 %156, 32
  br i1 %157, label %158, label %165

158:                                              ; preds = %153
  %159 = getelementptr inbounds %"class.nv_dds::CDDSImage", ptr %34, i32 0, i32 0
  store i32 32993, ptr %159, align 8, !tbaa !28
  %160 = getelementptr inbounds %"class.nv_dds::CDDSImage", ptr %34, i32 0, i32 2
  store i32 4, ptr %160, align 8, !tbaa !29
  %161 = getelementptr inbounds %"class.nv_dds::CDDSImage", ptr %34, i32 0, i32 2
  %162 = load i32, ptr %161, align 8, !tbaa !29
  %163 = call noundef i32 @_Z17comps2internalfmti(i32 noundef %162)
  %164 = getelementptr inbounds %"class.nv_dds::CDDSImage", ptr %34, i32 0, i32 1
  store i32 %163, ptr %164, align 4, !tbaa !30
  br label %199

165:                                              ; preds = %153, %148
  %166 = getelementptr inbounds %"struct.nv_dds::DDS_HEADER", ptr %12, i32 0, i32 8
  %167 = getelementptr inbounds %"struct.nv_dds::DDS_PIXELFORMAT", ptr %166, i32 0, i32 1
  %168 = load i32, ptr %167, align 4, !tbaa !26
  %169 = icmp eq i32 %168, 64
  br i1 %169, label %170, label %182

170:                                              ; preds = %165
  %171 = getelementptr inbounds %"struct.nv_dds::DDS_HEADER", ptr %12, i32 0, i32 8
  %172 = getelementptr inbounds %"struct.nv_dds::DDS_PIXELFORMAT", ptr %171, i32 0, i32 3
  %173 = load i32, ptr %172, align 4, !tbaa !31
  %174 = icmp eq i32 %173, 24
  br i1 %174, label %175, label %182

175:                                              ; preds = %170
  %176 = getelementptr inbounds %"class.nv_dds::CDDSImage", ptr %34, i32 0, i32 0
  store i32 32992, ptr %176, align 8, !tbaa !28
  %177 = getelementptr inbounds %"class.nv_dds::CDDSImage", ptr %34, i32 0, i32 2
  store i32 3, ptr %177, align 8, !tbaa !29
  %178 = getelementptr inbounds %"class.nv_dds::CDDSImage", ptr %34, i32 0, i32 2
  %179 = load i32, ptr %178, align 8, !tbaa !29
  %180 = call noundef i32 @_Z17comps2internalfmti(i32 noundef %179)
  %181 = getelementptr inbounds %"class.nv_dds::CDDSImage", ptr %34, i32 0, i32 1
  store i32 %180, ptr %181, align 4, !tbaa !30
  br label %198

182:                                              ; preds = %170, %165
  %183 = getelementptr inbounds %"struct.nv_dds::DDS_HEADER", ptr %12, i32 0, i32 8
  %184 = getelementptr inbounds %"struct.nv_dds::DDS_PIXELFORMAT", ptr %183, i32 0, i32 3
  %185 = load i32, ptr %184, align 4, !tbaa !31
  %186 = icmp eq i32 %185, 8
  br i1 %186, label %187, label %194

187:                                              ; preds = %182
  %188 = getelementptr inbounds %"class.nv_dds::CDDSImage", ptr %34, i32 0, i32 0
  store i32 6409, ptr %188, align 8, !tbaa !28
  %189 = getelementptr inbounds %"class.nv_dds::CDDSImage", ptr %34, i32 0, i32 2
  store i32 1, ptr %189, align 8, !tbaa !29
  %190 = getelementptr inbounds %"class.nv_dds::CDDSImage", ptr %34, i32 0, i32 2
  %191 = load i32, ptr %190, align 8, !tbaa !29
  %192 = call noundef i32 @_Z17comps2internalfmti(i32 noundef %191)
  %193 = getelementptr inbounds %"class.nv_dds::CDDSImage", ptr %34, i32 0, i32 1
  store i32 %192, ptr %193, align 4, !tbaa !30
  br label %197

194:                                              ; preds = %182
  %195 = load ptr, ptr %8, align 8, !tbaa !5
  %196 = call i32 @fclose(ptr noundef %195)
  store i1 false, ptr %4, align 1
  store i32 1, ptr %9, align 4
  br label %420

197:                                              ; preds = %187
  br label %198

198:                                              ; preds = %197, %175
  br label %199

199:                                              ; preds = %198, %158
  br label %200

200:                                              ; preds = %199, %141
  br label %201

201:                                              ; preds = %200, %130
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #10
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #10
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #10
  %202 = getelementptr inbounds %"struct.nv_dds::DDS_HEADER", ptr %12, i32 0, i32 3
  %203 = load i32, ptr %202, align 4, !tbaa !32
  store i32 %203, ptr %13, align 4, !tbaa !33
  %204 = getelementptr inbounds %"struct.nv_dds::DDS_HEADER", ptr %12, i32 0, i32 2
  %205 = load i32, ptr %204, align 4, !tbaa !34
  store i32 %205, ptr %14, align 4, !tbaa !33
  %206 = getelementptr inbounds %"struct.nv_dds::DDS_HEADER", ptr %12, i32 0, i32 5
  %207 = load i32, ptr %206, align 4, !tbaa !25
  %208 = call noundef i32 @_ZN6nv_dds9CDDSImage10clamp_sizeEj(ptr noundef nonnull align 8 dereferenceable(104) %34, i32 noundef %207)
  store i32 %208, ptr %15, align 4, !tbaa !33
  call void @llvm.lifetime.start.p0(i64 16, ptr %16) #10
  %209 = call noundef zeroext i1 @_ZN6nv_dds9CDDSImage13is_compressedEv(ptr noundef nonnull align 8 dereferenceable(104) %34)
  %210 = zext i1 %209 to i64
  %211 = select i1 %209, { i64, i64 } { i64 ptrtoint (ptr @_ZN6nv_dds9CDDSImage9size_dxtcEjj to i64), i64 0 }, { i64, i64 } { i64 ptrtoint (ptr @_ZN6nv_dds9CDDSImage8size_rgbEjj to i64), i64 0 }
  store { i64, i64 } %211, ptr %16, align 8, !tbaa !35
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #10
  store i32 0, ptr %17, align 4, !tbaa !33
  br label %212

212:                                              ; preds = %379, %201
  %213 = load i32, ptr %17, align 4, !tbaa !33
  %214 = getelementptr inbounds %"class.nv_dds::CDDSImage", ptr %34, i32 0, i32 3
  %215 = load i32, ptr %214, align 4, !tbaa !13
  %216 = icmp eq i32 %215, 3
  %217 = zext i1 %216 to i64
  %218 = select i1 %216, i32 6, i32 1
  %219 = icmp ult i32 %213, %218
  br i1 %219, label %221, label %220

220:                                              ; preds = %212
  store i32 3, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #10
  br label %383

221:                                              ; preds = %212
  %222 = getelementptr inbounds %"class.nv_dds::CDDSImage", ptr %34, i32 0, i32 5
  call void @llvm.lifetime.start.p0(i64 112, ptr %18) #10
  call void @_ZN6nv_dds8CTextureC1Ev(ptr noundef nonnull align 8 dereferenceable(112) %18)
  invoke void @_ZNSt5dequeIN6nv_dds8CTextureESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(80) %222, ptr noundef nonnull align 8 dereferenceable(112) %18)
          to label %223 unwind label %239

223:                                              ; preds = %221
  call void @_ZN6nv_dds8CTextureD1Ev(ptr noundef nonnull align 8 dereferenceable(112) %18) #10
  call void @llvm.lifetime.end.p0(i64 112, ptr %18) #10
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #10
  %224 = getelementptr inbounds %"class.nv_dds::CDDSImage", ptr %34, i32 0, i32 5
  %225 = load i32, ptr %17, align 4, !tbaa !33
  %226 = zext i32 %225 to i64
  %227 = call noundef nonnull align 8 dereferenceable(112) ptr @_ZNSt5dequeIN6nv_dds8CTextureESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(80) %224, i64 noundef %226) #10
  store ptr %227, ptr %21, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #10
  %228 = load { i64, i64 }, ptr %16, align 8, !tbaa !35
  %229 = extractvalue { i64, i64 } %228, 1
  %230 = getelementptr inbounds i8, ptr %34, i64 %229
  %231 = extractvalue { i64, i64 } %228, 0
  %232 = and i64 %231, 1
  %233 = icmp ne i64 %232, 0
  br i1 %233, label %234, label %243

234:                                              ; preds = %223
  %235 = load ptr, ptr %230, align 8, !tbaa !36
  %236 = sub i64 %231, 1
  %237 = getelementptr i8, ptr %235, i64 %236, !nosanitize !38
  %238 = load ptr, ptr %237, align 8, !nosanitize !38
  br label %245

239:                                              ; preds = %221
  %240 = landingpad { ptr, i32 }
          cleanup
  %241 = extractvalue { ptr, i32 } %240, 0
  store ptr %241, ptr %19, align 8
  %242 = extractvalue { ptr, i32 } %240, 1
  store i32 %242, ptr %20, align 4
  call void @_ZN6nv_dds8CTextureD1Ev(ptr noundef nonnull align 8 dereferenceable(112) %18) #10
  call void @llvm.lifetime.end.p0(i64 112, ptr %18) #10
  br label %382

243:                                              ; preds = %223
  %244 = inttoptr i64 %231 to ptr
  br label %245

245:                                              ; preds = %243, %234
  %246 = phi ptr [ %238, %234 ], [ %244, %243 ]
  %247 = load i32, ptr %13, align 4, !tbaa !33
  %248 = load i32, ptr %14, align 4, !tbaa !33
  %249 = call noundef i32 %246(ptr noundef nonnull align 8 dereferenceable(104) %230, i32 noundef %247, i32 noundef %248)
  %250 = load i32, ptr %15, align 4, !tbaa !33
  %251 = mul i32 %249, %250
  store i32 %251, ptr %22, align 4, !tbaa !33
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #10
  %252 = load i32, ptr %22, align 4, !tbaa !33
  %253 = zext i32 %252 to i64
  %254 = call noalias noundef nonnull ptr @_Znam(i64 noundef %253) #13
  store ptr %254, ptr %23, align 8, !tbaa !5
  %255 = load ptr, ptr %23, align 8, !tbaa !5
  %256 = load i32, ptr %22, align 4, !tbaa !33
  %257 = zext i32 %256 to i64
  %258 = load ptr, ptr %8, align 8, !tbaa !5
  %259 = call i64 @fread(ptr noundef %255, i64 noundef 1, i64 noundef %257, ptr noundef %258)
  store i64 %259, ptr %11, align 8, !tbaa !11
  %260 = load ptr, ptr %21, align 8, !tbaa !5
  %261 = load i32, ptr %13, align 4, !tbaa !33
  %262 = load i32, ptr %14, align 4, !tbaa !33
  %263 = load i32, ptr %15, align 4, !tbaa !33
  %264 = load i32, ptr %22, align 4, !tbaa !33
  %265 = load ptr, ptr %23, align 8, !tbaa !5
  %266 = load ptr, ptr %260, align 8, !tbaa !36
  %267 = getelementptr inbounds ptr, ptr %266, i64 2
  %268 = load ptr, ptr %267, align 8
  call void %268(ptr noundef nonnull align 8 dereferenceable(112) %260, i32 noundef %261, i32 noundef %262, i32 noundef %263, i32 noundef %264, ptr noundef %265)
  %269 = load ptr, ptr %23, align 8, !tbaa !5
  %270 = icmp eq ptr %269, null
  br i1 %270, label %272, label %271

271:                                              ; preds = %245
  call void @_ZdaPv(ptr noundef %269) #14
  br label %272

272:                                              ; preds = %271, %245
  %273 = load i8, ptr %7, align 1, !tbaa !9, !range !39, !noundef !38
  %274 = trunc i8 %273 to i1
  br i1 %274, label %275, label %277

275:                                              ; preds = %272
  %276 = load ptr, ptr %21, align 8, !tbaa !5
  call void @_ZN6nv_dds9CDDSImage4flipERNS_8CSurfaceE(ptr noundef nonnull align 8 dereferenceable(104) %34, ptr noundef nonnull align 8 dereferenceable(32) %276)
  br label %277

277:                                              ; preds = %275, %272
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #10
  %278 = load i32, ptr %13, align 4, !tbaa !33
  %279 = lshr i32 %278, 1
  %280 = call noundef i32 @_ZN6nv_dds9CDDSImage10clamp_sizeEj(ptr noundef nonnull align 8 dereferenceable(104) %34, i32 noundef %279)
  store i32 %280, ptr %24, align 4, !tbaa !33
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #10
  %281 = load i32, ptr %14, align 4, !tbaa !33
  %282 = lshr i32 %281, 1
  %283 = call noundef i32 @_ZN6nv_dds9CDDSImage10clamp_sizeEj(ptr noundef nonnull align 8 dereferenceable(104) %34, i32 noundef %282)
  store i32 %283, ptr %25, align 4, !tbaa !33
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #10
  %284 = load i32, ptr %15, align 4, !tbaa !33
  %285 = lshr i32 %284, 1
  %286 = call noundef i32 @_ZN6nv_dds9CDDSImage10clamp_sizeEj(ptr noundef nonnull align 8 dereferenceable(104) %34, i32 noundef %285)
  store i32 %286, ptr %26, align 4, !tbaa !33
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #10
  %287 = getelementptr inbounds %"struct.nv_dds::DDS_HEADER", ptr %12, i32 0, i32 6
  %288 = load i32, ptr %287, align 4, !tbaa !40
  store i32 %288, ptr %27, align 4, !tbaa !33
  %289 = load i32, ptr %27, align 4, !tbaa !33
  %290 = icmp ne i32 %289, 0
  br i1 %290, label %291, label %294

291:                                              ; preds = %277
  %292 = load i32, ptr %27, align 4, !tbaa !33
  %293 = add i32 %292, -1
  store i32 %293, ptr %27, align 4, !tbaa !33
  br label %294

294:                                              ; preds = %291, %277
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #10
  store i32 0, ptr %28, align 4, !tbaa !33
  br label %295

295:                                              ; preds = %375, %294
  %296 = load i32, ptr %28, align 4, !tbaa !33
  %297 = load i32, ptr %27, align 4, !tbaa !33
  %298 = icmp ult i32 %296, %297
  br i1 %298, label %299, label %307

299:                                              ; preds = %295
  %300 = load i32, ptr %24, align 4, !tbaa !33
  %301 = icmp ne i32 %300, 0
  br i1 %301, label %305, label %302

302:                                              ; preds = %299
  %303 = load i32, ptr %25, align 4, !tbaa !33
  %304 = icmp ne i32 %303, 0
  br label %305

305:                                              ; preds = %302, %299
  %306 = phi i1 [ true, %299 ], [ %304, %302 ]
  br label %307

307:                                              ; preds = %305, %295
  %308 = phi i1 [ false, %295 ], [ %306, %305 ]
  br i1 %308, label %310, label %309

309:                                              ; preds = %307
  store i32 6, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #10
  br label %378

310:                                              ; preds = %307
  %311 = load ptr, ptr %21, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 32, ptr %29) #10
  call void @_ZN6nv_dds8CSurfaceC1Ev(ptr noundef nonnull align 8 dereferenceable(32) %29)
  invoke void @_ZN6nv_dds8CTexture10add_mipmapERKNS_8CSurfaceE(ptr noundef nonnull align 8 dereferenceable(112) %311, ptr noundef nonnull align 8 dereferenceable(32) %29)
          to label %312 unwind label %327

312:                                              ; preds = %310
  call void @_ZN6nv_dds8CSurfaceD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %29) #10
  call void @llvm.lifetime.end.p0(i64 32, ptr %29) #10
  call void @llvm.lifetime.start.p0(i64 8, ptr %30) #10
  %313 = load ptr, ptr %21, align 8, !tbaa !5
  %314 = load i32, ptr %28, align 4, !tbaa !33
  %315 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZN6nv_dds8CTexture10get_mipmapEj(ptr noundef nonnull align 8 dereferenceable(112) %313, i32 noundef %314)
  store ptr %315, ptr %30, align 8, !tbaa !5
  %316 = load { i64, i64 }, ptr %16, align 8, !tbaa !35
  %317 = extractvalue { i64, i64 } %316, 1
  %318 = getelementptr inbounds i8, ptr %34, i64 %317
  %319 = extractvalue { i64, i64 } %316, 0
  %320 = and i64 %319, 1
  %321 = icmp ne i64 %320, 0
  br i1 %321, label %322, label %331

322:                                              ; preds = %312
  %323 = load ptr, ptr %318, align 8, !tbaa !36
  %324 = sub i64 %319, 1
  %325 = getelementptr i8, ptr %323, i64 %324, !nosanitize !38
  %326 = load ptr, ptr %325, align 8, !nosanitize !38
  br label %333

327:                                              ; preds = %310
  %328 = landingpad { ptr, i32 }
          cleanup
  %329 = extractvalue { ptr, i32 } %328, 0
  store ptr %329, ptr %19, align 8
  %330 = extractvalue { ptr, i32 } %328, 1
  store i32 %330, ptr %20, align 4
  call void @_ZN6nv_dds8CSurfaceD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %29) #10
  call void @llvm.lifetime.end.p0(i64 32, ptr %29) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #10
  br label %382

331:                                              ; preds = %312
  %332 = inttoptr i64 %319 to ptr
  br label %333

333:                                              ; preds = %331, %322
  %334 = phi ptr [ %326, %322 ], [ %332, %331 ]
  %335 = load i32, ptr %24, align 4, !tbaa !33
  %336 = load i32, ptr %25, align 4, !tbaa !33
  %337 = call noundef i32 %334(ptr noundef nonnull align 8 dereferenceable(104) %318, i32 noundef %335, i32 noundef %336)
  %338 = load i32, ptr %26, align 4, !tbaa !33
  %339 = mul i32 %337, %338
  store i32 %339, ptr %22, align 4, !tbaa !33
  call void @llvm.lifetime.start.p0(i64 8, ptr %31) #10
  %340 = load i32, ptr %22, align 4, !tbaa !33
  %341 = zext i32 %340 to i64
  %342 = call noalias noundef nonnull ptr @_Znam(i64 noundef %341) #13
  store ptr %342, ptr %31, align 8, !tbaa !5
  %343 = load ptr, ptr %31, align 8, !tbaa !5
  %344 = load i32, ptr %22, align 4, !tbaa !33
  %345 = zext i32 %344 to i64
  %346 = load ptr, ptr %8, align 8, !tbaa !5
  %347 = call i64 @fread(ptr noundef %343, i64 noundef 1, i64 noundef %345, ptr noundef %346)
  store i64 %347, ptr %11, align 8, !tbaa !11
  %348 = load ptr, ptr %30, align 8, !tbaa !5
  %349 = load i32, ptr %24, align 4, !tbaa !33
  %350 = load i32, ptr %25, align 4, !tbaa !33
  %351 = load i32, ptr %26, align 4, !tbaa !33
  %352 = load i32, ptr %22, align 4, !tbaa !33
  %353 = load ptr, ptr %31, align 8, !tbaa !5
  %354 = load ptr, ptr %348, align 8, !tbaa !36
  %355 = getelementptr inbounds ptr, ptr %354, i64 2
  %356 = load ptr, ptr %355, align 8
  call void %356(ptr noundef nonnull align 8 dereferenceable(32) %348, i32 noundef %349, i32 noundef %350, i32 noundef %351, i32 noundef %352, ptr noundef %353)
  %357 = load ptr, ptr %31, align 8, !tbaa !5
  %358 = icmp eq ptr %357, null
  br i1 %358, label %360, label %359

359:                                              ; preds = %333
  call void @_ZdaPv(ptr noundef %357) #14
  br label %360

360:                                              ; preds = %359, %333
  %361 = load i8, ptr %7, align 1, !tbaa !9, !range !39, !noundef !38
  %362 = trunc i8 %361 to i1
  br i1 %362, label %363, label %365

363:                                              ; preds = %360
  %364 = load ptr, ptr %30, align 8, !tbaa !5
  call void @_ZN6nv_dds9CDDSImage4flipERNS_8CSurfaceE(ptr noundef nonnull align 8 dereferenceable(104) %34, ptr noundef nonnull align 8 dereferenceable(32) %364)
  br label %365

365:                                              ; preds = %363, %360
  %366 = load i32, ptr %24, align 4, !tbaa !33
  %367 = lshr i32 %366, 1
  %368 = call noundef i32 @_ZN6nv_dds9CDDSImage10clamp_sizeEj(ptr noundef nonnull align 8 dereferenceable(104) %34, i32 noundef %367)
  store i32 %368, ptr %24, align 4, !tbaa !33
  %369 = load i32, ptr %25, align 4, !tbaa !33
  %370 = lshr i32 %369, 1
  %371 = call noundef i32 @_ZN6nv_dds9CDDSImage10clamp_sizeEj(ptr noundef nonnull align 8 dereferenceable(104) %34, i32 noundef %370)
  store i32 %371, ptr %25, align 4, !tbaa !33
  %372 = load i32, ptr %26, align 4, !tbaa !33
  %373 = lshr i32 %372, 1
  %374 = call noundef i32 @_ZN6nv_dds9CDDSImage10clamp_sizeEj(ptr noundef nonnull align 8 dereferenceable(104) %34, i32 noundef %373)
  store i32 %374, ptr %26, align 4, !tbaa !33
  call void @llvm.lifetime.end.p0(i64 8, ptr %31) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #10
  br label %375

375:                                              ; preds = %365
  %376 = load i32, ptr %28, align 4, !tbaa !33
  %377 = add i32 %376, 1
  store i32 %377, ptr %28, align 4, !tbaa !33
  br label %295, !llvm.loop !41

378:                                              ; preds = %309
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #10
  br label %379

379:                                              ; preds = %378
  %380 = load i32, ptr %17, align 4, !tbaa !33
  %381 = add i32 %380, 1
  store i32 %381, ptr %17, align 4, !tbaa !33
  br label %212, !llvm.loop !43

382:                                              ; preds = %327, %239
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #10
  br label %419

383:                                              ; preds = %220
  %384 = getelementptr inbounds %"class.nv_dds::CDDSImage", ptr %34, i32 0, i32 3
  %385 = load i32, ptr %384, align 4, !tbaa !13
  %386 = icmp eq i32 %385, 3
  br i1 %386, label %387, label %409

387:                                              ; preds = %383
  %388 = load i8, ptr %7, align 1, !tbaa !9, !range !39, !noundef !38
  %389 = trunc i8 %388 to i1
  br i1 %389, label %390, label %409

390:                                              ; preds = %387
  call void @llvm.lifetime.start.p0(i64 112, ptr %32) #10
  call void @_ZN6nv_dds8CTextureC1Ev(ptr noundef nonnull align 8 dereferenceable(112) %32)
  %391 = getelementptr inbounds %"class.nv_dds::CDDSImage", ptr %34, i32 0, i32 5
  %392 = call noundef nonnull align 8 dereferenceable(112) ptr @_ZNSt5dequeIN6nv_dds8CTextureESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(80) %391, i64 noundef 3) #10
  %393 = invoke noundef nonnull align 8 dereferenceable(112) ptr @_ZN6nv_dds8CTextureaSERKS0_(ptr noundef nonnull align 8 dereferenceable(112) %32, ptr noundef nonnull align 8 dereferenceable(112) %392)
          to label %394 unwind label %405

394:                                              ; preds = %390
  %395 = getelementptr inbounds %"class.nv_dds::CDDSImage", ptr %34, i32 0, i32 5
  %396 = call noundef nonnull align 8 dereferenceable(112) ptr @_ZNSt5dequeIN6nv_dds8CTextureESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(80) %395, i64 noundef 2) #10
  %397 = getelementptr inbounds %"class.nv_dds::CDDSImage", ptr %34, i32 0, i32 5
  %398 = call noundef nonnull align 8 dereferenceable(112) ptr @_ZNSt5dequeIN6nv_dds8CTextureESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(80) %397, i64 noundef 3) #10
  %399 = invoke noundef nonnull align 8 dereferenceable(112) ptr @_ZN6nv_dds8CTextureaSERKS0_(ptr noundef nonnull align 8 dereferenceable(112) %398, ptr noundef nonnull align 8 dereferenceable(112) %396)
          to label %400 unwind label %405

400:                                              ; preds = %394
  %401 = getelementptr inbounds %"class.nv_dds::CDDSImage", ptr %34, i32 0, i32 5
  %402 = call noundef nonnull align 8 dereferenceable(112) ptr @_ZNSt5dequeIN6nv_dds8CTextureESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(80) %401, i64 noundef 2) #10
  %403 = invoke noundef nonnull align 8 dereferenceable(112) ptr @_ZN6nv_dds8CTextureaSERKS0_(ptr noundef nonnull align 8 dereferenceable(112) %402, ptr noundef nonnull align 8 dereferenceable(112) %32)
          to label %404 unwind label %405

404:                                              ; preds = %400
  call void @_ZN6nv_dds8CTextureD1Ev(ptr noundef nonnull align 8 dereferenceable(112) %32) #10
  call void @llvm.lifetime.end.p0(i64 112, ptr %32) #10
  br label %409

405:                                              ; preds = %400, %394, %390
  %406 = landingpad { ptr, i32 }
          cleanup
  %407 = extractvalue { ptr, i32 } %406, 0
  store ptr %407, ptr %19, align 8
  %408 = extractvalue { ptr, i32 } %406, 1
  store i32 %408, ptr %20, align 4
  call void @_ZN6nv_dds8CTextureD1Ev(ptr noundef nonnull align 8 dereferenceable(112) %32) #10
  call void @llvm.lifetime.end.p0(i64 112, ptr %32) #10
  br label %419

409:                                              ; preds = %404, %387, %383
  %410 = load ptr, ptr %8, align 8, !tbaa !5
  %411 = call i32 @fclose(ptr noundef %410)
  %412 = load i64, ptr %11, align 8, !tbaa !11
  %413 = icmp ne i64 %412, 0
  br i1 %413, label %414, label %416

414:                                              ; preds = %409
  %415 = getelementptr inbounds %"class.nv_dds::CDDSImage", ptr %34, i32 0, i32 4
  store i8 1, ptr %415, align 8, !tbaa !44
  br label %418

416:                                              ; preds = %409
  %417 = getelementptr inbounds %"class.nv_dds::CDDSImage", ptr %34, i32 0, i32 4
  store i8 1, ptr %417, align 8, !tbaa !44
  br label %418

418:                                              ; preds = %416, %414
  store i1 true, ptr %4, align 1
  store i32 1, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %16) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #10
  br label %420

419:                                              ; preds = %405, %382
  call void @llvm.lifetime.end.p0(i64 16, ptr %16) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #10
  call void @llvm.lifetime.end.p0(i64 124, ptr %12) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #10
  br label %424

420:                                              ; preds = %418, %194, %127
  call void @llvm.lifetime.end.p0(i64 124, ptr %12) #10
  br label %421

421:                                              ; preds = %420, %57
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #10
  br label %422

422:                                              ; preds = %421, %47
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #10
  %423 = load i1, ptr %4, align 1
  ret i1 %423

424:                                              ; preds = %419
  %425 = load ptr, ptr %19, align 8
  %426 = load i32, ptr %20, align 4
  %427 = insertvalue { ptr, i32 } poison, ptr %425, 0
  %428 = insertvalue { ptr, i32 } %427, i32 %426, 1
  resume { ptr, i32 } %428
}

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #4

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #4

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

declare noalias ptr @fopen(ptr noundef, ptr noundef) #6

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

declare i64 @fread(ptr noundef, i64 noundef, i64 noundef, ptr noundef) #6

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

declare i32 @fclose(ptr noundef) #6

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN6nv_dds9CDDSImage10clamp_sizeEj(ptr noundef nonnull align 8 dereferenceable(104), i32 noundef) #2 align 2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN6nv_dds9CDDSImage9size_dxtcEjj(ptr noundef nonnull align 8 dereferenceable(104), i32 noundef, i32 noundef) #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN6nv_dds9CDDSImage8size_rgbEjj(ptr noundef nonnull align 8 dereferenceable(104), i32 noundef, i32 noundef) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt5dequeIN6nv_dds8CTextureESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(80), ptr noundef nonnull align 8 dereferenceable(112)) #3 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(112) ptr @_ZNSt5dequeIN6nv_dds8CTextureESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(80), i64 noundef) #1 align 2

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

; Function Attrs: nobuiltin nounwind
declare void @_ZdaPv(ptr noundef) #9

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN6nv_dds8CTexture10add_mipmapERKNS_8CSurfaceE(ptr noundef nonnull align 8 dereferenceable(112), ptr noundef nonnull align 8 dereferenceable(32)) #4 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(32) ptr @_ZN6nv_dds8CTexture10get_mipmapEj(ptr noundef nonnull align 8 dereferenceable(112), i32 noundef) #2 align 2

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

declare void @_ZN6nv_dds8CTextureC1Ev(ptr)

declare void @_ZN6nv_dds8CTextureD1Ev(ptr)

declare void @_ZN6nv_dds8CSurfaceC1Ev(ptr)

declare void @_ZN6nv_dds8CSurfaceD1Ev(ptr)

attributes #0 = { noreturn 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 #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 = { 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 #3 = { 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 = { 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 #5 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #6 = { "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 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 #8 = { 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 #9 = { 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 #10 = { nounwind }
attributes #11 = { noreturn nounwind }
attributes #12 = { nounwind willreturn memory(read) }
attributes #13 = { builtin allocsize(0) }
attributes #14 = { 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 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !10, i64 0}
!10 = !{!"bool", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"long", !7, i64 0}
!13 = !{!14, !16, i64 12}
!14 = !{!"_ZTSN6nv_dds9CDDSImageE", !15, i64 0, !15, i64 4, !15, i64 8, !16, i64 12, !10, i64 16, !17, i64 24}
!15 = !{!"int", !7, i64 0}
!16 = !{!"_ZTSN6nv_dds11TextureTypeE", !7, i64 0}
!17 = !{!"_ZTSSt5dequeIN6nv_dds8CTextureESaIS1_EE", !18, i64 0}
!18 = !{!"_ZTSSt11_Deque_baseIN6nv_dds8CTextureESaIS1_EE", !19, i64 0}
!19 = !{!"_ZTSNSt11_Deque_baseIN6nv_dds8CTextureESaIS1_EE11_Deque_implE", !20, i64 0}
!20 = !{!"_ZTSNSt11_Deque_baseIN6nv_dds8CTextureESaIS1_EE16_Deque_impl_dataE", !6, i64 0, !12, i64 8, !21, i64 16, !21, i64 48}
!21 = !{!"_ZTSSt15_Deque_iteratorIN6nv_dds8CTextureERS1_PS1_E", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24}
!22 = !{!23, !15, i64 108}
!23 = !{!"_ZTSN6nv_dds10DDS_HEADERE", !15, i64 0, !15, i64 4, !15, i64 8, !15, i64 12, !15, i64 16, !15, i64 20, !15, i64 24, !7, i64 28, !24, i64 72, !15, i64 104, !15, i64 108, !7, i64 112}
!24 = !{!"_ZTSN6nv_dds15DDS_PIXELFORMATE", !15, i64 0, !15, i64 4, !15, i64 8, !15, i64 12, !15, i64 16, !15, i64 20, !15, i64 24, !15, i64 28}
!25 = !{!23, !15, i64 20}
!26 = !{!23, !15, i64 76}
!27 = !{!23, !15, i64 80}
!28 = !{!14, !15, i64 0}
!29 = !{!14, !15, i64 8}
!30 = !{!14, !15, i64 4}
!31 = !{!23, !15, i64 84}
!32 = !{!23, !15, i64 12}
!33 = !{!15, !15, i64 0}
!34 = !{!23, !15, i64 8}
!35 = !{!7, !7, i64 0}
!36 = !{!37, !37, i64 0}
!37 = !{!"vtable pointer", !8, i64 0}
!38 = !{}
!39 = !{i8 0, i8 2}
!40 = !{!23, !15, i64 24}
!41 = distinct !{!41, !42}
!42 = !{!"llvm.loop.mustprogress"}
!43 = distinct !{!43, !42}
!44 = !{!14, !10, i64 16}


; 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::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"struct.nv_dds::DDS_HEADER" = type { i32, i32, i32, i32, i32, i32, i32, [11 x i32], %"struct.nv_dds::DDS_PIXELFORMAT", i32, i32, [3 x i32] }
%"struct.nv_dds::DDS_PIXELFORMAT" = type { i32, i32, i32, i32, i32, i32, i32, i32 }
%"class.nv_dds::CTexture" = type { %"class.nv_dds::CSurface", %"class.std::deque.0" }
%"class.nv_dds::CSurface" = type { ptr, i32, i32, i32, i32, ptr }
%"class.std::deque.0" = type { %"class.std::_Deque_base.1" }
%"class.std::_Deque_base.1" = type { %"struct.std::_Deque_base<nv_dds::CSurface, std::allocator<nv_dds::CSurface>>::_Deque_impl" }
%"struct.std::_Deque_base<nv_dds::CSurface, std::allocator<nv_dds::CSurface>>::_Deque_impl" = type { %"struct.std::_Deque_base<nv_dds::CSurface, std::allocator<nv_dds::CSurface>>::_Deque_impl_data" }
%"struct.std::_Deque_base<nv_dds::CSurface, std::allocator<nv_dds::CSurface>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator.5", %"struct.std::_Deque_iterator.5" }
%"struct.std::_Deque_iterator.5" = type { ptr, ptr, ptr, ptr }

@.str.1 = external hidden unnamed_addr constant [82 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [23 x i8], align 1
@__PRETTY_FUNCTION__._ZN6nv_dds9CDDSImage4loadENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEb = external hidden unnamed_addr constant [43 x i8], align 1
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str.12 = external hidden unnamed_addr constant [21 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.14 = external hidden unnamed_addr constant [13 x i8], align 1
@.str.15 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.16 = external hidden unnamed_addr constant [15 x i8], align 1

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #0

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z17comps2internalfmti(i32 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_ZN6nv_dds9CDDSImage4loadENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEb(ptr noundef nonnull align 8 dereferenceable(104) %0, ptr noundef nonnull %1, i1 noundef zeroext %2) local_unnamed_addr #3 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca [4 x i8], align 1
  %5 = alloca %"struct.nv_dds::DDS_HEADER", align 4
  %6 = alloca %"class.nv_dds::CTexture", align 8
  %7 = alloca %"class.nv_dds::CSurface", align 8
  %8 = alloca %"class.nv_dds::CTexture", align 8
  %9 = tail call noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6lengthEv(ptr noundef nonnull align 8 dereferenceable(32) %1) #11
  %.not = icmp eq i64 %9, 0
  br i1 %.not, label %10, label %11

10:                                               ; preds = %3
  tail call void @__assert_fail(ptr noundef nonnull @.str.11, ptr noundef nonnull @.str.1, i32 noundef 324, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN6nv_dds9CDDSImage4loadENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEEb) #12
  unreachable

11:                                               ; preds = %3
  %12 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.12)
  %13 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  tail call void @_ZN6nv_dds9CDDSImage5clearEv(ptr noundef nonnull align 8 dereferenceable(104) %0)
  %14 = tail call noundef ptr @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE5c_strEv(ptr noundef nonnull align 8 dereferenceable(32) %1) #11
  %15 = tail call noalias ptr @fopen(ptr noundef %14, ptr noundef nonnull @.str.13)
  %16 = icmp eq ptr %15, null
  br i1 %16, label %163, label %17

17:                                               ; preds = %11
  %18 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.14)
  %19 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %18, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #11
  %20 = call i64 @fread(ptr noundef nonnull %4, i64 noundef 1, i64 noundef 4, ptr noundef nonnull %15)
  %21 = call i32 @strncmp(ptr noundef nonnull dereferenceable(1) %4, ptr noundef nonnull dereferenceable(1) @.str.15, i64 noundef 4) #13
  %.not102 = icmp eq i32 %21, 0
  br i1 %.not102, label %24, label %22

22:                                               ; preds = %17
  %23 = tail call i32 @fclose(ptr noundef nonnull %15)
  br label %162

24:                                               ; preds = %17
  %25 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull @.str.16)
  %26 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %25, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.start.p0(i64 124, ptr nonnull %5) #11
  %27 = call i64 @fread(ptr noundef nonnull %5, i64 noundef 124, i64 noundef 1, ptr noundef nonnull %15)
  call void @_ZN6nv_dds9CDDSImage11swap_endianEPv(ptr noundef nonnull align 8 dereferenceable(104) %0, ptr noundef nonnull %5)
  %28 = getelementptr inbounds i8, ptr %5, i64 4
  call void @_ZN6nv_dds9CDDSImage11swap_endianEPv(ptr noundef nonnull align 8 dereferenceable(104) %0, ptr noundef nonnull %28)
  %29 = getelementptr inbounds i8, ptr %5, i64 8
  call void @_ZN6nv_dds9CDDSImage11swap_endianEPv(ptr noundef nonnull align 8 dereferenceable(104) %0, ptr noundef nonnull %29)
  %30 = getelementptr inbounds i8, ptr %5, i64 12
  call void @_ZN6nv_dds9CDDSImage11swap_endianEPv(ptr noundef nonnull align 8 dereferenceable(104) %0, ptr noundef nonnull %30)
  %31 = getelementptr inbounds i8, ptr %5, i64 16
  call void @_ZN6nv_dds9CDDSImage11swap_endianEPv(ptr noundef nonnull align 8 dereferenceable(104) %0, ptr noundef nonnull %31)
  %32 = getelementptr inbounds i8, ptr %5, i64 24
  call void @_ZN6nv_dds9CDDSImage11swap_endianEPv(ptr noundef nonnull align 8 dereferenceable(104) %0, ptr noundef nonnull %32)
  %33 = getelementptr inbounds i8, ptr %5, i64 72
  call void @_ZN6nv_dds9CDDSImage11swap_endianEPv(ptr noundef nonnull align 8 dereferenceable(104) %0, ptr noundef nonnull %33)
  %34 = getelementptr inbounds i8, ptr %5, i64 76
  call void @_ZN6nv_dds9CDDSImage11swap_endianEPv(ptr noundef nonnull align 8 dereferenceable(104) %0, ptr noundef nonnull %34)
  %35 = getelementptr inbounds i8, ptr %5, i64 80
  call void @_ZN6nv_dds9CDDSImage11swap_endianEPv(ptr noundef nonnull align 8 dereferenceable(104) %0, ptr noundef nonnull %35)
  %36 = getelementptr inbounds i8, ptr %5, i64 84
  call void @_ZN6nv_dds9CDDSImage11swap_endianEPv(ptr noundef nonnull align 8 dereferenceable(104) %0, ptr noundef nonnull %36)
  %37 = getelementptr inbounds i8, ptr %5, i64 104
  call void @_ZN6nv_dds9CDDSImage11swap_endianEPv(ptr noundef nonnull align 8 dereferenceable(104) %0, ptr noundef nonnull %37)
  %38 = getelementptr inbounds i8, ptr %5, i64 108
  call void @_ZN6nv_dds9CDDSImage11swap_endianEPv(ptr noundef nonnull align 8 dereferenceable(104) %0, ptr noundef nonnull %38)
  %39 = getelementptr inbounds i8, ptr %0, i64 12
  %40 = load i32, ptr %38, align 4, !tbaa !5
  %41 = and i32 %40, 512
  %.not103 = icmp eq i32 %41, 0
  %spec.store.select = select i1 %.not103, i32 1, i32 3
  %42 = and i32 %40, 2097152
  %43 = icmp ne i32 %42, 0
  %44 = getelementptr inbounds i8, ptr %5, i64 20
  %45 = load i32, ptr %44, align 4
  %46 = icmp ne i32 %45, 0
  %or.cond = select i1 %43, i1 %46, i1 false
  %spec.store.select113 = select i1 %or.cond, i32 2, i32 %spec.store.select
  store i32 %spec.store.select113, ptr %39, align 4
  %47 = load i32, ptr %34, align 4, !tbaa !11
  %48 = and i32 %47, 4
  %.not104 = icmp eq i32 %48, 0
  br i1 %.not104, label %59, label %49

49:                                               ; preds = %24
  %50 = load i32, ptr %35, align 4, !tbaa !12
  switch i32 %50, label %57 [
    i32 827611204, label %51
    i32 861165636, label %53
    i32 894720068, label %55
  ]

51:                                               ; preds = %49
  store i32 33777, ptr %0, align 8, !tbaa !13
  %52 = getelementptr inbounds i8, ptr %0, i64 8
  store i32 3, ptr %52, align 8, !tbaa !24
  br label %83

53:                                               ; preds = %49
  store i32 33778, ptr %0, align 8, !tbaa !13
  %54 = getelementptr inbounds i8, ptr %0, i64 8
  store i32 4, ptr %54, align 8, !tbaa !24
  br label %83

55:                                               ; preds = %49
  store i32 33779, ptr %0, align 8, !tbaa !13
  %56 = getelementptr inbounds i8, ptr %0, i64 8
  store i32 4, ptr %56, align 8, !tbaa !24
  br label %83

57:                                               ; preds = %49
  %58 = call i32 @fclose(ptr noundef nonnull %15)
  br label %161

59:                                               ; preds = %24
  %60 = icmp eq i32 %47, 65
  %61 = load i32, ptr %36, align 4
  %62 = icmp eq i32 %61, 32
  %or.cond6 = select i1 %60, i1 %62, i1 false
  br i1 %or.cond6, label %63, label %66

63:                                               ; preds = %59
  store i32 32993, ptr %0, align 8, !tbaa !13
  %64 = getelementptr inbounds i8, ptr %0, i64 8
  store i32 4, ptr %64, align 8, !tbaa !24
  %65 = call noundef i32 @_Z17comps2internalfmti(i32 noundef 4)
  br label %83

66:                                               ; preds = %59
  %67 = icmp eq i32 %47, 64
  %or.cond10 = select i1 %67, i1 %62, i1 false
  br i1 %or.cond10, label %68, label %71

68:                                               ; preds = %66
  store i32 32993, ptr %0, align 8, !tbaa !13
  %69 = getelementptr inbounds i8, ptr %0, i64 8
  store i32 4, ptr %69, align 8, !tbaa !24
  %70 = call noundef i32 @_Z17comps2internalfmti(i32 noundef 4)
  br label %83

71:                                               ; preds = %66
  %72 = icmp eq i32 %61, 24
  %or.cond14 = select i1 %67, i1 %72, i1 false
  br i1 %or.cond14, label %73, label %76

73:                                               ; preds = %71
  store i32 32992, ptr %0, align 8, !tbaa !13
  %74 = getelementptr inbounds i8, ptr %0, i64 8
  store i32 3, ptr %74, align 8, !tbaa !24
  %75 = call noundef i32 @_Z17comps2internalfmti(i32 noundef 3)
  br label %83

76:                                               ; preds = %71
  %77 = icmp eq i32 %61, 8
  br i1 %77, label %78, label %81

78:                                               ; preds = %76
  store i32 6409, ptr %0, align 8, !tbaa !13
  %79 = getelementptr inbounds i8, ptr %0, i64 8
  store i32 1, ptr %79, align 8, !tbaa !24
  %80 = call noundef i32 @_Z17comps2internalfmti(i32 noundef 1)
  br label %83

81:                                               ; preds = %76
  %82 = call i32 @fclose(ptr noundef nonnull %15)
  br label %161

83:                                               ; preds = %63, %73, %78, %68, %51, %53, %55
  %.sink = phi i32 [ %65, %63 ], [ %75, %73 ], [ %80, %78 ], [ %70, %68 ], [ 33777, %51 ], [ 33778, %53 ], [ 33779, %55 ]
  %84 = getelementptr inbounds i8, ptr %0, i64 4
  store i32 %.sink, ptr %84, align 4, !tbaa !25
  %85 = load i32, ptr %30, align 4, !tbaa !26
  %86 = load i32, ptr %29, align 4, !tbaa !27
  %87 = load i32, ptr %44, align 4, !tbaa !28
  %88 = call noundef i32 @_ZN6nv_dds9CDDSImage10clamp_sizeEj(ptr noundef nonnull align 8 dereferenceable(104) %0, i32 noundef %87)
  %89 = call noundef zeroext i1 @_ZN6nv_dds9CDDSImage13is_compressedEv(ptr noundef nonnull align 8 dereferenceable(104) %0)
  %90 = getelementptr inbounds i8, ptr %0, i64 24
  %91 = select i1 %89, ptr @_ZN6nv_dds9CDDSImage9size_dxtcEjj, ptr @_ZN6nv_dds9CDDSImage8size_rgbEjj
  %92 = lshr i32 %85, 1
  %93 = lshr i32 %86, 1
  %94 = lshr i32 %88, 1
  br label %96

95:                                               ; preds = %.critedge
  %brmerge.not = and i1 %118, %2
  br i1 %brmerge.not, label %144, label %157

96:                                               ; preds = %83, %.critedge
  %indvars.iv = phi i64 [ 0, %83 ], [ %indvars.iv.next, %.critedge ]
  call void @llvm.lifetime.start.p0(i64 112, ptr nonnull %6) #11
  call void @_ZN6nv_dds8CTextureC1Ev(ptr noundef nonnull align 8 dereferenceable(112) %6)
  invoke void @_ZNSt5dequeIN6nv_dds8CTextureESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(80) %90, ptr noundef nonnull align 8 dereferenceable(112) %6)
          to label %97 unwind label %107

97:                                               ; preds = %96
  call void @_ZN6nv_dds8CTextureD1Ev(ptr noundef nonnull align 8 dereferenceable(112) %6) #11
  call void @llvm.lifetime.end.p0(i64 112, ptr nonnull %6) #11
  %98 = call noundef nonnull align 8 dereferenceable(112) ptr @_ZNSt5dequeIN6nv_dds8CTextureESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(80) %90, i64 noundef %indvars.iv) #11
  %99 = call noundef i32 %91(ptr noundef nonnull align 8 dereferenceable(104) %0, i32 noundef %85, i32 noundef %86)
  %100 = mul i32 %99, %88
  %101 = zext i32 %100 to i64
  %102 = call noalias noundef nonnull ptr @_Znam(i64 noundef %101) #14
  %103 = call i64 @fread(ptr noundef nonnull %102, i64 noundef 1, i64 noundef %101, ptr noundef nonnull %15)
  %104 = load ptr, ptr %98, align 8, !tbaa !29
  %105 = getelementptr inbounds i8, ptr %104, i64 16
  %106 = load ptr, ptr %105, align 8
  call void %106(ptr noundef nonnull align 8 dereferenceable(112) %98, i32 noundef %85, i32 noundef %86, i32 noundef %88, i32 noundef %100, ptr noundef nonnull %102)
  call void @_ZdaPv(ptr noundef nonnull %102) #15
  br i1 %2, label %109, label %110

107:                                              ; preds = %96
  %108 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN6nv_dds8CTextureD1Ev(ptr noundef nonnull align 8 dereferenceable(112) %6) #11
  call void @llvm.lifetime.end.p0(i64 112, ptr nonnull %6) #11
  br label %160

109:                                              ; preds = %97
  call void @_ZN6nv_dds9CDDSImage4flipERNS_8CSurfaceE(ptr noundef nonnull align 8 dereferenceable(104) %0, ptr noundef nonnull align 8 dereferenceable(32) %98)
  br label %110

110:                                              ; preds = %109, %97
  %111 = call noundef i32 @_ZN6nv_dds9CDDSImage10clamp_sizeEj(ptr noundef nonnull align 8 dereferenceable(104) %0, i32 noundef %92)
  %112 = call noundef i32 @_ZN6nv_dds9CDDSImage10clamp_sizeEj(ptr noundef nonnull align 8 dereferenceable(104) %0, i32 noundef %93)
  %113 = call noundef i32 @_ZN6nv_dds9CDDSImage10clamp_sizeEj(ptr noundef nonnull align 8 dereferenceable(104) %0, i32 noundef %94)
  %114 = load i32, ptr %32, align 4, !tbaa !31
  %spec.select = call i32 @llvm.usub.sat.i32(i32 %114, i32 1)
  %115 = icmp ult i32 %114, 2
  %116 = or i32 %112, %111
  %.not107120 = icmp eq i32 %116, 0
  %or.cond110121 = or i1 %.not107120, %115
  br i1 %or.cond110121, label %.critedge, label %.lr.ph

.critedge:                                        ; preds = %134, %110
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %117 = load i32, ptr %39, align 4, !tbaa !32
  %118 = icmp eq i32 %117, 3
  %119 = icmp ult i64 %indvars.iv, 5
  %120 = select i1 %118, i1 %119, i1 false
  br i1 %120, label %96, label %95, !llvm.loop !33

.lr.ph:                                           ; preds = %110, %134
  %.087125 = phi i32 [ %141, %134 ], [ 0, %110 ]
  %.089124 = phi i32 [ %140, %134 ], [ %113, %110 ]
  %.090123 = phi i32 [ %138, %134 ], [ %112, %110 ]
  %.091122 = phi i32 [ %136, %134 ], [ %111, %110 ]
  call void @llvm.lifetime.start.p0(i64 32, ptr nonnull %7) #11
  call void @_ZN6nv_dds8CSurfaceC1Ev(ptr noundef nonnull align 8 dereferenceable(32) %7)
  invoke void @_ZN6nv_dds8CTexture10add_mipmapERKNS_8CSurfaceE(ptr noundef nonnull align 8 dereferenceable(112) %98, ptr noundef nonnull align 8 dereferenceable(32) %7)
          to label %121 unwind label %131

121:                                              ; preds = %.lr.ph
  call void @_ZN6nv_dds8CSurfaceD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %7) #11
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %7) #11
  %122 = call noundef nonnull align 8 dereferenceable(32) ptr @_ZN6nv_dds8CTexture10get_mipmapEj(ptr noundef nonnull align 8 dereferenceable(112) %98, i32 noundef %.087125)
  %123 = call noundef i32 %91(ptr noundef nonnull align 8 dereferenceable(104) %0, i32 noundef %.091122, i32 noundef %.090123)
  %124 = mul i32 %123, %.089124
  %125 = zext i32 %124 to i64
  %126 = call noalias noundef nonnull ptr @_Znam(i64 noundef %125) #14
  %127 = call i64 @fread(ptr noundef nonnull %126, i64 noundef 1, i64 noundef %125, ptr noundef nonnull %15)
  %128 = load ptr, ptr %122, align 8, !tbaa !29
  %129 = getelementptr inbounds i8, ptr %128, i64 16
  %130 = load ptr, ptr %129, align 8
  call void %130(ptr noundef nonnull align 8 dereferenceable(32) %122, i32 noundef %.091122, i32 noundef %.090123, i32 noundef %.089124, i32 noundef %124, ptr noundef nonnull %126)
  call void @_ZdaPv(ptr noundef nonnull %126) #15
  br i1 %2, label %133, label %134

131:                                              ; preds = %.lr.ph
  %132 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN6nv_dds8CSurfaceD1Ev(ptr noundef nonnull align 8 dereferenceable(32) %7) #11
  call void @llvm.lifetime.end.p0(i64 32, ptr nonnull %7) #11
  br label %160

133:                                              ; preds = %121
  call void @_ZN6nv_dds9CDDSImage4flipERNS_8CSurfaceE(ptr noundef nonnull align 8 dereferenceable(104) %0, ptr noundef nonnull align 8 dereferenceable(32) %122)
  br label %134

134:                                              ; preds = %133, %121
  %135 = lshr i32 %.091122, 1
  %136 = call noundef i32 @_ZN6nv_dds9CDDSImage10clamp_sizeEj(ptr noundef nonnull align 8 dereferenceable(104) %0, i32 noundef %135)
  %137 = lshr i32 %.090123, 1
  %138 = call noundef i32 @_ZN6nv_dds9CDDSImage10clamp_sizeEj(ptr noundef nonnull align 8 dereferenceable(104) %0, i32 noundef %137)
  %139 = lshr i32 %.089124, 1
  %140 = call noundef i32 @_ZN6nv_dds9CDDSImage10clamp_sizeEj(ptr noundef nonnull align 8 dereferenceable(104) %0, i32 noundef %139)
  %141 = add nuw i32 %.087125, 1
  %142 = icmp uge i32 %141, %spec.select
  %143 = or i32 %138, %136
  %.not107 = icmp eq i32 %143, 0
  %or.cond110 = or i1 %.not107, %142
  br i1 %or.cond110, label %.critedge, label %.lr.ph, !llvm.loop !35

144:                                              ; preds = %95
  call void @llvm.lifetime.start.p0(i64 112, ptr nonnull %8) #11
  call void @_ZN6nv_dds8CTextureC1Ev(ptr noundef nonnull align 8 dereferenceable(112) %8)
  %145 = call noundef nonnull align 8 dereferenceable(112) ptr @_ZNSt5dequeIN6nv_dds8CTextureESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(80) %90, i64 noundef 3) #11
  %146 = invoke noundef nonnull align 8 dereferenceable(112) ptr @_ZN6nv_dds8CTextureaSERKS0_(ptr noundef nonnull align 8 dereferenceable(112) %8, ptr noundef nonnull align 8 dereferenceable(112) %145)
          to label %147 unwind label %155

147:                                              ; preds = %144
  %148 = call noundef nonnull align 8 dereferenceable(112) ptr @_ZNSt5dequeIN6nv_dds8CTextureESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(80) %90, i64 noundef 2) #11
  %149 = call noundef nonnull align 8 dereferenceable(112) ptr @_ZNSt5dequeIN6nv_dds8CTextureESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(80) %90, i64 noundef 3) #11
  %150 = invoke noundef nonnull align 8 dereferenceable(112) ptr @_ZN6nv_dds8CTextureaSERKS0_(ptr noundef nonnull align 8 dereferenceable(112) %149, ptr noundef nonnull align 8 dereferenceable(112) %148)
          to label %151 unwind label %155

151:                                              ; preds = %147
  %152 = call noundef nonnull align 8 dereferenceable(112) ptr @_ZNSt5dequeIN6nv_dds8CTextureESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(80) %90, i64 noundef 2) #11
  %153 = invoke noundef nonnull align 8 dereferenceable(112) ptr @_ZN6nv_dds8CTextureaSERKS0_(ptr noundef nonnull align 8 dereferenceable(112) %152, ptr noundef nonnull align 8 dereferenceable(112) %8)
          to label %154 unwind label %155

154:                                              ; preds = %151
  call void @_ZN6nv_dds8CTextureD1Ev(ptr noundef nonnull align 8 dereferenceable(112) %8) #11
  call void @llvm.lifetime.end.p0(i64 112, ptr nonnull %8) #11
  br label %157

155:                                              ; preds = %151, %147, %144
  %156 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN6nv_dds8CTextureD1Ev(ptr noundef nonnull align 8 dereferenceable(112) %8) #11
  call void @llvm.lifetime.end.p0(i64 112, ptr nonnull %8) #11
  br label %160

157:                                              ; preds = %95, %154
  %158 = call i32 @fclose(ptr noundef nonnull %15)
  %159 = getelementptr inbounds i8, ptr %0, i64 16
  store i8 1, ptr %159, align 8, !tbaa !36
  br label %161

160:                                              ; preds = %107, %131, %155
  %.pn.pn = phi { ptr, i32 } [ %156, %155 ], [ %132, %131 ], [ %108, %107 ]
  call void @llvm.lifetime.end.p0(i64 124, ptr nonnull %5) #11
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #11
  resume { ptr, i32 } %.pn.pn

161:                                              ; preds = %157, %81, %57
  %.0 = phi i1 [ false, %57 ], [ false, %81 ], [ true, %157 ]
  call void @llvm.lifetime.end.p0(i64 124, ptr nonnull %5) #11
  br label %162

162:                                              ; preds = %161, %22
  %.1 = phi i1 [ false, %22 ], [ %.0, %161 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #11
  br label %163

163:                                              ; preds = %11, %162
  %.2 = phi i1 [ %.1, %162 ], [ false, %11 ]
  ret i1 %.2
}

; Function Attrs: mustprogress nounwind uwtable
declare noundef i64 @_ZNKSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEE6lengthEv(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #4

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #4

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

; Function Attrs: nofree nounwind
declare noalias noundef ptr @fopen(ptr nocapture noundef readonly, ptr nocapture noundef readonly) local_unnamed_addr #6

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

; Function Attrs: nofree nounwind
declare noundef i64 @fread(ptr nocapture noundef, i64 noundef, i64 noundef, ptr nocapture noundef) local_unnamed_addr #6

; Function Attrs: mustprogress nofree nounwind willreturn memory(argmem: read)
declare i32 @strncmp(ptr nocapture noundef, ptr nocapture noundef, i64 noundef) local_unnamed_addr #7

; Function Attrs: nofree nounwind
declare noundef i32 @fclose(ptr nocapture noundef) local_unnamed_addr #6

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZN6nv_dds9CDDSImage11swap_endianEPv(ptr noundef nonnull align 8 dereferenceable(104), ptr noundef) local_unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN6nv_dds9CDDSImage10clamp_sizeEj(ptr noundef nonnull align 8 dereferenceable(104), i32 noundef) local_unnamed_addr #2 align 2

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN6nv_dds9CDDSImage9size_dxtcEjj(ptr noundef nonnull align 8 dereferenceable(104), i32 noundef, i32 noundef) local_unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN6nv_dds9CDDSImage8size_rgbEjj(ptr noundef nonnull align 8 dereferenceable(104), i32 noundef, i32 noundef) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt5dequeIN6nv_dds8CTextureESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(80), ptr noundef nonnull align 8 dereferenceable(112)) local_unnamed_addr #3 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(112) ptr @_ZNSt5dequeIN6nv_dds8CTextureESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(80), i64 noundef) local_unnamed_addr #1 align 2

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

; Function Attrs: nobuiltin nounwind
declare void @_ZdaPv(ptr noundef) local_unnamed_addr #9

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN6nv_dds8CTexture10add_mipmapERKNS_8CSurfaceE(ptr noundef nonnull align 8 dereferenceable(112), ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #4 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(32) ptr @_ZN6nv_dds8CTexture10get_mipmapEj(ptr noundef nonnull align 8 dereferenceable(112), i32 noundef) local_unnamed_addr #2 align 2

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

declare void @_ZN6nv_dds8CTextureC1Ev(ptr) local_unnamed_addr

declare void @_ZN6nv_dds8CTextureD1Ev(ptr) local_unnamed_addr

declare void @_ZN6nv_dds8CSurfaceC1Ev(ptr) local_unnamed_addr

declare void @_ZN6nv_dds8CSurfaceD1Ev(ptr) local_unnamed_addr

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.usub.sat.i32(i32, i32) #10

attributes #0 = { noreturn 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 #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 = { 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 #3 = { 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 = { 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 #5 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #6 = { nofree 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 #7 = { mustprogress nofree nounwind willreturn memory(argmem: 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 #8 = { 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 #9 = { 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 #10 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #11 = { nounwind }
attributes #12 = { noreturn nounwind }
attributes #13 = { nounwind willreturn memory(read) }
attributes #14 = { builtin allocsize(0) }
attributes #15 = { 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 108}
!6 = !{!"_ZTSN6nv_dds10DDS_HEADERE", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !7, i64 16, !7, i64 20, !7, i64 24, !8, i64 28, !10, i64 72, !7, i64 104, !7, i64 108, !8, i64 112}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"_ZTSN6nv_dds15DDS_PIXELFORMATE", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !7, i64 16, !7, i64 20, !7, i64 24, !7, i64 28}
!11 = !{!6, !7, i64 76}
!12 = !{!6, !7, i64 80}
!13 = !{!14, !7, i64 0}
!14 = !{!"_ZTSN6nv_dds9CDDSImageE", !7, i64 0, !7, i64 4, !7, i64 8, !15, i64 12, !16, i64 16, !17, i64 24}
!15 = !{!"_ZTSN6nv_dds11TextureTypeE", !8, i64 0}
!16 = !{!"bool", !8, i64 0}
!17 = !{!"_ZTSSt5dequeIN6nv_dds8CTextureESaIS1_EE", !18, i64 0}
!18 = !{!"_ZTSSt11_Deque_baseIN6nv_dds8CTextureESaIS1_EE", !19, i64 0}
!19 = !{!"_ZTSNSt11_Deque_baseIN6nv_dds8CTextureESaIS1_EE11_Deque_implE", !20, i64 0}
!20 = !{!"_ZTSNSt11_Deque_baseIN6nv_dds8CTextureESaIS1_EE16_Deque_impl_dataE", !21, i64 0, !22, i64 8, !23, i64 16, !23, i64 48}
!21 = !{!"any pointer", !8, i64 0}
!22 = !{!"long", !8, i64 0}
!23 = !{!"_ZTSSt15_Deque_iteratorIN6nv_dds8CTextureERS1_PS1_E", !21, i64 0, !21, i64 8, !21, i64 16, !21, i64 24}
!24 = !{!14, !7, i64 8}
!25 = !{!14, !7, i64 4}
!26 = !{!6, !7, i64 12}
!27 = !{!6, !7, i64 8}
!28 = !{!6, !7, i64 20}
!29 = !{!30, !30, i64 0}
!30 = !{!"vtable pointer", !9, i64 0}
!31 = !{!6, !7, i64 24}
!32 = !{!14, !15, i64 12}
!33 = distinct !{!33, !34}
!34 = !{!"llvm.loop.mustprogress"}
!35 = distinct !{!35, !34}
!36 = !{!14, !16, i64 16}


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