; LLVM IR from facebookresearch/habitat-sim :: src/deps/basis-universal/encoder/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], i32, [4 x i8], 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, i32, [4 x i8], [8 x ptr], [4 x ptr], [4 x ptr], i32, [4 x i32], [4 x i8], ptr, i32, i32, [64 x i8], [8320 x i8], [64 x i8], i32, i32, i32, i32, i32, i32, i32, i32, [4 x i32], ptr, [10 x i32], ptr, ptr, [256 x i32], [256 x i32], [256 x i32], [256 x i32], ptr, ptr, i32, i32, i8, i8, i8, [5 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(13523), i32 noundef) #1 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4jpgd12jpeg_decoder15read_sos_markerEv(ptr noundef nonnull align 8 dereferenceable(13523) %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(13523) %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(13523) %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 21
  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(13523) %9, i32 noundef -244) #5
  unreachable

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

29:                                               ; preds = %102, %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 %105

33:                                               ; preds = %29
  %34 = call noundef i32 @_ZN4jpgd12jpeg_decoder8get_bitsEi(ptr noundef nonnull align 8 dereferenceable(13523) %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(13523) %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 14
  %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 18
  %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 14
  %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(13523) %9, i32 noundef -243) #5
  unreachable

62:                                               ; preds = %56
  %63 = load i32, ptr %5, align 4, !tbaa !9
  %64 = icmp sge i32 %63, 4
  br i1 %64, label %65, label %66

65:                                               ; preds = %62
  call void @_ZN4jpgd12jpeg_decoder13stop_decodingENS_11jpgd_statusE(ptr noundef nonnull align 8 dereferenceable(13523) %9, i32 noundef -230) #5
  unreachable

66:                                               ; preds = %62
  %67 = load i32, ptr %5, align 4, !tbaa !9
  %68 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %9, i32 0, i32 22
  %69 = load i32, ptr %4, align 4, !tbaa !9
  %70 = sext i32 %69 to i64
  %71 = getelementptr inbounds [4 x i32], ptr %68, i64 0, i64 %70
  store i32 %67, ptr %71, align 4, !tbaa !9
  %72 = load i32, ptr %7, align 4, !tbaa !9
  %73 = ashr i32 %72, 4
  %74 = and i32 %73, 15
  %75 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %9, i32 0, i32 23
  %76 = load i32, ptr %5, align 4, !tbaa !9
  %77 = sext i32 %76 to i64
  %78 = getelementptr inbounds [4 x i32], ptr %75, i64 0, i64 %77
  store i32 %74, ptr %78, align 4, !tbaa !9
  %79 = load i32, ptr %7, align 4, !tbaa !9
  %80 = and i32 %79, 15
  %81 = add nsw i32 %80, 4
  %82 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %9, i32 0, i32 24
  %83 = load i32, ptr %5, align 4, !tbaa !9
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds [4 x i32], ptr %82, i64 0, i64 %84
  store i32 %81, ptr %85, align 4, !tbaa !9
  %86 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %9, i32 0, i32 23
  %87 = load i32, ptr %5, align 4, !tbaa !9
  %88 = sext i32 %87 to i64
  %89 = getelementptr inbounds [4 x i32], ptr %86, i64 0, i64 %88
  %90 = load i32, ptr %89, align 4, !tbaa !9
  %91 = icmp sge i32 %90, 8
  br i1 %91, label %92, label %93

92:                                               ; preds = %66
  call void @_ZN4jpgd12jpeg_decoder13stop_decodingENS_11jpgd_statusE(ptr noundef nonnull align 8 dereferenceable(13523) %9, i32 noundef -230) #5
  unreachable

93:                                               ; preds = %66
  %94 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %9, i32 0, i32 24
  %95 = load i32, ptr %5, align 4, !tbaa !9
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds [4 x i32], ptr %94, i64 0, i64 %96
  %98 = load i32, ptr %97, align 4, !tbaa !9
  %99 = icmp sge i32 %98, 8
  br i1 %99, label %100, label %101

100:                                              ; preds = %93
  call void @_ZN4jpgd12jpeg_decoder13stop_decodingENS_11jpgd_statusE(ptr noundef nonnull align 8 dereferenceable(13523) %9, i32 noundef -230) #5
  unreachable

101:                                              ; preds = %93
  br label %102

102:                                              ; preds = %101
  %103 = load i32, ptr %4, align 4, !tbaa !9
  %104 = add nsw i32 %103, 1
  store i32 %104, ptr %4, align 4, !tbaa !9
  br label %29, !llvm.loop !18

