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

; 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.jpgd::jpeg_decoder" = type <{ [1 x %struct.__jmp_buf_tag], ptr, i32, i32, ptr, i32, [8 x i8], [4 x i8], [8 x ptr], [8 x ptr], [4 x ptr], i32, i32, [4 x i32], [4 x i32], [4 x i32], [4 x i32], [4 x i32], [4 x i32], i32, [4 x i32], [4 x i32], [4 x i32], i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, [10 x i32], i32, i32, i32, i32, i32, [8 x ptr], [4 x ptr], [4 x ptr], i32, [4 x i32], [4 x i8], ptr, i32, i32, i8, [128 x i8], [8320 x i8], [128 x i8], [3 x i8], i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i8, [3 x i8], i32, [4 x i32], [4 x i8], ptr, [10 x i32], ptr, [256 x i32], [256 x i32], [256 x i32], [256 x i32], ptr, ptr, i32, i8, [3 x i8], i32, [4 x i8] }>
%struct.__jmp_buf_tag = type { [8 x i64], i32, %struct.__sigset_t }
%struct.__sigset_t = type { [16 x i64] }

; 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 noreturn uwtable
declare dso_local void @_ZN4jpgd12jpeg_decoder13stop_decodingENS_11jpgd_statusE(ptr noundef nonnull align 8 dereferenceable(13652), i32 noundef) #1 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4jpgd12jpeg_decoder15read_sos_markerEv(ptr noundef nonnull align 8 dereferenceable(13652) %0) #3 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
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  %9 = load ptr, ptr %2, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  %10 = call noundef i32 @_ZN4jpgd12jpeg_decoder8get_bitsEi(ptr noundef nonnull align 8 dereferenceable(13652) %9, i32 noundef 16)
  store i32 %10, ptr %3, align 4, !tbaa !9
  %11 = call noundef i32 @_ZN4jpgd12jpeg_decoder8get_bitsEi(ptr noundef nonnull align 8 dereferenceable(13652) %9, i32 noundef 8)
  store i32 %11, ptr %6, align 4, !tbaa !9
  %12 = load i32, ptr %6, align 4, !tbaa !9
  %13 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %9, i32 0, i32 19
  store i32 %12, ptr %13, align 8, !tbaa !11
  %14 = load i32, ptr %3, align 4, !tbaa !9
  %15 = sub i32 %14, 3
  store i32 %15, ptr %3, align 4, !tbaa !9
  %16 = load i32, ptr %3, align 4, !tbaa !9
  %17 = load i32, ptr %6, align 4, !tbaa !9
  %18 = mul nsw i32 %17, 2
  %19 = add nsw i32 %18, 3
  %20 = icmp ne i32 %16, %19
  br i1 %20, label %27, label %21

21:                                               ; preds = %1
  %22 = load i32, ptr %6, align 4, !tbaa !9
  %23 = icmp slt i32 %22, 1
  br i1 %23, label %27, label %24

24:                                               ; preds = %21
  %25 = load i32, ptr %6, align 4, !tbaa !9
  %26 = icmp sgt i32 %25, 4
  br i1 %26, label %27, label %28

27:                                               ; preds = %24, %21, %1
  call void @_ZN4jpgd12jpeg_decoder13stop_decodingENS_11jpgd_statusE(ptr noundef nonnull align 8 dereferenceable(13652) %9, i32 noundef -244) #5
  unreachable

28:                                               ; preds = %24
  store i32 0, ptr %4, align 4, !tbaa !9
  br label %29

29:                                               ; preds = %82, %28
  %30 = load i32, ptr %4, align 4, !tbaa !9
  %31 = load i32, ptr %6, align 4, !tbaa !9
  %32 = icmp slt i32 %30, %31
  br i1 %32, label %33, label %85

33:                                               ; preds = %29
  %34 = call noundef i32 @_ZN4jpgd12jpeg_decoder8get_bitsEi(ptr noundef nonnull align 8 dereferenceable(13652) %9, i32 noundef 8)
  store i32 %34, ptr %8, align 4, !tbaa !9
  %35 = call noundef i32 @_ZN4jpgd12jpeg_decoder8get_bitsEi(ptr noundef nonnull align 8 dereferenceable(13652) %9, i32 noundef 8)
  store i32 %35, ptr %7, align 4, !tbaa !9
  %36 = load i32, ptr %3, align 4, !tbaa !9
  %37 = sub i32 %36, 2
  store i32 %37, ptr %3, align 4, !tbaa !9
  store i32 0, ptr %5, align 4, !tbaa !9
  br label %38

