; LLVM IR from Optiroc/SuperFamiconv :: src/Tiles.ll (ZN3sfc4TileC2ERKSt6vectorIhSaIhEENS_4ModeEjbjj)

; 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::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<unsigned char, std::allocator<unsigned char>>::_Vector_impl" }
%"struct.std::_Vector_base<unsigned char, std::allocator<unsigned char>>::_Vector_impl" = type { %"struct.std::_Vector_base<unsigned char, std::allocator<unsigned char>>::_Vector_impl_data" }
%"struct.std::_Vector_base<unsigned char, std::allocator<unsigned char>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"struct.sfc::Tile" = type { i32, i32, i32, i32, %"class.std::vector", %"class.std::vector.0", %"class.std::vector.5" }
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<std::vector<unsigned char>, std::allocator<std::vector<unsigned char>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::vector<unsigned char>, std::allocator<std::vector<unsigned char>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::vector<unsigned char>, std::allocator<std::vector<unsigned char>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::vector<unsigned char>, std::allocator<std::vector<unsigned char>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.5" = type { %"struct.std::_Vector_base.6" }
%"struct.std::_Vector_base.6" = type { %"struct.std::_Vector_base<unsigned int, std::allocator<unsigned int>>::_Vector_impl" }
%"struct.std::_Vector_base<unsigned int, std::allocator<unsigned int>>::_Vector_impl" = type { %"struct.std::_Vector_base<unsigned int, std::allocator<unsigned int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<unsigned int, std::allocator<unsigned int>>::_Vector_impl_data" = type { ptr, ptr, ptr }

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

declare i32 @__gxx_personality_v0(...)

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN3sfc6mirrorIhEESt6vectorIT_SaIS2_EERKS4_jbb(ptr dead_on_unwind noalias writable sret(%"class.std::vector") align 8, ptr noundef nonnull align 8 dereferenceable(24), i32 noundef, i1 noundef zeroext, i1 noundef zeroext) #3

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3sfc4TileC2ERKSt6vectorIhSaIhEENS_4ModeEjbjj(ptr noundef nonnull align 8 dereferenceable(88) %0, ptr noundef nonnull align 8 dereferenceable(24) %1, i32 noundef %2, i32 noundef %3, i1 noundef zeroext %4, i32 noundef %5, i32 noundef %6) unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i8, align 1
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca ptr, align 8
  %16 = alloca i32, align 4
  %17 = alloca i8, align 1
  %18 = alloca i32, align 4
  %19 = alloca i8, align 1
  %20 = alloca %"class.std::vector", align 8
  %21 = alloca %"class.std::vector", align 8
  %22 = alloca %"class.std::vector", align 8
  store ptr %0, ptr %8, align 8, !tbaa !5
  store ptr %1, ptr %9, align 8, !tbaa !5
  store i32 %2, ptr %10, align 4, !tbaa !9
  store i32 %3, ptr %11, align 4, !tbaa !11
  %23 = zext i1 %4 to i8
  store i8 %23, ptr %12, align 1, !tbaa !13
  store i32 %5, ptr %13, align 4, !tbaa !11
  store i32 %6, ptr %14, align 4, !tbaa !11
  %24 = load ptr, ptr %8, align 8
  %25 = getelementptr inbounds %"struct.sfc::Tile", ptr %24, i32 0, i32 0
  %26 = load i32, ptr %10, align 4, !tbaa !9
  store i32 %26, ptr %25, align 8, !tbaa !15
  %27 = getelementptr inbounds %"struct.sfc::Tile", ptr %24, i32 0, i32 1
  %28 = load i32, ptr %11, align 4, !tbaa !11
  store i32 %28, ptr %27, align 4, !tbaa !29
  %29 = getelementptr inbounds %"struct.sfc::Tile", ptr %24, i32 0, i32 2
  %30 = load i32, ptr %13, align 4, !tbaa !11
  store i32 %30, ptr %29, align 8, !tbaa !30
  %31 = getelementptr inbounds %"struct.sfc::Tile", ptr %24, i32 0, i32 3
  %32 = load i32, ptr %14, align 4, !tbaa !11
  store i32 %32, ptr %31, align 4, !tbaa !31
  %33 = getelementptr inbounds %"struct.sfc::Tile", ptr %24, i32 0, i32 4
  %34 = load ptr, ptr %9, align 8, !tbaa !5
  %35 = load i32, ptr %10, align 4, !tbaa !9
  %36 = load i32, ptr %11, align 4, !tbaa !11
  %37 = load i32, ptr %13, align 4, !tbaa !11
  %38 = load i32, ptr %14, align 4, !tbaa !11
  call void @_ZN3sfc18unpack_native_tileERKSt6vectorIhSaIhEENS_4ModeEjjj(ptr dead_on_unwind writable sret(%"class.std::vector") align 8 %33, ptr noundef nonnull align 8 dereferenceable(24) %34, i32 noundef %35, i32 noundef %36, i32 noundef %37, i32 noundef %38)
  %39 = getelementptr inbounds %"struct.sfc::Tile", ptr %24, i32 0, i32 5
  call void @_ZNSt6vectorIS_IhSaIhEESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %39) #4
  %40 = getelementptr inbounds %"struct.sfc::Tile", ptr %24, i32 0, i32 6
  call void @_ZNSt6vectorIjSaIjEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %40) #4
  %41 = getelementptr inbounds %"struct.sfc::Tile", ptr %24, i32 0, i32 6
  %42 = load i32, ptr %11, align 4, !tbaa !11
  %43 = invoke noundef i32 @_ZN3sfc19palette_size_at_bppEj(i32 noundef %42)
          to label %44 unwind label %58

