; LLVM IR from aap/librw :: src/image.ll (ZN2rw10ColorQuant10matchImageEPhjPNS_5ImageE)

; 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.rw::RGBA" = type { i8, i8, i8, i8 }
%"struct.rw::Image" = type { i32, i32, i32, i32, i32, i32, ptr, ptr }

@.str.2 = external hidden unnamed_addr constant [57 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [21 x i8], align 1
@__PRETTY_FUNCTION__._ZN2rw10ColorQuant10matchImageEPhjPNS_5ImageE = external hidden unnamed_addr constant [58 x i8], align 1

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

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

; 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: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #2

declare void @_ZN2rw27conv_RGBA8888_from_ARGB1555EPhS0_(ptr noundef, ptr noundef) #3

declare void @_ZN2rw25conv_RGBA8888_from_RGB888EPhS0_(ptr noundef, ptr noundef) #3

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN2rw10ColorQuant10matchImageEPhjPNS_5ImageE(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef %1, i32 noundef %2, ptr noundef %3) #4 align 2 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca %"struct.rw::RGBA", align 1
  %10 = alloca [4 x i8], align 1
  %11 = alloca ptr, align 8
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca i32, align 4
  %17 = alloca ptr, align 8
  %18 = alloca ptr, align 8
  %19 = alloca %"struct.rw::RGBA", align 1
  store ptr %0, ptr %5, align 8, !tbaa !5
  store ptr %1, ptr %6, align 8, !tbaa !5
  store i32 %2, ptr %7, align 4, !tbaa !9
  store ptr %3, ptr %8, align 8, !tbaa !5
  %20 = load ptr, ptr %5, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  %21 = load ptr, ptr %8, align 8, !tbaa !5
  %22 = getelementptr inbounds %"struct.rw::Image", ptr %21, i32 0, i32 6
  %23 = load ptr, ptr %22, align 8, !tbaa !11
  store ptr %23, ptr %11, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  store i32 0, ptr %12, align 4, !tbaa !9
  br label %24

24:                                               ; preds = %107, %4
  %25 = load i32, ptr %12, align 4, !tbaa !9
  %26 = load ptr, ptr %8, align 8, !tbaa !5
  %27 = getelementptr inbounds %"struct.rw::Image", ptr %26, i32 0, i32 2
  %28 = load i32, ptr %27, align 8, !tbaa !13
  %29 = icmp slt i32 %25, %28
  br i1 %29, label %31, label %30

30:                                               ; preds = %24
  store i32 2, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  br label %110

31:                                               ; preds = %24
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #5
  %32 = load ptr, ptr %11, align 8, !tbaa !5
  store ptr %32, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  %33 = load ptr, ptr %6, align 8, !tbaa !5
  store ptr %33, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #5
  store i32 0, ptr %16, align 4, !tbaa !9
  br label %34

34:                                               ; preds = %93, %31
  %35 = load i32, ptr %16, align 4, !tbaa !9
  %36 = load ptr, ptr %8, align 8, !tbaa !5
  %37 = getelementptr inbounds %"struct.rw::Image", ptr %36, i32 0, i32 1
  %38 = load i32, ptr %37, align 4, !tbaa !14
  %39 = icmp slt i32 %35, %38
  br i1 %39, label %41, label %40

40:                                               ; preds = %34
  store i32 5, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  br label %96

41:                                               ; preds = %34
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #5
  %42 = load ptr, ptr %14, align 8, !tbaa !5
  store ptr %42, ptr %17, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #5
  %43 = load ptr, ptr %15, align 8, !tbaa !5
  store ptr %43, ptr %18, align 8, !tbaa !5
  %44 = load ptr, ptr %8, align 8, !tbaa !5
  %45 = getelementptr inbounds %"struct.rw::Image", ptr %44, i32 0, i32 3
  %46 = load i32, ptr %45, align 4, !tbaa !15
  switch i32 %46, label %68 [
    i32 4, label %47
    i32 8, label %47
    i32 32, label %59
    i32 24, label %62
    i32 16, label %65
  ]

47:                                               ; preds = %41, %41
  %48 = getelementptr inbounds [4 x i8], ptr %10, i64 0, i64 0
  %49 = load ptr, ptr %8, align 8, !tbaa !5
  %50 = getelementptr inbounds %"struct.rw::Image", ptr %49, i32 0, i32 7
  %51 = load ptr, ptr %50, align 8, !tbaa !16
  %52 = load ptr, ptr %17, align 8, !tbaa !5
  %53 = getelementptr inbounds i8, ptr %52, i64 0
  %54 = load i8, ptr %53, align 1, !tbaa !17
  %55 = zext i8 %54 to i32
  %56 = mul nsw i32 %55, 4
  %57 = sext i32 %56 to i64
  %58 = getelementptr inbounds i8, ptr %51, i64 %57
  call void @_ZN2rw27conv_RGBA8888_from_RGBA8888EPhS0_(ptr noundef %48, ptr noundef %58)
  br label %69

59:                                               ; preds = %41
  %60 = getelementptr inbounds [4 x i8], ptr %10, i64 0, i64 0
  %61 = load ptr, ptr %17, align 8, !tbaa !5
  call void @_ZN2rw27conv_RGBA8888_from_RGBA8888EPhS0_(ptr noundef %60, ptr noundef %61)
  br label %69

62:                                               ; preds = %41
  %63 = getelementptr inbounds [4 x i8], ptr %10, i64 0, i64 0
  %64 = load ptr, ptr %17, align 8, !tbaa !5
  call void @_ZN2rw25conv_RGBA8888_from_RGB888EPhS0_(ptr noundef %63, ptr noundef %64)
  br label %69

65:                                               ; preds = %41
  %66 = getelementptr inbounds [4 x i8], ptr %10, i64 0, i64 0
  %67 = load ptr, ptr %17, align 8, !tbaa !5
  call void @_ZN2rw27conv_RGBA8888_from_ARGB1555EPhS0_(ptr noundef %66, ptr noundef %67)
  br label %69

68:                                               ; preds = %41
  call void @__assert_fail(ptr noundef @.str.25, ptr noundef @.str.2, i32 noundef 1305, ptr noundef @__PRETTY_FUNCTION__._ZN2rw10ColorQuant10matchImageEPhjPNS_5ImageE) #6
  unreachable

69:                                               ; preds = %65, %62, %59, %47
  %70 = getelementptr inbounds [4 x i8], ptr %10, i64 0, i64 0
  %71 = load i8, ptr %70, align 1, !tbaa !17
  %72 = getelementptr inbounds %"struct.rw::RGBA", ptr %9, i32 0, i32 0
  store i8 %71, ptr %72, align 1, !tbaa !18
  %73 = getelementptr inbounds [4 x i8], ptr %10, i64 0, i64 1
  %74 = load i8, ptr %73, align 1, !tbaa !17
  %75 = getelementptr inbounds %"struct.rw::RGBA", ptr %9, i32 0, i32 1
  store i8 %74, ptr %75, align 1, !tbaa !20
  %76 = getelementptr inbounds [4 x i8], ptr %10, i64 0, i64 2
  %77 = load i8, ptr %76, align 1, !tbaa !17
  %78 = getelementptr inbounds %"struct.rw::RGBA", ptr %9, i32 0, i32 2
  store i8 %77, ptr %78, align 1, !tbaa !21
  %79 = getelementptr inbounds [4 x i8], ptr %10, i64 0, i64 3
  %80 = load i8, ptr %79, align 1, !tbaa !17
  %81 = getelementptr inbounds %"struct.rw::RGBA", ptr %9, i32 0, i32 3
  store i8 %80, ptr %81, align 1, !tbaa !22
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %19, ptr align 1 %9, i64 4, i1 false), !tbaa.struct !23
  %82 = load i32, ptr %19, align 1
  %83 = call noundef zeroext i8 @_ZN2rw10ColorQuant9findColorENS_4RGBAE(ptr noundef nonnull align 8 dereferenceable(24) %20, i32 %82)
  %84 = load ptr, ptr %18, align 8, !tbaa !5
  store i8 %83, ptr %84, align 1, !tbaa !17
  %85 = load ptr, ptr %8, align 8, !tbaa !5
  %86 = getelementptr inbounds %"struct.rw::Image", ptr %85, i32 0, i32 4
  %87 = load i32, ptr %86, align 8, !tbaa !24
  %88 = load ptr, ptr %14, align 8, !tbaa !5
  %89 = sext i32 %87 to i64
  %90 = getelementptr inbounds i8, ptr %88, i64 %89
  store ptr %90, ptr %14, align 8, !tbaa !5
  %91 = load ptr, ptr %15, align 8, !tbaa !5
  %92 = getelementptr inbounds i8, ptr %91, i32 1
  store ptr %92, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #5
  br label %93