38:                                               ; preds = %53, %33
  %39 = load i32, ptr %5, align 4, !tbaa !9
  %40 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %9, i32 0, i32 12
  %41 = load i32, ptr %40, align 4, !tbaa !15
  %42 = icmp slt i32 %39, %41
  br i1 %42, label %43, label %56

43:                                               ; preds = %38
  %44 = load i32, ptr %8, align 4, !tbaa !9
  %45 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %9, i32 0, i32 16
  %46 = load i32, ptr %5, align 4, !tbaa !9
  %47 = sext i32 %46 to i64
  %48 = getelementptr inbounds [4 x i32], ptr %45, i64 0, i64 %47
  %49 = load i32, ptr %48, align 4, !tbaa !9
  %50 = icmp eq i32 %44, %49
  br i1 %50, label %51, label %52

51:                                               ; preds = %43
  br label %56

52:                                               ; preds = %43
  br label %53

53:                                               ; preds = %52
  %54 = load i32, ptr %5, align 4, !tbaa !9
  %55 = add nsw i32 %54, 1
  store i32 %55, ptr %5, align 4, !tbaa !9
  br label %38, !llvm.loop !16

56:                                               ; preds = %51, %38
  %57 = load i32, ptr %5, align 4, !tbaa !9
  %58 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %9, i32 0, i32 12
  %59 = load i32, ptr %58, align 4, !tbaa !15
  %60 = icmp sge i32 %57, %59
  br i1 %60, label %61, label %62

61:                                               ; preds = %56
  call void @_ZN4jpgd12jpeg_decoder13stop_decodingENS_11jpgd_statusE(ptr noundef nonnull align 8 dereferenceable(13652) %9, i32 noundef -243) #5
  unreachable

62:                                               ; preds = %56
  %63 = load i32, ptr %5, align 4, !tbaa !9
  %64 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %9, i32 0, i32 20
  %65 = load i32, ptr %4, align 4, !tbaa !9
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds [4 x i32], ptr %64, i64 0, i64 %66
  store i32 %63, ptr %67, align 4, !tbaa !9
  %68 = load i32, ptr %7, align 4, !tbaa !9
  %69 = ashr i32 %68, 4
  %70 = and i32 %69, 15
  %71 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %9, i32 0, i32 21
  %72 = load i32, ptr %5, align 4, !tbaa !9
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds [4 x i32], ptr %71, i64 0, i64 %73
  store i32 %70, ptr %74, align 4, !tbaa !9
  %75 = load i32, ptr %7, align 4, !tbaa !9
  %76 = and i32 %75, 15
  %77 = add nsw i32 %76, 4
  %78 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %9, i32 0, i32 22
  %79 = load i32, ptr %5, align 4, !tbaa !9
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds [4 x i32], ptr %78, i64 0, i64 %80
  store i32 %77, ptr %81, align 4, !tbaa !9
  br label %82

82:                                               ; preds = %62
  %83 = load i32, ptr %4, align 4, !tbaa !9
  %84 = add nsw i32 %83, 1
  store i32 %84, ptr %4, align 4, !tbaa !9
  br label %29, !llvm.loop !18

85:                                               ; preds = %29
  %86 = call noundef i32 @_ZN4jpgd12jpeg_decoder8get_bitsEi(ptr noundef nonnull align 8 dereferenceable(13652) %9, i32 noundef 8)
  %87 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %9, i32 0, i32 23
  store i32 %86, ptr %87, align 4, !tbaa !19
  %88 = call noundef i32 @_ZN4jpgd12jpeg_decoder8get_bitsEi(ptr noundef nonnull align 8 dereferenceable(13652) %9, i32 noundef 8)
  %89 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %9, i32 0, i32 24
  store i32 %88, ptr %89, align 8, !tbaa !20
  %90 = call noundef i32 @_ZN4jpgd12jpeg_decoder8get_bitsEi(ptr noundef nonnull align 8 dereferenceable(13652) %9, i32 noundef 4)
  %91 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %9, i32 0, i32 26
  store i32 %90, ptr %91, align 8, !tbaa !21
  %92 = call noundef i32 @_ZN4jpgd12jpeg_decoder8get_bitsEi(ptr noundef nonnull align 8 dereferenceable(13652) %9, i32 noundef 4)
  %93 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %9, i32 0, i32 25
  store i32 %92, ptr %93, align 4, !tbaa !22
  %94 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %9, i32 0, i32 5
  %95 = load i32, ptr %94, align 8, !tbaa !23
  %96 = icmp ne i32 %95, 0
  br i1 %96, label %100, label %97