44:                                               ; preds = %7
  %45 = zext i32 %43 to i64
  invoke void @_ZNSt6vectorIjSaIjEE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) %41, i64 noundef %45)
          to label %46 unwind label %58

46:                                               ; preds = %44
  call void @llvm.lifetime.start.p0(i64 1, ptr %17) #4
  %47 = getelementptr inbounds %"struct.sfc::Tile", ptr %24, i32 0, i32 6
  %48 = call noundef i64 @_ZNKSt6vectorIjSaIjEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %47) #4
  %49 = udiv i64 256, %48
  %50 = trunc i64 %49 to i8
  store i8 %50, ptr %17, align 1, !tbaa !32
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #4
  store i32 0, ptr %18, align 4, !tbaa !11
  br label %51

51:                                               ; preds = %83, %46
  %52 = load i32, ptr %18, align 4, !tbaa !11
  %53 = zext i32 %52 to i64
  %54 = getelementptr inbounds %"struct.sfc::Tile", ptr %24, i32 0, i32 6
  %55 = call noundef i64 @_ZNKSt6vectorIjSaIjEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %54) #4
  %56 = icmp ult i64 %53, %55
  br i1 %56, label %62, label %57

57:                                               ; preds = %51
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #4
  br label %86

58:                                               ; preds = %44, %7
  %59 = landingpad { ptr, i32 }
          cleanup
  %60 = extractvalue { ptr, i32 } %59, 0
  store ptr %60, ptr %15, align 8
  %61 = extractvalue { ptr, i32 } %59, 1
  store i32 %61, ptr %16, align 4
  br label %137

62:                                               ; preds = %51
  call void @llvm.lifetime.start.p0(i64 1, ptr %19) #4
  %63 = load i8, ptr %17, align 1, !tbaa !32
  %64 = zext i8 %63 to i32
  %65 = load i32, ptr %18, align 4, !tbaa !11
  %66 = mul i32 %64, %65
  %67 = trunc i32 %66 to i8
  store i8 %67, ptr %19, align 1, !tbaa !32
  %68 = load i8, ptr %19, align 1, !tbaa !32
  %69 = zext i8 %68 to i32
  %70 = add i32 -16777216, %69
  %71 = load i8, ptr %19, align 1, !tbaa !32
  %72 = zext i8 %71 to i32
  %73 = shl i32 %72, 8
  %74 = add i32 %70, %73
  %75 = load i8, ptr %19, align 1, !tbaa !32
  %76 = zext i8 %75 to i32
  %77 = shl i32 %76, 16
  %78 = add i32 %74, %77
  %79 = getelementptr inbounds %"struct.sfc::Tile", ptr %24, i32 0, i32 6
  %80 = load i32, ptr %18, align 4, !tbaa !11
  %81 = zext i32 %80 to i64
  %82 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIjSaIjEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %79, i64 noundef %81) #4
  store i32 %78, ptr %82, align 4, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 1, ptr %19) #4
  br label %83

