; LLVM IR from InsightSoftwareConsortium/ITK :: Modules/ThirdParty/GDCM/src/gdcm/Utilities/gdcmrle (rle)

; 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.rle::pixel_info" = type { i8, i8 }
%"class.rle::rle_encoder" = type { ptr }
%"struct.rle::rle_encoder::internal" = type { %"class.rle::image_info", %"struct.rle::header", ptr, [16 x i32], %"class.std::vector", %"class.std::vector" }
%"class.rle::image_info" = type { i32, i32, %"class.rle::pixel_info", i8, i8 }
%"struct.rle::header" = type { i32, [15 x i32] }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<char, std::allocator<char>>::_Vector_impl" }
%"struct.std::_Vector_base<char, std::allocator<char>>::_Vector_impl" = type { %"struct.std::_Vector_base<char, std::allocator<char>>::_Vector_impl_data" }
%"struct.std::_Vector_base<char, std::allocator<char>>::_Vector_impl_data" = type { ptr, ptr, ptr }

@.str.2 = external hidden unnamed_addr constant [122 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [26 x i8], align 1
@__PRETTY_FUNCTION__._ZN3rle11rle_encoder10encode_rowERNS_4destE = external hidden unnamed_addr constant [41 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: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNK3rle10image_info9get_widthEv(ptr noundef nonnull align 4 dereferenceable(12)) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local i16 @_ZNK3rle10image_info14get_pixel_infoEv(ptr noundef nonnull align 4 dereferenceable(12)) #1 align 2

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

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

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

declare noundef i32 @_ZN3rle6source18read_into_segmentsEPciRKNS_10image_infoE(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef, i32 noundef, ptr noundef nonnull align 4 dereferenceable(12)) #3

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN3rle11rle_encoder10encode_rowERNS_4destE(ptr noundef nonnull align 8 dereferenceable(8) %0, ptr noundef nonnull align 8 dereferenceable(8) %1) #2 align 2 {
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca ptr, align 8
  %9 = alloca %"class.rle::pixel_info", align 1
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i8, align 1
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  %19 = load ptr, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  %20 = getelementptr inbounds %"class.rle::rle_encoder", ptr %19, i32 0, i32 0
  %21 = load ptr, ptr %20, align 8, !tbaa !9
  %22 = getelementptr inbounds %"struct.rle::rle_encoder::internal", ptr %21, i32 0, i32 2
  %23 = load ptr, ptr %22, align 8, !tbaa !11
  store ptr %23, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  %24 = getelementptr inbounds %"class.rle::rle_encoder", ptr %19, i32 0, i32 0
  %25 = load ptr, ptr %24, align 8, !tbaa !9
  %26 = getelementptr inbounds %"struct.rle::rle_encoder::internal", ptr %25, i32 0, i32 0
  %27 = call noundef i32 @_ZNK3rle10image_info9get_widthEv(ptr noundef nonnull align 4 dereferenceable(12) %26)
  store i32 %27, ptr %7, align 4, !tbaa !22
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #5
  call void @llvm.lifetime.start.p0(i64 2, ptr %9) #5
  %28 = getelementptr inbounds %"class.rle::rle_encoder", ptr %19, i32 0, i32 0
  %29 = load ptr, ptr %28, align 8, !tbaa !9
  %30 = getelementptr inbounds %"struct.rle::rle_encoder::internal", ptr %29, i32 0, i32 0
  %31 = call i16 @_ZNK3rle10image_info14get_pixel_infoEv(ptr noundef nonnull align 4 dereferenceable(12) %30)
  store i16 %31, ptr %9, align 1
  store ptr %9, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  %32 = load ptr, ptr %8, align 8, !tbaa !5
  %33 = call noundef i32 @_ZNK3rle10pixel_info24get_number_of_componentsEv(ptr noundef nonnull align 1 dereferenceable(2) %32)
  store i32 %33, ptr %10, align 4, !tbaa !22
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  %34 = load ptr, ptr %8, align 8, !tbaa !5
  %35 = call noundef i32 @_ZNK3rle10pixel_info28get_number_of_bits_per_pixelEv(ptr noundef nonnull align 1 dereferenceable(2) %34)
  store i32 %35, ptr %11, align 4, !tbaa !22
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  %36 = getelementptr inbounds %"class.rle::rle_encoder", ptr %19, i32 0, i32 0
  %37 = load ptr, ptr %36, align 8, !tbaa !9
  %38 = getelementptr inbounds %"struct.rle::rle_encoder::internal", ptr %37, i32 0, i32 1
  %39 = getelementptr inbounds %"struct.rle::header", ptr %38, i32 0, i32 0
  %40 = load i32, ptr %39, align 4, !tbaa !23
  store i32 %40, ptr %12, align 4, !tbaa !22
  %41 = load i32, ptr %12, align 4, !tbaa !22
  %42 = load i32, ptr %11, align 4, !tbaa !22
  %43 = sdiv i32 %42, 8
  %44 = load i32, ptr %10, align 4, !tbaa !22
  %45 = mul nsw i32 %43, %44
  %46 = icmp eq i32 %41, %45
  br i1 %46, label %47, label %48

47:                                               ; preds = %2
  br label %50

48:                                               ; preds = %2
  call void @__assert_fail(ptr noundef @.str.8, ptr noundef @.str.2, i32 noundef 267, ptr noundef @__PRETTY_FUNCTION__._ZN3rle11rle_encoder10encode_rowERNS_4destE) #6
  unreachable

49:                                               ; No predecessors!
  br label %50

50:                                               ; preds = %49, %47
  %51 = getelementptr inbounds %"class.rle::rle_encoder", ptr %19, i32 0, i32 0
  %52 = load ptr, ptr %51, align 8, !tbaa !9
  %53 = getelementptr inbounds %"struct.rle::rle_encoder::internal", ptr %52, i32 0, i32 4
  %54 = load i32, ptr %7, align 4, !tbaa !22
  %55 = load i32, ptr %12, align 4, !tbaa !22
  %56 = mul nsw i32 %54, %55
  %57 = sext i32 %56 to i64
  call void @_ZNSt6vectorIcSaIcEE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) %53, i64 noundef %57)
  %58 = getelementptr inbounds %"class.rle::rle_encoder", ptr %19, i32 0, i32 0
  %59 = load ptr, ptr %58, align 8, !tbaa !9
  %60 = getelementptr inbounds %"struct.rle::rle_encoder::internal", ptr %59, i32 0, i32 5
  %61 = load i32, ptr %7, align 4, !tbaa !22
  %62 = mul nsw i32 %61, 2
  %63 = sext i32 %62 to i64
  call void @_ZNSt6vectorIcSaIcEE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) %60, i64 noundef %63)
  %64 = load ptr, ptr %6, align 8, !tbaa !5
  %65 = getelementptr inbounds %"class.rle::rle_encoder", ptr %19, i32 0, i32 0
  %66 = load ptr, ptr %65, align 8, !tbaa !9
  %67 = getelementptr inbounds %"struct.rle::rle_encoder::internal", ptr %66, i32 0, i32 4
  %68 = call noundef ptr @_ZNSt6vectorIcSaIcEE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %67) #5
  %69 = getelementptr inbounds %"class.rle::rle_encoder", ptr %19, i32 0, i32 0
  %70 = load ptr, ptr %69, align 8, !tbaa !9
  %71 = getelementptr inbounds %"struct.rle::rle_encoder::internal", ptr %70, i32 0, i32 4
  %72 = call noundef i64 @_ZNKSt6vectorIcSaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %71) #5
  %73 = trunc i64 %72 to i32
  %74 = getelementptr inbounds %"class.rle::rle_encoder", ptr %19, i32 0, i32 0
  %75 = load ptr, ptr %74, align 8, !tbaa !9
  %76 = getelementptr inbounds %"struct.rle::rle_encoder::internal", ptr %75, i32 0, i32 0
  %77 = call noundef i32 @_ZN3rle6source18read_into_segmentsEPciRKNS_10image_infoE(ptr noundef nonnull align 8 dereferenceable(8) %64, ptr noundef %68, i32 noundef %73, ptr noundef nonnull align 4 dereferenceable(12) %76)
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  %78 = getelementptr inbounds %"class.rle::rle_encoder", ptr %19, i32 0, i32 0
  %79 = load ptr, ptr %78, align 8, !tbaa !9
  %80 = getelementptr inbounds %"struct.rle::rle_encoder::internal", ptr %79, i32 0, i32 3
  %81 = getelementptr inbounds [16 x i32], ptr %80, i64 0, i64 0
  store ptr %81, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  store i32 0, ptr %14, align 4, !tbaa !22
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #5
  store i32 0, ptr %15, align 4, !tbaa !22
  br label %82

