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

@.str.2 = external hidden unnamed_addr constant [122 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [16 x i8], align 1
@__PRETTY_FUNCTION__._ZN3rle11rle_encoder19encode_row_internalEPciPKci = external hidden unnamed_addr constant [74 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [11 x i8], align 1

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare hidden noundef i32 @_ZN3rleL21count_identical_bytesEPKci(ptr noundef, i32 noundef) #3

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef i32 @_ZN3rleL25count_nonrepetitive_bytesEPKci(ptr noundef, i32 noundef) #4

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN3rle11rle_encoder19encode_row_internalEPciPKci(ptr noundef nonnull align 8 dereferenceable(8) %0, ptr noundef %1, i32 noundef %2, ptr noundef %3, i32 noundef %4) #5 align 2 {
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca ptr, align 8
  %11 = alloca i32, align 4
  %12 = alloca ptr, align 8
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  store ptr %0, ptr %7, align 8, !tbaa !5
  store ptr %1, ptr %8, align 8, !tbaa !5
  store i32 %2, ptr %9, align 4, !tbaa !9
  store ptr %3, ptr %10, align 8, !tbaa !5
  store i32 %4, ptr %11, align 4, !tbaa !9
  %17 = load ptr, ptr %7, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #6
  %18 = load ptr, ptr %8, align 8, !tbaa !5
  store ptr %18, ptr %12, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  %19 = load ptr, ptr %10, align 8, !tbaa !5
  store ptr %19, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  %20 = load i32, ptr %11, align 4, !tbaa !9
  store i32 %20, ptr %14, align 4, !tbaa !9
  br label %21

21:                                               ; preds = %161, %5
  %22 = load ptr, ptr %13, align 8, !tbaa !5
  %23 = load ptr, ptr %10, align 8, !tbaa !5
  %24 = load i32, ptr %11, align 4, !tbaa !9
  %25 = sext i32 %24 to i64
  %26 = getelementptr inbounds i8, ptr %23, i64 %25
  %27 = icmp ne ptr %22, %26
  br i1 %27, label %28, label %162

28:                                               ; preds = %21
  %29 = load i32, ptr %14, align 4, !tbaa !9
  %30 = load i32, ptr %11, align 4, !tbaa !9
  %31 = icmp sle i32 %29, %30
  br i1 %31, label %32, label %33

32:                                               ; preds = %28
  br label %35

33:                                               ; preds = %28
  call void @__assert_fail(ptr noundef @.str.5, ptr noundef @.str.2, i32 noundef 300, ptr noundef @__PRETTY_FUNCTION__._ZN3rle11rle_encoder19encode_row_internalEPciPKci) #7
  unreachable

34:                                               ; No predecessors!
  br label %35

35:                                               ; preds = %34, %32
  %36 = load ptr, ptr %13, align 8, !tbaa !5
  %37 = load ptr, ptr %10, align 8, !tbaa !5
  %38 = load i32, ptr %11, align 4, !tbaa !9
  %39 = sext i32 %38 to i64
  %40 = getelementptr inbounds i8, ptr %37, i64 %39
  %41 = icmp ule ptr %36, %40
  br i1 %41, label %42, label %43

42:                                               ; preds = %35
  br label %45

43:                                               ; preds = %35
  call void @__assert_fail(ptr noundef @.str.6, ptr noundef @.str.2, i32 noundef 301, ptr noundef @__PRETTY_FUNCTION__._ZN3rle11rle_encoder19encode_row_internalEPciPKci) #7
  unreachable

44:                                               ; No predecessors!
  br label %45

45:                                               ; preds = %44, %42
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  %46 = load ptr, ptr %13, align 8, !tbaa !5
  %47 = load i32, ptr %14, align 4, !tbaa !9
  %48 = call noundef i32 @_ZN3rleL21count_identical_bytesEPKci(ptr noundef %46, i32 noundef %47)
  store i32 %48, ptr %15, align 4, !tbaa !9
  %49 = load i32, ptr %15, align 4, !tbaa !9
  %50 = icmp sgt i32 %49, 1
  br i1 %50, label %51, label %89

51:                                               ; preds = %45
  %52 = load ptr, ptr %12, align 8, !tbaa !5
  %53 = getelementptr inbounds i8, ptr %52, i64 1
  %54 = getelementptr inbounds i8, ptr %53, i64 1
  %55 = load ptr, ptr %8, align 8, !tbaa !5
  %56 = load i32, ptr %9, align 4, !tbaa !9
  %57 = sext i32 %56 to i64
  %58 = getelementptr inbounds i8, ptr %55, i64 %57
  %59 = icmp ugt ptr %54, %58
  br i1 %59, label %60, label %61

60:                                               ; preds = %51
  store i32 -1, ptr %6, align 4
  store i32 1, ptr %16, align 4
  br label %159

61:                                               ; preds = %51
  %62 = load i32, ptr %15, align 4, !tbaa !9
  %63 = sub nsw i32 0, %62
  %64 = add nsw i32 %63, 1
  %65 = trunc i32 %64 to i8
  %66 = load ptr, ptr %12, align 8, !tbaa !5
  store i8 %65, ptr %66, align 1, !tbaa !11
  %67 = load ptr, ptr %12, align 8, !tbaa !5
  %68 = load i8, ptr %67, align 1, !tbaa !11
  %69 = sext i8 %68 to i32
  %70 = icmp sle i32 %69, -1
  br i1 %70, label %71, label %76

71:                                               ; preds = %61
  %72 = load ptr, ptr %12, align 8, !tbaa !5
  %73 = load i8, ptr %72, align 1, !tbaa !11
  %74 = sext i8 %73 to i32
  %75 = icmp sge i32 %74, -127
  br label %76

76:                                               ; preds = %71, %61
  %77 = phi i1 [ false, %61 ], [ %75, %71 ]
  br i1 %77, label %78, label %79

78:                                               ; preds = %76
  br label %81

79:                                               ; preds = %76
  call void @__assert_fail(ptr noundef @.str.9, ptr noundef @.str.2, i32 noundef 310, ptr noundef @__PRETTY_FUNCTION__._ZN3rle11rle_encoder19encode_row_internalEPciPKci) #7
  unreachable

80:                                               ; No predecessors!
  br label %81

81:                                               ; preds = %80, %78
  %82 = load ptr, ptr %12, align 8, !tbaa !5
  %83 = getelementptr inbounds i8, ptr %82, i32 1
  store ptr %83, ptr %12, align 8, !tbaa !5
  %84 = load ptr, ptr %13, align 8, !tbaa !5
  %85 = load i8, ptr %84, align 1, !tbaa !11
  %86 = load ptr, ptr %12, align 8, !tbaa !5
  store i8 %85, ptr %86, align 1, !tbaa !11
  %87 = load ptr, ptr %12, align 8, !tbaa !5
  %88 = getelementptr inbounds i8, ptr %87, i32 1
  store ptr %88, ptr %12, align 8, !tbaa !5
  br label %144

89:                                               ; preds = %45
  %90 = load ptr, ptr %13, align 8, !tbaa !5
  %91 = load i32, ptr %14, align 4, !tbaa !9
  %92 = call noundef i32 @_ZN3rleL25count_nonrepetitive_bytesEPKci(ptr noundef %90, i32 noundef %91)
  store i32 %92, ptr %15, align 4, !tbaa !9
  %93 = load ptr, ptr %12, align 8, !tbaa !5
  %94 = load i32, ptr %15, align 4, !tbaa !9
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds i8, ptr %93, i64 %95
  %97 = getelementptr inbounds i8, ptr %96, i64 1
  %98 = load ptr, ptr %8, align 8, !tbaa !5
  %99 = load i32, ptr %9, align 4, !tbaa !9
  %100 = sext i32 %99 to i64
  %101 = getelementptr inbounds i8, ptr %98, i64 %100
  %102 = icmp ugt ptr %97, %101
  br i1 %102, label %103, label %104

103:                                              ; preds = %89
  store i32 -1, ptr %6, align 4
  store i32 1, ptr %16, align 4
  br label %159

104:                                              ; preds = %89
  %105 = load i32, ptr %15, align 4, !tbaa !9
  %106 = sub nsw i32 %105, 1
  %107 = trunc i32 %106 to i8
  %108 = load ptr, ptr %12, align 8, !tbaa !5
  store i8 %107, ptr %108, align 1, !tbaa !11
  %109 = load ptr, ptr %12, align 8, !tbaa !5
  %110 = load i8, ptr %109, align 1, !tbaa !11
  %111 = sext i8 %110 to i32
  %112 = icmp ne i32 %111, -128
  br i1 %112, label %113, label %120

113:                                              ; preds = %104
  %114 = load ptr, ptr %12, align 8, !tbaa !5
  %115 = load i8, ptr %114, align 1, !tbaa !11
  %116 = sext i8 %115 to i32
  %117 = add nsw i32 %116, 1
  %118 = load i32, ptr %15, align 4, !tbaa !9
  %119 = icmp eq i32 %117, %118
  br label %120

120:                                              ; preds = %113, %104
  %121 = phi i1 [ false, %104 ], [ %119, %113 ]
  br i1 %121, label %122, label %123

122:                                              ; preds = %120
  br label %125

123:                                              ; preds = %120
  call void @__assert_fail(ptr noundef @.str.10, ptr noundef @.str.2, i32 noundef 323, ptr noundef @__PRETTY_FUNCTION__._ZN3rle11rle_encoder19encode_row_internalEPciPKci) #7
  unreachable

124:                                              ; No predecessors!
  br label %125

125:                                              ; preds = %124, %122
  %126 = load ptr, ptr %12, align 8, !tbaa !5
  %127 = load i8, ptr %126, align 1, !tbaa !11
  %128 = sext i8 %127 to i32
  %129 = icmp sge i32 %128, 0
  br i1 %129, label %130, label %131

130:                                              ; preds = %125
  br label %133

131:                                              ; preds = %125
  call void @__assert_fail(ptr noundef @.str.11, ptr noundef @.str.2, i32 noundef 324, ptr noundef @__PRETTY_FUNCTION__._ZN3rle11rle_encoder19encode_row_internalEPciPKci) #7
  unreachable

132:                                              ; No predecessors!
  br label %133

133:                                              ; preds = %132, %130
  %134 = load ptr, ptr %12, align 8, !tbaa !5
  %135 = getelementptr inbounds i8, ptr %134, i32 1
  store ptr %135, ptr %12, align 8, !tbaa !5
  %136 = load ptr, ptr %12, align 8, !tbaa !5
  %137 = load ptr, ptr %13, align 8, !tbaa !5
  %138 = load i32, ptr %15, align 4, !tbaa !9
  %139 = sext i32 %138 to i64
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %136, ptr align 1 %137, i64 %139, i1 false)
  %140 = load i32, ptr %15, align 4, !tbaa !9
  %141 = load ptr, ptr %12, align 8, !tbaa !5
  %142 = sext i32 %140 to i64
  %143 = getelementptr inbounds i8, ptr %141, i64 %142
  store ptr %143, ptr %12, align 8, !tbaa !5
  br label %144

144:                                              ; preds = %133, %81
  %145 = load i32, ptr %15, align 4, !tbaa !9
  %146 = load ptr, ptr %13, align 8, !tbaa !5
  %147 = sext i32 %145 to i64
  %148 = getelementptr inbounds i8, ptr %146, i64 %147
  store ptr %148, ptr %13, align 8, !tbaa !5
  %149 = load i32, ptr %15, align 4, !tbaa !9
  %150 = load i32, ptr %14, align 4, !tbaa !9
  %151 = icmp sle i32 %149, %150
  br i1 %151, label %152, label %153

152:                                              ; preds = %144
  br label %155

153:                                              ; preds = %144
  call void @__assert_fail(ptr noundef @.str.7, ptr noundef @.str.2, i32 noundef 332, ptr noundef @__PRETTY_FUNCTION__._ZN3rle11rle_encoder19encode_row_internalEPciPKci) #7
  unreachable

154:                                              ; No predecessors!
  br label %155

155:                                              ; preds = %154, %152
  %156 = load i32, ptr %15, align 4, !tbaa !9
  %157 = load i32, ptr %14, align 4, !tbaa !9
  %158 = sub nsw i32 %157, %156
  store i32 %158, ptr %14, align 4, !tbaa !9
  store i32 0, ptr %16, align 4
  br label %159

159:                                              ; preds = %155, %103, %60
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  %160 = load i32, ptr %16, align 4
  switch i32 %160, label %169 [
    i32 0, label %161
  ]

161:                                              ; preds = %159
  br label %21, !llvm.loop !12

162:                                              ; preds = %21
  %163 = load ptr, ptr %12, align 8, !tbaa !5
  %164 = load ptr, ptr %8, align 8, !tbaa !5
  %165 = ptrtoint ptr %163 to i64
  %166 = ptrtoint ptr %164 to i64
  %167 = sub i64 %165, %166
  %168 = trunc i64 %167 to i32
  store i32 %168, ptr %6, align 4
  store i32 1, ptr %16, align 4
  br label %169

169:                                              ; preds = %162, %159
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #6
  %170 = load i32, ptr %6, align 4
  ret i32 %170
}

