; 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_decoder" = type { ptr }
%"struct.rle::rle_decoder::internal" = type { %"class.rle::image_info", %"struct.rle::header", ptr, i32, %"class.std::vector", [16 x [128 x i8]], [16 x i32] }
%"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.12 = external hidden unnamed_addr constant [29 x i8], align 1
@__PRETTY_FUNCTION__._ZN3rle11rle_decoder10decode_rowERNS_4destE = external hidden unnamed_addr constant [41 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [42 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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIcSaIcEE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #3 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: 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

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

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

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

40:                                               ; preds = %2
  br label %43

41:                                               ; preds = %2
  call void @__assert_fail(ptr noundef @.str.12, ptr noundef @.str.2, i32 noundef 512, ptr noundef @__PRETTY_FUNCTION__._ZN3rle11rle_decoder10decode_rowERNS_4destE) #6
  unreachable

42:                                               ; No predecessors!
  br label %43

43:                                               ; preds = %42, %40
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #5
  %44 = getelementptr inbounds %"class.rle::rle_decoder", ptr %21, i32 0, i32 0
  %45 = load ptr, ptr %44, align 8, !tbaa !9
  %46 = getelementptr inbounds %"struct.rle::rle_decoder::internal", ptr %45, i32 0, i32 0
  %47 = call noundef i32 @_ZNK3rle10image_info9get_widthEv(ptr noundef nonnull align 4 dereferenceable(12) %46)
  %48 = load i32, ptr %9, align 4, !tbaa !11
  %49 = mul nsw i32 %47, %48
  %50 = sext i32 %49 to i64
  store i64 %50, ptr %11, align 8, !tbaa !23
  %51 = getelementptr inbounds %"class.rle::rle_decoder", ptr %21, i32 0, i32 0
  %52 = load ptr, ptr %51, align 8, !tbaa !9
  %53 = getelementptr inbounds %"struct.rle::rle_decoder::internal", ptr %52, i32 0, i32 4
  %54 = load i64, ptr %11, align 8, !tbaa !23
  call void @_ZNSt6vectorIcSaIcEE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) %53, i64 noundef %54)
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #5
  %55 = getelementptr inbounds %"class.rle::rle_decoder", ptr %21, i32 0, i32 0
  %56 = load ptr, ptr %55, align 8, !tbaa !9
  %57 = getelementptr inbounds %"struct.rle::rle_decoder::internal", ptr %56, i32 0, i32 4
  %58 = call noundef ptr @_ZNSt6vectorIcSaIcEE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %57) #5
  store ptr %58, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  store i32 0, ptr %13, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  store i32 0, ptr %14, align 4, !tbaa !11
  br label %59

59:                                               ; preds = %134, %43
  %60 = load i32, ptr %14, align 4, !tbaa !11
  %61 = load i32, ptr %7, align 4, !tbaa !11
  %62 = icmp slt i32 %60, %61
  br i1 %62, label %64, label %63

63:                                               ; preds = %59
  store i32 2, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  br label %137

64:                                               ; preds = %59
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #5
  store i32 0, ptr %16, align 4, !tbaa !11
  br label %65

65:                                               ; preds = %130, %64
  %66 = load i32, ptr %16, align 4, !tbaa !11
  %67 = load i32, ptr %10, align 4, !tbaa !11
  %68 = icmp slt i32 %66, %67
  br i1 %68, label %70, label %69

69:                                               ; preds = %65
  store i32 5, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  br label %133

