; LLVM IR from facebookresearch/habitat-sim :: src/deps/basis-universal/encoder (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], 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] }

@_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(13523), 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(13523), i32 noundef) #2 align 2

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_ZN4jpgd12jpeg_decoder11huff_decodeEPNS0_11huff_tablesE(ptr noundef nonnull align 8 dereferenceable(13523), 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) #3 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
  %14 = alloca i32, align 4
  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) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #4
  %15 = load ptr, ptr %5, align 8, !tbaa !5
  %16 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %15, i32 0, i32 46
  %17 = load i32, ptr %16, align 8, !tbaa !11
  %18 = icmp ne i32 %17, 0
  br i1 %18, label %19, label %24

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

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

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

44:                                               ; preds = %38
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #4
  %45 = load ptr, ptr %5, align 8, !tbaa !5
  %46 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %45, i32 0, i32 24
  %47 = load i32, ptr %6, align 4, !tbaa !9
  %48 = sext i32 %47 to i64
  %49 = getelementptr inbounds [4 x i32], ptr %46, i64 0, i64 %48
  %50 = load i32, ptr %49, align 4, !tbaa !9
  store i32 %50, ptr %14, align 4, !tbaa !9
  %51 = load i32, ptr %14, align 4, !tbaa !9
  %52 = icmp uge i32 %51, 8
  br i1 %52, label %53, label %55

53:                                               ; preds = %44
  %54 = load ptr, ptr %5, align 8, !tbaa !5
  call void @_ZN4jpgd12jpeg_decoder13stop_decodingENS_11jpgd_statusE(ptr noundef nonnull align 8 dereferenceable(13523) %54, i32 noundef -230) #5
  unreachable

55:                                               ; preds = %44
  %56 = load ptr, ptr %5, align 8, !tbaa !5
  %57 = load ptr, ptr %5, align 8, !tbaa !5
  %58 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %57, i32 0, i32 43
  %59 = load i32, ptr %14, align 4, !tbaa !9
  %60 = zext i32 %59 to i64
  %61 = getelementptr inbounds [8 x ptr], ptr %58, i64 0, i64 %60
  %62 = load ptr, ptr %61, align 8, !tbaa !5
  %63 = call noundef i32 @_ZN4jpgd12jpeg_decoder11huff_decodeEPNS0_11huff_tablesE(ptr noundef nonnull align 8 dereferenceable(13523) %56, ptr noundef %62)
  store i32 %63, ptr %10, align 4, !tbaa !9
  %64 = load i32, ptr %10, align 4, !tbaa !9
  %65 = ashr i32 %64, 4
  store i32 %65, ptr %11, align 4, !tbaa !9
  %66 = load i32, ptr %10, align 4, !tbaa !9
  %67 = and i32 %66, 15
  store i32 %67, ptr %10, align 4, !tbaa !9
  %68 = load i32, ptr %10, align 4, !tbaa !9
  %69 = icmp ne i32 %68, 0
  br i1 %69, label %70, label %113

70:                                               ; preds = %55
  %71 = load i32, ptr %11, align 4, !tbaa !9
  %72 = load i32, ptr %9, align 4, !tbaa !9
  %73 = add nsw i32 %72, %71
  store i32 %73, ptr %9, align 4, !tbaa !9
  %74 = icmp sgt i32 %73, 63
  br i1 %74, label %75, label %77

75:                                               ; preds = %70
  %76 = load ptr, ptr %5, align 8, !tbaa !5
  call void @_ZN4jpgd12jpeg_decoder13stop_decodingENS_11jpgd_statusE(ptr noundef nonnull align 8 dereferenceable(13523) %76, i32 noundef -230) #5
  unreachable

77:                                               ; preds = %70
  %78 = load ptr, ptr %5, align 8, !tbaa !5
  %79 = load i32, ptr %10, align 4, !tbaa !9
  %80 = call noundef i32 @_ZN4jpgd12jpeg_decoder19get_bits_no_markersEi(ptr noundef nonnull align 8 dereferenceable(13523) %78, i32 noundef %79)
  store i32 %80, ptr %11, align 4, !tbaa !9
  %81 = load i32, ptr %11, align 4, !tbaa !9
  %82 = load i32, ptr %10, align 4, !tbaa !9
  %83 = and i32 %82, 15
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds [16 x i32], ptr @_ZN4jpgdL13s_extend_testE, i64 0, i64 %84
  %86 = load i32, ptr %85, align 4, !tbaa !9
  %87 = icmp slt i32 %81, %86
  br i1 %87, label %88, label %96

88:                                               ; preds = %77
  %89 = load i32, ptr %11, align 4, !tbaa !9
  %90 = load i32, ptr %10, align 4, !tbaa !9
  %91 = and i32 %90, 15
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds [16 x i32], ptr @_ZN4jpgdL15s_extend_offsetE, i64 0, i64 %92
  %94 = load i32, ptr %93, align 4, !tbaa !9
  %95 = add nsw i32 %89, %94
  br label %98

