; LLVM IR from paroj/gltut :: glsdk/glimg/source/ImageCreator.ll (ZN5glimg12ImageCreator16CopyImageFlippedEPKvPhi)

; 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"

%"struct.glimg::Dimensions" = type { i32, i32, i32, i32 }
%"class.glimg::ImageCreator" = type { %"class.glimg::ImageFormat", %"struct.glimg::Dimensions", i32, i32, i32, %"class.std::vector", %"class.std::vector.0" }
%"class.glimg::ImageFormat" = type { %"struct.glimg::UncheckedImageFormat" }
%"struct.glimg::UncheckedImageFormat" = type { i32, i32, i32, i32, i32 }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = 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.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<unsigned long, std::allocator<unsigned long>>::_Vector_impl" }
%"struct.std::_Vector_base<unsigned long, std::allocator<unsigned long>>::_Vector_impl" = type { %"struct.std::_Vector_base<unsigned long, std::allocator<unsigned long>>::_Vector_impl_data" }
%"struct.std::_Vector_base<unsigned long, std::allocator<unsigned long>>::_Vector_impl_data" = type { ptr, ptr, ptr }

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0

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

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

declare { i64, i64 } @_ZN5glimg19ModifySizeForMipmapENS_10DimensionsEi(i64, i64, i32 noundef) #2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN5glimg12ImageCreator16CopyImageFlippedEPKvPhi(ptr noundef nonnull align 8 dereferenceable(96) %0, ptr noundef %1, ptr noundef %2, i32 noundef %3) #4 align 2 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i32, align 4
  %9 = alloca %"struct.glimg::Dimensions", align 4
  %10 = alloca %"struct.glimg::Dimensions", align 4
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !5
  store i32 %3, ptr %8, align 4, !tbaa !9
  %11 = load ptr, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr %9) #5
  %12 = getelementptr inbounds %"class.glimg::ImageCreator", ptr %11, i32 0, i32 1
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %10, ptr align 4 %12, i64 16, i1 false), !tbaa.struct !11
  %13 = load i32, ptr %8, align 4, !tbaa !9
  %14 = getelementptr inbounds { i64, i64 }, ptr %10, i32 0, i32 0
  %15 = load i64, ptr %14, align 4
  %16 = getelementptr inbounds { i64, i64 }, ptr %10, i32 0, i32 1
  %17 = load i64, ptr %16, align 4
  %18 = call { i64, i64 } @_ZN5glimg19ModifySizeForMipmapENS_10DimensionsEi(i64 %15, i64 %17, i32 noundef %13)
  %19 = getelementptr inbounds { i64, i64 }, ptr %9, i32 0, i32 0
  %20 = extractvalue { i64, i64 } %18, 0
  store i64 %20, ptr %19, align 4
  %21 = getelementptr inbounds { i64, i64 }, ptr %9, i32 0, i32 1
  %22 = extractvalue { i64, i64 } %18, 1
  store i64 %22, ptr %21, align 4
  %23 = getelementptr inbounds %"class.glimg::ImageCreator", ptr %11, i32 0, i32 0
  %24 = call noundef i32 @_ZNK5glimg11ImageFormat4TypeEv(ptr noundef nonnull align 4 dereferenceable(20) %23)
  %25 = icmp slt i32 %24, 6
  br i1 %25, label %26, label %38

26:                                               ; preds = %4
  %27 = load ptr, ptr %7, align 8, !tbaa !5
  %28 = getelementptr inbounds %"class.glimg::ImageCreator", ptr %11, i32 0, i32 0
  %29 = load i32, ptr %8, align 4, !tbaa !9
  %30 = load ptr, ptr %6, align 8, !tbaa !5
  %31 = getelementptr inbounds %"class.glimg::ImageCreator", ptr %11, i32 0, i32 6
  %32 = load i32, ptr %8, align 4, !tbaa !9
  %33 = sext i32 %32 to i64
  %34 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorImSaImEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %31, i64 noundef %33) #5
  %35 = load i64, ptr %34, align 8, !tbaa !12
  %36 = trunc i64 %35 to i32
  %37 = call noundef ptr @_ZN5glimg12_GLOBAL__N_117CopyPixelsFlippedEPhRKNS_10DimensionsERKNS_11ImageFormatEiPKvi(ptr noundef %27, ptr noundef nonnull align 4 dereferenceable(16) %9, ptr noundef nonnull align 4 dereferenceable(20) %28, i32 noundef %29, ptr noundef %30, i32 noundef %36)
  br label %110