70:                                               ; preds = %65
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #5
  %71 = load i32, ptr %16, align 4, !tbaa !11
  %72 = load i32, ptr %14, align 4, !tbaa !11
  %73 = load i32, ptr %10, align 4, !tbaa !11
  %74 = mul nsw i32 %72, %73
  %75 = add nsw i32 %71, %74
  store i32 %75, ptr %17, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #5
  %76 = getelementptr inbounds %"class.rle::rle_decoder", ptr %21, i32 0, i32 0
  %77 = load ptr, ptr %76, align 8, !tbaa !9
  %78 = getelementptr inbounds %"struct.rle::rle_decoder::internal", ptr %77, i32 0, i32 2
  %79 = load ptr, ptr %78, align 8, !tbaa !25
  %80 = load i32, ptr %17, align 4, !tbaa !11
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds ptr, ptr %79, i64 %81
  %83 = load ptr, ptr %82, align 8, !tbaa !5
  store ptr %83, ptr %18, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #5
  %84 = load i32, ptr %10, align 4, !tbaa !11
  %85 = sub nsw i32 %84, 1
  %86 = load i32, ptr %16, align 4, !tbaa !11
  %87 = sub nsw i32 %85, %86
  %88 = load i32, ptr %14, align 4, !tbaa !11
  %89 = load i32, ptr %10, align 4, !tbaa !11
  %90 = mul nsw i32 %88, %89
  %91 = add nsw i32 %87, %90
  store i32 %91, ptr %19, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #5
  %92 = load ptr, ptr %12, align 8, !tbaa !5
  %93 = load ptr, ptr %18, align 8, !tbaa !5
  %94 = getelementptr inbounds %"class.rle::rle_decoder", ptr %21, i32 0, i32 0
  %95 = load ptr, ptr %94, align 8, !tbaa !9
  %96 = getelementptr inbounds %"struct.rle::rle_decoder::internal", ptr %95, i32 0, i32 0
  %97 = call noundef i32 @_ZNK3rle10image_info9get_widthEv(ptr noundef nonnull align 4 dereferenceable(12) %96)
  %98 = load i32, ptr %19, align 4, !tbaa !11
  %99 = getelementptr inbounds %"class.rle::rle_decoder", ptr %21, i32 0, i32 0
  %100 = load ptr, ptr %99, align 8, !tbaa !9
  %101 = getelementptr inbounds %"struct.rle::rle_decoder::internal", ptr %100, i32 0, i32 3
  %102 = load i32, ptr %101, align 8, !tbaa !13
  %103 = getelementptr inbounds %"class.rle::rle_decoder", ptr %21, i32 0, i32 0
  %104 = load ptr, ptr %103, align 8, !tbaa !9
  %105 = getelementptr inbounds %"struct.rle::rle_decoder::internal", ptr %104, i32 0, i32 5
  %106 = load i32, ptr %17, align 4, !tbaa !11
  %107 = sext i32 %106 to i64
  %108 = getelementptr inbounds [16 x [128 x i8]], ptr %105, i64 0, i64 %107
  %109 = getelementptr inbounds [128 x i8], ptr %108, i64 0, i64 0
  %110 = getelementptr inbounds %"class.rle::rle_decoder", ptr %21, i32 0, i32 0
  %111 = load ptr, ptr %110, align 8, !tbaa !9
  %112 = getelementptr inbounds %"struct.rle::rle_decoder::internal", ptr %111, i32 0, i32 6
  %113 = load i32, ptr %17, align 4, !tbaa !11
  %114 = sext i32 %113 to i64
  %115 = getelementptr inbounds [16 x i32], ptr %112, i64 0, i64 %114
  %116 = call noundef i32 @_ZN3rleL15decode_internalEPcRNS_6sourceEiiiS0_Ri(ptr noundef %92, ptr noundef nonnull align 8 dereferenceable(8) %93, i32 noundef %97, i32 noundef %98, i32 noundef %102, ptr noundef %109, ptr noundef nonnull align 4 dereferenceable(4) %115)
  store i32 %116, ptr %20, align 4, !tbaa !11
  %117 = load i32, ptr %20, align 4, !tbaa !11
  %118 = getelementptr inbounds %"class.rle::rle_decoder", ptr %21, i32 0, i32 0
  %119 = load ptr, ptr %118, align 8, !tbaa !9
  %120 = getelementptr inbounds %"struct.rle::rle_decoder::internal", ptr %119, i32 0, i32 0
  %121 = call noundef i32 @_ZNK3rle10image_info9get_widthEv(ptr noundef nonnull align 4 dereferenceable(12) %120)
  %122 = icmp sle i32 %117, %121
  br i1 %122, label %123, label %124

123:                                              ; preds = %70
  br label %126

124:                                              ; preds = %70
  call void @__assert_fail(ptr noundef @.str.13, ptr noundef @.str.2, i32 noundef 529, ptr noundef @__PRETTY_FUNCTION__._ZN3rle11rle_decoder10decode_rowERNS_4destE) #6
  unreachable

125:                                              ; No predecessors!
  br label %126

126:                                              ; preds = %125, %123
  %127 = load i32, ptr %20, align 4, !tbaa !11
  %128 = load i32, ptr %13, align 4, !tbaa !11
  %129 = add nsw i32 %128, %127
  store i32 %129, ptr %13, align 4, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #5
  br label %130

130:                                              ; preds = %126
  %131 = load i32, ptr %16, align 4, !tbaa !11
  %132 = add nsw i32 %131, 1
  store i32 %132, ptr %16, align 4, !tbaa !11
  br label %65, !llvm.loop !26

133:                                              ; preds = %69
  br label %134

134:                                              ; preds = %133
  %135 = load i32, ptr %14, align 4, !tbaa !11
  %136 = add nsw i32 %135, 1
  store i32 %136, ptr %14, align 4, !tbaa !11
  br label %59, !llvm.loop !28

