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

; 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] }

@_ZN4jpgdL5g_ZAGE = external hidden global [64 x i32], align 16
@_ZN4jpgdL13s_extend_testE = external hidden constant [16 x i32], align 16
@_ZN4jpgdL15s_extend_offsetE = external hidden constant [16 x i32], align 16

; 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_decoder19get_bits_no_markersEi(ptr noundef nonnull align 8 dereferenceable(13652), i32 noundef) #2 align 2

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4jpgd12jpeg_decoder21decode_block_ac_firstEPS0_iii(ptr noundef %0, i32 noundef %1, i32 noundef %2, i32 noundef %3) #4 align 2 {
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca ptr, align 8
  store ptr %0, ptr %5, align 8, !tbaa !5
  store i32 %1, ptr %6, align 4, !tbaa !9
  store i32 %2, ptr %7, align 4, !tbaa !9
  store i32 %3, ptr %8, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  %14 = load ptr, ptr %5, align 8, !tbaa !5
  %15 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %14, i32 0, i32 42
  %16 = load i32, ptr %15, align 8, !tbaa !11
  %17 = icmp ne i32 %16, 0
  br i1 %17, label %18, label %23

18:                                               ; preds = %4
  %19 = load ptr, ptr %5, align 8, !tbaa !5
  %20 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %19, i32 0, i32 42
  %21 = load i32, ptr %20, align 8, !tbaa !11
  %22 = add nsw i32 %21, -1
  store i32 %22, ptr %20, align 8, !tbaa !11
  store i32 1, ptr %12, align 4
  br label %142

23:                                               ; preds = %4
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  %24 = load ptr, ptr %5, align 8, !tbaa !5
  %25 = load ptr, ptr %5, align 8, !tbaa !5
  %26 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %25, i32 0, i32 41
  %27 = load i32, ptr %6, align 4, !tbaa !9
  %28 = sext i32 %27 to i64
  %29 = getelementptr inbounds [4 x ptr], ptr %26, i64 0, i64 %28
  %30 = load ptr, ptr %29, align 8, !tbaa !5
  %31 = load i32, ptr %7, align 4, !tbaa !9
  %32 = load i32, ptr %8, align 4, !tbaa !9
  %33 = call noundef ptr @_ZN4jpgd12jpeg_decoder14coeff_buf_getpEPNS0_9coeff_bufEii(ptr noundef nonnull align 8 dereferenceable(13652) %24, ptr noundef %30, i32 noundef %31, i32 noundef %32)
  store ptr %33, ptr %13, align 8, !tbaa !5
  %34 = load ptr, ptr %5, align 8, !tbaa !5
  %35 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %34, i32 0, i32 23
  %36 = load i32, ptr %35, align 4, !tbaa !15
  store i32 %36, ptr %9, align 4, !tbaa !9
  br label %37

37:                                               ; preds = %138, %23
  %38 = load i32, ptr %9, align 4, !tbaa !9
  %39 = load ptr, ptr %5, align 8, !tbaa !5
  %40 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %39, i32 0, i32 24
  %41 = load i32, ptr %40, align 8, !tbaa !16
  %42 = icmp sle i32 %38, %41
  br i1 %42, label %43, label %141

43:                                               ; preds = %37
  %44 = load ptr, ptr %5, align 8, !tbaa !5
  %45 = load ptr, ptr %5, align 8, !tbaa !5
  %46 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %45, i32 0, i32 39
  %47 = load ptr, ptr %5, align 8, !tbaa !5
  %48 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %47, i32 0, i32 22
  %49 = load i32, ptr %6, align 4, !tbaa !9
  %50 = sext i32 %49 to i64
  %51 = getelementptr inbounds [4 x i32], ptr %48, i64 0, i64 %50
  %52 = load i32, ptr %51, align 4, !tbaa !9
  %53 = sext i32 %52 to i64
  %54 = getelementptr inbounds [8 x ptr], ptr %46, i64 0, i64 %53
  %55 = load ptr, ptr %54, align 8, !tbaa !5
  %56 = call noundef i32 @_ZN4jpgd12jpeg_decoder11huff_decodeEPNS0_11huff_tablesE(ptr noundef nonnull align 8 dereferenceable(13652) %44, ptr noundef %55)
  store i32 %56, ptr %10, align 4, !tbaa !9
  %57 = load i32, ptr %10, align 4, !tbaa !9
  %58 = ashr i32 %57, 4
  store i32 %58, ptr %11, align 4, !tbaa !9
  %59 = load i32, ptr %10, align 4, !tbaa !9
  %60 = and i32 %59, 15
  store i32 %60, ptr %10, align 4, !tbaa !9
  %61 = load i32, ptr %10, align 4, !tbaa !9
  %62 = icmp ne i32 %61, 0
  br i1 %62, label %63, label %106