96:                                               ; preds = %77
  %97 = load i32, ptr %11, align 4, !tbaa !9
  br label %98

98:                                               ; preds = %96, %88
  %99 = phi i32 [ %95, %88 ], [ %97, %96 ]
  store i32 %99, ptr %10, align 4, !tbaa !9
  %100 = load i32, ptr %10, align 4, !tbaa !9
  %101 = load ptr, ptr %5, align 8, !tbaa !5
  %102 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %101, i32 0, i32 27
  %103 = load i32, ptr %102, align 4, !tbaa !17
  %104 = shl i32 %100, %103
  %105 = trunc i32 %104 to i16
  %106 = load ptr, ptr %13, align 8, !tbaa !5
  %107 = load i32, ptr %9, align 4, !tbaa !9
  %108 = sext i32 %107 to i64
  %109 = getelementptr inbounds [64 x i32], ptr @_ZN4jpgdL5g_ZAGE, i64 0, i64 %108
  %110 = load i32, ptr %109, align 4, !tbaa !9
  %111 = sext i32 %110 to i64
  %112 = getelementptr inbounds i16, ptr %106, i64 %111
  store i16 %105, ptr %112, align 2, !tbaa !18
  br label %144

113:                                              ; preds = %55
  %114 = load i32, ptr %11, align 4, !tbaa !9
  %115 = icmp eq i32 %114, 15
  br i1 %115, label %116, label %123

116:                                              ; preds = %113
  %117 = load i32, ptr %9, align 4, !tbaa !9
  %118 = add nsw i32 %117, 15
  store i32 %118, ptr %9, align 4, !tbaa !9
  %119 = icmp sgt i32 %118, 63
  br i1 %119, label %120, label %122

120:                                              ; preds = %116
  %121 = load ptr, ptr %5, align 8, !tbaa !5
  call void @_ZN4jpgd12jpeg_decoder13stop_decodingENS_11jpgd_statusE(ptr noundef nonnull align 8 dereferenceable(13523) %121, i32 noundef -230) #5
  unreachable

122:                                              ; preds = %116
  br label %143

123:                                              ; preds = %113
  %124 = load i32, ptr %11, align 4, !tbaa !9
  %125 = shl i32 1, %124
  %126 = load ptr, ptr %5, align 8, !tbaa !5
  %127 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %126, i32 0, i32 46
  store i32 %125, ptr %127, align 8, !tbaa !11
  %128 = load i32, ptr %11, align 4, !tbaa !9
  %129 = icmp ne i32 %128, 0
  br i1 %129, label %130, label %138

130:                                              ; preds = %123
  %131 = load ptr, ptr %5, align 8, !tbaa !5
  %132 = load i32, ptr %11, align 4, !tbaa !9
  %133 = call noundef i32 @_ZN4jpgd12jpeg_decoder19get_bits_no_markersEi(ptr noundef nonnull align 8 dereferenceable(13523) %131, i32 noundef %132)
  %134 = load ptr, ptr %5, align 8, !tbaa !5
  %135 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %134, i32 0, i32 46
  %136 = load i32, ptr %135, align 8, !tbaa !11
  %137 = add i32 %136, %133
  store i32 %137, ptr %135, align 8, !tbaa !11
  br label %138

138:                                              ; preds = %130, %123
  %139 = load ptr, ptr %5, align 8, !tbaa !5
  %140 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %139, i32 0, i32 46
  %141 = load i32, ptr %140, align 8, !tbaa !11
  %142 = add nsw i32 %141, -1
  store i32 %142, ptr %140, align 8, !tbaa !11
  store i32 2, ptr %12, align 4
  br label %145

143:                                              ; preds = %122
  br label %144

144:                                              ; preds = %143, %98
  store i32 0, ptr %12, align 4
  br label %145

145:                                              ; preds = %144, %138
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #4
  %146 = load i32, ptr %12, align 4
  switch i32 %146, label %155 [
    i32 0, label %147
    i32 2, label %151
  ]

147:                                              ; preds = %145
  br label %148

148:                                              ; preds = %147
  %149 = load i32, ptr %9, align 4, !tbaa !9
  %150 = add nsw i32 %149, 1
  store i32 %150, ptr %9, align 4, !tbaa !9
  br label %38, !llvm.loop !20

151:                                              ; preds = %145, %38
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #4
  store i32 0, ptr %12, align 4
  br label %152

152:                                              ; preds = %151, %19
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  %153 = load i32, ptr %12, align 4
  switch i32 %153, label %155 [
    i32 0, label %154
    i32 1, label %154
  ]

154:                                              ; preds = %152, %152
  ret void

155:                                              ; preds = %152, %145
  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 = { 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 800}