82:                                               ; preds = %154, %50
  %83 = load i32, ptr %15, align 4, !tbaa !22
  %84 = load i32, ptr %12, align 4, !tbaa !22
  %85 = icmp slt i32 %83, %84
  br i1 %85, label %87, label %86

86:                                               ; preds = %82
  store i32 2, ptr %16, align 4
  br label %157

87:                                               ; preds = %82
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #5
  %88 = getelementptr inbounds %"class.rle::rle_encoder", ptr %19, i32 0, i32 0
  %89 = load ptr, ptr %88, align 8, !tbaa !9
  %90 = getelementptr inbounds %"struct.rle::rle_encoder::internal", ptr %89, i32 0, i32 5
  %91 = call noundef ptr @_ZNSt6vectorIcSaIcEE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %90) #5
  %92 = getelementptr inbounds %"class.rle::rle_encoder", ptr %19, i32 0, i32 0
  %93 = load ptr, ptr %92, align 8, !tbaa !9
  %94 = getelementptr inbounds %"struct.rle::rle_encoder::internal", ptr %93, i32 0, i32 5
  %95 = call noundef i64 @_ZNKSt6vectorIcSaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %94) #5
  %96 = trunc i64 %95 to i32
  %97 = getelementptr inbounds %"class.rle::rle_encoder", ptr %19, i32 0, i32 0
  %98 = load ptr, ptr %97, align 8, !tbaa !9
  %99 = getelementptr inbounds %"struct.rle::rle_encoder::internal", ptr %98, i32 0, i32 4
  %100 = call noundef ptr @_ZNSt6vectorIcSaIcEE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %99) #5
  %101 = load i32, ptr %15, align 4, !tbaa !22
  %102 = load i32, ptr %7, align 4, !tbaa !22
  %103 = mul nsw i32 %101, %102
  %104 = sext i32 %103 to i64
  %105 = getelementptr inbounds i8, ptr %100, i64 %104
  %106 = load i32, ptr %7, align 4, !tbaa !22
  %107 = call noundef i32 @_ZN3rle11rle_encoder19encode_row_internalEPciPKci(ptr noundef nonnull align 8 dereferenceable(8) %19, ptr noundef %91, i32 noundef %96, ptr noundef %105, i32 noundef %106)
  store i32 %107, ptr %17, align 4, !tbaa !22
  %108 = load i32, ptr %17, align 4, !tbaa !22
  %109 = icmp slt i32 %108, 0
  br i1 %109, label %110, label %111

