; LLVM IR from drohmer/cgp :: library/third_party/src/jpeg/jpge.ll (ZN4jpge12jpeg_encoder8load_mcuEPKv)

; 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.jpge::jpeg_encoder" = type <{ ptr, %"struct.jpge::params", i8, [3 x i8], [3 x i8], i8, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, [16 x ptr], i8, [3 x i8], [64 x i32], [64 x i16], [2 x [64 x i32]], [4 x [256 x i32]], [4 x [256 x i8]], [4 x [17 x i8]], [4 x [256 x i8]], [4 x [256 x i32]], [3 x i32], [2048 x i8], [4 x i8], ptr, i32, i32, i32, i8, i8, [2 x i8] }>
%"struct.jpge::params" = type <{ i32, i32, i8, i8, [2 x i8] }>

; 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: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #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) #2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4jpge12jpeg_encoder15process_mcu_rowEv(ptr noundef nonnull align 8 dereferenceable(13494)) #3 align 2

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

24:                                               ; preds = %2
  %25 = getelementptr inbounds %"class.jpge::jpeg_encoder", ptr %12, i32 0, i32 8
  %26 = load i32, ptr %25, align 4, !tbaa !16
  %27 = icmp eq i32 %26, 4
  br i1 %27, label %28, label %33

28:                                               ; preds = %24
  %29 = load ptr, ptr %6, align 8, !tbaa !5
  %30 = load ptr, ptr %5, align 8, !tbaa !5
  %31 = getelementptr inbounds %"class.jpge::jpeg_encoder", ptr %12, i32 0, i32 6
  %32 = load i32, ptr %31, align 4, !tbaa !17
  call void @_ZN4jpgeL9RGBA_to_YEPhPKhi(ptr noundef %29, ptr noundef %30, i32 noundef %32)
  br label %49

33:                                               ; preds = %24
  %34 = getelementptr inbounds %"class.jpge::jpeg_encoder", ptr %12, i32 0, i32 8
  %35 = load i32, ptr %34, align 4, !tbaa !16
  %36 = icmp eq i32 %35, 3
  br i1 %36, label %37, label %42

37:                                               ; preds = %33
  %38 = load ptr, ptr %6, align 8, !tbaa !5
  %39 = load ptr, ptr %5, align 8, !tbaa !5
  %40 = getelementptr inbounds %"class.jpge::jpeg_encoder", ptr %12, i32 0, i32 6
  %41 = load i32, ptr %40, align 4, !tbaa !17
  call void @_ZN4jpgeL8RGB_to_YEPhPKhi(ptr noundef %38, ptr noundef %39, i32 noundef %41)
  br label %48

42:                                               ; preds = %33
  %43 = load ptr, ptr %6, align 8, !tbaa !5
  %44 = load ptr, ptr %5, align 8, !tbaa !5
  %45 = getelementptr inbounds %"class.jpge::jpeg_encoder", ptr %12, i32 0, i32 6
  %46 = load i32, ptr %45, align 4, !tbaa !17
  %47 = sext i32 %46 to i64
  call void @llvm.memcpy.p0.p0.i64(ptr align 1 %43, ptr align 1 %44, i64 %47, i1 false)
  br label %48

48:                                               ; preds = %42, %37
  br label %49

49:                                               ; preds = %48, %28
  br label %75

50:                                               ; preds = %2
  %51 = getelementptr inbounds %"class.jpge::jpeg_encoder", ptr %12, i32 0, i32 8
  %52 = load i32, ptr %51, align 4, !tbaa !16
  %53 = icmp eq i32 %52, 4
  br i1 %53, label %54, label %59

54:                                               ; preds = %50
  %55 = load ptr, ptr %6, align 8, !tbaa !5
  %56 = load ptr, ptr %5, align 8, !tbaa !5
  %57 = getelementptr inbounds %"class.jpge::jpeg_encoder", ptr %12, i32 0, i32 6
  %58 = load i32, ptr %57, align 4, !tbaa !17
  call void @_ZN4jpgeL11RGBA_to_YCCEPhPKhi(ptr noundef %55, ptr noundef %56, i32 noundef %58)
  br label %74