105:                                              ; preds = %29
  %106 = call noundef i32 @_ZN4jpgd12jpeg_decoder8get_bitsEi(ptr noundef nonnull align 8 dereferenceable(13523) %9, i32 noundef 8)
  %107 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %9, i32 0, i32 25
  store i32 %106, ptr %107, align 4, !tbaa !19
  %108 = call noundef i32 @_ZN4jpgd12jpeg_decoder8get_bitsEi(ptr noundef nonnull align 8 dereferenceable(13523) %9, i32 noundef 8)
  %109 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %9, i32 0, i32 26
  store i32 %108, ptr %109, align 8, !tbaa !20
  %110 = call noundef i32 @_ZN4jpgd12jpeg_decoder8get_bitsEi(ptr noundef nonnull align 8 dereferenceable(13523) %9, i32 noundef 4)
  %111 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %9, i32 0, i32 28
  store i32 %110, ptr %111, align 8, !tbaa !21
  %112 = call noundef i32 @_ZN4jpgd12jpeg_decoder8get_bitsEi(ptr noundef nonnull align 8 dereferenceable(13523) %9, i32 noundef 4)
  %113 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %9, i32 0, i32 27
  store i32 %112, ptr %113, align 4, !tbaa !22
  %114 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %9, i32 0, i32 7
  %115 = load i32, ptr %114, align 8, !tbaa !23
  %116 = icmp ne i32 %115, 0
  br i1 %116, label %120, label %117

117:                                              ; preds = %105
  %118 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %9, i32 0, i32 25
  store i32 0, ptr %118, align 4, !tbaa !19
  %119 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %9, i32 0, i32 26
  store i32 63, ptr %119, align 8, !tbaa !20
  br label %120

120:                                              ; preds = %117, %105
  %121 = load i32, ptr %3, align 4, !tbaa !9
  %122 = sub i32 %121, 3
  store i32 %122, ptr %3, align 4, !tbaa !9
  br label %123

123:                                              ; preds = %126, %120
  %124 = load i32, ptr %3, align 4, !tbaa !9
  %125 = icmp ne i32 %124, 0
  br i1 %125, label %126, label %130

126:                                              ; preds = %123
  %127 = call noundef i32 @_ZN4jpgd12jpeg_decoder8get_bitsEi(ptr noundef nonnull align 8 dereferenceable(13523) %9, i32 noundef 8)
  %128 = load i32, ptr %3, align 4, !tbaa !9
  %129 = add i32 %128, -1
  store i32 %129, ptr %3, align 4, !tbaa !9
  br label %123, !llvm.loop !24

130:                                              ; preds = %123
  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 512}
!12 = !{!"_ZTSN4jpgd12jpeg_decoderE", !7, i64 0, !10, i64 200, !6, i64 208, !10, i64 216, !10, i64 220, !6, i64 224, !10, i64 232, !7, i64 236, !7, i64 248, !7, i64 312, !7, i64 376, !10, i64 408, !10, i64 412, !7, i64 416, !7, i64 432, !7, i64 448, !7, i64 464, !7, i64 480, !7, i64 496, !10, i64 512, !7, i64 516, !7, i64 532, !7, i64 548, !10, i64 564, !10, i64 568, !10, i64 572, !10, i64 576, !10, i64 580, !10, i64 584, !10, i64 588, !10, i64 592, !10, i64 596, !10, i64 600, !7, i64 604, !10, i64 644, !10, i64 648, !10, i64 652, !10, i64 656, !10, i64 660, !10, i64 664, !7, i64 672, !7, i64 736, !7, i64 768, !10, i64 800, !7, i64 804, !6, i64 824, !10, i64 832, !10, i64 836, !7, i64 840, !7, i64 904, !7, i64 9224, !10, i64 9288, !10, i64 9292, !10, i64 9296, !10, i64 9300, !10, i64 9304, !10, i64 9308, !10, i64 9312, !10, i64 9316, !7, i64 9320, !6, i64 9336, !7, i64 9344, !6, i64 9384, !6, i64 9392, !7, i64 9400, !7, i64 10424, !7, i64 11448, !7, i64 12472, !6, i64 13496, !6, i64 13504, !13, i64 13512, !10, i64 13516, !14, i64 13520, !14, i64 13521, !14, i64 13522}
!13 = !{!"_ZTSN4jpgd11jpgd_statusE", !7, i64 0}
!14 = !{!"bool", !7, i64 0}
!15 = !{!12, !10, i64 412}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}
!18 = distinct !{!18, !17}
!19 = !{!12, !10, i64 564}
!20 = !{!12, !10, i64 568}
!21 = !{!12, !10, i64 576}
!22 = !{!12, !10, i64 572}
!23 = !{!12, !10, i64 232}
!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(13523), 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(13523), 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(13523) %0) local_unnamed_addr #2 align 2 {
  %2 = tail call noundef i32 @_ZN4jpgd12jpeg_decoder8get_bitsEi(ptr noundef nonnull align 8 dereferenceable(13523) %0, i32 noundef 16)
  %3 = tail call noundef i32 @_ZN4jpgd12jpeg_decoder8get_bitsEi(ptr noundef nonnull align 8 dereferenceable(13523) %0, i32 noundef 8)
  %4 = getelementptr inbounds i8, ptr %0, i64 512
  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.ph46

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