110:                                              ; preds = %87
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %16, align 4
  br label %151

111:                                              ; preds = %87
  %112 = load i32, ptr %17, align 4, !tbaa !22
  %113 = load i32, ptr %14, align 4, !tbaa !22
  %114 = add nsw i32 %113, %112
  store i32 %114, ptr %14, align 4, !tbaa !22
  call void @llvm.lifetime.start.p0(i64 1, ptr %18) #5
  %115 = load ptr, ptr %5, align 8, !tbaa !5
  %116 = load ptr, ptr %13, align 8, !tbaa !5
  %117 = load i32, ptr %15, align 4, !tbaa !22
  %118 = sext i32 %117 to i64
  %119 = getelementptr inbounds i32, ptr %116, i64 %118
  %120 = load i32, ptr %119, align 4, !tbaa !22
  %121 = load ptr, ptr %115, align 8, !tbaa !24
  %122 = getelementptr inbounds ptr, ptr %121, i64 1
  %123 = load ptr, ptr %122, align 8
  %124 = call noundef zeroext i1 %123(ptr noundef nonnull align 8 dereferenceable(8) %115, i32 noundef %120)
  %125 = zext i1 %124 to i8
  store i8 %125, ptr %18, align 1, !tbaa !26
  %126 = load i8, ptr %18, align 1, !tbaa !26, !range !27, !noundef !28
  %127 = trunc i8 %126 to i1
  br i1 %127, label %129, label %128