38:                                               ; preds = %4
  %39 = getelementptr inbounds %"class.glimg::ImageCreator", ptr %11, i32 0, i32 0
  %40 = call noundef i32 @_ZNK5glimg11ImageFormat4TypeEv(ptr noundef nonnull align 4 dereferenceable(20) %39)
  switch i32 %40, label %101 [
    i32 6, label %41
    i32 7, label %53
    i32 8, label %65
    i32 9, label %77
    i32 10, label %77
    i32 11, label %89
    i32 12, label %89
  ]

41:                                               ; preds = %38
  %42 = load ptr, ptr %7, align 8, !tbaa !5
  %43 = getelementptr inbounds %"class.glimg::ImageCreator", ptr %11, i32 0, i32 0
  %44 = load i32, ptr %8, align 4, !tbaa !9
  %45 = load ptr, ptr %6, align 8, !tbaa !5
  %46 = getelementptr inbounds %"class.glimg::ImageCreator", ptr %11, i32 0, i32 6
  %47 = load i32, ptr %8, align 4, !tbaa !9
  %48 = sext i32 %47 to i64
  %49 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorImSaImEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %46, i64 noundef %48) #5
  %50 = load i64, ptr %49, align 8, !tbaa !12
  %51 = trunc i64 %50 to i32
  %52 = call noundef ptr @_ZN5glimg12_GLOBAL__N_113CopyBCFlippedIPFvPhPKhEEEPKvS2_RKNS_10DimensionsERKNS_11ImageFormatEiS8_iT_(ptr noundef %42, ptr noundef nonnull align 4 dereferenceable(16) %9, ptr noundef nonnull align 4 dereferenceable(20) %43, i32 noundef %44, ptr noundef %45, i32 noundef %51, ptr noundef @_ZN5glimg12_GLOBAL__N_119CopyBlockBC1FlippedEPhPKh)
  br label %109

53:                                               ; preds = %38
  %54 = load ptr, ptr %7, align 8, !tbaa !5
  %55 = getelementptr inbounds %"class.glimg::ImageCreator", ptr %11, i32 0, i32 0
  %56 = load i32, ptr %8, align 4, !tbaa !9
  %57 = load ptr, ptr %6, align 8, !tbaa !5
  %58 = getelementptr inbounds %"class.glimg::ImageCreator", ptr %11, i32 0, i32 6
  %59 = load i32, ptr %8, align 4, !tbaa !9
  %60 = sext i32 %59 to i64
  %61 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorImSaImEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %58, i64 noundef %60) #5
  %62 = load i64, ptr %61, align 8, !tbaa !12
  %63 = trunc i64 %62 to i32
  %64 = call noundef ptr @_ZN5glimg12_GLOBAL__N_113CopyBCFlippedIPFvPhPKhEEEPKvS2_RKNS_10DimensionsERKNS_11ImageFormatEiS8_iT_(ptr noundef %54, ptr noundef nonnull align 4 dereferenceable(16) %9, ptr noundef nonnull align 4 dereferenceable(20) %55, i32 noundef %56, ptr noundef %57, i32 noundef %63, ptr noundef @_ZN5glimg12_GLOBAL__N_119CopyBlockBC2FlippedEPhPKh)
  br label %109