83:                                               ; preds = %62
  %84 = load i32, ptr %18, align 4, !tbaa !11
  %85 = add i32 %84, 1
  store i32 %85, ptr %18, align 4, !tbaa !11
  br label %51, !llvm.loop !33

86:                                               ; preds = %57
  %87 = load i8, ptr %12, align 1, !tbaa !13, !range !35, !noundef !36
  %88 = trunc i8 %87 to i1
  br i1 %88, label %135, label %89

89:                                               ; preds = %86
  %90 = getelementptr inbounds %"struct.sfc::Tile", ptr %24, i32 0, i32 5
  call void @llvm.lifetime.start.p0(i64 24, ptr %20) #4
  %91 = getelementptr inbounds %"struct.sfc::Tile", ptr %24, i32 0, i32 4
  %92 = getelementptr inbounds %"struct.sfc::Tile", ptr %24, i32 0, i32 2
  %93 = load i32, ptr %92, align 8, !tbaa !30
  invoke void @_ZN3sfc6mirrorIhEESt6vectorIT_SaIS2_EERKS4_jbb(ptr dead_on_unwind writable sret(%"class.std::vector") align 8 %20, ptr noundef nonnull align 8 dereferenceable(24) %91, i32 noundef %93, i1 noundef zeroext true, i1 noundef zeroext false)
          to label %94 unwind label %108

94:                                               ; preds = %89
  invoke void @_ZNSt6vectorIS_IhSaIhEESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %90, ptr noundef nonnull align 8 dereferenceable(24) %20)
          to label %95 unwind label %112

95:                                               ; preds = %94
  call void @_ZNSt6vectorIhSaIhEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %20) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr %20) #4
  %96 = getelementptr inbounds %"struct.sfc::Tile", ptr %24, i32 0, i32 5
  call void @llvm.lifetime.start.p0(i64 24, ptr %21) #4
  %97 = getelementptr inbounds %"struct.sfc::Tile", ptr %24, i32 0, i32 4
  %98 = getelementptr inbounds %"struct.sfc::Tile", ptr %24, i32 0, i32 2
  %99 = load i32, ptr %98, align 8, !tbaa !30
  invoke void @_ZN3sfc6mirrorIhEESt6vectorIT_SaIS2_EERKS4_jbb(ptr dead_on_unwind writable sret(%"class.std::vector") align 8 %21, ptr noundef nonnull align 8 dereferenceable(24) %97, i32 noundef %99, i1 noundef zeroext false, i1 noundef zeroext true)
          to label %100 unwind label %117

100:                                              ; preds = %95
  invoke void @_ZNSt6vectorIS_IhSaIhEESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %96, ptr noundef nonnull align 8 dereferenceable(24) %21)
          to label %101 unwind label %121

101:                                              ; preds = %100
  call void @_ZNSt6vectorIhSaIhEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %21) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr %21) #4
  %102 = getelementptr inbounds %"struct.sfc::Tile", ptr %24, i32 0, i32 5
  call void @llvm.lifetime.start.p0(i64 24, ptr %22) #4
  %103 = getelementptr inbounds %"struct.sfc::Tile", ptr %24, i32 0, i32 4
  %104 = getelementptr inbounds %"struct.sfc::Tile", ptr %24, i32 0, i32 2
  %105 = load i32, ptr %104, align 8, !tbaa !30
  invoke void @_ZN3sfc6mirrorIhEESt6vectorIT_SaIS2_EERKS4_jbb(ptr dead_on_unwind writable sret(%"class.std::vector") align 8 %22, ptr noundef nonnull align 8 dereferenceable(24) %103, i32 noundef %105, i1 noundef zeroext true, i1 noundef zeroext true)
          to label %106 unwind label %126

106:                                              ; preds = %101
  invoke void @_ZNSt6vectorIS_IhSaIhEESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %102, ptr noundef nonnull align 8 dereferenceable(24) %22)
          to label %107 unwind label %130

107:                                              ; preds = %106
  call void @_ZNSt6vectorIhSaIhEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %22) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr %22) #4
  br label %135

