; LLVM IR from awawa-dev/HyperHDR :: sources/image/ImageData.ll (ZN9ImageDataI8ColorRgbE7fastBoxEtttthhh)

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

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

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

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

; 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) #1

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN9ImageDataI8ColorRgbE7fastBoxEtttthhh(ptr noundef nonnull align 8 dereferenceable(24) %0, i16 noundef zeroext %1, i16 noundef zeroext %2, i16 noundef zeroext %3, i16 noundef zeroext %4, i8 noundef zeroext %5, i8 noundef zeroext %6, i8 noundef zeroext %7) #3 align 2 {
  %9 = alloca ptr, align 8
  %10 = alloca i16, align 2
  %11 = alloca i16, align 2
  %12 = alloca i16, align 2
  %13 = alloca i16, align 2
  %14 = alloca i8, align 1
  %15 = alloca i8, align 1
  %16 = alloca i8, align 1
  %17 = alloca i64, align 8
  %18 = alloca i16, align 2
  %19 = alloca i64, align 8
  %20 = alloca i16, align 2
  %21 = alloca i64, align 8
  %22 = alloca i16, align 2
  %23 = alloca i64, align 8
  %24 = alloca i16, align 2
  %25 = alloca i64, align 8
  %26 = alloca i64, align 8
  %27 = alloca ptr, align 8
  %28 = alloca i64, align 8
  %29 = alloca i64, align 8
  store ptr %0, ptr %9, align 8, !tbaa !5
  store i16 %1, ptr %10, align 2, !tbaa !9
  store i16 %2, ptr %11, align 2, !tbaa !9
  store i16 %3, ptr %12, align 2, !tbaa !9
  store i16 %4, ptr %13, align 2, !tbaa !9
  store i8 %5, ptr %14, align 1, !tbaa !11
  store i8 %6, ptr %15, align 1, !tbaa !11
  store i8 %7, ptr %16, align 1, !tbaa !11
  %30 = load ptr, ptr %9, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #5
  %31 = call noundef nonnull align 2 dereferenceable(2) ptr @_ZSt3minItERKT_S2_S2_(ptr noundef nonnull align 2 dereferenceable(2) %10, ptr noundef nonnull align 2 dereferenceable(2) %12)
  call void @llvm.lifetime.start.p0(i64 2, ptr %18) #5
  %32 = call noundef i32 @_ZNK9ImageDataI8ColorRgbE5widthEv(ptr noundef nonnull align 8 dereferenceable(24) %30)
  %33 = sub i32 %32, 1
  %34 = trunc i32 %33 to i16
  store i16 %34, ptr %18, align 2, !tbaa !9
  %35 = call noundef nonnull align 2 dereferenceable(2) ptr @_ZSt3minItERKT_S2_S2_(ptr noundef nonnull align 2 dereferenceable(2) %31, ptr noundef nonnull align 2 dereferenceable(2) %18)
  %36 = load i16, ptr %35, align 2, !tbaa !9
  %37 = zext i16 %36 to i64
  call void @llvm.lifetime.end.p0(i64 2, ptr %18) #5
  store i64 %37, ptr %17, align 8, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #5
  %38 = call noundef nonnull align 2 dereferenceable(2) ptr @_ZSt3maxItERKT_S2_S2_(ptr noundef nonnull align 2 dereferenceable(2) %10, ptr noundef nonnull align 2 dereferenceable(2) %12)
  call void @llvm.lifetime.start.p0(i64 2, ptr %20) #5
  %39 = call noundef i32 @_ZNK9ImageDataI8ColorRgbE5widthEv(ptr noundef nonnull align 8 dereferenceable(24) %30)
  %40 = sub i32 %39, 1
  %41 = trunc i32 %40 to i16
  store i16 %41, ptr %20, align 2, !tbaa !9
  %42 = call noundef nonnull align 2 dereferenceable(2) ptr @_ZSt3minItERKT_S2_S2_(ptr noundef nonnull align 2 dereferenceable(2) %38, ptr noundef nonnull align 2 dereferenceable(2) %20)
  %43 = load i16, ptr %42, align 2, !tbaa !9
  %44 = zext i16 %43 to i64
  call void @llvm.lifetime.end.p0(i64 2, ptr %20) #5
  store i64 %44, ptr %19, align 8, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #5
  %45 = call noundef nonnull align 2 dereferenceable(2) ptr @_ZSt3minItERKT_S2_S2_(ptr noundef nonnull align 2 dereferenceable(2) %11, ptr noundef nonnull align 2 dereferenceable(2) %13)
  call void @llvm.lifetime.start.p0(i64 2, ptr %22) #5
  %46 = call noundef i32 @_ZNK9ImageDataI8ColorRgbE6heightEv(ptr noundef nonnull align 8 dereferenceable(24) %30)
  %47 = sub i32 %46, 1
  %48 = trunc i32 %47 to i16
  store i16 %48, ptr %22, align 2, !tbaa !9
  %49 = call noundef nonnull align 2 dereferenceable(2) ptr @_ZSt3minItERKT_S2_S2_(ptr noundef nonnull align 2 dereferenceable(2) %45, ptr noundef nonnull align 2 dereferenceable(2) %22)
  %50 = load i16, ptr %49, align 2, !tbaa !9
  %51 = zext i16 %50 to i64
  call void @llvm.lifetime.end.p0(i64 2, ptr %22) #5
  store i64 %51, ptr %21, align 8, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #5
  %52 = call noundef nonnull align 2 dereferenceable(2) ptr @_ZSt3maxItERKT_S2_S2_(ptr noundef nonnull align 2 dereferenceable(2) %11, ptr noundef nonnull align 2 dereferenceable(2) %13)
  call void @llvm.lifetime.start.p0(i64 2, ptr %24) #5
  %53 = call noundef i32 @_ZNK9ImageDataI8ColorRgbE6heightEv(ptr noundef nonnull align 8 dereferenceable(24) %30)
  %54 = sub i32 %53, 1
  %55 = trunc i32 %54 to i16
  store i16 %55, ptr %24, align 2, !tbaa !9
  %56 = call noundef nonnull align 2 dereferenceable(2) ptr @_ZSt3minItERKT_S2_S2_(ptr noundef nonnull align 2 dereferenceable(2) %52, ptr noundef nonnull align 2 dereferenceable(2) %24)
  %57 = load i16, ptr %56, align 2, !tbaa !9
  %58 = zext i16 %57 to i64
  call void @llvm.lifetime.end.p0(i64 2, ptr %24) #5
  store i64 %58, ptr %23, align 8, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #5
  %59 = load i64, ptr %19, align 8, !tbaa !12
  %60 = load i64, ptr %17, align 8, !tbaa !12
  %61 = sub i64 %59, %60
  %62 = add i64 %61, 1
  %63 = mul i64 %62, 3
  store i64 %63, ptr %25, align 8, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #5
  %64 = call noundef i32 @_ZNK9ImageDataI8ColorRgbE5widthEv(ptr noundef nonnull align 8 dereferenceable(24) %30)
  %65 = mul i32 %64, 3
  %66 = zext i32 %65 to i64
  store i64 %66, ptr %26, align 8, !tbaa !12
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #5
  %67 = call noundef ptr @_ZN9ImageDataI8ColorRgbE6rawMemEv(ptr noundef nonnull align 8 dereferenceable(24) %30)
  %68 = load i64, ptr %21, align 8, !tbaa !12
  %69 = load i64, ptr %26, align 8, !tbaa !12
  %70 = mul i64 %68, %69
  %71 = getelementptr inbounds i8, ptr %67, i64 %70
  %72 = load i64, ptr %17, align 8, !tbaa !12
  %73 = mul i64 %72, 3
  %74 = getelementptr inbounds i8, ptr %71, i64 %73
  store ptr %74, ptr %27, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #5
  store i64 0, ptr %28, align 8, !tbaa !12
  br label %75