.lr.ph46:                                         ; preds = %1
  %11 = add i32 %2, -3
  %12 = getelementptr inbounds i8, ptr %0, i64 412
  %13 = getelementptr inbounds i8, ptr %0, i64 464
  %14 = getelementptr inbounds i8, ptr %0, i64 516
  %15 = getelementptr inbounds i8, ptr %0, i64 532
  %16 = getelementptr inbounds i8, ptr %0, i64 548
  %17 = sub i32 %11, %5
  %wide.trip.count64 = zext nneg i32 %3 to i64
  br label %19

18:                                               ; preds = %42
  %indvars.iv.next62 = add nuw nsw i64 %indvars.iv61, 1
  %exitcond65.not = icmp eq i64 %indvars.iv.next62, %wide.trip.count64
  br i1 %exitcond65.not, label %._crit_edge47, label %19, !llvm.loop !13

19:                                               ; preds = %.lr.ph46, %18
  %indvars.iv61 = phi i64 [ 0, %.lr.ph46 ], [ %indvars.iv.next62, %18 ]
  %20 = tail call noundef i32 @_ZN4jpgd12jpeg_decoder8get_bitsEi(ptr noundef nonnull align 8 dereferenceable(13523) %0, i32 noundef 8)
  %21 = tail call noundef i32 @_ZN4jpgd12jpeg_decoder8get_bitsEi(ptr noundef nonnull align 8 dereferenceable(13523) %0, i32 noundef 8)
  %22 = load i32, ptr %12, align 4, !tbaa !15
  %23 = icmp sgt i32 %22, 0
  br i1 %23, label %.lr.ph.preheader, label %._crit_edge

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

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

27:                                               ; 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 !17

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

28:                                               ; preds = %.lr.ph
  %29 = icmp ugt i64 %indvars.iv, 3
  br i1 %29, label %30, label %31

30:                                               ; preds = %28
  tail call void @_ZN4jpgd12jpeg_decoder13stop_decodingENS_11jpgd_statusE(ptr noundef nonnull align 8 dereferenceable(13523) %0, i32 noundef -230) #3
  unreachable

31:                                               ; preds = %28
  %32 = trunc nuw nsw i64 %indvars.iv to i32
  %33 = getelementptr inbounds [4 x i32], ptr %14, i64 0, i64 %indvars.iv61
  store i32 %32, ptr %33, align 4, !tbaa !16
  %34 = lshr i32 %21, 4
  %35 = and i32 %34, 15
  %36 = getelementptr inbounds [4 x i32], ptr %15, i64 0, i64 %indvars.iv
  store i32 %35, ptr %36, align 4, !tbaa !16
  %37 = and i32 %21, 15
  %38 = add nuw nsw i32 %37, 4
  %39 = getelementptr inbounds [4 x i32], ptr %16, i64 0, i64 %indvars.iv
  store i32 %38, ptr %39, align 4, !tbaa !16
  %40 = icmp ugt i32 %35, 7
  br i1 %40, label %41, label %42

41:                                               ; preds = %31
  tail call void @_ZN4jpgd12jpeg_decoder13stop_decodingENS_11jpgd_statusE(ptr noundef nonnull align 8 dereferenceable(13523) %0, i32 noundef -230) #3
  unreachable

42:                                               ; preds = %31
  %43 = icmp ugt i32 %37, 3
  br i1 %43, label %44, label %18

44:                                               ; preds = %42
  tail call void @_ZN4jpgd12jpeg_decoder13stop_decodingENS_11jpgd_statusE(ptr noundef nonnull align 8 dereferenceable(13523) %0, i32 noundef -230) #3
  unreachable