!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 564}
!16 = !{!12, !10, i64 568}
!17 = !{!12, !10, i64 572}
!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(13523), 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(13523), i32 noundef) local_unnamed_addr #1 align 2

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef i32 @_ZN4jpgd12jpeg_decoder11huff_decodeEPNS0_11huff_tablesE(ptr noundef nonnull align 8 dereferenceable(13523), 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 #2 align 2 {
  %5 = getelementptr inbounds i8, ptr %0, i64 800
  %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 768
  %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(13523) %0, ptr noundef %11, i32 noundef %2, i32 noundef %3)
  %13 = getelementptr inbounds i8, ptr %0, i64 564
  %14 = load i32, ptr %13, align 4, !tbaa !14
  %15 = getelementptr inbounds i8, ptr %0, i64 568
  %16 = load i32, ptr %15, align 8, !tbaa !15
  %.not5466 = icmp sgt i32 %14, %16
  br i1 %.not5466, label %.loopexit, label %.lr.ph

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

21:                                               ; preds = %.lr.ph, %68
  %.067 = phi i32 [ %14, %.lr.ph ], [ %69, %68 ]
  %22 = load i32, ptr %18, align 4, !tbaa !16
  %23 = icmp ugt i32 %22, 7
  br i1 %23, label %24, label %25

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

25:                                               ; preds = %21
  %26 = zext nneg i32 %22 to i64
  %27 = getelementptr inbounds [8 x ptr], ptr %19, i64 0, i64 %26
  %28 = load ptr, ptr %27, align 8, !tbaa !13
  %29 = tail call noundef i32 @_ZN4jpgd12jpeg_decoder11huff_decodeEPNS0_11huff_tablesE(ptr noundef nonnull align 8 dereferenceable(13523) %0, ptr noundef %28)
  %30 = ashr i32 %29, 4
  %31 = and i32 %29, 15
  %.not55 = icmp eq i32 %31, 0
  br i1 %.not55, label %56, label %32

32:                                               ; preds = %25
  %33 = add nsw i32 %30, %.067
  %34 = icmp sgt i32 %33, 63
  br i1 %34, label %35, label %36

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

36:                                               ; preds = %32
  %37 = tail call noundef i32 @_ZN4jpgd12jpeg_decoder19get_bits_no_markersEi(ptr noundef nonnull align 8 dereferenceable(13523) %0, i32 noundef %31)
  %38 = zext nneg i32 %31 to i64
  %39 = getelementptr inbounds [16 x i32], ptr @_ZN4jpgdL13s_extend_testE, i64 0, i64 %38
  %40 = load i32, ptr %39, align 4, !tbaa !16
  %41 = icmp slt i32 %37, %40
  br i1 %41, label %42, label %46

42:                                               ; preds = %36
  %43 = getelementptr inbounds [16 x i32], ptr @_ZN4jpgdL15s_extend_offsetE, i64 0, i64 %38
  %44 = load i32, ptr %43, align 4, !tbaa !16
  %45 = add nsw i32 %44, %37
  br label %46

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

56:                                               ; preds = %25
  %57 = icmp eq i32 %30, 15
  br i1 %57, label %58, label %62

58:                                               ; preds = %56
  %59 = add nsw i32 %.067, 15
  %60 = icmp sgt i32 %.067, 48
  br i1 %60, label %61, label %68

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

62:                                               ; preds = %56
  %63 = shl nuw i32 1, %30
  store i32 %63, ptr %5, align 8, !tbaa !5
  %.not56 = icmp ult i32 %29, 16
  br i1 %.not56, label %.loopexit.sink.split, label %64

64:                                               ; preds = %62
  %65 = tail call noundef i32 @_ZN4jpgd12jpeg_decoder19get_bits_no_markersEi(ptr noundef nonnull align 8 dereferenceable(13523) %0, i32 noundef %30)
  %66 = load i32, ptr %5, align 8, !tbaa !5
  %67 = add i32 %66, %65
  br label %.loopexit.sink.split

68:                                               ; preds = %58, %46
  %.2.ph = phi i32 [ %59, %58 ], [ %33, %46 ]
  %69 = add nsw i32 %.2.ph, 1
  %70 = load i32, ptr %15, align 8, !tbaa !15
  %.not54.not = icmp slt i32 %.2.ph, %70
  br i1 %.not54.not, label %21, label %.loopexit, !llvm.loop !20

.loopexit.sink.split:                             ; preds = %64, %62, %4
  %.sink82 = phi i32 [ %6, %4 ], [ %63, %62 ], [ %67, %64 ]
  %71 = add nsw i32 %.sink82, -1
  store i32 %71, ptr %5, align 8, !tbaa !5
  br label %.loopexit

.loopexit:                                        ; preds = %68, %.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 = { 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 800}
!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 = !{!10, !10, i64 0}
!14 = !{!6, !9, i64 564}
!15 = !{!6, !9, i64 568}
!16 = !{!9, !9, i64 0}
!17 = !{!6, !9, i64 572}
!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