65:                                               ; preds = %38
  %66 = load ptr, ptr %7, align 8, !tbaa !5
  %67 = getelementptr inbounds %"class.glimg::ImageCreator", ptr %11, i32 0, i32 0
  %68 = load i32, ptr %8, align 4, !tbaa !9
  %69 = load ptr, ptr %6, align 8, !tbaa !5
  %70 = getelementptr inbounds %"class.glimg::ImageCreator", ptr %11, i32 0, i32 6
  %71 = load i32, ptr %8, align 4, !tbaa !9
  %72 = sext i32 %71 to i64
  %73 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorImSaImEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %70, i64 noundef %72) #5
  %74 = load i64, ptr %73, align 8, !tbaa !12
  %75 = trunc i64 %74 to i32
  %76 = call noundef ptr @_ZN5glimg12_GLOBAL__N_113CopyBCFlippedIPFvPhPKhEEEPKvS2_RKNS_10DimensionsERKNS_11ImageFormatEiS8_iT_(ptr noundef %66, ptr noundef nonnull align 4 dereferenceable(16) %9, ptr noundef nonnull align 4 dereferenceable(20) %67, i32 noundef %68, ptr noundef %69, i32 noundef %75, ptr noundef @_ZN5glimg12_GLOBAL__N_119CopyBlockBC3FlippedEPhPKh)
  br label %109

77:                                               ; preds = %38, %38
  %78 = load ptr, ptr %7, align 8, !tbaa !5
  %79 = getelementptr inbounds %"class.glimg::ImageCreator", ptr %11, i32 0, i32 0
  %80 = load i32, ptr %8, align 4, !tbaa !9
  %81 = load ptr, ptr %6, align 8, !tbaa !5
  %82 = getelementptr inbounds %"class.glimg::ImageCreator", ptr %11, i32 0, i32 6
  %83 = load i32, ptr %8, align 4, !tbaa !9
  %84 = sext i32 %83 to i64
  %85 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorImSaImEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %82, i64 noundef %84) #5
  %86 = load i64, ptr %85, align 8, !tbaa !12
  %87 = trunc i64 %86 to i32
  %88 = call noundef ptr @_ZN5glimg12_GLOBAL__N_113CopyBCFlippedIPFvPhPKhEEEPKvS2_RKNS_10DimensionsERKNS_11ImageFormatEiS8_iT_(ptr noundef %78, ptr noundef nonnull align 4 dereferenceable(16) %9, ptr noundef nonnull align 4 dereferenceable(20) %79, i32 noundef %80, ptr noundef %81, i32 noundef %87, ptr noundef @_ZN5glimg12_GLOBAL__N_119CopyBlockBC4FlippedEPhPKh)
  br label %109

89:                                               ; preds = %38, %38
  %90 = load ptr, ptr %7, align 8, !tbaa !5
  %91 = getelementptr inbounds %"class.glimg::ImageCreator", ptr %11, i32 0, i32 0
  %92 = load i32, ptr %8, align 4, !tbaa !9
  %93 = load ptr, ptr %6, align 8, !tbaa !5
  %94 = getelementptr inbounds %"class.glimg::ImageCreator", ptr %11, i32 0, i32 6
  %95 = load i32, ptr %8, align 4, !tbaa !9
  %96 = sext i32 %95 to i64
  %97 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorImSaImEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %94, i64 noundef %96) #5
  %98 = load i64, ptr %97, align 8, !tbaa !12
  %99 = trunc i64 %98 to i32
  %100 = call noundef ptr @_ZN5glimg12_GLOBAL__N_113CopyBCFlippedIPFvPhPKhEEEPKvS2_RKNS_10DimensionsERKNS_11ImageFormatEiS8_iT_(ptr noundef %90, ptr noundef nonnull align 4 dereferenceable(16) %9, ptr noundef nonnull align 4 dereferenceable(20) %91, i32 noundef %92, ptr noundef %93, i32 noundef %99, ptr noundef @_ZN5glimg12_GLOBAL__N_119CopyBlockBC5FlippedEPhPKh)
  br label %109

101:                                              ; preds = %38
  %102 = load ptr, ptr %7, align 8, !tbaa !5
  %103 = load ptr, ptr %6, align 8, !tbaa !5
  %104 = getelementptr inbounds %"class.glimg::ImageCreator", ptr %11, i32 0, i32 6
  %105 = load i32, ptr %8, align 4, !tbaa !9
  %106 = sext i32 %105 to i64
  %107 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorImSaImEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %104, i64 noundef %106) #5
  %108 = load i64, ptr %107, align 8, !tbaa !12
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %102, ptr align 1 %103, i64 %108, i1 false)
  br label %109