75:                                               ; preds = %95, %8
  %76 = load i64, ptr %28, align 8, !tbaa !12
  %77 = load i64, ptr %25, align 8, !tbaa !12
  %78 = icmp ult i64 %76, %77
  br i1 %78, label %80, label %79

79:                                               ; preds = %75
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #5
  br label %98

80:                                               ; preds = %75
  %81 = load i8, ptr %14, align 1, !tbaa !11
  %82 = load ptr, ptr %27, align 8, !tbaa !5
  %83 = load i64, ptr %28, align 8, !tbaa !12
  %84 = getelementptr inbounds i8, ptr %82, i64 %83
  store i8 %81, ptr %84, align 1, !tbaa !11
  %85 = load i8, ptr %15, align 1, !tbaa !11
  %86 = load ptr, ptr %27, align 8, !tbaa !5
  %87 = load i64, ptr %28, align 8, !tbaa !12
  %88 = add i64 %87, 1
  %89 = getelementptr inbounds i8, ptr %86, i64 %88
  store i8 %85, ptr %89, align 1, !tbaa !11
  %90 = load i8, ptr %16, align 1, !tbaa !11
  %91 = load ptr, ptr %27, align 8, !tbaa !5
  %92 = load i64, ptr %28, align 8, !tbaa !12
  %93 = add i64 %92, 2
  %94 = getelementptr inbounds i8, ptr %91, i64 %93
  store i8 %90, ptr %94, align 1, !tbaa !11
  br label %95