108:                                              ; preds = %89
  %109 = landingpad { ptr, i32 }
          cleanup
  %110 = extractvalue { ptr, i32 } %109, 0
  store ptr %110, ptr %15, align 8
  %111 = extractvalue { ptr, i32 } %109, 1
  store i32 %111, ptr %16, align 4
  br label %116

112:                                              ; preds = %94
  %113 = landingpad { ptr, i32 }
          cleanup
  %114 = extractvalue { ptr, i32 } %113, 0
  store ptr %114, ptr %15, align 8
  %115 = extractvalue { ptr, i32 } %113, 1
  store i32 %115, ptr %16, align 4
  call void @_ZNSt6vectorIhSaIhEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %20) #4
  br label %116

116:                                              ; preds = %112, %108
  call void @llvm.lifetime.end.p0(i64 24, ptr %20) #4
  br label %136

117:                                              ; preds = %95
  %118 = landingpad { ptr, i32 }
          cleanup
  %119 = extractvalue { ptr, i32 } %118, 0
  store ptr %119, ptr %15, align 8
  %120 = extractvalue { ptr, i32 } %118, 1
  store i32 %120, ptr %16, align 4
  br label %125

121:                                              ; preds = %100
  %122 = landingpad { ptr, i32 }
          cleanup
  %123 = extractvalue { ptr, i32 } %122, 0
  store ptr %123, ptr %15, align 8
  %124 = extractvalue { ptr, i32 } %122, 1
  store i32 %124, ptr %16, align 4
  call void @_ZNSt6vectorIhSaIhEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %21) #4
  br label %125

125:                                              ; preds = %121, %117
  call void @llvm.lifetime.end.p0(i64 24, ptr %21) #4
  br label %136

126:                                              ; preds = %101
  %127 = landingpad { ptr, i32 }
          cleanup
  %128 = extractvalue { ptr, i32 } %127, 0
  store ptr %128, ptr %15, align 8
  %129 = extractvalue { ptr, i32 } %127, 1
  store i32 %129, ptr %16, align 4
  br label %134

130:                                              ; preds = %106
  %131 = landingpad { ptr, i32 }
          cleanup
  %132 = extractvalue { ptr, i32 } %131, 0
  store ptr %132, ptr %15, align 8
  %133 = extractvalue { ptr, i32 } %131, 1
  store i32 %133, ptr %16, align 4
  call void @_ZNSt6vectorIhSaIhEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %22) #4
  br label %134

134:                                              ; preds = %130, %126
  call void @llvm.lifetime.end.p0(i64 24, ptr %22) #4
  br label %136

135:                                              ; preds = %107, %86
  call void @llvm.lifetime.end.p0(i64 1, ptr %17) #4
  ret void

136:                                              ; preds = %134, %125, %116
  call void @llvm.lifetime.end.p0(i64 1, ptr %17) #4
  br label %137

137:                                              ; preds = %136, %58
  call void @_ZNSt6vectorIjSaIjEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %40) #4
  call void @_ZNSt6vectorIS_IhSaIhEESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %39) #4
  call void @_ZNSt6vectorIhSaIhEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %33) #4
  br label %138

138:                                              ; preds = %137
  %139 = load ptr, ptr %15, align 8
  %140 = load i32, ptr %16, align 4
  %141 = insertvalue { ptr, i32 } poison, ptr %139, 0
  %142 = insertvalue { ptr, i32 } %141, i32 %140, 1
  resume { ptr, i32 } %142
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN3sfc18unpack_native_tileERKSt6vectorIhSaIhEENS_4ModeEjjj(ptr dead_on_unwind noalias writable sret(%"class.std::vector") align 8, ptr noundef nonnull align 8 dereferenceable(24), i32 noundef, i32 noundef, i32 noundef, i32 noundef) #3

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN3sfc19palette_size_at_bppEj(i32 noundef) #0

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIjSaIjEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #0 align 2

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