109:                                              ; preds = %101, %89, %77, %65, %53, %41
  br label %110

110:                                              ; preds = %109, %26
  call void @llvm.lifetime.end.p0(i64 16, ptr %9) #5
  ret void
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK5glimg11ImageFormat4TypeEv(ptr noundef nonnull align 4 dereferenceable(20)) #3 align 2

; Function Attrs: mustprogress uwtable
declare hidden noundef ptr @_ZN5glimg12_GLOBAL__N_117CopyPixelsFlippedEPhRKNS_10DimensionsERKNS_11ImageFormatEiPKvi(ptr noundef, ptr noundef nonnull align 4 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(20), i32 noundef, ptr noundef, i32 noundef) #4

; Function Attrs: mustprogress uwtable
declare hidden noundef ptr @_ZN5glimg12_GLOBAL__N_113CopyBCFlippedIPFvPhPKhEEEPKvS2_RKNS_10DimensionsERKNS_11ImageFormatEiS8_iT_(ptr noundef, ptr noundef nonnull align 4 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(20), i32 noundef, ptr noundef, i32 noundef, ptr noundef) #4

; Function Attrs: mustprogress nounwind uwtable
declare hidden void @_ZN5glimg12_GLOBAL__N_119CopyBlockBC1FlippedEPhPKh(ptr noundef, ptr noundef) #3

; Function Attrs: mustprogress nounwind uwtable
declare hidden void @_ZN5glimg12_GLOBAL__N_119CopyBlockBC2FlippedEPhPKh(ptr noundef, ptr noundef) #3

; Function Attrs: mustprogress uwtable
declare hidden void @_ZN5glimg12_GLOBAL__N_119CopyBlockBC3FlippedEPhPKh(ptr noundef, ptr noundef) #4

; Function Attrs: mustprogress nounwind uwtable
declare hidden void @_ZN5glimg12_GLOBAL__N_119CopyBlockBC4FlippedEPhPKh(ptr noundef, ptr noundef) #3

; Function Attrs: mustprogress nounwind uwtable
declare hidden void @_ZN5glimg12_GLOBAL__N_119CopyBlockBC5FlippedEPhPKh(ptr noundef, ptr noundef) #3

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


; 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"

%"struct.glimg::Dimensions" = type { i32, i32, i32, i32 }

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #0

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

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

declare { i64, i64 } @_ZN5glimg19ModifySizeForMipmapENS_10DimensionsEi(i64, i64, i32 noundef) local_unnamed_addr #2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN5glimg12ImageCreator16CopyImageFlippedEPKvPhi(ptr noundef nonnull align 8 dereferenceable(96) %0, ptr noundef %1, ptr noundef %2, i32 noundef %3) local_unnamed_addr #4 align 2 {
  %5 = alloca %"struct.glimg::Dimensions", align 8
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #5
  %6 = getelementptr inbounds i8, ptr %0, i64 20
  %.sroa.0.0.copyload = load i64, ptr %6, align 4
  %.sroa.2.0..sroa_idx = getelementptr inbounds i8, ptr %0, i64 28
  %.sroa.2.0.copyload = load i64, ptr %.sroa.2.0..sroa_idx, align 4
  %7 = tail call { i64, i64 } @_ZN5glimg19ModifySizeForMipmapENS_10DimensionsEi(i64 %.sroa.0.0.copyload, i64 %.sroa.2.0.copyload, i32 noundef %3)
  %8 = extractvalue { i64, i64 } %7, 0
  store i64 %8, ptr %5, align 8
  %9 = getelementptr inbounds i8, ptr %5, i64 8
  %10 = extractvalue { i64, i64 } %7, 1
  store i64 %10, ptr %9, align 8
  %11 = tail call noundef i32 @_ZNK5glimg11ImageFormat4TypeEv(ptr noundef nonnull align 4 dereferenceable(20) %0)
  %12 = icmp slt i32 %11, 6
  br i1 %12, label %13, label %20