59:                                               ; preds = %50
  %60 = getelementptr inbounds %"class.jpge::jpeg_encoder", ptr %12, i32 0, i32 8
  %61 = load i32, ptr %60, align 4, !tbaa !16
  %62 = icmp eq i32 %61, 3
  br i1 %62, label %63, label %68

63:                                               ; preds = %59
  %64 = load ptr, ptr %6, align 8, !tbaa !5
  %65 = load ptr, ptr %5, align 8, !tbaa !5
  %66 = getelementptr inbounds %"class.jpge::jpeg_encoder", ptr %12, i32 0, i32 6
  %67 = load i32, ptr %66, align 4, !tbaa !17
  call void @_ZN4jpgeL10RGB_to_YCCEPhPKhi(ptr noundef %64, ptr noundef %65, i32 noundef %67)
  br label %73

68:                                               ; preds = %59
  %69 = load ptr, ptr %6, align 8, !tbaa !5
  %70 = load ptr, ptr %5, align 8, !tbaa !5
  %71 = getelementptr inbounds %"class.jpge::jpeg_encoder", ptr %12, i32 0, i32 6
  %72 = load i32, ptr %71, align 4, !tbaa !17
  call void @_ZN4jpgeL8Y_to_YCCEPhPKhi(ptr noundef %69, ptr noundef %70, i32 noundef %72)
  br label %73

73:                                               ; preds = %68, %63
  br label %74

74:                                               ; preds = %73, %54
  br label %75

75:                                               ; preds = %74, %49
  %76 = getelementptr inbounds %"class.jpge::jpeg_encoder", ptr %12, i32 0, i32 2
  %77 = load i8, ptr %76, align 4, !tbaa !15
  %78 = zext i8 %77 to i32
  %79 = icmp eq i32 %78, 1
  br i1 %79, label %80, label %106

80:                                               ; preds = %75
  %81 = getelementptr inbounds %"class.jpge::jpeg_encoder", ptr %12, i32 0, i32 17
  %82 = getelementptr inbounds %"class.jpge::jpeg_encoder", ptr %12, i32 0, i32 18
  %83 = load i8, ptr %82, align 8, !tbaa !9
  %84 = zext i8 %83 to i64
  %85 = getelementptr inbounds [16 x ptr], ptr %81, i64 0, i64 %84
  %86 = load ptr, ptr %85, align 8, !tbaa !5
  %87 = getelementptr inbounds %"class.jpge::jpeg_encoder", ptr %12, i32 0, i32 12
  %88 = load i32, ptr %87, align 4, !tbaa !18
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds i8, ptr %86, i64 %89
  %91 = load ptr, ptr %6, align 8, !tbaa !5
  %92 = getelementptr inbounds %"class.jpge::jpeg_encoder", ptr %12, i32 0, i32 12
  %93 = load i32, ptr %92, align 4, !tbaa !18
  %94 = sub nsw i32 %93, 1
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds i8, ptr %91, i64 %95
  %97 = load i8, ptr %96, align 1, !tbaa !19
  %98 = zext i8 %97 to i32
  %99 = trunc i32 %98 to i8
  %100 = getelementptr inbounds %"class.jpge::jpeg_encoder", ptr %12, i32 0, i32 10
  %101 = load i32, ptr %100, align 4, !tbaa !20
  %102 = getelementptr inbounds %"class.jpge::jpeg_encoder", ptr %12, i32 0, i32 6
  %103 = load i32, ptr %102, align 4, !tbaa !17
  %104 = sub nsw i32 %101, %103
  %105 = sext i32 %104 to i64
  call void @llvm.memset.p0.i64(ptr align 1 %90, i8 %99, i64 %105, i1 false)
  br label %163