137:                                              ; preds = %63
  %138 = load ptr, ptr %4, align 8, !tbaa !5
  %139 = load ptr, ptr %12, align 8, !tbaa !5
  %140 = load i64, ptr %11, align 8, !tbaa !23
  %141 = trunc i64 %140 to i32
  %142 = load ptr, ptr %138, align 8, !tbaa !29
  %143 = getelementptr inbounds ptr, ptr %142, i64 0
  %144 = load ptr, ptr %143, align 8
  %145 = call noundef i32 %144(ptr noundef nonnull align 8 dereferenceable(8) %138, ptr noundef %139, i32 noundef %141)
  %146 = load i32, ptr %13, align 4, !tbaa !11
  store i32 1, ptr %15, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #5
  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
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  call void @llvm.lifetime.end.p0(i64 2, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  ret i32 %146
}

; Function Attrs: mustprogress uwtable
declare hidden noundef i32 @_ZN3rleL15decode_internalEPcRNS_6sourceEiiiS0_Ri(ptr noundef, ptr noundef nonnull align 8 dereferenceable(8), i32 noundef, i32 noundef, i32 noundef, ptr noundef, ptr noundef nonnull align 4 dereferenceable(4)) #3

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 = { "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 = { 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_decoderE", !6, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!14, !12, i64 88}
!14 = !{!"_ZTSN3rle11rle_decoder8internalE", !15, i64 0, !18, i64 12, !6, i64 80, !12, i64 88, !19, i64 96, !7, i64 120, !7, i64 2168}
!15 = !{!"_ZTSN3rle10image_infoE", !12, i64 0, !12, i64 4, !16, i64 8, !17, i64 10, !17, i64 11}
!16 = !{!"_ZTSN3rle10pixel_infoE", !7, i64 0, !7, i64 1}
!17 = !{!"bool", !7, i64 0}
!18 = !{!"_ZTSN3rle6headerE", !12, i64 0, !7, i64 4}
!19 = !{!"_ZTSSt6vectorIcSaIcEE", !20, i64 0}
!20 = !{!"_ZTSSt12_Vector_baseIcSaIcEE", !21, i64 0}
!21 = !{!"_ZTSNSt12_Vector_baseIcSaIcEE12_Vector_implE", !22, i64 0}
!22 = !{!"_ZTSNSt12_Vector_baseIcSaIcEE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!23 = !{!24, !24, i64 0}
!24 = !{!"long", !7, i64 0}
!25 = !{!14, !6, i64 80}
!26 = distinct !{!26, !27}
!27 = !{!"llvm.loop.mustprogress"}
!28 = distinct !{!28, !27}
!29 = !{!30, !30, i64 0}
!30 = !{!"vtable pointer", !8, 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"

%"class.rle::pixel_info" = type { i8, i8 }

@.str.2 = external hidden unnamed_addr constant [122 x i8], align 1
@.str.12 = external hidden unnamed_addr constant [29 x i8], align 1
@__PRETTY_FUNCTION__._ZN3rle11rle_decoder10decode_rowERNS_4destE = external hidden unnamed_addr constant [41 x i8], align 1
@.str.13 = external hidden unnamed_addr constant [42 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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIcSaIcEE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #3 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: 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

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

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

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

14:                                               ; preds = %2
  call void @__assert_fail(ptr noundef nonnull @.str.12, ptr noundef nonnull @.str.2, i32 noundef 512, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN3rle11rle_decoder10decode_rowERNS_4destE) #6
  unreachable

15:                                               ; preds = %2
  %16 = call noundef i32 @_ZNK3rle10image_info9get_widthEv(ptr noundef nonnull align 4 dereferenceable(12) %10)
  %17 = mul nsw i32 %16, %8
  %18 = sext i32 %17 to i64
  %19 = load ptr, ptr %0, align 8, !tbaa !5
  %20 = getelementptr inbounds i8, ptr %19, i64 96
  call void @_ZNSt6vectorIcSaIcEE6resizeEm(ptr noundef nonnull align 8 dereferenceable(24) %20, i64 noundef %18)
  %21 = load ptr, ptr %0, align 8, !tbaa !5
  %22 = getelementptr inbounds i8, ptr %21, i64 96
  %23 = call noundef ptr @_ZNSt6vectorIcSaIcEE4dataEv(ptr noundef nonnull align 8 dereferenceable(24) %22) #5
  %24 = icmp sgt i32 %6, 0
  %25 = icmp sgt i32 %7, 7
  %or.cond = and i1 %24, %25
  br i1 %or.cond, label %.preheader.us.preheader, label %._crit_edge44

.preheader.us.preheader:                          ; preds = %15
  %26 = zext nneg i32 %9 to i64
  %wide.trip.count51 = zext nneg i32 %6 to i64
  br label %.preheader.us

.preheader.us:                                    ; preds = %.preheader.us.preheader, %._crit_edge.us
  %indvars.iv48 = phi i64 [ 0, %.preheader.us.preheader ], [ %indvars.iv.next49, %._crit_edge.us ]
  %.043.us = phi i32 [ 0, %.preheader.us.preheader ], [ %52, %._crit_edge.us ]
  %27 = mul nuw nsw i64 %indvars.iv48, %26
  %28 = trunc i64 %27 to i32
  %29 = add i32 %9, %28
  br label %30

30:                                               ; preds = %.preheader.us, %51
  %indvars.iv = phi i64 [ 0, %.preheader.us ], [ %indvars.iv.next, %51 ]
  %.141.us = phi i32 [ %.043.us, %.preheader.us ], [ %52, %51 ]
  %31 = add nuw nsw i64 %indvars.iv, %27
  %32 = load ptr, ptr %0, align 8, !tbaa !5
  %33 = getelementptr inbounds i8, ptr %32, i64 80
  %34 = load ptr, ptr %33, align 8, !tbaa !21
  %35 = getelementptr inbounds ptr, ptr %34, i64 %31
  %36 = load ptr, ptr %35, align 8, !tbaa !22
  %37 = trunc nuw nsw i64 %indvars.iv to i32
  %38 = xor i32 %37, -1
  %39 = add i32 %29, %38
  %40 = call noundef i32 @_ZNK3rle10image_info9get_widthEv(ptr noundef nonnull align 4 dereferenceable(12) %32)
  %41 = load ptr, ptr %0, align 8, !tbaa !5
  %42 = getelementptr inbounds i8, ptr %41, i64 88
  %43 = load i32, ptr %42, align 8, !tbaa !10
  %44 = getelementptr inbounds i8, ptr %41, i64 120
  %45 = getelementptr inbounds [16 x [128 x i8]], ptr %44, i64 0, i64 %31
  %46 = getelementptr inbounds i8, ptr %41, i64 2168
  %47 = getelementptr inbounds [16 x i32], ptr %46, i64 0, i64 %31
  %48 = call noundef i32 @_ZN3rleL15decode_internalEPcRNS_6sourceEiiiS0_Ri(ptr noundef %23, ptr noundef nonnull align 8 dereferenceable(8) %36, i32 noundef %40, i32 noundef %39, i32 noundef %43, ptr noundef nonnull %45, ptr noundef nonnull align 4 dereferenceable(4) %47)
  %49 = load ptr, ptr %0, align 8, !tbaa !5
  %50 = call noundef i32 @_ZNK3rle10image_info9get_widthEv(ptr noundef nonnull align 4 dereferenceable(12) %49)
  %.not.us = icmp sgt i32 %48, %50
  br i1 %.not.us, label %.split.us, label %51

51:                                               ; preds = %30
  %52 = add nsw i32 %48, %.141.us
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %26
  br i1 %exitcond.not, label %._crit_edge.us, label %30, !llvm.loop !23

._crit_edge.us:                                   ; preds = %51
  %indvars.iv.next49 = add nuw nsw i64 %indvars.iv48, 1
  %exitcond52.not = icmp eq i64 %indvars.iv.next49, %wide.trip.count51
  br i1 %exitcond52.not, label %._crit_edge44, label %.preheader.us, !llvm.loop !25

._crit_edge44:                                    ; preds = %._crit_edge.us, %15
  %.0.lcssa = phi i32 [ 0, %15 ], [ %52, %._crit_edge.us ]
  %53 = load ptr, ptr %1, align 8, !tbaa !26
  %54 = load ptr, ptr %53, align 8
  %55 = call noundef i32 %54(ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef %23, i32 noundef %17)
  call void @llvm.lifetime.end.p0(i64 2, ptr nonnull %3) #5
  ret i32 %.0.lcssa

.split.us:                                        ; preds = %30
  call void @__assert_fail(ptr noundef nonnull @.str.13, ptr noundef nonnull @.str.2, i32 noundef 529, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN3rle11rle_decoder10decode_rowERNS_4destE) #6
  unreachable
}

; Function Attrs: mustprogress uwtable
declare hidden noundef i32 @_ZN3rleL15decode_internalEPcRNS_6sourceEiiiS0_Ri(ptr noundef, ptr noundef nonnull align 8 dereferenceable(8), i32 noundef, i32 noundef, i32 noundef, ptr noundef, ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #3

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 = { "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 = { 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_decoderE", !7, i64 0}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!11, !13, i64 88}
!11 = !{!"_ZTSN3rle11rle_decoder8internalE", !12, i64 0, !16, i64 12, !7, i64 80, !13, i64 88, !17, i64 96, !8, i64 120, !8, i64 2168}
!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, !7, i64 80}
!22 = !{!7, !7, i64 0}
!23 = distinct !{!23, !24}
!24 = !{!"llvm.loop.mustprogress"}
!25 = distinct !{!25, !24}
!26 = !{!27, !27, i64 0}
!27 = !{!"vtable pointer", !9, i64 0}


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