13:                                               ; preds = %4
  %14 = getelementptr inbounds i8, ptr %0, i64 72
  %15 = sext i32 %3 to i64
  %16 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorImSaImEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %14, i64 noundef %15) #5
  %17 = load i64, ptr %16, align 8, !tbaa !5
  %18 = trunc i64 %17 to i32
  %19 = call noundef ptr @_ZN5glimg12_GLOBAL__N_117CopyPixelsFlippedEPhRKNS_10DimensionsERKNS_11ImageFormatEiPKvi(ptr noundef %2, ptr noundef nonnull align 4 dereferenceable(16) %5, ptr noundef nonnull align 4 dereferenceable(20) %0, i32 noundef %3, ptr noundef %1, i32 noundef %18)
  br label %62

20:                                               ; preds = %4
  %21 = tail call noundef i32 @_ZNK5glimg11ImageFormat4TypeEv(ptr noundef nonnull align 4 dereferenceable(20) %0)
  switch i32 %21, label %57 [
    i32 6, label %22
    i32 7, label %29
    i32 8, label %36
    i32 9, label %43
    i32 10, label %43
    i32 11, label %50
    i32 12, label %50
  ]

22:                                               ; preds = %20
  %23 = getelementptr inbounds i8, ptr %0, i64 72
  %24 = sext i32 %3 to i64
  %25 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorImSaImEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %23, i64 noundef %24) #5
  %26 = load i64, ptr %25, align 8, !tbaa !5
  %27 = trunc i64 %26 to i32
  %28 = call noundef ptr @_ZN5glimg12_GLOBAL__N_113CopyBCFlippedIPFvPhPKhEEEPKvS2_RKNS_10DimensionsERKNS_11ImageFormatEiS8_iT_(ptr noundef %2, ptr noundef nonnull align 4 dereferenceable(16) %5, ptr noundef nonnull align 4 dereferenceable(20) %0, i32 noundef %3, ptr noundef %1, i32 noundef %27, ptr noundef nonnull @_ZN5glimg12_GLOBAL__N_119CopyBlockBC1FlippedEPhPKh)
  br label %62

29:                                               ; preds = %20
  %30 = getelementptr inbounds i8, ptr %0, i64 72
  %31 = sext i32 %3 to i64
  %32 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorImSaImEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %30, i64 noundef %31) #5
  %33 = load i64, ptr %32, align 8, !tbaa !5
  %34 = trunc i64 %33 to i32
  %35 = call noundef ptr @_ZN5glimg12_GLOBAL__N_113CopyBCFlippedIPFvPhPKhEEEPKvS2_RKNS_10DimensionsERKNS_11ImageFormatEiS8_iT_(ptr noundef %2, ptr noundef nonnull align 4 dereferenceable(16) %5, ptr noundef nonnull align 4 dereferenceable(20) %0, i32 noundef %3, ptr noundef %1, i32 noundef %34, ptr noundef nonnull @_ZN5glimg12_GLOBAL__N_119CopyBlockBC2FlippedEPhPKh)
  br label %62

36:                                               ; preds = %20
  %37 = getelementptr inbounds i8, ptr %0, i64 72
  %38 = sext i32 %3 to i64
  %39 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorImSaImEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %37, i64 noundef %38) #5
  %40 = load i64, ptr %39, align 8, !tbaa !5
  %41 = trunc i64 %40 to i32
  %42 = call noundef ptr @_ZN5glimg12_GLOBAL__N_113CopyBCFlippedIPFvPhPKhEEEPKvS2_RKNS_10DimensionsERKNS_11ImageFormatEiS8_iT_(ptr noundef %2, ptr noundef nonnull align 4 dereferenceable(16) %5, ptr noundef nonnull align 4 dereferenceable(20) %0, i32 noundef %3, ptr noundef %1, i32 noundef %41, ptr noundef nonnull @_ZN5glimg12_GLOBAL__N_119CopyBlockBC3FlippedEPhPKh)
  br label %62