128:                                              ; preds = %111
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %16, align 4
  br label %150

129:                                              ; preds = %111
  %130 = load ptr, ptr %5, align 8, !tbaa !5
  %131 = getelementptr inbounds %"class.rle::rle_encoder", ptr %19, i32 0, i32 0
  %132 = load ptr, ptr %131, align 8, !tbaa !9
  %133 = getelementptr inbounds %"struct.rle::rle_encoder::internal", ptr %132, i32 0, i32 5
  %134 = call noundef ptr @_ZNSt6vectorIcSaIcEE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %133) #5
  %135 = load i32, ptr %17, align 4, !tbaa !22
  %136 = load ptr, ptr %130, align 8, !tbaa !24
  %137 = getelementptr inbounds ptr, ptr %136, i64 0
  %138 = load ptr, ptr %137, align 8
  %139 = call noundef i32 %138(ptr noundef nonnull align 8 dereferenceable(8) %130, ptr noundef %134, i32 noundef %135)
  %140 = icmp slt i32 %139, 0
  br i1 %140, label %141, label %142

141:                                              ; preds = %129
  store i32 -1, ptr %3, align 4
  store i32 1, ptr %16, align 4
  br label %150

142:                                              ; preds = %129
  %143 = load i32, ptr %17, align 4, !tbaa !22
  %144 = load ptr, ptr %13, align 8, !tbaa !5
  %145 = load i32, ptr %15, align 4, !tbaa !22
  %146 = sext i32 %145 to i64
  %147 = getelementptr inbounds i32, ptr %144, i64 %146
  %148 = load i32, ptr %147, align 4, !tbaa !22
  %149 = add i32 %148, %143
  store i32 %149, ptr %147, align 4, !tbaa !22
  store i32 0, ptr %16, align 4
  br label %150

150:                                              ; preds = %142, %141, %128
  call void @llvm.lifetime.end.p0(i64 1, ptr %18) #5
  br label %151

151:                                              ; preds = %150, %110
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #5
  %152 = load i32, ptr %16, align 4
  switch i32 %152, label %157 [
    i32 0, label %153
  ]

153:                                              ; preds = %151
  br label %154

154:                                              ; preds = %153
  %155 = load i32, ptr %15, align 4, !tbaa !22
  %156 = add nsw i32 %155, 1
  store i32 %156, ptr %15, align 4, !tbaa !22
  br label %82, !llvm.loop !29

157:                                              ; preds = %151, %86
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  %158 = load i32, ptr %16, align 4
  switch i32 %158, label %161 [
    i32 2, label %159
  ]

159:                                              ; preds = %157
  %160 = load i32, ptr %14, align 4, !tbaa !22
  store i32 %160, ptr %3, align 4
  store i32 1, ptr %16, align 4
  br label %161

161:                                              ; preds = %159, %157
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 2, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  %162 = load i32, ptr %3, align 4
  ret i32 %162
}

