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

; 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: mustprogress nounwind uwtable
declare dso_local void @_ZN4jpge12jpeg_encoder19load_block_8_8_greyEi(ptr noundef nonnull align 8 dereferenceable(13494), i32 noundef) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4jpge12jpeg_encoder14load_block_8_8Eiii(ptr noundef nonnull align 8 dereferenceable(13494), i32 noundef, i32 noundef, i32 noundef) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4jpge12jpeg_encoder15load_block_16_8Eii(ptr noundef nonnull align 8 dereferenceable(13494), i32 noundef, i32 noundef) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4jpge12jpeg_encoder17load_block_16_8_8Eii(ptr noundef nonnull align 8 dereferenceable(13494), i32 noundef, i32 noundef) #1 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4jpge12jpeg_encoder15process_mcu_rowEv(ptr noundef nonnull align 8 dereferenceable(13494) %0) #2 align 2 {
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  %7 = load ptr, ptr %2, align 8
  %8 = getelementptr inbounds %"class.jpge::jpeg_encoder", ptr %7, i32 0, i32 2
  %9 = load i8, ptr %8, align 4, !tbaa !9
  %10 = zext i8 %9 to i32
  %11 = icmp eq i32 %10, 1
  br i1 %11, label %12, label %25

12:                                               ; preds = %1
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #3
  store i32 0, ptr %3, align 4, !tbaa !15
  br label %13

13:                                               ; preds = %21, %12
  %14 = load i32, ptr %3, align 4, !tbaa !15
  %15 = getelementptr inbounds %"class.jpge::jpeg_encoder", ptr %7, i32 0, i32 14
  %16 = load i32, ptr %15, align 4, !tbaa !16
  %17 = icmp slt i32 %14, %16
  br i1 %17, label %19, label %18

18:                                               ; preds = %13
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #3
  br label %24

19:                                               ; preds = %13
  %20 = load i32, ptr %3, align 4, !tbaa !15
  call void @_ZN4jpge12jpeg_encoder19load_block_8_8_greyEi(ptr noundef nonnull align 8 dereferenceable(13494) %7, i32 noundef %20)
  call void @_ZN4jpge12jpeg_encoder10code_blockEi(ptr noundef nonnull align 8 dereferenceable(13494) %7, i32 noundef 0)
  br label %21

21:                                               ; preds = %19
  %22 = load i32, ptr %3, align 4, !tbaa !15
  %23 = add nsw i32 %22, 1
  store i32 %23, ptr %3, align 4, !tbaa !15
  br label %13, !llvm.loop !17

24:                                               ; preds = %18
  br label %125

25:                                               ; preds = %1
  %26 = getelementptr inbounds %"class.jpge::jpeg_encoder", ptr %7, i32 0, i32 3
  %27 = getelementptr inbounds [3 x i8], ptr %26, i64 0, i64 0
  %28 = load i8, ptr %27, align 1, !tbaa !19
  %29 = zext i8 %28 to i32
  %30 = icmp eq i32 %29, 1
  br i1 %30, label %31, label %52

31:                                               ; preds = %25
  %32 = getelementptr inbounds %"class.jpge::jpeg_encoder", ptr %7, i32 0, i32 4
  %33 = getelementptr inbounds [3 x i8], ptr %32, i64 0, i64 0
  %34 = load i8, ptr %33, align 8, !tbaa !19
  %35 = zext i8 %34 to i32
  %36 = icmp eq i32 %35, 1
  br i1 %36, label %37, label %52

37:                                               ; preds = %31
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #3
  store i32 0, ptr %4, align 4, !tbaa !15
  br label %38

38:                                               ; preds = %48, %37
  %39 = load i32, ptr %4, align 4, !tbaa !15
  %40 = getelementptr inbounds %"class.jpge::jpeg_encoder", ptr %7, i32 0, i32 14
  %41 = load i32, ptr %40, align 4, !tbaa !16
  %42 = icmp slt i32 %39, %41
  br i1 %42, label %44, label %43

43:                                               ; preds = %38
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #3
  br label %51