63:                                               ; preds = %43
  %64 = load i32, ptr %11, align 4, !tbaa !9
  %65 = load i32, ptr %9, align 4, !tbaa !9
  %66 = add nsw i32 %65, %64
  store i32 %66, ptr %9, align 4, !tbaa !9
  %67 = icmp sgt i32 %66, 63
  br i1 %67, label %68, label %70

68:                                               ; preds = %63
  %69 = load ptr, ptr %5, align 8, !tbaa !5
  call void @_ZN4jpgd12jpeg_decoder13stop_decodingENS_11jpgd_statusE(ptr noundef nonnull align 8 dereferenceable(13652) %69, i32 noundef -230) #6
  unreachable

70:                                               ; preds = %63
  %71 = load ptr, ptr %5, align 8, !tbaa !5
  %72 = load i32, ptr %10, align 4, !tbaa !9
  %73 = call noundef i32 @_ZN4jpgd12jpeg_decoder19get_bits_no_markersEi(ptr noundef nonnull align 8 dereferenceable(13652) %71, i32 noundef %72)
  store i32 %73, ptr %11, align 4, !tbaa !9
  %74 = load i32, ptr %11, align 4, !tbaa !9
  %75 = load i32, ptr %10, align 4, !tbaa !9
  %76 = and i32 %75, 15
  %77 = sext i32 %76 to i64
  %78 = getelementptr inbounds [16 x i32], ptr @_ZN4jpgdL13s_extend_testE, i64 0, i64 %77
  %79 = load i32, ptr %78, align 4, !tbaa !9
  %80 = icmp slt i32 %74, %79
  br i1 %80, label %81, label %89

81:                                               ; preds = %70
  %82 = load i32, ptr %11, align 4, !tbaa !9
  %83 = load i32, ptr %10, align 4, !tbaa !9
  %84 = and i32 %83, 15
  %85 = sext i32 %84 to i64
  %86 = getelementptr inbounds [16 x i32], ptr @_ZN4jpgdL15s_extend_offsetE, i64 0, i64 %85
  %87 = load i32, ptr %86, align 4, !tbaa !9
  %88 = add nsw i32 %82, %87
  br label %91

89:                                               ; preds = %70
  %90 = load i32, ptr %11, align 4, !tbaa !9
  br label %91

91:                                               ; preds = %89, %81
  %92 = phi i32 [ %88, %81 ], [ %90, %89 ]
  store i32 %92, ptr %10, align 4, !tbaa !9
  %93 = load i32, ptr %10, align 4, !tbaa !9
  %94 = load ptr, ptr %5, align 8, !tbaa !5
  %95 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %94, i32 0, i32 25
  %96 = load i32, ptr %95, align 4, !tbaa !17
  %97 = shl i32 %93, %96
  %98 = trunc i32 %97 to i16
  %99 = load ptr, ptr %13, align 8, !tbaa !5
  %100 = load i32, ptr %9, align 4, !tbaa !9
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds [64 x i32], ptr @_ZN4jpgdL5g_ZAGE, i64 0, i64 %101
  %103 = load i32, ptr %102, align 4, !tbaa !9
  %104 = sext i32 %103 to i64
  %105 = getelementptr inbounds i16, ptr %99, i64 %104
  store i16 %98, ptr %105, align 2, !tbaa !18
  br label %137

106:                                              ; preds = %43
  %107 = load i32, ptr %11, align 4, !tbaa !9
  %108 = icmp eq i32 %107, 15
  br i1 %108, label %109, label %116

109:                                              ; preds = %106
  %110 = load i32, ptr %9, align 4, !tbaa !9
  %111 = add nsw i32 %110, 15
  store i32 %111, ptr %9, align 4, !tbaa !9
  %112 = icmp sgt i32 %111, 63
  br i1 %112, label %113, label %115

113:                                              ; preds = %109
  %114 = load ptr, ptr %5, align 8, !tbaa !5
  call void @_ZN4jpgd12jpeg_decoder13stop_decodingENS_11jpgd_statusE(ptr noundef nonnull align 8 dereferenceable(13652) %114, i32 noundef -230) #6
  unreachable

115:                                              ; preds = %109
  br label %136

116:                                              ; preds = %106
  %117 = load i32, ptr %11, align 4, !tbaa !9
  %118 = shl i32 1, %117
  %119 = load ptr, ptr %5, align 8, !tbaa !5
  %120 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %119, i32 0, i32 42
  store i32 %118, ptr %120, align 8, !tbaa !11
  %121 = load i32, ptr %11, align 4, !tbaa !9
  %122 = icmp ne i32 %121, 0
  br i1 %122, label %123, label %131