97:                                               ; preds = %85
  %98 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %9, i32 0, i32 23
  store i32 0, ptr %98, align 4, !tbaa !19
  %99 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %9, i32 0, i32 24
  store i32 63, ptr %99, align 8, !tbaa !20
  br label %100

100:                                              ; preds = %97, %85
  %101 = load i32, ptr %3, align 4, !tbaa !9
  %102 = sub i32 %101, 3
  store i32 %102, ptr %3, align 4, !tbaa !9
  br label %103

103:                                              ; preds = %106, %100
  %104 = load i32, ptr %3, align 4, !tbaa !9
  %105 = icmp ne i32 %104, 0
  br i1 %105, label %106, label %110

106:                                              ; preds = %103
  %107 = call noundef i32 @_ZN4jpgd12jpeg_decoder8get_bitsEi(ptr noundef nonnull align 8 dereferenceable(13652) %9, i32 noundef 8)
  %108 = load i32, ptr %3, align 4, !tbaa !9
  %109 = add i32 %108, -1
  store i32 %109, ptr %3, align 4, !tbaa !9
  br label %103, !llvm.loop !24

110:                                              ; preds = %103
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #4
  ret void
}

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

!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 = !{!12, !10, i64 504}
!12 = !{!"_ZTSN4jpgd12jpeg_decoderE", !7, i64 0, !6, i64 200, !10, i64 208, !10, i64 212, !6, i64 216, !10, i64 224, !7, i64 228, !7, i64 240, !7, i64 304, !7, i64 368, !10, i64 400, !10, i64 404, !7, i64 408, !7, i64 424, !7, i64 440, !7, i64 456, !7, i64 472, !7, i64 488, !10, i64 504, !7, i64 508, !7, i64 524, !7, i64 540, !10, i64 556, !10, i64 560, !10, i64 564, !10, i64 568, !10, i64 572, !10, i64 576, !10, i64 580, !10, i64 584, !10, i64 588, !10, i64 592, !7, i64 596, !10, i64 636, !10, i64 640, !10, i64 644, !10, i64 648, !10, i64 652, !7, i64 656, !7, i64 720, !7, i64 752, !10, i64 784, !7, i64 788, !6, i64 808, !10, i64 816, !10, i64 820, !13, i64 824, !7, i64 825, !7, i64 953, !7, i64 9273, !10, i64 9404, !10, i64 9408, !10, i64 9412, !10, i64 9416, !10, i64 9420, !10, i64 9424, !10, i64 9428, !10, i64 9432, !10, i64 9436, !10, i64 9440, !13, i64 9444, !10, i64 9448, !7, i64 9452, !6, i64 9472, !7, i64 9480, !6, i64 9520, !7, i64 9528, !7, i64 10552, !7, i64 11576, !7, i64 12600, !6, i64 13624, !6, i64 13632, !14, i64 13640, !13, i64 13644, !10, i64 13648}
!13 = !{!"bool", !7, i64 0}
!14 = !{!"_ZTSN4jpgd11jpgd_statusE", !7, i64 0}
!15 = !{!12, !10, i64 404}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}
!18 = distinct !{!18, !17}
!19 = !{!12, !10, i64 556}
!20 = !{!12, !10, i64 560}
!21 = !{!12, !10, i64 568}
!22 = !{!12, !10, i64 564}
!23 = !{!12, !10, i64 224}
!24 = distinct !{!24, !17}


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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4jpgd12jpeg_decoder15read_sos_markerEv(ptr noundef nonnull align 8 dereferenceable(13652) %0) local_unnamed_addr #2 align 2 {
  %2 = tail call noundef i32 @_ZN4jpgd12jpeg_decoder8get_bitsEi(ptr noundef nonnull align 8 dereferenceable(13652) %0, i32 noundef 16)
  %3 = tail call noundef i32 @_ZN4jpgd12jpeg_decoder8get_bitsEi(ptr noundef nonnull align 8 dereferenceable(13652) %0, i32 noundef 8)
  %4 = getelementptr inbounds i8, ptr %0, i64 504
  store i32 %3, ptr %4, align 8, !tbaa !5
  %5 = shl nsw i32 %3, 1
  %6 = add i32 %5, 6
  %7 = icmp ne i32 %2, %6
  %8 = add i32 %3, -5
  %9 = icmp ult i32 %8, -4
  %or.cond3 = or i1 %9, %7
  br i1 %or.cond3, label %10, label %.lr.ph40