106:                                              ; preds = %75
  call void @llvm.lifetime.start.p0(i64 1, ptr %7) #5
  %107 = load ptr, ptr %6, align 8, !tbaa !5
  %108 = getelementptr inbounds %"class.jpge::jpeg_encoder", ptr %12, i32 0, i32 12
  %109 = load i32, ptr %108, align 4, !tbaa !18
  %110 = sub nsw i32 %109, 3
  %111 = add nsw i32 %110, 0
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds i8, ptr %107, i64 %112
  %114 = load i8, ptr %113, align 1, !tbaa !19
  store i8 %114, ptr %7, align 1, !tbaa !19
  call void @llvm.lifetime.start.p0(i64 1, ptr %8) #5
  %115 = load ptr, ptr %6, align 8, !tbaa !5
  %116 = getelementptr inbounds %"class.jpge::jpeg_encoder", ptr %12, i32 0, i32 12
  %117 = load i32, ptr %116, align 4, !tbaa !18
  %118 = sub nsw i32 %117, 3
  %119 = add nsw i32 %118, 1
  %120 = sext i32 %119 to i64
  %121 = getelementptr inbounds i8, ptr %115, i64 %120
  %122 = load i8, ptr %121, align 1, !tbaa !19
  store i8 %122, ptr %8, align 1, !tbaa !19
  call void @llvm.lifetime.start.p0(i64 1, ptr %9) #5
  %123 = load ptr, ptr %6, align 8, !tbaa !5
  %124 = getelementptr inbounds %"class.jpge::jpeg_encoder", ptr %12, i32 0, i32 12
  %125 = load i32, ptr %124, align 4, !tbaa !18
  %126 = sub nsw i32 %125, 3
  %127 = add nsw i32 %126, 2
  %128 = sext i32 %127 to i64
  %129 = getelementptr inbounds i8, ptr %123, i64 %128
  %130 = load i8, ptr %129, align 1, !tbaa !19
  store i8 %130, ptr %9, align 1, !tbaa !19
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  %131 = getelementptr inbounds %"class.jpge::jpeg_encoder", ptr %12, i32 0, i32 17
  %132 = getelementptr inbounds %"class.jpge::jpeg_encoder", ptr %12, i32 0, i32 18
  %133 = load i8, ptr %132, align 8, !tbaa !9
  %134 = zext i8 %133 to i64
  %135 = getelementptr inbounds [16 x ptr], ptr %131, i64 0, i64 %134
  %136 = load ptr, ptr %135, align 8, !tbaa !5
  %137 = getelementptr inbounds %"class.jpge::jpeg_encoder", ptr %12, i32 0, i32 12
  %138 = load i32, ptr %137, align 4, !tbaa !18
  %139 = sext i32 %138 to i64
  %140 = getelementptr inbounds i8, ptr %136, i64 %139
  store ptr %140, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  %141 = getelementptr inbounds %"class.jpge::jpeg_encoder", ptr %12, i32 0, i32 6
  %142 = load i32, ptr %141, align 4, !tbaa !17
  store i32 %142, ptr %11, align 4, !tbaa !21
  br label %143

143:                                              ; preds = %159, %106
  %144 = load i32, ptr %11, align 4, !tbaa !21
  %145 = getelementptr inbounds %"class.jpge::jpeg_encoder", ptr %12, i32 0, i32 10
  %146 = load i32, ptr %145, align 4, !tbaa !20
  %147 = icmp slt i32 %144, %146
  br i1 %147, label %149, label %148

148:                                              ; preds = %143
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  br label %162

149:                                              ; preds = %143
  %150 = load i8, ptr %7, align 1, !tbaa !19
  %151 = load ptr, ptr %10, align 8, !tbaa !5
  %152 = getelementptr inbounds i8, ptr %151, i32 1
  store ptr %152, ptr %10, align 8, !tbaa !5
  store i8 %150, ptr %151, align 1, !tbaa !19
  %153 = load i8, ptr %8, align 1, !tbaa !19
  %154 = load ptr, ptr %10, align 8, !tbaa !5
  %155 = getelementptr inbounds i8, ptr %154, i32 1
  store ptr %155, ptr %10, align 8, !tbaa !5
  store i8 %153, ptr %154, align 1, !tbaa !19
  %156 = load i8, ptr %9, align 1, !tbaa !19
  %157 = load ptr, ptr %10, align 8, !tbaa !5
  %158 = getelementptr inbounds i8, ptr %157, i32 1
  store ptr %158, ptr %10, align 8, !tbaa !5
  store i8 %156, ptr %157, align 1, !tbaa !19
  br label %159