95:                                               ; preds = %80
  %96 = load i64, ptr %28, align 8, !tbaa !12
  %97 = add i64 %96, 3
  store i64 %97, ptr %28, align 8, !tbaa !12
  br label %75, !llvm.loop !14

98:                                               ; preds = %79
  call void @llvm.lifetime.start.p0(i64 8, ptr %29) #5
  %99 = load i64, ptr %21, align 8, !tbaa !12
  %100 = add i64 %99, 1
  store i64 %100, ptr %29, align 8, !tbaa !12
  br label %101

101:                                              ; preds = %117, %98
  %102 = load i64, ptr %29, align 8, !tbaa !12
  %103 = load i64, ptr %23, align 8, !tbaa !12
  %104 = icmp ule i64 %102, %103
  br i1 %104, label %106, label %105

105:                                              ; preds = %101
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #5
  br label %120

106:                                              ; preds = %101
  %107 = call noundef ptr @_ZN9ImageDataI8ColorRgbE6rawMemEv(ptr noundef nonnull align 8 dereferenceable(24) %30)
  %108 = load i64, ptr %29, align 8, !tbaa !12
  %109 = load i64, ptr %26, align 8, !tbaa !12
  %110 = mul i64 %108, %109
  %111 = getelementptr inbounds i8, ptr %107, i64 %110
  %112 = load i64, ptr %17, align 8, !tbaa !12
  %113 = mul i64 %112, 3
  %114 = getelementptr inbounds i8, ptr %111, i64 %113
  %115 = load ptr, ptr %27, align 8, !tbaa !5
  %116 = load i64, ptr %25, align 8, !tbaa !12
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %114, ptr align 1 %115, i64 %116, i1 false)
  br label %117

117:                                              ; preds = %106
  %118 = load i64, ptr %29, align 8, !tbaa !12
  %119 = add i64 %118, 1
  store i64 %119, ptr %29, align 8, !tbaa !12
  br label %101, !llvm.loop !16

120:                                              ; preds = %105
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  ret void
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 2 dereferenceable(2) ptr @_ZSt3minItERKT_S2_S2_(ptr noundef nonnull align 2 dereferenceable(2), ptr noundef nonnull align 2 dereferenceable(2)) #4

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 2 dereferenceable(2) ptr @_ZSt3maxItERKT_S2_S2_(ptr noundef nonnull align 2 dereferenceable(2), ptr noundef nonnull align 2 dereferenceable(2)) #4

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 nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
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 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 #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 = !{!"short", !7, i64 0}
!11 = !{!7, !7, i64 0}
!12 = !{!13, !13, i64 0}
!13 = !{!"long", !7, i64 0}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = distinct !{!16, !15}


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

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

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

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

; 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) #1

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

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