declare noundef i32 @_ZNK3rle10pixel_info24get_number_of_componentsEv(ptr noundef nonnull align 1 dereferenceable(2)) #3

declare noundef i32 @_ZNK3rle10pixel_info28get_number_of_bits_per_pixelEv(ptr noundef nonnull align 1 dereferenceable(2)) #3

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { 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 = { "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 = { 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 #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, !6, i64 0}
!10 = !{!"_ZTSN3rle11rle_encoderE", !6, i64 0}
!11 = !{!12, !6, i64 80}
!12 = !{!"_ZTSN3rle11rle_encoder8internalE", !13, i64 0, !17, i64 12, !6, i64 80, !7, i64 88, !18, i64 152, !18, i64 176}
!13 = !{!"_ZTSN3rle10image_infoE", !14, i64 0, !14, i64 4, !15, i64 8, !16, i64 10, !16, i64 11}
!14 = !{!"int", !7, i64 0}
!15 = !{!"_ZTSN3rle10pixel_infoE", !7, i64 0, !7, i64 1}
!16 = !{!"bool", !7, i64 0}
!17 = !{!"_ZTSN3rle6headerE", !14, i64 0, !7, i64 4}
!18 = !{!"_ZTSSt6vectorIcSaIcEE", !19, i64 0}
!19 = !{!"_ZTSSt12_Vector_baseIcSaIcEE", !20, i64 0}
!20 = !{!"_ZTSNSt12_Vector_baseIcSaIcEE12_Vector_implE", !21, i64 0}
!21 = !{!"_ZTSNSt12_Vector_baseIcSaIcEE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!22 = !{!14, !14, i64 0}
!23 = !{!12, !14, i64 12}
!24 = !{!25, !25, i64 0}
!25 = !{!"vtable pointer", !8, i64 0}
!26 = !{!16, !16, i64 0}
!27 = !{i8 0, i8 2}
!28 = !{}
!29 = distinct !{!29, !30}
!30 = !{!"llvm.loop.mustprogress"}


; 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.rle::pixel_info" = type { i8, i8 }

@.str.2 = external hidden unnamed_addr constant [122 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [26 x i8], align 1
@__PRETTY_FUNCTION__._ZN3rle11rle_encoder10encode_rowERNS_4destE = external hidden unnamed_addr constant [41 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 nounwind uwtable
declare dso_local noundef i32 @_ZNK3rle10image_info9get_widthEv(ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local i16 @_ZNK3rle10image_info14get_pixel_infoEv(ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #1 align 2

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

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

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

declare noundef i32 @_ZN3rle6source18read_into_segmentsEPciRKNS_10image_infoE(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef, i32 noundef, ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #3

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN3rle11rle_encoder10encode_rowERNS_4destE(ptr noundef nonnull align 8 dereferenceable(8) %0, ptr noundef nonnull align 8 dereferenceable(8) %1) local_unnamed_addr #2 align 2 {
  %3 = alloca %"class.rle::pixel_info", align 2
  %4 = load ptr, ptr %0, align 8, !tbaa !5
  %5 = getelementptr inbounds i8, ptr %4, i64 80
  %6 = load ptr, ptr %5, align 8, !tbaa !10
  %7 = tail call noundef i32 @_ZNK3rle10image_info9get_widthEv(ptr noundef nonnull align 4 dereferenceable(12) %4)
  call void @llvm.lifetime.start.p0(i64 2, ptr nonnull %3) #5
  %8 = load ptr, ptr %0, align 8, !tbaa !5
  %9 = tail call i16 @_ZNK3rle10image_info14get_pixel_infoEv(ptr noundef nonnull align 4 dereferenceable(12) %8)
  store i16 %9, ptr %3, align 2
  %10 = call noundef i32 @_ZNK3rle10pixel_info24get_number_of_componentsEv(ptr noundef nonnull align 1 dereferenceable(2) %3)
  %11 = call noundef i32 @_ZNK3rle10pixel_info28get_number_of_bits_per_pixelEv(ptr noundef nonnull align 1 dereferenceable(2) %3)
  %12 = load ptr, ptr %0, align 8, !tbaa !5
  %13 = getelementptr inbounds i8, ptr %12, i64 12
  %14 = load i32, ptr %13, align 4, !tbaa !21
  %15 = sdiv i32 %11, 8
  %16 = mul nsw i32 %15, %10
  %17 = icmp eq i32 %14, %16
  br i1 %17, label %19, label %18

18:                                               ; preds = %2
  call void @__assert_fail(ptr noundef nonnull @.str.8, ptr noundef nonnull @.str.2, i32 noundef 267, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN3rle11rle_encoder10encode_rowERNS_4destE) #6
  unreachable

19:                                               ; preds = %2
  %20 = getelementptr inbounds i8, ptr %12, i64 152
  %21 = mul nsw i32 %14, %7
  %22 = sext i32 %21 to i64
  call void @_ZNSt6vectorIcSaIcEE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) %20, i64 noundef %22)
  %23 = load ptr, ptr %0, align 8, !tbaa !5
  %24 = getelementptr inbounds i8, ptr %23, i64 176
  %25 = shl nsw i32 %7, 1
  %26 = sext i32 %25 to i64
  call void @_ZNSt6vectorIcSaIcEE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) %24, i64 noundef %26)
  %27 = load ptr, ptr %0, align 8, !tbaa !5
  %28 = getelementptr inbounds i8, ptr %27, i64 152
  %29 = call noundef ptr @_ZNSt6vectorIcSaIcEE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %28) #5
  %30 = load ptr, ptr %0, align 8, !tbaa !5
  %31 = getelementptr inbounds i8, ptr %30, i64 152
  %32 = call noundef i64 @_ZNKSt6vectorIcSaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %31) #5
  %33 = trunc i64 %32 to i32
  %34 = load ptr, ptr %0, align 8, !tbaa !5
  %35 = call noundef i32 @_ZN3rle6source18read_into_segmentsEPciRKNS_10image_infoE(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef %29, i32 noundef %33, ptr noundef nonnull align 4 dereferenceable(12) %34)
  %36 = load ptr, ptr %0, align 8, !tbaa !5
  %37 = getelementptr inbounds i8, ptr %36, i64 88
  %.not44 = icmp sgt i32 %14, 0
  br i1 %.not44, label %.lr.ph.preheader, label %.thread

.lr.ph.preheader:                                 ; preds = %19
  %38 = sext i32 %7 to i64
  %wide.trip.count = zext nneg i32 %14 to i64
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader, %69
  %indvars.iv = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next, %69 ]
  %.03246 = phi i32 [ 0, %.lr.ph.preheader ], [ %54, %69 ]
  %39 = load ptr, ptr %0, align 8, !tbaa !5
  %40 = getelementptr inbounds i8, ptr %39, i64 176
  %41 = call noundef ptr @_ZNSt6vectorIcSaIcEE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %40) #5
  %42 = load ptr, ptr %0, align 8, !tbaa !5
  %43 = getelementptr inbounds i8, ptr %42, i64 176
  %44 = call noundef i64 @_ZNKSt6vectorIcSaIcEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %43) #5
  %45 = trunc i64 %44 to i32
  %46 = load ptr, ptr %0, align 8, !tbaa !5
  %47 = getelementptr inbounds i8, ptr %46, i64 152
  %48 = call noundef ptr @_ZNSt6vectorIcSaIcEE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %47) #5
  %49 = mul nsw i64 %indvars.iv, %38
  %50 = getelementptr inbounds i8, ptr %48, i64 %49
  %51 = call noundef i32 @_ZN3rle11rle_encoder19encode_row_internalEPciPKci(ptr noundef nonnull align 8 dereferenceable(8) %0, ptr noundef %41, i32 noundef %45, ptr noundef %50, i32 noundef %7)
  %52 = icmp slt i32 %51, 0
  br i1 %52, label %.thread, label %53