159:                                              ; preds = %149
  %160 = load i32, ptr %11, align 4, !tbaa !21
  %161 = add nsw i32 %160, 1
  store i32 %161, ptr %11, align 4, !tbaa !21
  br label %143, !llvm.loop !22

162:                                              ; preds = %148
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 1, ptr %7) #5
  br label %163

163:                                              ; preds = %162, %80
  %164 = getelementptr inbounds %"class.jpge::jpeg_encoder", ptr %12, i32 0, i32 18
  %165 = load i8, ptr %164, align 8, !tbaa !9
  %166 = add i8 %165, 1
  store i8 %166, ptr %164, align 8, !tbaa !9
  %167 = zext i8 %166 to i32
  %168 = getelementptr inbounds %"class.jpge::jpeg_encoder", ptr %12, i32 0, i32 16
  %169 = load i32, ptr %168, align 4, !tbaa !24
  %170 = icmp eq i32 %167, %169
  br i1 %170, label %171, label %173

171:                                              ; preds = %163
  call void @_ZN4jpge12jpeg_encoder15process_mcu_rowEv(ptr noundef nonnull align 8 dereferenceable(13494) %12)
  %172 = getelementptr inbounds %"class.jpge::jpeg_encoder", ptr %12, i32 0, i32 18
  store i8 0, ptr %172, align 8, !tbaa !9
  br label %173