; Function Attrs: mustprogress nounwind uwtable
define dso_local void @_ZN9ImageDataI8ColorRgbE7fastBoxEtttthhh(ptr noundef nonnull align 8 dereferenceable(24) %0, i16 noundef zeroext %1, i16 noundef zeroext %2, i16 noundef zeroext %3, i16 noundef zeroext %4, i8 noundef zeroext %5, i8 noundef zeroext %6, i8 noundef zeroext %7) local_unnamed_addr #0 align 2 {
  %9 = alloca i16, align 2
  %10 = alloca i16, align 2
  %11 = alloca i16, align 2
  %12 = alloca i16, align 2
  %13 = alloca i16, align 2
  %14 = alloca i16, align 2
  %15 = alloca i16, align 2
  %16 = alloca i16, align 2
  store i16 %1, ptr %9, align 2, !tbaa !5
  store i16 %2, ptr %10, align 2, !tbaa !5
  store i16 %3, ptr %11, align 2, !tbaa !5
  store i16 %4, ptr %12, align 2, !tbaa !5
  %17 = call noundef nonnull align 2 dereferenceable(2) ptr @_ZSt3minItERKT_S2_S2_(ptr noundef nonnull align 2 dereferenceable(2) %9, ptr noundef nonnull align 2 dereferenceable(2) %11)
  call void @llvm.lifetime.start.p0(i64 2, ptr nonnull %13) #4
  %18 = call noundef i32 @_ZNK9ImageDataI8ColorRgbE5widthEv(ptr noundef nonnull align 8 dereferenceable(24) %0)
  %19 = trunc i32 %18 to i16
  %20 = add i16 %19, -1
  store i16 %20, ptr %13, align 2, !tbaa !5
  %21 = call noundef nonnull align 2 dereferenceable(2) ptr @_ZSt3minItERKT_S2_S2_(ptr noundef nonnull align 2 dereferenceable(2) %17, ptr noundef nonnull align 2 dereferenceable(2) %13)
  %22 = load i16, ptr %21, align 2, !tbaa !5
  %23 = zext i16 %22 to i64
  call void @llvm.lifetime.end.p0(i64 2, ptr nonnull %13) #4
  %24 = call noundef nonnull align 2 dereferenceable(2) ptr @_ZSt3maxItERKT_S2_S2_(ptr noundef nonnull align 2 dereferenceable(2) %9, ptr noundef nonnull align 2 dereferenceable(2) %11)
  call void @llvm.lifetime.start.p0(i64 2, ptr nonnull %14) #4
  %25 = call noundef i32 @_ZNK9ImageDataI8ColorRgbE5widthEv(ptr noundef nonnull align 8 dereferenceable(24) %0)
  %26 = trunc i32 %25 to i16
  %27 = add i16 %26, -1
  store i16 %27, ptr %14, align 2, !tbaa !5
  %28 = call noundef nonnull align 2 dereferenceable(2) ptr @_ZSt3minItERKT_S2_S2_(ptr noundef nonnull align 2 dereferenceable(2) %24, ptr noundef nonnull align 2 dereferenceable(2) %14)
  %29 = load i16, ptr %28, align 2, !tbaa !5
  %30 = zext i16 %29 to i64
  call void @llvm.lifetime.end.p0(i64 2, ptr nonnull %14) #4
  %31 = call noundef nonnull align 2 dereferenceable(2) ptr @_ZSt3minItERKT_S2_S2_(ptr noundef nonnull align 2 dereferenceable(2) %10, ptr noundef nonnull align 2 dereferenceable(2) %12)
  call void @llvm.lifetime.start.p0(i64 2, ptr nonnull %15) #4
  %32 = call noundef i32 @_ZNK9ImageDataI8ColorRgbE6heightEv(ptr noundef nonnull align 8 dereferenceable(24) %0)
  %33 = trunc i32 %32 to i16
  %34 = add i16 %33, -1
  store i16 %34, ptr %15, align 2, !tbaa !5
  %35 = call noundef nonnull align 2 dereferenceable(2) ptr @_ZSt3minItERKT_S2_S2_(ptr noundef nonnull align 2 dereferenceable(2) %31, ptr noundef nonnull align 2 dereferenceable(2) %15)
  %36 = load i16, ptr %35, align 2, !tbaa !5
  %37 = zext i16 %36 to i64
  call void @llvm.lifetime.end.p0(i64 2, ptr nonnull %15) #4
  %38 = call noundef nonnull align 2 dereferenceable(2) ptr @_ZSt3maxItERKT_S2_S2_(ptr noundef nonnull align 2 dereferenceable(2) %10, ptr noundef nonnull align 2 dereferenceable(2) %12)
  call void @llvm.lifetime.start.p0(i64 2, ptr nonnull %16) #4
  %39 = call noundef i32 @_ZNK9ImageDataI8ColorRgbE6heightEv(ptr noundef nonnull align 8 dereferenceable(24) %0)
  %40 = trunc i32 %39 to i16
  %41 = add i16 %40, -1
  store i16 %41, ptr %16, align 2, !tbaa !5
  %42 = call noundef nonnull align 2 dereferenceable(2) ptr @_ZSt3minItERKT_S2_S2_(ptr noundef nonnull align 2 dereferenceable(2) %38, ptr noundef nonnull align 2 dereferenceable(2) %16)
  %43 = load i16, ptr %42, align 2, !tbaa !5
  %44 = zext i16 %43 to i64
  call void @llvm.lifetime.end.p0(i64 2, ptr nonnull %16) #4
  %45 = sub nsw i64 %30, %23
  %46 = mul nsw i64 %45, 3
  %47 = add nsw i64 %46, 3
  %48 = call noundef i32 @_ZNK9ImageDataI8ColorRgbE5widthEv(ptr noundef nonnull align 8 dereferenceable(24) %0)
  %49 = mul i32 %48, 3
  %50 = zext i32 %49 to i64
  %51 = call noundef ptr @_ZN9ImageDataI8ColorRgbE6rawMemEv(ptr noundef nonnull align 8 dereferenceable(24) %0)
  %52 = mul nuw nsw i64 %50, %37
  %53 = getelementptr inbounds i8, ptr %51, i64 %52
  %54 = mul nuw nsw i64 %23, 3
  %55 = getelementptr inbounds i8, ptr %53, i64 %54
  %.not = icmp eq i64 %47, 0
  br i1 %.not, label %.preheader, label %.lr.ph