93:                                               ; preds = %69
  %94 = load i32, ptr %16, align 4, !tbaa !9
  %95 = add nsw i32 %94, 1
  store i32 %95, ptr %16, align 4, !tbaa !9
  br label %34, !llvm.loop !25

96:                                               ; preds = %40
  %97 = load ptr, ptr %8, align 8, !tbaa !5
  %98 = getelementptr inbounds %"struct.rw::Image", ptr %97, i32 0, i32 5
  %99 = load i32, ptr %98, align 4, !tbaa !27
  %100 = load ptr, ptr %11, align 8, !tbaa !5
  %101 = sext i32 %99 to i64
  %102 = getelementptr inbounds i8, ptr %100, i64 %101
  store ptr %102, ptr %11, align 8, !tbaa !5
  %103 = load i32, ptr %7, align 4, !tbaa !9
  %104 = load ptr, ptr %6, align 8, !tbaa !5
  %105 = zext i32 %103 to i64
  %106 = getelementptr inbounds i8, ptr %104, i64 %105
  store ptr %106, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #5
  br label %107

107:                                              ; preds = %96
  %108 = load i32, ptr %12, align 4, !tbaa !9
  %109 = add nsw i32 %108, 1
  store i32 %109, ptr %12, align 4, !tbaa !9
  br label %24, !llvm.loop !28