123:                                              ; preds = %116
  %124 = load ptr, ptr %5, align 8, !tbaa !5
  %125 = load i32, ptr %11, align 4, !tbaa !9
  %126 = call noundef i32 @_ZN4jpgd12jpeg_decoder19get_bits_no_markersEi(ptr noundef nonnull align 8 dereferenceable(13652) %124, i32 noundef %125)
  %127 = load ptr, ptr %5, align 8, !tbaa !5
  %128 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %127, i32 0, i32 42
  %129 = load i32, ptr %128, align 8, !tbaa !11
  %130 = add i32 %129, %126
  store i32 %130, ptr %128, align 8, !tbaa !11
  br label %131

131:                                              ; preds = %123, %116
  %132 = load ptr, ptr %5, align 8, !tbaa !5
  %133 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %132, i32 0, i32 42
  %134 = load i32, ptr %133, align 8, !tbaa !11
  %135 = add nsw i32 %134, -1
  store i32 %135, ptr %133, align 8, !tbaa !11
  br label %141

136:                                              ; preds = %115
  br label %137

137:                                              ; preds = %136, %91
  br label %138

138:                                              ; preds = %137
  %139 = load i32, ptr %9, align 4, !tbaa !9
  %140 = add nsw i32 %139, 1
  store i32 %140, ptr %9, align 4, !tbaa !9
  br label %37, !llvm.loop !20

141:                                              ; preds = %131, %37
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  store i32 0, ptr %12, align 4
  br label %142

142:                                              ; preds = %141, %18
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #5
  %143 = load i32, ptr %12, align 4
  switch i32 %143, label %145 [
    i32 0, label %144
    i32 1, label %144
  ]

144:                                              ; preds = %142, %142
  ret void

145:                                              ; preds = %142
  unreachable
}

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 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { nounwind }
attributes #6 = { 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 784}
!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 556}
!16 = !{!12, !10, i64 560}
!17 = !{!12, !10, i64 564}
!18 = !{!19, !19, i64 0}
!19 = !{!"short", !7, i64 0}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.mustprogress"}


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

@_ZN4jpgdL5g_ZAGE = external hidden local_unnamed_addr global [64 x i32], align 16
@_ZN4jpgdL13s_extend_testE = external hidden local_unnamed_addr constant [16 x i32], align 16
@_ZN4jpgdL15s_extend_offsetE = external hidden local_unnamed_addr constant [16 x i32], align 16

; 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_decoder19get_bits_no_markersEi(ptr noundef nonnull align 8 dereferenceable(13652), i32 noundef) local_unnamed_addr #1 align 2

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4jpgd12jpeg_decoder21decode_block_ac_firstEPS0_iii(ptr noundef %0, i32 noundef %1, i32 noundef %2, i32 noundef %3) local_unnamed_addr #3 align 2 {
  %5 = getelementptr inbounds i8, ptr %0, i64 784
  %6 = load i32, ptr %5, align 8, !tbaa !5
  %.not = icmp eq i32 %6, 0
  br i1 %.not, label %7, label %.loopexit.sink.split

7:                                                ; preds = %4
  %8 = getelementptr inbounds i8, ptr %0, i64 752
  %9 = sext i32 %1 to i64
  %10 = getelementptr inbounds [4 x ptr], ptr %8, i64 0, i64 %9
  %11 = load ptr, ptr %10, align 8, !tbaa !13
  %12 = tail call noundef ptr @_ZN4jpgd12jpeg_decoder14coeff_buf_getpEPNS0_9coeff_bufEii(ptr noundef nonnull align 8 dereferenceable(13652) %0, ptr noundef %11, i32 noundef %2, i32 noundef %3)
  %13 = getelementptr inbounds i8, ptr %0, i64 556
  %14 = load i32, ptr %13, align 4, !tbaa !14
  %15 = getelementptr inbounds i8, ptr %0, i64 560
  %16 = load i32, ptr %15, align 8, !tbaa !15
  %.not4856 = icmp sgt i32 %14, %16
  br i1 %.not4856, label %.loopexit, label %.lr.ph

.lr.ph:                                           ; preds = %7
  %17 = getelementptr inbounds i8, ptr %0, i64 656
  %18 = getelementptr inbounds i8, ptr %0, i64 540
  %19 = getelementptr inbounds [4 x i32], ptr %18, i64 0, i64 %9
  %20 = getelementptr inbounds i8, ptr %0, i64 564
  br label %21

21:                                               ; preds = %.lr.ph, %65
  %.057 = phi i32 [ %14, %.lr.ph ], [ %66, %65 ]
  %22 = load i32, ptr %19, align 4, !tbaa !16
  %23 = sext i32 %22 to i64
  %24 = getelementptr inbounds [8 x ptr], ptr %17, i64 0, i64 %23
  %25 = load ptr, ptr %24, align 8, !tbaa !13
  %26 = tail call noundef i32 @_ZN4jpgd12jpeg_decoder11huff_decodeEPNS0_11huff_tablesE(ptr noundef nonnull align 8 dereferenceable(13652) %0, ptr noundef %25)
  %27 = ashr i32 %26, 4
  %28 = and i32 %26, 15
  %.not49 = icmp eq i32 %28, 0
  br i1 %.not49, label %53, label %29