43:                                               ; preds = %20, %20
  %44 = getelementptr inbounds i8, ptr %0, i64 72
  %45 = sext i32 %3 to i64
  %46 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorImSaImEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %44, i64 noundef %45) #5
  %47 = load i64, ptr %46, align 8, !tbaa !5
  %48 = trunc i64 %47 to i32
  %49 = call noundef ptr @_ZN5glimg12_GLOBAL__N_113CopyBCFlippedIPFvPhPKhEEEPKvS2_RKNS_10DimensionsERKNS_11ImageFormatEiS8_iT_(ptr noundef %2, ptr noundef nonnull align 4 dereferenceable(16) %5, ptr noundef nonnull align 4 dereferenceable(20) %0, i32 noundef %3, ptr noundef %1, i32 noundef %48, ptr noundef nonnull @_ZN5glimg12_GLOBAL__N_119CopyBlockBC4FlippedEPhPKh)
  br label %62

50:                                               ; preds = %20, %20
  %51 = getelementptr inbounds i8, ptr %0, i64 72
  %52 = sext i32 %3 to i64
  %53 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorImSaImEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %51, i64 noundef %52) #5
  %54 = load i64, ptr %53, align 8, !tbaa !5
  %55 = trunc i64 %54 to i32
  %56 = call noundef ptr @_ZN5glimg12_GLOBAL__N_113CopyBCFlippedIPFvPhPKhEEEPKvS2_RKNS_10DimensionsERKNS_11ImageFormatEiS8_iT_(ptr noundef %2, ptr noundef nonnull align 4 dereferenceable(16) %5, ptr noundef nonnull align 4 dereferenceable(20) %0, i32 noundef %3, ptr noundef %1, i32 noundef %55, ptr noundef nonnull @_ZN5glimg12_GLOBAL__N_119CopyBlockBC5FlippedEPhPKh)
  br label %62

57:                                               ; preds = %20
  %58 = getelementptr inbounds i8, ptr %0, i64 72
  %59 = sext i32 %3 to i64
  %60 = tail call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorImSaImEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %58, i64 noundef %59) #5
  %61 = load i64, ptr %60, align 8, !tbaa !5
  tail call void @llvm.memcpy.p0.p0.i64(ptr align 1 %2, ptr align 1 %1, i64 %61, i1 false)
  br label %62

62:                                               ; preds = %22, %29, %36, %43, %50, %57, %13
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #5
  ret void
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK5glimg11ImageFormat4TypeEv(ptr noundef nonnull align 4 dereferenceable(20)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare hidden noundef ptr @_ZN5glimg12_GLOBAL__N_117CopyPixelsFlippedEPhRKNS_10DimensionsERKNS_11ImageFormatEiPKvi(ptr noundef, ptr noundef nonnull align 4 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(20), i32 noundef, ptr noundef, i32 noundef) local_unnamed_addr #4

; Function Attrs: mustprogress uwtable
declare hidden noundef ptr @_ZN5glimg12_GLOBAL__N_113CopyBCFlippedIPFvPhPKhEEEPKvS2_RKNS_10DimensionsERKNS_11ImageFormatEiS8_iT_(ptr noundef, ptr noundef nonnull align 4 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(20), i32 noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #4

; Function Attrs: mustprogress nounwind uwtable
declare hidden void @_ZN5glimg12_GLOBAL__N_119CopyBlockBC1FlippedEPhPKh(ptr noundef, ptr noundef) #3

; Function Attrs: mustprogress nounwind uwtable
declare hidden void @_ZN5glimg12_GLOBAL__N_119CopyBlockBC2FlippedEPhPKh(ptr noundef, ptr noundef) #3

; Function Attrs: mustprogress uwtable
declare hidden void @_ZN5glimg12_GLOBAL__N_119CopyBlockBC3FlippedEPhPKh(ptr noundef, ptr noundef) #4

; Function Attrs: mustprogress nounwind uwtable
declare hidden void @_ZN5glimg12_GLOBAL__N_119CopyBlockBC4FlippedEPhPKh(ptr noundef, ptr noundef) #3

; Function Attrs: mustprogress nounwind uwtable
declare hidden void @_ZN5glimg12_GLOBAL__N_119CopyBlockBC5FlippedEPhPKh(ptr noundef, ptr noundef) #3

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


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,SROAPass,SimplifyCFGPass,TailCallElimPass