!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 = !{!"_ZTSN3sfc4ModeE", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!14, !14, i64 0}
!14 = !{!"bool", !7, i64 0}
!15 = !{!16, !10, i64 0}
!16 = !{!"_ZTSN3sfc4TileE", !10, i64 0, !12, i64 4, !12, i64 8, !12, i64 12, !17, i64 16, !21, i64 40, !25, i64 64}
!17 = !{!"_ZTSSt6vectorIhSaIhEE", !18, i64 0}
!18 = !{!"_ZTSSt12_Vector_baseIhSaIhEE", !19, i64 0}
!19 = !{!"_ZTSNSt12_Vector_baseIhSaIhEE12_Vector_implE", !20, i64 0}
!20 = !{!"_ZTSNSt12_Vector_baseIhSaIhEE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!21 = !{!"_ZTSSt6vectorIS_IhSaIhEESaIS1_EE", !22, i64 0}
!22 = !{!"_ZTSSt12_Vector_baseISt6vectorIhSaIhEESaIS2_EE", !23, i64 0}
!23 = !{!"_ZTSNSt12_Vector_baseISt6vectorIhSaIhEESaIS2_EE12_Vector_implE", !24, i64 0}
!24 = !{!"_ZTSNSt12_Vector_baseISt6vectorIhSaIhEESaIS2_EE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!25 = !{!"_ZTSSt6vectorIjSaIjEE", !26, i64 0}
!26 = !{!"_ZTSSt12_Vector_baseIjSaIjEE", !27, i64 0}
!27 = !{!"_ZTSNSt12_Vector_baseIjSaIjEE12_Vector_implE", !28, i64 0}
!28 = !{!"_ZTSNSt12_Vector_baseIjSaIjEE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!29 = !{!16, !12, i64 4}
!30 = !{!16, !12, i64 8}
!31 = !{!16, !12, i64 12}
!32 = !{!7, !7, i64 0}
!33 = distinct !{!33, !34}
!34 = !{!"llvm.loop.mustprogress"}
!35 = !{i8 0, i8 2}
!36 = !{}


; 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::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<unsigned char, std::allocator<unsigned char>>::_Vector_impl" }
%"struct.std::_Vector_base<unsigned char, std::allocator<unsigned char>>::_Vector_impl" = type { %"struct.std::_Vector_base<unsigned char, std::allocator<unsigned char>>::_Vector_impl_data" }
%"struct.std::_Vector_base<unsigned char, std::allocator<unsigned char>>::_Vector_impl_data" = type { ptr, ptr, ptr }

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

declare i32 @__gxx_personality_v0(...)

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN3sfc6mirrorIhEESt6vectorIT_SaIS2_EERKS4_jbb(ptr dead_on_unwind noalias writable sret(%"class.std::vector") align 8, ptr noundef nonnull align 8 dereferenceable(24), i32 noundef, i1 noundef zeroext, i1 noundef zeroext) local_unnamed_addr #3

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN3sfc4TileC2ERKSt6vectorIhSaIhEENS_4ModeEjbjj(ptr noundef nonnull align 8 dereferenceable(88) %0, ptr noundef nonnull align 8 dereferenceable(24) %1, i32 noundef %2, i32 noundef %3, i1 noundef zeroext %4, i32 noundef %5, i32 noundef %6) unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %8 = alloca %"class.std::vector", align 8
  %9 = alloca %"class.std::vector", align 8
  %10 = alloca %"class.std::vector", align 8
  store i32 %2, ptr %0, align 8, !tbaa !5
  %11 = getelementptr inbounds i8, ptr %0, i64 4
  store i32 %3, ptr %11, align 4, !tbaa !24
  %12 = getelementptr inbounds i8, ptr %0, i64 8
  store i32 %5, ptr %12, align 8, !tbaa !25
  %13 = getelementptr inbounds i8, ptr %0, i64 12
  store i32 %6, ptr %13, align 4, !tbaa !26
  %14 = getelementptr inbounds i8, ptr %0, i64 16
  tail call void @_ZN3sfc18unpack_native_tileERKSt6vectorIhSaIhEENS_4ModeEjjj(ptr dead_on_unwind nonnull writable sret(%"class.std::vector") align 8 %14, ptr noundef nonnull align 8 dereferenceable(24) %1, i32 noundef %2, i32 noundef %3, i32 noundef %5, i32 noundef %6)
  %15 = getelementptr inbounds i8, ptr %0, i64 40
  tail call void @_ZNSt6vectorIS_IhSaIhEESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %15) #4
  %16 = getelementptr inbounds i8, ptr %0, i64 64
  tail call void @_ZNSt6vectorIjSaIjEEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %16) #4
  %17 = tail call noundef i32 @_ZN3sfc19palette_size_at_bppEj(i32 noundef %3)
  %18 = zext i32 %17 to i64
  invoke void @_ZNSt6vectorIjSaIjEE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) %16, i64 noundef %18)
          to label %19 unwind label %24