110:                                              ; preds = %30
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  ret void
}

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i8 @_ZN2rw10ColorQuant9findColorENS_4RGBAE(ptr noundef nonnull align 8 dereferenceable(24), i32) #4 align 2

declare void @_ZN2rw27conv_RGBA8888_from_RGBA8888EPhS0_(ptr noundef, ptr noundef) #3

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { "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 }
attributes #6 = { noreturn 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 = !{!12, !6, i64 24}
!12 = !{!"_ZTSN2rw5ImageE", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !6, i64 24, !6, i64 32}
!13 = !{!12, !10, i64 8}
!14 = !{!12, !10, i64 4}
!15 = !{!12, !10, i64 12}
!16 = !{!12, !6, i64 32}
!17 = !{!7, !7, i64 0}
!18 = !{!19, !7, i64 0}
!19 = !{!"_ZTSN2rw4RGBAE", !7, i64 0, !7, i64 1, !7, i64 2, !7, i64 3}
!20 = !{!19, !7, i64 1}
!21 = !{!19, !7, i64 2}
!22 = !{!19, !7, i64 3}
!23 = !{i64 0, i64 1, !17, i64 1, i64 1, !17, i64 2, i64 1, !17, i64 3, i64 1, !17}
!24 = !{!12, !10, i64 16}
!25 = distinct !{!25, !26}
!26 = !{!"llvm.loop.mustprogress"}
!27 = !{!12, !10, i64 20}
!28 = distinct !{!28, !26}


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

@.str.2 = external hidden unnamed_addr constant [57 x i8], align 1
@.str.25 = external hidden unnamed_addr constant [21 x i8], align 1
@__PRETTY_FUNCTION__._ZN2rw10ColorQuant10matchImageEPhjPNS_5ImageE = external hidden unnamed_addr constant [58 x i8], align 1

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

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

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

declare void @_ZN2rw27conv_RGBA8888_from_ARGB1555EPhS0_(ptr noundef, ptr noundef) local_unnamed_addr #2

declare void @_ZN2rw25conv_RGBA8888_from_RGB888EPhS0_(ptr noundef, ptr noundef) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN2rw10ColorQuant10matchImageEPhjPNS_5ImageE(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr nocapture noundef writeonly %1, i32 noundef %2, ptr nocapture noundef readonly %3) local_unnamed_addr #3 align 2 {
  %5 = alloca [4 x i8], align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #5
  %6 = getelementptr inbounds i8, ptr %3, i64 8
  %7 = load i32, ptr %6, align 8, !tbaa !5
  %8 = icmp sgt i32 %7, 0
  br i1 %8, label %.preheader.lr.ph, label %._crit_edge37

.preheader.lr.ph:                                 ; preds = %4
  %9 = getelementptr inbounds i8, ptr %3, i64 4
  %10 = getelementptr inbounds i8, ptr %3, i64 12
  %11 = getelementptr inbounds i8, ptr %3, i64 32
  %12 = getelementptr inbounds i8, ptr %3, i64 16
  %13 = getelementptr inbounds i8, ptr %3, i64 20
  %14 = zext i32 %2 to i64
  %15 = load i32, ptr %9, align 4, !tbaa !11
  %16 = icmp sgt i32 %15, 0
  br i1 %16, label %.preheader.preheader, label %._crit_edge37

.preheader.preheader:                             ; preds = %.preheader.lr.ph
  %17 = getelementptr inbounds i8, ptr %3, i64 24
  %18 = load ptr, ptr %17, align 8, !tbaa !12
  br label %.preheader

.preheader:                                       ; preds = %.preheader.preheader, %._crit_edge
  %19 = phi i32 [ %22, %._crit_edge ], [ %7, %.preheader.preheader ]
  %20 = phi i32 [ %23, %._crit_edge ], [ %15, %.preheader.preheader ]
  %.036 = phi ptr [ %27, %._crit_edge ], [ %1, %.preheader.preheader ]
  %.02635 = phi ptr [ %26, %._crit_edge ], [ %18, %.preheader.preheader ]
  %.02734 = phi i32 [ %28, %._crit_edge ], [ 0, %.preheader.preheader ]
  %21 = icmp sgt i32 %20, 0
  br i1 %21, label %.lr.ph, label %._crit_edge

._crit_edge37:                                    ; preds = %._crit_edge, %.preheader.lr.ph, %4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #5
  ret void

._crit_edge.loopexit:                             ; preds = %43
  %.pre = load i32, ptr %6, align 8, !tbaa !5
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %.preheader
  %22 = phi i32 [ %.pre, %._crit_edge.loopexit ], [ %19, %.preheader ]
  %23 = phi i32 [ %51, %._crit_edge.loopexit ], [ %20, %.preheader ]
  %24 = load i32, ptr %13, align 4, !tbaa !13
  %25 = sext i32 %24 to i64
  %26 = getelementptr inbounds i8, ptr %.02635, i64 %25
  %27 = getelementptr inbounds i8, ptr %.036, i64 %14
  %28 = add nuw nsw i32 %.02734, 1
  %29 = icmp slt i32 %28, %22
  br i1 %29, label %.preheader, label %._crit_edge37, !llvm.loop !14

.lr.ph:                                           ; preds = %.preheader, %43
  %.02833 = phi i32 [ %50, %43 ], [ 0, %.preheader ]
  %.02932 = phi ptr [ %49, %43 ], [ %.036, %.preheader ]
  %.03031 = phi ptr [ %48, %43 ], [ %.02635, %.preheader ]
  %30 = load i32, ptr %10, align 4, !tbaa !17
  %31 = add i32 %30, -4
  %32 = call i32 @llvm.fshl.i32(i32 %31, i32 %31, i32 30)
  switch i32 %32, label %42 [
    i32 0, label %33
    i32 1, label %33
    i32 7, label %39
    i32 5, label %40
    i32 3, label %41
  ]

33:                                               ; preds = %.lr.ph, %.lr.ph
  %34 = load ptr, ptr %11, align 8, !tbaa !18
  %35 = load i8, ptr %.03031, align 1, !tbaa !19
  %36 = zext i8 %35 to i64
  %37 = shl nuw nsw i64 %36, 2
  %38 = getelementptr inbounds i8, ptr %34, i64 %37
  call void @_ZN2rw27conv_RGBA8888_from_RGBA8888EPhS0_(ptr noundef nonnull %5, ptr noundef %38)
  br label %43

39:                                               ; preds = %.lr.ph
  call void @_ZN2rw27conv_RGBA8888_from_RGBA8888EPhS0_(ptr noundef nonnull %5, ptr noundef %.03031)
  br label %43

40:                                               ; preds = %.lr.ph
  call void @_ZN2rw25conv_RGBA8888_from_RGB888EPhS0_(ptr noundef nonnull %5, ptr noundef %.03031)
  br label %43

41:                                               ; preds = %.lr.ph
  call void @_ZN2rw27conv_RGBA8888_from_ARGB1555EPhS0_(ptr noundef nonnull %5, ptr noundef %.03031)
  br label %43

42:                                               ; preds = %.lr.ph
  call void @__assert_fail(ptr noundef nonnull @.str.25, ptr noundef nonnull @.str.2, i32 noundef 1305, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN2rw10ColorQuant10matchImageEPhjPNS_5ImageE) #6
  unreachable

43:                                               ; preds = %41, %40, %39, %33
  %44 = load i32, ptr %5, align 4
  %45 = call noundef zeroext i8 @_ZN2rw10ColorQuant9findColorENS_4RGBAE(ptr noundef nonnull align 8 dereferenceable(24) %0, i32 %44)
  store i8 %45, ptr %.02932, align 1, !tbaa !19
  %46 = load i32, ptr %12, align 8, !tbaa !20
  %47 = sext i32 %46 to i64
  %48 = getelementptr inbounds i8, ptr %.03031, i64 %47
  %49 = getelementptr inbounds i8, ptr %.02932, i64 1
  %50 = add nuw nsw i32 %.02833, 1
  %51 = load i32, ptr %9, align 4, !tbaa !11
  %52 = icmp slt i32 %50, %51
  br i1 %52, label %.lr.ph, label %._crit_edge.loopexit, !llvm.loop !21
}

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i8 @_ZN2rw10ColorQuant9findColorENS_4RGBAE(ptr noundef nonnull align 8 dereferenceable(24), i32) local_unnamed_addr #3 align 2

declare void @_ZN2rw27conv_RGBA8888_from_RGBA8888EPhS0_(ptr noundef, ptr noundef) local_unnamed_addr #2

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #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 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 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #5 = { nounwind }
attributes #6 = { noreturn 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 8}
!6 = !{!"_ZTSN2rw5ImageE", !7, i64 0, !7, i64 4, !7, i64 8, !7, i64 12, !7, i64 16, !7, i64 20, !10, i64 24, !10, i64 32}
!7 = !{!"int", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"any pointer", !8, i64 0}
!11 = !{!6, !7, i64 4}
!12 = !{!6, !10, i64 24}
!13 = !{!6, !7, i64 20}
!14 = distinct !{!14, !15, !16}
!15 = !{!"llvm.loop.mustprogress"}
!16 = !{!"llvm.loop.unswitch.partial.disable"}
!17 = !{!6, !7, i64 12}
!18 = !{!6, !10, i64 32}
!19 = !{!8, !8, i64 0}
!20 = !{!6, !7, i64 16}
!21 = distinct !{!21, !15}


; Effective O3 passes: AggressiveInstCombinePass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimpleLoopUnswitchPass,SimplifyCFGPass