attributes #0 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { nocallback nofree nosync 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 = { inlinehint 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 = { 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 #6 = { nounwind }
attributes #7 = { 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 = !{!7, !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"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"

@.str.2 = external hidden unnamed_addr constant [122 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [20 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [26 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [16 x i8], align 1
@__PRETTY_FUNCTION__._ZN3rle11rle_encoder19encode_row_internalEPciPKci = external hidden unnamed_addr constant [74 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [29 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [34 x i8], align 1
@.str.11 = external hidden unnamed_addr constant [11 x i8], align 1

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare hidden noundef i32 @_ZN3rleL21count_identical_bytesEPKci(ptr noundef, i32 noundef) local_unnamed_addr #2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef i32 @_ZN3rleL25count_nonrepetitive_bytesEPKci(ptr noundef, i32 noundef) local_unnamed_addr #3

; Function Attrs: mustprogress uwtable
define dso_local noundef i32 @_ZN3rle11rle_encoder19encode_row_internalEPciPKci(ptr nocapture noundef nonnull readnone align 8 dereferenceable(8) %0, ptr noundef %1, i32 noundef %2, ptr noundef %3, i32 noundef %4) local_unnamed_addr #4 align 2 {
  %6 = sext i32 %4 to i64
  %7 = getelementptr inbounds i8, ptr %3, i64 %6
  %.not86 = icmp eq i32 %4, 0
  br i1 %.not86, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %5
  %8 = sext i32 %2 to i64
  %9 = getelementptr inbounds i8, ptr %1, i64 %8
  br label %10

10:                                               ; preds = %.lr.ph, %48
  %.05689 = phi i32 [ %4, %.lr.ph ], [ %51, %48 ]
  %.05788 = phi ptr [ %3, %.lr.ph ], [ %50, %48 ]
  %.05987 = phi ptr [ %1, %.lr.ph ], [ %.160, %48 ]
  %.not70 = icmp sgt i32 %.05689, %4
  br i1 %.not70, label %11, label %12

11:                                               ; preds = %10
  tail call void @__assert_fail(ptr noundef nonnull @.str.5, ptr noundef nonnull @.str.2, i32 noundef 300, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN3rle11rle_encoder19encode_row_internalEPciPKci) #5
  unreachable

12:                                               ; preds = %10
  %.not71 = icmp ugt ptr %.05788, %7
  br i1 %.not71, label %13, label %14

13:                                               ; preds = %12
  tail call void @__assert_fail(ptr noundef nonnull @.str.6, ptr noundef nonnull @.str.2, i32 noundef 301, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN3rle11rle_encoder19encode_row_internalEPciPKci) #5
  unreachable

14:                                               ; preds = %12
  %15 = tail call noundef i32 @_ZN3rleL21count_identical_bytesEPKci(ptr noundef %.05788, i32 noundef %.05689)
  %16 = icmp sgt i32 %15, 1
  br i1 %16, label %17, label %27

17:                                               ; preds = %14
  %18 = getelementptr inbounds i8, ptr %.05987, i64 1
  %19 = getelementptr inbounds i8, ptr %.05987, i64 2
  %20 = icmp ugt ptr %19, %9
  br i1 %20, label %.thread, label %21

21:                                               ; preds = %17
  %22 = trunc i32 %15 to i8
  %23 = sub i8 1, %22
  store i8 %23, ptr %.05987, align 1, !tbaa !5
  %24 = icmp sgt i8 %23, -1
  %.not73 = icmp eq i8 %22, -127
  %or.cond = or i1 %.not73, %24
  br i1 %or.cond, label %.critedge, label %25

.critedge:                                        ; preds = %21
  tail call void @__assert_fail(ptr noundef nonnull @.str.9, ptr noundef nonnull @.str.2, i32 noundef 310, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN3rle11rle_encoder19encode_row_internalEPciPKci) #5
  unreachable

25:                                               ; preds = %21
  %26 = load i8, ptr %.05788, align 1, !tbaa !5
  store i8 %26, ptr %18, align 1, !tbaa !5
  br label %46

27:                                               ; preds = %14
  %28 = tail call noundef i32 @_ZN3rleL25count_nonrepetitive_bytesEPKci(ptr noundef %.05788, i32 noundef %.05689)
  %29 = sext i32 %28 to i64
  %30 = getelementptr inbounds i8, ptr %.05987, i64 %29
  %31 = getelementptr inbounds i8, ptr %30, i64 1
  %32 = icmp ugt ptr %31, %9
  br i1 %32, label %.thread, label %33

33:                                               ; preds = %27
  %34 = trunc i32 %28 to i8
  %35 = add i8 %34, -1
  store i8 %35, ptr %.05987, align 1, !tbaa !5
  %.not72 = icmp eq i8 %35, -128
  br i1 %.not72, label %.critedge2, label %36

36:                                               ; preds = %33
  %37 = sext i8 %35 to i32
  %38 = add nsw i32 %37, 1
  %39 = icmp eq i32 %38, %28
  br i1 %39, label %40, label %.critedge2

.critedge2:                                       ; preds = %33, %36
  tail call void @__assert_fail(ptr noundef nonnull @.str.10, ptr noundef nonnull @.str.2, i32 noundef 323, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN3rle11rle_encoder19encode_row_internalEPciPKci) #5
  unreachable

40:                                               ; preds = %36
  %41 = icmp sgt i8 %35, -1
  br i1 %41, label %43, label %42

42:                                               ; preds = %40
  tail call void @__assert_fail(ptr noundef nonnull @.str.11, ptr noundef nonnull @.str.2, i32 noundef 324, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN3rle11rle_encoder19encode_row_internalEPciPKci) #5
  unreachable

43:                                               ; preds = %40
  %44 = getelementptr inbounds i8, ptr %.05987, i64 1
  tail call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 1 %44, ptr align 1 %.05788, i64 %29, i1 false)
  %45 = getelementptr inbounds i8, ptr %44, i64 %29
  br label %46

46:                                               ; preds = %43, %25
  %.160 = phi ptr [ %19, %25 ], [ %45, %43 ]
  %.055 = phi i32 [ %15, %25 ], [ %28, %43 ]
  %.not74 = icmp sgt i32 %.055, %.05689
  br i1 %.not74, label %47, label %48

47:                                               ; preds = %46
  tail call void @__assert_fail(ptr noundef nonnull @.str.7, ptr noundef nonnull @.str.2, i32 noundef 332, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN3rle11rle_encoder19encode_row_internalEPciPKci) #5
  unreachable

48:                                               ; preds = %46
  %49 = sext i32 %.055 to i64
  %50 = getelementptr inbounds i8, ptr %.05788, i64 %49
  %51 = sub nsw i32 %.05689, %.055
  %.not = icmp eq ptr %50, %7
  br i1 %.not, label %._crit_edge, label %10, !llvm.loop !8

._crit_edge:                                      ; preds = %48, %5
  %.059.lcssa = phi ptr [ %1, %5 ], [ %.160, %48 ]
  %52 = ptrtoint ptr %.059.lcssa to i64
  %53 = ptrtoint ptr %1 to i64
  %54 = sub i64 %52, %53
  %55 = trunc i64 %54 to i32
  br label %.thread

.thread:                                          ; preds = %27, %17, %._crit_edge
  %.263 = phi i32 [ %55, %._crit_edge ], [ -1, %17 ], [ -1, %27 ]
  ret i32 %.263
}

attributes #0 = { mustprogress nocallback nofree 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 = { inlinehint 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 = { 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 = { 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 = { 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 = !{!"omnipotent char", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = distinct !{!8, !9}
!9 = !{!"llvm.loop.mustprogress"}


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