173:                                              ; preds = %171, %163
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #5
  ret void
}

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

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

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

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

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

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

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !7, i64 200}
!10 = !{!"_ZTSN4jpge12jpeg_encoderE", !6, i64 0, !11, i64 8, !7, i64 20, !7, i64 21, !7, i64 24, !12, i64 28, !12, i64 32, !12, i64 36, !12, i64 40, !12, i64 44, !12, i64 48, !12, i64 52, !12, i64 56, !12, i64 60, !12, i64 64, !12, i64 68, !7, i64 72, !7, i64 200, !7, i64 204, !7, i64 460, !7, i64 588, !7, i64 1100, !7, i64 5196, !7, i64 6220, !7, i64 6288, !7, i64 7312, !7, i64 11408, !7, i64 11420, !6, i64 13472, !12, i64 13480, !12, i64 13484, !12, i64 13488, !7, i64 13492, !14, i64 13493}
!11 = !{!"_ZTSN4jpge6paramsE", !12, i64 0, !13, i64 4, !14, i64 8, !14, i64 9}
!12 = !{!"int", !7, i64 0}
!13 = !{!"_ZTSN4jpge13subsampling_tE", !7, i64 0}
!14 = !{!"bool", !7, i64 0}
!15 = !{!10, !7, i64 20}
!16 = !{!10, !12, i64 36}
!17 = !{!10, !12, i64 28}
!18 = !{!10, !12, i64 52}
!19 = !{!7, !7, i64 0}
!20 = !{!10, !12, i64 44}
!21 = !{!12, !12, i64 0}
!22 = distinct !{!22, !23}
!23 = !{!"llvm.loop.mustprogress"}
!24 = !{!10, !12, i64 68}


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN4jpge12jpeg_encoder15process_mcu_rowEv(ptr noundef nonnull align 8 dereferenceable(13494)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4jpge12jpeg_encoder8load_mcuEPKv(ptr noundef nonnull align 8 dereferenceable(13494) %0, ptr noundef %1) local_unnamed_addr #2 align 2 {
  %3 = getelementptr inbounds i8, ptr %0, i64 72
  %4 = getelementptr inbounds i8, ptr %0, i64 200
  %5 = load i8, ptr %4, align 8, !tbaa !5
  %6 = zext i8 %5 to i64
  %7 = getelementptr inbounds [16 x ptr], ptr %3, i64 0, i64 %6
  %8 = load ptr, ptr %7, align 8, !tbaa !14
  %9 = getelementptr inbounds i8, ptr %0, i64 20
  %10 = load i8, ptr %9, align 4, !tbaa !15
  %11 = icmp eq i8 %10, 1
  %12 = getelementptr inbounds i8, ptr %0, i64 36
  %13 = load i32, ptr %12, align 4, !tbaa !16
  %14 = getelementptr inbounds i8, ptr %0, i64 28
  %15 = load i32, ptr %14, align 4, !tbaa !17
  br i1 %11, label %16, label %21

16:                                               ; preds = %2
  switch i32 %13, label %19 [
    i32 4, label %17
    i32 3, label %18
  ]

17:                                               ; preds = %16
  tail call void @_ZN4jpgeL9RGBA_to_YEPhPKhi(ptr noundef %8, ptr noundef %1, i32 noundef %15)
  br label %25

18:                                               ; preds = %16
  tail call void @_ZN4jpgeL8RGB_to_YEPhPKhi(ptr noundef %8, ptr noundef %1, i32 noundef %15)
  br label %25

19:                                               ; preds = %16
  %20 = sext i32 %15 to i64
  tail call void @llvm.memcpy.p0.p0.i64(ptr align 1 %8, ptr align 1 %1, i64 %20, i1 false)
  br label %25

21:                                               ; preds = %2
  switch i32 %13, label %24 [
    i32 4, label %22
    i32 3, label %23
  ]

22:                                               ; preds = %21
  tail call void @_ZN4jpgeL11RGBA_to_YCCEPhPKhi(ptr noundef %8, ptr noundef %1, i32 noundef %15)
  br label %25

23:                                               ; preds = %21
  tail call void @_ZN4jpgeL10RGB_to_YCCEPhPKhi(ptr noundef %8, ptr noundef %1, i32 noundef %15)
  br label %25

24:                                               ; preds = %21
  tail call void @_ZN4jpgeL8Y_to_YCCEPhPKhi(ptr noundef %8, ptr noundef %1, i32 noundef %15)
  br label %25

25:                                               ; preds = %22, %24, %23, %17, %19, %18
  %26 = load i8, ptr %9, align 4, !tbaa !15
  %27 = icmp eq i8 %26, 1
  br i1 %27, label %28, label %46

28:                                               ; preds = %25
  %29 = load i8, ptr %4, align 8, !tbaa !5
  %30 = zext i8 %29 to i64
  %31 = getelementptr inbounds [16 x ptr], ptr %3, i64 0, i64 %30
  %32 = load ptr, ptr %31, align 8, !tbaa !14
  %33 = getelementptr inbounds i8, ptr %0, i64 52
  %34 = load i32, ptr %33, align 4, !tbaa !18
  %35 = sext i32 %34 to i64
  %36 = getelementptr inbounds i8, ptr %32, i64 %35
  %37 = getelementptr i8, ptr %8, i64 %35
  %38 = getelementptr i8, ptr %37, i64 -1
  %39 = load i8, ptr %38, align 1, !tbaa !19
  %40 = getelementptr inbounds i8, ptr %0, i64 44
  %41 = load i32, ptr %40, align 4, !tbaa !20
  %42 = getelementptr inbounds i8, ptr %0, i64 28
  %43 = load i32, ptr %42, align 4, !tbaa !17
  %44 = sub nsw i32 %41, %43
  %45 = sext i32 %44 to i64
  tail call void @llvm.memset.p0.i64(ptr align 1 %36, i8 %39, i64 %45, i1 false)
  br label %.loopexit

46:                                               ; preds = %25
  %47 = getelementptr inbounds i8, ptr %0, i64 52
  %48 = load i32, ptr %47, align 4, !tbaa !18
  %49 = sext i32 %48 to i64
  %50 = getelementptr i8, ptr %8, i64 %49
  %51 = getelementptr i8, ptr %50, i64 -3
  %52 = load i8, ptr %51, align 1, !tbaa !19
  %53 = getelementptr i8, ptr %50, i64 -2
  %54 = load i8, ptr %53, align 1, !tbaa !19
  %55 = getelementptr i8, ptr %50, i64 -1
  %56 = load i8, ptr %55, align 1, !tbaa !19
  %57 = getelementptr inbounds i8, ptr %0, i64 28
  %58 = load i32, ptr %57, align 4, !tbaa !17
  %59 = getelementptr inbounds i8, ptr %0, i64 44
  %60 = load i32, ptr %59, align 4, !tbaa !20
  %61 = icmp slt i32 %58, %60
  br i1 %61, label %.lr.ph.preheader, label %.loopexit

.lr.ph.preheader:                                 ; preds = %46
  %62 = load i8, ptr %4, align 8, !tbaa !5
  %63 = zext i8 %62 to i64
  %64 = getelementptr inbounds [16 x ptr], ptr %3, i64 0, i64 %63
  %65 = load ptr, ptr %64, align 8, !tbaa !14
  %66 = getelementptr inbounds i8, ptr %65, i64 %49
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader, %.lr.ph
  %.029 = phi i32 [ %70, %.lr.ph ], [ %58, %.lr.ph.preheader ]
  %.02528 = phi ptr [ %69, %.lr.ph ], [ %66, %.lr.ph.preheader ]
  %67 = getelementptr inbounds i8, ptr %.02528, i64 1
  store i8 %52, ptr %.02528, align 1, !tbaa !19
  %68 = getelementptr inbounds i8, ptr %.02528, i64 2
  store i8 %54, ptr %67, align 1, !tbaa !19
  %69 = getelementptr inbounds i8, ptr %.02528, i64 3
  store i8 %56, ptr %68, align 1, !tbaa !19
  %70 = add nsw i32 %.029, 1
  %71 = load i32, ptr %59, align 4, !tbaa !20
  %72 = icmp slt i32 %70, %71
  br i1 %72, label %.lr.ph, label %.loopexit, !llvm.loop !21

.loopexit:                                        ; preds = %.lr.ph, %46, %28
  %73 = load i8, ptr %4, align 8, !tbaa !5
  %74 = add i8 %73, 1
  store i8 %74, ptr %4, align 8, !tbaa !5
  %75 = zext i8 %74 to i32
  %76 = getelementptr inbounds i8, ptr %0, i64 68
  %77 = load i32, ptr %76, align 4, !tbaa !23
  %78 = icmp eq i32 %77, %75
  br i1 %78, label %79, label %80

79:                                               ; preds = %.loopexit
  tail call void @_ZN4jpge12jpeg_encoder15process_mcu_rowEv(ptr noundef nonnull align 8 dereferenceable(13494) %0)
  store i8 0, ptr %4, align 8, !tbaa !5
  br label %80

80:                                               ; preds = %79, %.loopexit
  ret void
}

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

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

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

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

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