44:                                               ; preds = %38
  %45 = load i32, ptr %4, align 4, !tbaa !15
  call void @_ZN4jpge12jpeg_encoder14load_block_8_8Eiii(ptr noundef nonnull align 8 dereferenceable(13494) %7, i32 noundef %45, i32 noundef 0, i32 noundef 0)
  call void @_ZN4jpge12jpeg_encoder10code_blockEi(ptr noundef nonnull align 8 dereferenceable(13494) %7, i32 noundef 0)
  %46 = load i32, ptr %4, align 4, !tbaa !15
  call void @_ZN4jpge12jpeg_encoder14load_block_8_8Eiii(ptr noundef nonnull align 8 dereferenceable(13494) %7, i32 noundef %46, i32 noundef 0, i32 noundef 1)
  call void @_ZN4jpge12jpeg_encoder10code_blockEi(ptr noundef nonnull align 8 dereferenceable(13494) %7, i32 noundef 1)
  %47 = load i32, ptr %4, align 4, !tbaa !15
  call void @_ZN4jpge12jpeg_encoder14load_block_8_8Eiii(ptr noundef nonnull align 8 dereferenceable(13494) %7, i32 noundef %47, i32 noundef 0, i32 noundef 2)
  call void @_ZN4jpge12jpeg_encoder10code_blockEi(ptr noundef nonnull align 8 dereferenceable(13494) %7, i32 noundef 2)
  br label %48

48:                                               ; preds = %44
  %49 = load i32, ptr %4, align 4, !tbaa !15
  %50 = add nsw i32 %49, 1
  store i32 %50, ptr %4, align 4, !tbaa !15
  br label %38, !llvm.loop !20

51:                                               ; preds = %43
  br label %124

52:                                               ; preds = %31, %25
  %53 = getelementptr inbounds %"class.jpge::jpeg_encoder", ptr %7, i32 0, i32 3
  %54 = getelementptr inbounds [3 x i8], ptr %53, i64 0, i64 0
  %55 = load i8, ptr %54, align 1, !tbaa !19
  %56 = zext i8 %55 to i32
  %57 = icmp eq i32 %56, 2
  br i1 %57, label %58, label %84

58:                                               ; preds = %52
  %59 = getelementptr inbounds %"class.jpge::jpeg_encoder", ptr %7, i32 0, i32 4
  %60 = getelementptr inbounds [3 x i8], ptr %59, i64 0, i64 0
  %61 = load i8, ptr %60, align 8, !tbaa !19
  %62 = zext i8 %61 to i32
  %63 = icmp eq i32 %62, 1
  br i1 %63, label %64, label %84

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

65:                                               ; preds = %80, %64
  %66 = load i32, ptr %5, align 4, !tbaa !15
  %67 = getelementptr inbounds %"class.jpge::jpeg_encoder", ptr %7, i32 0, i32 14
  %68 = load i32, ptr %67, align 4, !tbaa !16
  %69 = icmp slt i32 %66, %68
  br i1 %69, label %71, label %70

70:                                               ; preds = %65
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #3
  br label %83

71:                                               ; preds = %65
  %72 = load i32, ptr %5, align 4, !tbaa !15
  %73 = mul nsw i32 %72, 2
  %74 = add nsw i32 %73, 0
  call void @_ZN4jpge12jpeg_encoder14load_block_8_8Eiii(ptr noundef nonnull align 8 dereferenceable(13494) %7, i32 noundef %74, i32 noundef 0, i32 noundef 0)
  call void @_ZN4jpge12jpeg_encoder10code_blockEi(ptr noundef nonnull align 8 dereferenceable(13494) %7, i32 noundef 0)
  %75 = load i32, ptr %5, align 4, !tbaa !15
  %76 = mul nsw i32 %75, 2
  %77 = add nsw i32 %76, 1
  call void @_ZN4jpge12jpeg_encoder14load_block_8_8Eiii(ptr noundef nonnull align 8 dereferenceable(13494) %7, i32 noundef %77, i32 noundef 0, i32 noundef 0)
  call void @_ZN4jpge12jpeg_encoder10code_blockEi(ptr noundef nonnull align 8 dereferenceable(13494) %7, i32 noundef 0)
  %78 = load i32, ptr %5, align 4, !tbaa !15
  call void @_ZN4jpge12jpeg_encoder17load_block_16_8_8Eii(ptr noundef nonnull align 8 dereferenceable(13494) %7, i32 noundef %78, i32 noundef 1)
  call void @_ZN4jpge12jpeg_encoder10code_blockEi(ptr noundef nonnull align 8 dereferenceable(13494) %7, i32 noundef 1)
  %79 = load i32, ptr %5, align 4, !tbaa !15
  call void @_ZN4jpge12jpeg_encoder17load_block_16_8_8Eii(ptr noundef nonnull align 8 dereferenceable(13494) %7, i32 noundef %79, i32 noundef 2)
  call void @_ZN4jpge12jpeg_encoder10code_blockEi(ptr noundef nonnull align 8 dereferenceable(13494) %7, i32 noundef 2)
  br label %80