19:                                               ; preds = %7
  %20 = tail call noundef i64 @_ZNKSt6vectorIjSaIjEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %16) #4
  %21 = udiv i64 256, %20
  %22 = trunc nuw nsw i64 %21 to i32
  %23 = tail call noundef i64 @_ZNKSt6vectorIjSaIjEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %16) #4
  %.not = icmp eq i64 %23, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %.lr.ph, %19
  br i1 %4, label %61, label %36

24:                                               ; preds = %7
  %25 = landingpad { ptr, i32 }
          cleanup
  br label %62

.lr.ph:                                           ; preds = %19, %.lr.ph
  %26 = phi i64 [ %33, %.lr.ph ], [ 0, %19 ]
  %.02135 = phi i32 [ %32, %.lr.ph ], [ 0, %19 ]
  %27 = mul i32 %.02135, %22
  %28 = and i32 %27, 255
  %29 = mul nuw nsw i32 %28, 65793
  %30 = or disjoint i32 %29, -16777216
  %31 = tail call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIjSaIjEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %16, i64 noundef %26) #4
  store i32 %30, ptr %31, align 4, !tbaa !27
  %32 = add i32 %.02135, 1
  %33 = zext i32 %32 to i64
  %34 = tail call noundef i64 @_ZNKSt6vectorIjSaIjEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %16) #4
  %35 = icmp ugt i64 %34, %33
  br i1 %35, label %.lr.ph, label %._crit_edge, !llvm.loop !28

36:                                               ; preds = %._crit_edge
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %8) #4
  %37 = load i32, ptr %12, align 8, !tbaa !25
  invoke void @_ZN3sfc6mirrorIhEESt6vectorIT_SaIS2_EERKS4_jbb(ptr dead_on_unwind nonnull writable sret(%"class.std::vector") align 8 %8, ptr noundef nonnull align 8 dereferenceable(24) %14, i32 noundef %37, i1 noundef zeroext true, i1 noundef zeroext false)
          to label %38 unwind label %46

38:                                               ; preds = %36
  invoke void @_ZNSt6vectorIS_IhSaIhEESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %15, ptr noundef nonnull align 8 dereferenceable(24) %8)
          to label %39 unwind label %48

39:                                               ; preds = %38
  call void @_ZNSt6vectorIhSaIhEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %8) #4
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %9) #4
  %40 = load i32, ptr %12, align 8, !tbaa !25
  invoke void @_ZN3sfc6mirrorIhEESt6vectorIT_SaIS2_EERKS4_jbb(ptr dead_on_unwind nonnull writable sret(%"class.std::vector") align 8 %9, ptr noundef nonnull align 8 dereferenceable(24) %14, i32 noundef %40, i1 noundef zeroext false, i1 noundef zeroext true)
          to label %41 unwind label %51

41:                                               ; preds = %39
  invoke void @_ZNSt6vectorIS_IhSaIhEESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %15, ptr noundef nonnull align 8 dereferenceable(24) %9)
          to label %42 unwind label %53

42:                                               ; preds = %41
  call void @_ZNSt6vectorIhSaIhEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %9) #4
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %10) #4
  %43 = load i32, ptr %12, align 8, !tbaa !25
  invoke void @_ZN3sfc6mirrorIhEESt6vectorIT_SaIS2_EERKS4_jbb(ptr dead_on_unwind nonnull writable sret(%"class.std::vector") align 8 %10, ptr noundef nonnull align 8 dereferenceable(24) %14, i32 noundef %43, i1 noundef zeroext true, i1 noundef zeroext true)
          to label %44 unwind label %56

44:                                               ; preds = %42
  invoke void @_ZNSt6vectorIS_IhSaIhEESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %15, ptr noundef nonnull align 8 dereferenceable(24) %10)
          to label %45 unwind label %58

45:                                               ; preds = %44
  call void @_ZNSt6vectorIhSaIhEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %10) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %10) #4
  br label %61