10:                                               ; preds = %1
  tail call void @_ZN4jpgd12jpeg_decoder13stop_decodingENS_11jpgd_statusE(ptr noundef nonnull align 8 dereferenceable(13652) %0, i32 noundef -244) #3
  unreachable

.lr.ph40:                                         ; preds = %1
  %11 = add i32 %2, -3
  %12 = getelementptr inbounds i8, ptr %0, i64 404
  %13 = getelementptr inbounds i8, ptr %0, i64 456
  %14 = getelementptr inbounds i8, ptr %0, i64 508
  %15 = getelementptr inbounds i8, ptr %0, i64 524
  %16 = getelementptr inbounds i8, ptr %0, i64 540
  %17 = sub i32 %11, %5
  %wide.trip.count55 = zext nneg i32 %3 to i64
  br label %18

18:                                               ; preds = %.lr.ph40, %27
  %indvars.iv52 = phi i64 [ 0, %.lr.ph40 ], [ %indvars.iv.next53, %27 ]
  %19 = tail call noundef i32 @_ZN4jpgd12jpeg_decoder8get_bitsEi(ptr noundef nonnull align 8 dereferenceable(13652) %0, i32 noundef 8)
  %20 = tail call noundef i32 @_ZN4jpgd12jpeg_decoder8get_bitsEi(ptr noundef nonnull align 8 dereferenceable(13652) %0, i32 noundef 8)
  %21 = load i32, ptr %12, align 4, !tbaa !13
  %22 = icmp sgt i32 %21, 0
  br i1 %22, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %18
  %wide.trip.count = zext nneg i32 %21 to i64
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader, %26
  %indvars.iv = phi i64 [ 0, %.lr.ph.preheader ], [ %indvars.iv.next, %26 ]
  %23 = getelementptr inbounds [4 x i32], ptr %13, i64 0, i64 %indvars.iv
  %24 = load i32, ptr %23, align 4, !tbaa !14
  %25 = icmp eq i32 %19, %24
  br i1 %25, label %27, label %26

26:                                               ; preds = %.lr.ph
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge, label %.lr.ph, !llvm.loop !15

._crit_edge:                                      ; preds = %18, %26
  tail call void @_ZN4jpgd12jpeg_decoder13stop_decodingENS_11jpgd_statusE(ptr noundef nonnull align 8 dereferenceable(13652) %0, i32 noundef -243) #3
  unreachable

27:                                               ; preds = %.lr.ph
  %28 = trunc nuw nsw i64 %indvars.iv to i32
  %29 = getelementptr inbounds [4 x i32], ptr %14, i64 0, i64 %indvars.iv52
  store i32 %28, ptr %29, align 4, !tbaa !14
  %30 = lshr i32 %20, 4
  %31 = and i32 %30, 15
  %32 = and i64 %indvars.iv, 4294967295
  %33 = getelementptr inbounds [4 x i32], ptr %15, i64 0, i64 %32
  store i32 %31, ptr %33, align 4, !tbaa !14
  %34 = and i32 %20, 15
  %35 = add nuw nsw i32 %34, 4
  %36 = getelementptr inbounds [4 x i32], ptr %16, i64 0, i64 %32
  store i32 %35, ptr %36, align 4, !tbaa !14
  %indvars.iv.next53 = add nuw nsw i64 %indvars.iv52, 1
  %exitcond56.not = icmp eq i64 %indvars.iv.next53, %wide.trip.count55
  br i1 %exitcond56.not, label %._crit_edge41, label %18, !llvm.loop !17