attributes #0 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #1 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
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 = { 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" }

!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, !8, i64 200}
!6 = !{!"_ZTSN4jpge12jpeg_encoderE", !7, i64 0, !10, i64 8, !8, i64 20, !8, i64 21, !8, i64 24, !11, i64 28, !11, i64 32, !11, i64 36, !11, i64 40, !11, i64 44, !11, i64 48, !11, i64 52, !11, i64 56, !11, i64 60, !11, i64 64, !11, i64 68, !8, i64 72, !8, i64 200, !8, i64 204, !8, i64 460, !8, i64 588, !8, i64 1100, !8, i64 5196, !8, i64 6220, !8, i64 6288, !8, i64 7312, !8, i64 11408, !8, i64 11420, !7, i64 13472, !11, i64 13480, !11, i64 13484, !11, i64 13488, !8, i64 13492, !13, i64 13493}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!"_ZTSN4jpge6paramsE", !11, i64 0, !12, i64 4, !13, i64 8, !13, i64 9}
!11 = !{!"int", !8, i64 0}
!12 = !{!"_ZTSN4jpge13subsampling_tE", !8, i64 0}
!13 = !{!"bool", !8, i64 0}
!14 = !{!7, !7, i64 0}
!15 = !{!6, !8, i64 20}
!16 = !{!6, !11, i64 36}
!17 = !{!6, !11, i64 28}
!18 = !{!6, !11, i64 52}
!19 = !{!8, !8, i64 0}
!20 = !{!6, !11, i64 44}
!21 = distinct !{!21, !22}
!22 = !{!"llvm.loop.mustprogress"}
!23 = !{!6, !11, i64 68}


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,SROAPass,SimplifyCFGPass,TailCallElimPass