80:                                               ; preds = %71
  %81 = load i32, ptr %5, align 4, !tbaa !15
  %82 = add nsw i32 %81, 1
  store i32 %82, ptr %5, align 4, !tbaa !15
  br label %65, !llvm.loop !21

83:                                               ; preds = %70
  br label %123

84:                                               ; preds = %58, %52
  %85 = getelementptr inbounds %"class.jpge::jpeg_encoder", ptr %7, i32 0, i32 3
  %86 = getelementptr inbounds [3 x i8], ptr %85, i64 0, i64 0
  %87 = load i8, ptr %86, align 1, !tbaa !19
  %88 = zext i8 %87 to i32
  %89 = icmp eq i32 %88, 2
  br i1 %89, label %90, label %122

90:                                               ; preds = %84
  %91 = getelementptr inbounds %"class.jpge::jpeg_encoder", ptr %7, i32 0, i32 4
  %92 = getelementptr inbounds [3 x i8], ptr %91, i64 0, i64 0
  %93 = load i8, ptr %92, align 8, !tbaa !19
  %94 = zext i8 %93 to i32
  %95 = icmp eq i32 %94, 2
  br i1 %95, label %96, label %122

96:                                               ; preds = %90
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #3
  store i32 0, ptr %6, align 4, !tbaa !15
  br label %97

97:                                               ; preds = %118, %96
  %98 = load i32, ptr %6, align 4, !tbaa !15
  %99 = getelementptr inbounds %"class.jpge::jpeg_encoder", ptr %7, i32 0, i32 14
  %100 = load i32, ptr %99, align 4, !tbaa !16
  %101 = icmp slt i32 %98, %100
  br i1 %101, label %103, label %102

102:                                              ; preds = %97
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #3
  br label %121

103:                                              ; preds = %97
  %104 = load i32, ptr %6, align 4, !tbaa !15
  %105 = mul nsw i32 %104, 2
  %106 = add nsw i32 %105, 0
  call void @_ZN4jpge12jpeg_encoder14load_block_8_8Eiii(ptr noundef nonnull align 8 dereferenceable(13494) %7, i32 noundef %106, i32 noundef 0, i32 noundef 0)
  call void @_ZN4jpge12jpeg_encoder10code_blockEi(ptr noundef nonnull align 8 dereferenceable(13494) %7, i32 noundef 0)
  %107 = load i32, ptr %6, align 4, !tbaa !15
  %108 = mul nsw i32 %107, 2
  %109 = add nsw i32 %108, 1
  call void @_ZN4jpge12jpeg_encoder14load_block_8_8Eiii(ptr noundef nonnull align 8 dereferenceable(13494) %7, i32 noundef %109, i32 noundef 0, i32 noundef 0)
  call void @_ZN4jpge12jpeg_encoder10code_blockEi(ptr noundef nonnull align 8 dereferenceable(13494) %7, i32 noundef 0)
  %110 = load i32, ptr %6, align 4, !tbaa !15
  %111 = mul nsw i32 %110, 2
  %112 = add nsw i32 %111, 0
  call void @_ZN4jpge12jpeg_encoder14load_block_8_8Eiii(ptr noundef nonnull align 8 dereferenceable(13494) %7, i32 noundef %112, i32 noundef 1, i32 noundef 0)
  call void @_ZN4jpge12jpeg_encoder10code_blockEi(ptr noundef nonnull align 8 dereferenceable(13494) %7, i32 noundef 0)
  %113 = load i32, ptr %6, align 4, !tbaa !15
  %114 = mul nsw i32 %113, 2
  %115 = add nsw i32 %114, 1
  call void @_ZN4jpge12jpeg_encoder14load_block_8_8Eiii(ptr noundef nonnull align 8 dereferenceable(13494) %7, i32 noundef %115, i32 noundef 1, i32 noundef 0)
  call void @_ZN4jpge12jpeg_encoder10code_blockEi(ptr noundef nonnull align 8 dereferenceable(13494) %7, i32 noundef 0)
  %116 = load i32, ptr %6, align 4, !tbaa !15
  call void @_ZN4jpge12jpeg_encoder15load_block_16_8Eii(ptr noundef nonnull align 8 dereferenceable(13494) %7, i32 noundef %116, i32 noundef 1)
  call void @_ZN4jpge12jpeg_encoder10code_blockEi(ptr noundef nonnull align 8 dereferenceable(13494) %7, i32 noundef 1)
  %117 = load i32, ptr %6, align 4, !tbaa !15
  call void @_ZN4jpge12jpeg_encoder15load_block_16_8Eii(ptr noundef nonnull align 8 dereferenceable(13494) %7, i32 noundef %117, i32 noundef 2)
  call void @_ZN4jpge12jpeg_encoder10code_blockEi(ptr noundef nonnull align 8 dereferenceable(13494) %7, i32 noundef 2)
  br label %118