53:                                               ; preds = %.lr.ph
  %54 = add nuw nsw i32 %51, %.03246
  %55 = getelementptr inbounds i32, ptr %37, i64 %indvars.iv
  %56 = load i32, ptr %55, align 4, !tbaa !22
  %57 = load ptr, ptr %1, align 8, !tbaa !23
  %58 = getelementptr inbounds i8, ptr %57, i64 8
  %59 = load ptr, ptr %58, align 8
  %60 = call noundef zeroext i1 %59(ptr noundef nonnull align 8 dereferenceable(8) %1, i32 noundef %56)
  br i1 %60, label %61, label %.thread

61:                                               ; preds = %53
  %62 = load ptr, ptr %0, align 8, !tbaa !5
  %63 = getelementptr inbounds i8, ptr %62, i64 176
  %64 = call noundef ptr @_ZNSt6vectorIcSaIcEE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %63) #5
  %65 = load ptr, ptr %1, align 8, !tbaa !23
  %66 = load ptr, ptr %65, align 8
  %67 = call noundef i32 %66(ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef %64, i32 noundef %51)
  %68 = icmp slt i32 %67, 0
  br i1 %68, label %.thread, label %69

69:                                               ; preds = %61
  %70 = load i32, ptr %55, align 4, !tbaa !22
  %71 = add i32 %70, %51
  store i32 %71, ptr %55, align 4, !tbaa !22
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %.thread, label %.lr.ph, !llvm.loop !25