46:                                               ; preds = %36
  %47 = landingpad { ptr, i32 }
          cleanup
  br label %50

48:                                               ; preds = %38
  %49 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt6vectorIhSaIhEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %8) #4
  br label %50

50:                                               ; preds = %48, %46
  %.pn = phi { ptr, i32 } [ %49, %48 ], [ %47, %46 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %8) #4
  br label %62

51:                                               ; preds = %39
  %52 = landingpad { ptr, i32 }
          cleanup
  br label %55

53:                                               ; preds = %41
  %54 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt6vectorIhSaIhEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #4
  br label %55

55:                                               ; preds = %53, %51
  %.pn29 = phi { ptr, i32 } [ %54, %53 ], [ %52, %51 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %9) #4
  br label %62

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

58:                                               ; preds = %44
  %59 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt6vectorIhSaIhEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %10) #4
  br label %60

60:                                               ; preds = %58, %56
  %.pn31 = phi { ptr, i32 } [ %59, %58 ], [ %57, %56 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %10) #4
  br label %62

61:                                               ; preds = %45, %._crit_edge
  ret void

62:                                               ; preds = %50, %55, %60, %24
  %.pn31.pn.pn = phi { ptr, i32 } [ %25, %24 ], [ %.pn31, %60 ], [ %.pn29, %55 ], [ %.pn, %50 ]
  call void @_ZNSt6vectorIjSaIjEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %16) #4
  call void @_ZNSt6vectorIS_IhSaIhEESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %15) #4
  call void @_ZNSt6vectorIhSaIhEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %14) #4
  resume { ptr, i32 } %.pn31.pn.pn
}

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN3sfc18unpack_native_tileERKSt6vectorIhSaIhEENS_4ModeEjjj(ptr dead_on_unwind noalias writable sret(%"class.std::vector") align 8, ptr noundef nonnull align 8 dereferenceable(24), i32 noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #3

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZN3sfc19palette_size_at_bppEj(i32 noundef) local_unnamed_addr #0

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIjSaIjEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #0 align 2

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

!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 = !{!"_ZTSN3sfc4TileE", !7, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !11, i64 16, !16, i64 40, !20, i64 64}
!7 = !{!"_ZTSN3sfc4ModeE", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!"_ZTSSt6vectorIhSaIhEE", !12, i64 0}
!12 = !{!"_ZTSSt12_Vector_baseIhSaIhEE", !13, i64 0}
!13 = !{!"_ZTSNSt12_Vector_baseIhSaIhEE12_Vector_implE", !14, i64 0}
!14 = !{!"_ZTSNSt12_Vector_baseIhSaIhEE17_Vector_impl_dataE", !15, i64 0, !15, i64 8, !15, i64 16}
!15 = !{!"any pointer", !8, i64 0}
!16 = !{!"_ZTSSt6vectorIS_IhSaIhEESaIS1_EE", !17, i64 0}
!17 = !{!"_ZTSSt12_Vector_baseISt6vectorIhSaIhEESaIS2_EE", !18, i64 0}
!18 = !{!"_ZTSNSt12_Vector_baseISt6vectorIhSaIhEESaIS2_EE12_Vector_implE", !19, i64 0}
!19 = !{!"_ZTSNSt12_Vector_baseISt6vectorIhSaIhEESaIS2_EE17_Vector_impl_dataE", !15, i64 0, !15, i64 8, !15, i64 16}
!20 = !{!"_ZTSSt6vectorIjSaIjEE", !21, i64 0}
!21 = !{!"_ZTSSt12_Vector_baseIjSaIjEE", !22, i64 0}
!22 = !{!"_ZTSNSt12_Vector_baseIjSaIjEE12_Vector_implE", !23, i64 0}
!23 = !{!"_ZTSNSt12_Vector_baseIjSaIjEE17_Vector_impl_dataE", !15, i64 0, !15, i64 8, !15, i64 16}
!24 = !{!6, !10, i64 4}
!25 = !{!6, !10, i64 8}
!26 = !{!6, !10, i64 12}
!27 = !{!10, !10, i64 0}
!28 = distinct !{!28, !29}
!29 = !{!"llvm.loop.mustprogress"}


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