29:                                               ; preds = %21
  %30 = add nsw i32 %27, %.057
  %31 = icmp sgt i32 %30, 63
  br i1 %31, label %32, label %33

32:                                               ; preds = %29
  tail call void @_ZN4jpgd12jpeg_decoder13stop_decodingENS_11jpgd_statusE(ptr noundef nonnull align 8 dereferenceable(13652) %0, i32 noundef -230) #4
  unreachable

33:                                               ; preds = %29
  %34 = tail call noundef i32 @_ZN4jpgd12jpeg_decoder19get_bits_no_markersEi(ptr noundef nonnull align 8 dereferenceable(13652) %0, i32 noundef %28)
  %35 = zext nneg i32 %28 to i64
  %36 = getelementptr inbounds [16 x i32], ptr @_ZN4jpgdL13s_extend_testE, i64 0, i64 %35
  %37 = load i32, ptr %36, align 4, !tbaa !16
  %38 = icmp slt i32 %34, %37
  br i1 %38, label %39, label %43

39:                                               ; preds = %33
  %40 = getelementptr inbounds [16 x i32], ptr @_ZN4jpgdL15s_extend_offsetE, i64 0, i64 %35
  %41 = load i32, ptr %40, align 4, !tbaa !16
  %42 = add nsw i32 %41, %34
  br label %43

43:                                               ; preds = %33, %39
  %44 = phi i32 [ %42, %39 ], [ %34, %33 ]
  %45 = load i32, ptr %20, align 4, !tbaa !17
  %46 = shl i32 %44, %45
  %47 = trunc i32 %46 to i16
  %48 = sext i32 %30 to i64
  %49 = getelementptr inbounds [64 x i32], ptr @_ZN4jpgdL5g_ZAGE, i64 0, i64 %48
  %50 = load i32, ptr %49, align 4, !tbaa !16
  %51 = sext i32 %50 to i64
  %52 = getelementptr inbounds i16, ptr %12, i64 %51
  store i16 %47, ptr %52, align 2, !tbaa !18
  br label %65

53:                                               ; preds = %21
  %54 = icmp eq i32 %27, 15
  br i1 %54, label %55, label %59

55:                                               ; preds = %53
  %56 = add nsw i32 %.057, 15
  %57 = icmp sgt i32 %.057, 48
  br i1 %57, label %58, label %65

58:                                               ; preds = %55
  tail call void @_ZN4jpgd12jpeg_decoder13stop_decodingENS_11jpgd_statusE(ptr noundef nonnull align 8 dereferenceable(13652) %0, i32 noundef -230) #4
  unreachable

59:                                               ; preds = %53
  %60 = shl nuw i32 1, %27
  store i32 %60, ptr %5, align 8, !tbaa !5
  %.not50 = icmp ult i32 %26, 16
  br i1 %.not50, label %.loopexit.sink.split, label %61

61:                                               ; preds = %59
  %62 = tail call noundef i32 @_ZN4jpgd12jpeg_decoder19get_bits_no_markersEi(ptr noundef nonnull align 8 dereferenceable(13652) %0, i32 noundef %27)
  %63 = load i32, ptr %5, align 8, !tbaa !5
  %64 = add i32 %63, %62
  br label %.loopexit.sink.split

65:                                               ; preds = %43, %55
  %.1 = phi i32 [ %30, %43 ], [ %56, %55 ]
  %66 = add nsw i32 %.1, 1
  %67 = load i32, ptr %15, align 8, !tbaa !15
  %.not48.not = icmp slt i32 %.1, %67
  br i1 %.not48.not, label %21, label %.loopexit, !llvm.loop !20

.loopexit.sink.split:                             ; preds = %59, %61, %4
  %.sink72 = phi i32 [ %6, %4 ], [ %64, %61 ], [ %60, %59 ]
  %68 = add nsw i32 %.sink72, -1
  store i32 %68, ptr %5, align 8, !tbaa !5
  br label %.loopexit

.loopexit:                                        ; preds = %65, %.loopexit.sink.split, %7
  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 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #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 = { 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 784}
!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 = !{!9, !9, i64 0}
!14 = !{!6, !10, i64 556}
!15 = !{!6, !10, i64 560}
!16 = !{!10, !10, i64 0}
!17 = !{!6, !10, i64 564}
!18 = !{!19, !19, i64 0}
!19 = !{!"short", !7, i64 0}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.mustprogress"}


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