._crit_edge47:                                    ; preds = %18
  %45 = tail call noundef i32 @_ZN4jpgd12jpeg_decoder8get_bitsEi(ptr noundef nonnull align 8 dereferenceable(13523) %0, i32 noundef 8)
  %46 = getelementptr inbounds i8, ptr %0, i64 564
  store i32 %45, ptr %46, align 4, !tbaa !18
  %47 = tail call noundef i32 @_ZN4jpgd12jpeg_decoder8get_bitsEi(ptr noundef nonnull align 8 dereferenceable(13523) %0, i32 noundef 8)
  %48 = getelementptr inbounds i8, ptr %0, i64 568
  store i32 %47, ptr %48, align 8, !tbaa !19
  %49 = tail call noundef i32 @_ZN4jpgd12jpeg_decoder8get_bitsEi(ptr noundef nonnull align 8 dereferenceable(13523) %0, i32 noundef 4)
  %50 = getelementptr inbounds i8, ptr %0, i64 576
  store i32 %49, ptr %50, align 8, !tbaa !20
  %51 = tail call noundef i32 @_ZN4jpgd12jpeg_decoder8get_bitsEi(ptr noundef nonnull align 8 dereferenceable(13523) %0, i32 noundef 4)
  %52 = getelementptr inbounds i8, ptr %0, i64 572
  store i32 %51, ptr %52, align 4, !tbaa !21
  %53 = getelementptr inbounds i8, ptr %0, i64 232
  %54 = load i32, ptr %53, align 8, !tbaa !22
  %.not = icmp eq i32 %54, 0
  br i1 %.not, label %55, label %56

55:                                               ; preds = %._crit_edge47
  store i32 0, ptr %46, align 4, !tbaa !18
  store i32 63, ptr %48, align 8, !tbaa !19
  br label %56

56:                                               ; preds = %55, %._crit_edge47
  %57 = add i32 %17, -3
  %.not3448 = icmp eq i32 %57, 0
  br i1 %.not3448, label %._crit_edge52, label %.lr.ph51

.lr.ph51:                                         ; preds = %56, %.lr.ph51
  %.149 = phi i32 [ %59, %.lr.ph51 ], [ %57, %56 ]
  %58 = tail call noundef i32 @_ZN4jpgd12jpeg_decoder8get_bitsEi(ptr noundef nonnull align 8 dereferenceable(13523) %0, i32 noundef 8)
  %59 = add i32 %.149, -1
  %.not34 = icmp eq i32 %59, 0
  br i1 %.not34, label %._crit_edge52, label %.lr.ph51, !llvm.loop !23

._crit_edge52:                                    ; preds = %.lr.ph51, %56
  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, !9, i64 512}
!6 = !{!"_ZTSN4jpgd12jpeg_decoderE", !7, i64 0, !9, i64 200, !10, i64 208, !9, i64 216, !9, i64 220, !10, i64 224, !9, i64 232, !7, i64 236, !7, i64 248, !7, i64 312, !7, i64 376, !9, i64 408, !9, i64 412, !7, i64 416, !7, i64 432, !7, i64 448, !7, i64 464, !7, i64 480, !7, i64 496, !9, i64 512, !7, i64 516, !7, i64 532, !7, i64 548, !9, i64 564, !9, i64 568, !9, i64 572, !9, i64 576, !9, i64 580, !9, i64 584, !9, i64 588, !9, i64 592, !9, i64 596, !9, i64 600, !7, i64 604, !9, i64 644, !9, i64 648, !9, i64 652, !9, i64 656, !9, i64 660, !9, i64 664, !7, i64 672, !7, i64 736, !7, i64 768, !9, i64 800, !7, i64 804, !10, i64 824, !9, i64 832, !9, i64 836, !7, i64 840, !7, i64 904, !7, i64 9224, !9, i64 9288, !9, i64 9292, !9, i64 9296, !9, i64 9300, !9, i64 9304, !9, i64 9308, !9, i64 9312, !9, i64 9316, !7, i64 9320, !10, i64 9336, !7, i64 9344, !10, i64 9384, !10, i64 9392, !7, i64 9400, !7, i64 10424, !7, i64 11448, !7, i64 12472, !10, i64 13496, !10, i64 13504, !11, i64 13512, !9, i64 13516, !12, i64 13520, !12, i64 13521, !12, i64 13522}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!"int", !7, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!"_ZTSN4jpgd11jpgd_statusE", !7, i64 0}
!12 = !{!"bool", !7, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = !{!6, !9, i64 412}
!16 = !{!9, !9, i64 0}
!17 = distinct !{!17, !14}
!18 = !{!6, !9, i64 564}
!19 = !{!6, !9, i64 568}
!20 = !{!6, !9, i64 576}
!21 = !{!6, !9, i64 572}
!22 = !{!6, !9, i64 232}
!23 = distinct !{!23, !14}


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