._crit_edge41:                                    ; preds = %27
  %37 = tail call noundef i32 @_ZN4jpgd12jpeg_decoder8get_bitsEi(ptr noundef nonnull align 8 dereferenceable(13652) %0, i32 noundef 8)
  %38 = getelementptr inbounds i8, ptr %0, i64 556
  store i32 %37, ptr %38, align 4, !tbaa !18
  %39 = tail call noundef i32 @_ZN4jpgd12jpeg_decoder8get_bitsEi(ptr noundef nonnull align 8 dereferenceable(13652) %0, i32 noundef 8)
  %40 = getelementptr inbounds i8, ptr %0, i64 560
  store i32 %39, ptr %40, align 8, !tbaa !19
  %41 = tail call noundef i32 @_ZN4jpgd12jpeg_decoder8get_bitsEi(ptr noundef nonnull align 8 dereferenceable(13652) %0, i32 noundef 4)
  %42 = getelementptr inbounds i8, ptr %0, i64 568
  store i32 %41, ptr %42, align 8, !tbaa !20
  %43 = tail call noundef i32 @_ZN4jpgd12jpeg_decoder8get_bitsEi(ptr noundef nonnull align 8 dereferenceable(13652) %0, i32 noundef 4)
  %44 = getelementptr inbounds i8, ptr %0, i64 564
  store i32 %43, ptr %44, align 4, !tbaa !21
  %45 = getelementptr inbounds i8, ptr %0, i64 224
  %46 = load i32, ptr %45, align 8, !tbaa !22
  %.not = icmp eq i32 %46, 0
  br i1 %.not, label %47, label %48

47:                                               ; preds = %._crit_edge41
  store i32 0, ptr %38, align 4, !tbaa !18
  store i32 63, ptr %40, align 8, !tbaa !19
  br label %48

48:                                               ; preds = %47, %._crit_edge41
  %49 = add i32 %17, -3
  %.not3142 = icmp eq i32 %49, 0
  br i1 %.not3142, label %._crit_edge46, label %.lr.ph45

.lr.ph45:                                         ; preds = %48, %.lr.ph45
  %.143 = phi i32 [ %51, %.lr.ph45 ], [ %49, %48 ]
  %50 = tail call noundef i32 @_ZN4jpgd12jpeg_decoder8get_bitsEi(ptr noundef nonnull align 8 dereferenceable(13652) %0, i32 noundef 8)
  %51 = add i32 %.143, -1
  %.not31 = icmp eq i32 %51, 0
  br i1 %.not31, label %._crit_edge46, label %.lr.ph45, !llvm.loop !23

._crit_edge46:                                    ; preds = %.lr.ph45, %48
  ret void
}

attributes #0 = { mustprogress noreturn 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 = { 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 #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 = { noreturn }

!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, !10, i64 504}
!6 = !{!"_ZTSN4jpgd12jpeg_decoderE", !7, i64 0, !9, i64 200, !10, i64 208, !10, i64 212, !9, i64 216, !10, i64 224, !7, i64 228, !7, i64 240, !7, i64 304, !7, i64 368, !10, i64 400, !10, i64 404, !7, i64 408, !7, i64 424, !7, i64 440, !7, i64 456, !7, i64 472, !7, i64 488, !10, i64 504, !7, i64 508, !7, i64 524, !7, i64 540, !10, i64 556, !10, i64 560, !10, i64 564, !10, i64 568, !10, i64 572, !10, i64 576, !10, i64 580, !10, i64 584, !10, i64 588, !10, i64 592, !7, i64 596, !10, i64 636, !10, i64 640, !10, i64 644, !10, i64 648, !10, i64 652, !7, i64 656, !7, i64 720, !7, i64 752, !10, i64 784, !7, i64 788, !9, i64 808, !10, i64 816, !10, i64 820, !11, i64 824, !7, i64 825, !7, i64 953, !7, i64 9273, !10, i64 9404, !10, i64 9408, !10, i64 9412, !10, i64 9416, !10, i64 9420, !10, i64 9424, !10, i64 9428, !10, i64 9432, !10, i64 9436, !10, i64 9440, !11, i64 9444, !10, i64 9448, !7, i64 9452, !9, i64 9472, !7, i64 9480, !9, i64 9520, !7, i64 9528, !7, i64 10552, !7, i64 11576, !7, i64 12600, !9, i64 13624, !9, i64 13632, !12, i64 13640, !11, i64 13644, !10, i64 13648}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!"any pointer", !7, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!"bool", !7, i64 0}
!12 = !{!"_ZTSN4jpgd11jpgd_statusE", !7, i64 0}
!13 = !{!6, !10, i64 404}
!14 = !{!10, !10, i64 0}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.mustprogress"}
!17 = distinct !{!17, !16}
!18 = !{!6, !10, i64 556}
!19 = !{!6, !10, i64 560}
!20 = !{!6, !10, i64 568}
!21 = !{!6, !10, i64 564}
!22 = !{!6, !10, i64 224}
!23 = distinct !{!23, !16}


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