118:                                              ; preds = %103
  %119 = load i32, ptr %6, align 4, !tbaa !15
  %120 = add nsw i32 %119, 1
  store i32 %120, ptr %6, align 4, !tbaa !15
  br label %97, !llvm.loop !22

121:                                              ; preds = %102
  br label %122

122:                                              ; preds = %121, %90, %84
  br label %123

123:                                              ; preds = %122, %83
  br label %124

124:                                              ; preds = %123, %51
  br label %125

125:                                              ; preds = %124, %24
  ret void
}

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 = { 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 20}
!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 = !{!12, !12, i64 0}
!16 = !{!10, !12, i64 60}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}
!19 = !{!7, !7, i64 0}
!20 = distinct !{!20, !18}
!21 = distinct !{!21, !18}
!22 = distinct !{!22, !18}


; 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 nounwind uwtable
declare dso_local void @_ZN4jpge12jpeg_encoder19load_block_8_8_greyEi(ptr noundef nonnull align 8 dereferenceable(13494), i32 noundef) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4jpge12jpeg_encoder14load_block_8_8Eiii(ptr noundef nonnull align 8 dereferenceable(13494), i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4jpge12jpeg_encoder15load_block_16_8Eii(ptr noundef nonnull align 8 dereferenceable(13494), i32 noundef, i32 noundef) local_unnamed_addr #0 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN4jpge12jpeg_encoder17load_block_16_8_8Eii(ptr noundef nonnull align 8 dereferenceable(13494), i32 noundef, i32 noundef) local_unnamed_addr #0 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4jpge12jpeg_encoder15process_mcu_rowEv(ptr noundef nonnull align 8 dereferenceable(13494) %0) local_unnamed_addr #1 align 2 {
  %2 = getelementptr inbounds i8, ptr %0, i64 20
  %3 = load i8, ptr %2, align 4, !tbaa !5
  %4 = icmp eq i8 %3, 1
  br i1 %4, label %.preheader, label %11

.preheader:                                       ; preds = %1
  %5 = getelementptr inbounds i8, ptr %0, i64 60
  %6 = load i32, ptr %5, align 4, !tbaa !14
  %7 = icmp sgt i32 %6, 0
  br i1 %7, label %.lr.ph45, label %.loopexit

.lr.ph45:                                         ; preds = %.preheader, %.lr.ph45
  %.02444 = phi i32 [ %8, %.lr.ph45 ], [ 0, %.preheader ]
  tail call void @_ZN4jpge12jpeg_encoder19load_block_8_8_greyEi(ptr noundef nonnull align 8 dereferenceable(13494) %0, i32 noundef %.02444)
  tail call void @_ZN4jpge12jpeg_encoder10code_blockEi(ptr noundef nonnull align 8 dereferenceable(13494) %0, i32 noundef 0)
  %8 = add nuw nsw i32 %.02444, 1
  %9 = load i32, ptr %5, align 4, !tbaa !14
  %10 = icmp slt i32 %8, %9
  br i1 %10, label %.lr.ph45, label %.loopexit, !llvm.loop !15

11:                                               ; preds = %1
  %12 = getelementptr inbounds i8, ptr %0, i64 21
  %13 = load i8, ptr %12, align 1, !tbaa !17
  %14 = icmp eq i8 %13, 1
  %15 = getelementptr inbounds i8, ptr %0, i64 24
  %16 = load i8, ptr %15, align 8
  %17 = icmp eq i8 %16, 1
  %or.cond = select i1 %14, i1 %17, i1 false
  br i1 %or.cond, label %.preheader33, label %24

.preheader33:                                     ; preds = %11
  %18 = getelementptr inbounds i8, ptr %0, i64 60
  %19 = load i32, ptr %18, align 4, !tbaa !14
  %20 = icmp sgt i32 %19, 0
  br i1 %20, label %.lr.ph43, label %.loopexit

.lr.ph43:                                         ; preds = %.preheader33, %.lr.ph43
  %.02342 = phi i32 [ %21, %.lr.ph43 ], [ 0, %.preheader33 ]
  tail call void @_ZN4jpge12jpeg_encoder14load_block_8_8Eiii(ptr noundef nonnull align 8 dereferenceable(13494) %0, i32 noundef %.02342, i32 noundef 0, i32 noundef 0)
  tail call void @_ZN4jpge12jpeg_encoder10code_blockEi(ptr noundef nonnull align 8 dereferenceable(13494) %0, i32 noundef 0)
  tail call void @_ZN4jpge12jpeg_encoder14load_block_8_8Eiii(ptr noundef nonnull align 8 dereferenceable(13494) %0, i32 noundef %.02342, i32 noundef 0, i32 noundef 1)
  tail call void @_ZN4jpge12jpeg_encoder10code_blockEi(ptr noundef nonnull align 8 dereferenceable(13494) %0, i32 noundef 1)
  tail call void @_ZN4jpge12jpeg_encoder14load_block_8_8Eiii(ptr noundef nonnull align 8 dereferenceable(13494) %0, i32 noundef %.02342, i32 noundef 0, i32 noundef 2)
  tail call void @_ZN4jpge12jpeg_encoder10code_blockEi(ptr noundef nonnull align 8 dereferenceable(13494) %0, i32 noundef 2)
  %21 = add nuw nsw i32 %.02342, 1
  %22 = load i32, ptr %18, align 4, !tbaa !14
  %23 = icmp slt i32 %21, %22
  br i1 %23, label %.lr.ph43, label %.loopexit, !llvm.loop !18

24:                                               ; preds = %11
  %25 = icmp eq i8 %13, 2
  %or.cond29 = select i1 %25, i1 %17, i1 false
  br i1 %or.cond29, label %.preheader35, label %34

.preheader35:                                     ; preds = %24
  %26 = getelementptr inbounds i8, ptr %0, i64 60
  %27 = load i32, ptr %26, align 4, !tbaa !14
  %28 = icmp sgt i32 %27, 0
  br i1 %28, label %.lr.ph41, label %.loopexit

.lr.ph41:                                         ; preds = %.preheader35, %.lr.ph41
  %.02240 = phi i32 [ %31, %.lr.ph41 ], [ 0, %.preheader35 ]
  %29 = shl nuw nsw i32 %.02240, 1
  tail call void @_ZN4jpge12jpeg_encoder14load_block_8_8Eiii(ptr noundef nonnull align 8 dereferenceable(13494) %0, i32 noundef %29, i32 noundef 0, i32 noundef 0)
  tail call void @_ZN4jpge12jpeg_encoder10code_blockEi(ptr noundef nonnull align 8 dereferenceable(13494) %0, i32 noundef 0)
  %30 = or disjoint i32 %29, 1
  tail call void @_ZN4jpge12jpeg_encoder14load_block_8_8Eiii(ptr noundef nonnull align 8 dereferenceable(13494) %0, i32 noundef %30, i32 noundef 0, i32 noundef 0)
  tail call void @_ZN4jpge12jpeg_encoder10code_blockEi(ptr noundef nonnull align 8 dereferenceable(13494) %0, i32 noundef 0)
  tail call void @_ZN4jpge12jpeg_encoder17load_block_16_8_8Eii(ptr noundef nonnull align 8 dereferenceable(13494) %0, i32 noundef %.02240, i32 noundef 1)
  tail call void @_ZN4jpge12jpeg_encoder10code_blockEi(ptr noundef nonnull align 8 dereferenceable(13494) %0, i32 noundef 1)
  tail call void @_ZN4jpge12jpeg_encoder17load_block_16_8_8Eii(ptr noundef nonnull align 8 dereferenceable(13494) %0, i32 noundef %.02240, i32 noundef 2)
  tail call void @_ZN4jpge12jpeg_encoder10code_blockEi(ptr noundef nonnull align 8 dereferenceable(13494) %0, i32 noundef 2)
  %31 = add nuw nsw i32 %.02240, 1
  %32 = load i32, ptr %26, align 4, !tbaa !14
  %33 = icmp slt i32 %31, %32
  br i1 %33, label %.lr.ph41, label %.loopexit, !llvm.loop !19

34:                                               ; preds = %24
  %35 = icmp eq i8 %16, 2
  %or.cond32 = select i1 %25, i1 %35, i1 false
  br i1 %or.cond32, label %.preheader37, label %.loopexit

.preheader37:                                     ; preds = %34
  %36 = getelementptr inbounds i8, ptr %0, i64 60
  %37 = load i32, ptr %36, align 4, !tbaa !14
  %38 = icmp sgt i32 %37, 0
  br i1 %38, label %.lr.ph, label %.loopexit

.lr.ph:                                           ; preds = %.preheader37, %.lr.ph
  %.039 = phi i32 [ %41, %.lr.ph ], [ 0, %.preheader37 ]
  %39 = shl nuw nsw i32 %.039, 1
  tail call void @_ZN4jpge12jpeg_encoder14load_block_8_8Eiii(ptr noundef nonnull align 8 dereferenceable(13494) %0, i32 noundef %39, i32 noundef 0, i32 noundef 0)
  tail call void @_ZN4jpge12jpeg_encoder10code_blockEi(ptr noundef nonnull align 8 dereferenceable(13494) %0, i32 noundef 0)
  %40 = or disjoint i32 %39, 1
  tail call void @_ZN4jpge12jpeg_encoder14load_block_8_8Eiii(ptr noundef nonnull align 8 dereferenceable(13494) %0, i32 noundef %40, i32 noundef 0, i32 noundef 0)
  tail call void @_ZN4jpge12jpeg_encoder10code_blockEi(ptr noundef nonnull align 8 dereferenceable(13494) %0, i32 noundef 0)
  tail call void @_ZN4jpge12jpeg_encoder14load_block_8_8Eiii(ptr noundef nonnull align 8 dereferenceable(13494) %0, i32 noundef %39, i32 noundef 1, i32 noundef 0)
  tail call void @_ZN4jpge12jpeg_encoder10code_blockEi(ptr noundef nonnull align 8 dereferenceable(13494) %0, i32 noundef 0)
  tail call void @_ZN4jpge12jpeg_encoder14load_block_8_8Eiii(ptr noundef nonnull align 8 dereferenceable(13494) %0, i32 noundef %40, i32 noundef 1, i32 noundef 0)
  tail call void @_ZN4jpge12jpeg_encoder10code_blockEi(ptr noundef nonnull align 8 dereferenceable(13494) %0, i32 noundef 0)
  tail call void @_ZN4jpge12jpeg_encoder15load_block_16_8Eii(ptr noundef nonnull align 8 dereferenceable(13494) %0, i32 noundef %.039, i32 noundef 1)
  tail call void @_ZN4jpge12jpeg_encoder10code_blockEi(ptr noundef nonnull align 8 dereferenceable(13494) %0, i32 noundef 1)
  tail call void @_ZN4jpge12jpeg_encoder15load_block_16_8Eii(ptr noundef nonnull align 8 dereferenceable(13494) %0, i32 noundef %.039, i32 noundef 2)
  tail call void @_ZN4jpge12jpeg_encoder10code_blockEi(ptr noundef nonnull align 8 dereferenceable(13494) %0, i32 noundef 2)
  %41 = add nuw nsw i32 %.039, 1
  %42 = load i32, ptr %36, align 4, !tbaa !14
  %43 = icmp slt i32 %41, %42
  br i1 %43, label %.lr.ph, label %.loopexit, !llvm.loop !20

.loopexit:                                        ; preds = %.lr.ph, %.lr.ph41, %.lr.ph43, %.lr.ph45, %.preheader37, %.preheader35, %.preheader33, %.preheader, %34
  ret void
}

attributes #0 = { 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 #1 = { 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" }

!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 20}
!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 = !{!6, !11, i64 60}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = !{!8, !8, i64 0}
!18 = distinct !{!18, !16}
!19 = distinct !{!19, !16}
!20 = distinct !{!20, !16}


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