.thread:                                          ; preds = %69, %.lr.ph, %53, %61, %19
  %spec.select = phi i32 [ 0, %19 ], [ -1, %61 ], [ -1, %53 ], [ -1, %.lr.ph ], [ %54, %69 ]
  call void @llvm.lifetime.end.p0(i64 2, ptr nonnull %3) #5
  ret i32 %spec.select
}

declare noundef i32 @_ZNK3rle10pixel_info24get_number_of_componentsEv(ptr noundef nonnull align 1 dereferenceable(2)) local_unnamed_addr #3

declare noundef i32 @_ZNK3rle10pixel_info28get_number_of_bits_per_pixelEv(ptr noundef nonnull align 1 dereferenceable(2)) local_unnamed_addr #3

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

attributes #0 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { 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 = { "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 = { 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 #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 0}
!6 = !{!"_ZTSN3rle11rle_encoderE", !7, i64 0}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!11, !7, i64 80}
!11 = !{!"_ZTSN3rle11rle_encoder8internalE", !12, i64 0, !16, i64 12, !7, i64 80, !8, i64 88, !17, i64 152, !17, i64 176}
!12 = !{!"_ZTSN3rle10image_infoE", !13, i64 0, !13, i64 4, !14, i64 8, !15, i64 10, !15, i64 11}
!13 = !{!"int", !8, i64 0}
!14 = !{!"_ZTSN3rle10pixel_infoE", !8, i64 0, !8, i64 1}
!15 = !{!"bool", !8, i64 0}
!16 = !{!"_ZTSN3rle6headerE", !13, i64 0, !8, i64 4}
!17 = !{!"_ZTSSt6vectorIcSaIcEE", !18, i64 0}
!18 = !{!"_ZTSSt12_Vector_baseIcSaIcEE", !19, i64 0}
!19 = !{!"_ZTSNSt12_Vector_baseIcSaIcEE12_Vector_implE", !20, i64 0}
!20 = !{!"_ZTSNSt12_Vector_baseIcSaIcEE17_Vector_impl_dataE", !7, i64 0, !7, i64 8, !7, i64 16}
!21 = !{!11, !13, i64 12}
!22 = !{!13, !13, i64 0}
!23 = !{!24, !24, i64 0}
!24 = !{!"vtable pointer", !9, i64 0}
!25 = distinct !{!25, !26}
!26 = !{!"llvm.loop.mustprogress"}


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