.preheader:                                       ; preds = %.lr.ph, %8
  %.not.not29 = icmp ult i16 %36, %43
  br i1 %.not.not29, label %.lr.ph31, label %._crit_edge

.lr.ph:                                           ; preds = %8, %.lr.ph
  %.02628 = phi i64 [ %59, %.lr.ph ], [ 0, %8 ]
  %56 = getelementptr inbounds i8, ptr %55, i64 %.02628
  store i8 %5, ptr %56, align 1, !tbaa !9
  %57 = getelementptr i8, ptr %56, i64 1
  store i8 %6, ptr %57, align 1, !tbaa !9
  %58 = getelementptr i8, ptr %56, i64 2
  store i8 %7, ptr %58, align 1, !tbaa !9
  %59 = add i64 %.02628, 3
  %60 = icmp ult i64 %59, %47
  br i1 %60, label %.lr.ph, label %.preheader, !llvm.loop !10

._crit_edge:                                      ; preds = %.lr.ph31, %.preheader
  ret void

.lr.ph31:                                         ; preds = %.preheader, %.lr.ph31
  %.0.in30 = phi i64 [ %.0, %.lr.ph31 ], [ %37, %.preheader ]
  %.0 = add nuw nsw i64 %.0.in30, 1
  %61 = call noundef ptr @_ZN9ImageDataI8ColorRgbE6rawMemEv(ptr noundef nonnull align 8 dereferenceable(24) %0)
  %62 = mul nuw nsw i64 %.0, %50
  %63 = getelementptr inbounds i8, ptr %61, i64 %62
  %64 = getelementptr inbounds i8, ptr %63, i64 %54
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %64, ptr align 1 %55, i64 %47, i1 false)
  %exitcond.not = icmp eq i64 %.0, %44
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph31, !llvm.loop !12
}

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

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

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

!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 = !{!"short", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!7, !7, i64 0}
!10 = distinct !{!10, !11}
!11 = !{!"llvm.loop.mustprogress"}
!12 = distinct !{!12, !11}


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