; LLVM IR from facebookresearch/habitat-sim :: src/deps/basis-universal/encoder/jpgd.ll (ZN4jpgd12jpeg_decoder17check_huff_tablesEv)

; 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: mustprogress uwtable
declare dso_local noundef ptr @_ZN4jpgd12jpeg_decoder5allocEmb(ptr noundef nonnull align 8 dereferenceable(13523), i64 noundef, i1 noundef zeroext) #2 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4jpgd12jpeg_decoder17check_huff_tablesEv(ptr noundef nonnull align 8 dereferenceable(13523) %0) #2 align 2 {
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  %5 = load ptr, ptr %2, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #3
  store i32 0, ptr %3, align 4, !tbaa !9
  br label %6

6:                                                ; preds = %53, %1
  %7 = load i32, ptr %3, align 4, !tbaa !9
  %8 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %5, i32 0, i32 21
  %9 = load i32, ptr %8, align 8, !tbaa !11
  %10 = icmp slt i32 %7, %9
  br i1 %10, label %12, label %11

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

12:                                               ; preds = %6
  %13 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %5, i32 0, i32 25
  %14 = load i32, ptr %13, align 4, !tbaa !15
  %15 = icmp eq i32 %14, 0
  br i1 %15, label %16, label %32

16:                                               ; preds = %12
  %17 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %5, i32 0, i32 10
  %18 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %5, i32 0, i32 23
  %19 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %5, i32 0, i32 22
  %20 = load i32, ptr %3, align 4, !tbaa !9
  %21 = sext i32 %20 to i64
  %22 = getelementptr inbounds [4 x i32], ptr %19, i64 0, i64 %21
  %23 = load i32, ptr %22, align 4, !tbaa !9
  %24 = sext i32 %23 to i64
  %25 = getelementptr inbounds [4 x i32], ptr %18, i64 0, i64 %24
  %26 = load i32, ptr %25, align 4, !tbaa !9
  %27 = sext i32 %26 to i64
  %28 = getelementptr inbounds [8 x ptr], ptr %17, i64 0, i64 %27
  %29 = load ptr, ptr %28, align 8, !tbaa !5
  %30 = icmp eq ptr %29, null
  br i1 %30, label %31, label %32

31:                                               ; preds = %16
  call void @_ZN4jpgd12jpeg_decoder13stop_decodingENS_11jpgd_statusE(ptr noundef nonnull align 8 dereferenceable(13523) %5, i32 noundef -234) #4
  unreachable

32:                                               ; preds = %16, %12
  %33 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %5, i32 0, i32 26
  %34 = load i32, ptr %33, align 8, !tbaa !16
  %35 = icmp sgt i32 %34, 0
  br i1 %35, label %36, label %52

36:                                               ; preds = %32
  %37 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %5, i32 0, i32 10
  %38 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %5, i32 0, i32 24
  %39 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %5, i32 0, i32 22
  %40 = load i32, ptr %3, align 4, !tbaa !9
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds [4 x i32], ptr %39, i64 0, i64 %41
  %43 = load i32, ptr %42, align 4, !tbaa !9
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds [4 x i32], ptr %38, i64 0, i64 %44
  %46 = load i32, ptr %45, align 4, !tbaa !9
  %47 = sext i32 %46 to i64
  %48 = getelementptr inbounds [8 x ptr], ptr %37, i64 0, i64 %47
  %49 = load ptr, ptr %48, align 8, !tbaa !5
  %50 = icmp eq ptr %49, null
  br i1 %50, label %51, label %52

51:                                               ; preds = %36
  call void @_ZN4jpgd12jpeg_decoder13stop_decodingENS_11jpgd_statusE(ptr noundef nonnull align 8 dereferenceable(13523) %5, i32 noundef -234) #4
  unreachable

52:                                               ; preds = %36, %32
  br label %53

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

56:                                               ; preds = %11
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #3
  store i32 0, ptr %4, align 4, !tbaa !9
  br label %57

57:                                               ; preds = %89, %56
  %58 = load i32, ptr %4, align 4, !tbaa !9
  %59 = icmp slt i32 %58, 8
  br i1 %59, label %61, label %60

60:                                               ; preds = %57
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #3
  br label %92

61:                                               ; preds = %57
  %62 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %5, i32 0, i32 10
  %63 = load i32, ptr %4, align 4, !tbaa !9
  %64 = sext i32 %63 to i64
  %65 = getelementptr inbounds [8 x ptr], ptr %62, i64 0, i64 %64
  %66 = load ptr, ptr %65, align 8, !tbaa !5
  %67 = icmp ne ptr %66, null
  br i1 %67, label %68, label %88

68:                                               ; preds = %61
  %69 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %5, i32 0, i32 43
  %70 = load i32, ptr %4, align 4, !tbaa !9
  %71 = sext i32 %70 to i64
  %72 = getelementptr inbounds [8 x ptr], ptr %69, i64 0, i64 %71
  %73 = load ptr, ptr %72, align 8, !tbaa !5
  %74 = icmp ne ptr %73, null
  br i1 %74, label %81, label %75

75:                                               ; preds = %68
  %76 = call noundef ptr @_ZN4jpgd12jpeg_decoder5allocEmb(ptr noundef nonnull align 8 dereferenceable(13523) %5, i64 noundef 4356, i1 noundef zeroext false)
  %77 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %5, i32 0, i32 43
  %78 = load i32, ptr %4, align 4, !tbaa !9
  %79 = sext i32 %78 to i64
  %80 = getelementptr inbounds [8 x ptr], ptr %77, i64 0, i64 %79
  store ptr %76, ptr %80, align 8, !tbaa !5
  br label %81

81:                                               ; preds = %75, %68
  %82 = load i32, ptr %4, align 4, !tbaa !9
  %83 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %5, i32 0, i32 43
  %84 = load i32, ptr %4, align 4, !tbaa !9
  %85 = sext i32 %84 to i64
  %86 = getelementptr inbounds [8 x ptr], ptr %83, i64 0, i64 %85
  %87 = load ptr, ptr %86, align 8, !tbaa !5
  call void @_ZN4jpgd12jpeg_decoder15make_huff_tableEiPNS0_11huff_tablesE(ptr noundef nonnull align 8 dereferenceable(13523) %5, i32 noundef %82, ptr noundef %87)
  br label %88

88:                                               ; preds = %81, %61
  br label %89

89:                                               ; preds = %88
  %90 = load i32, ptr %4, align 4, !tbaa !9
  %91 = add nsw i32 %90, 1
  store i32 %91, ptr %4, align 4, !tbaa !9
  br label %57, !llvm.loop !19

92:                                               ; preds = %60
  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 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }
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, !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 564}
!16 = !{!12, !10, i64 568}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}
!19 = distinct !{!19, !18}


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

; Function Attrs: mustprogress 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: mustprogress uwtable
declare dso_local noundef ptr @_ZN4jpgd12jpeg_decoder5allocEmb(ptr noundef nonnull align 8 dereferenceable(13523), i64 noundef, i1 noundef zeroext) local_unnamed_addr #1 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4jpgd12jpeg_decoder17check_huff_tablesEv(ptr noundef nonnull align 8 dereferenceable(13523) %0) local_unnamed_addr #1 align 2 {
  %2 = getelementptr inbounds i8, ptr %0, i64 512
  %3 = load i32, ptr %2, align 8, !tbaa !5
  %4 = icmp sgt i32 %3, 0
  br i1 %4, label %.lr.ph, label %.preheader

.lr.ph:                                           ; preds = %1
  %5 = getelementptr inbounds i8, ptr %0, i64 564
  %6 = load i32, ptr %5, align 4, !tbaa !13
  %7 = icmp eq i32 %6, 0
  %8 = getelementptr inbounds i8, ptr %0, i64 248
  %9 = getelementptr inbounds i8, ptr %0, i64 532
  %10 = getelementptr inbounds i8, ptr %0, i64 516
  %11 = getelementptr inbounds i8, ptr %0, i64 568
  %12 = load i32, ptr %11, align 8
  %.fr18 = freeze i32 %12
  %13 = icmp sgt i32 %.fr18, 0
  %14 = getelementptr inbounds i8, ptr %0, i64 548
  br i1 %7, label %.lr.ph.split.us, label %.lr.ph.split

.lr.ph.split.us:                                  ; preds = %.lr.ph
  %wide.trip.count33 = zext nneg i32 %3 to i64
  br i1 %13, label %.lr.ph.split.us.split.us, label %.lr.ph.split.us.split

.lr.ph.split.us.split.us:                         ; preds = %.lr.ph.split.us, %31
  %indvars.iv30 = phi i64 [ %indvars.iv.next31, %31 ], [ 0, %.lr.ph.split.us ]
  %15 = getelementptr inbounds [4 x i32], ptr %10, i64 0, i64 %indvars.iv30
  %16 = load i32, ptr %15, align 4, !tbaa !14
  %17 = sext i32 %16 to i64
  %18 = getelementptr inbounds [4 x i32], ptr %9, i64 0, i64 %17
  %19 = load i32, ptr %18, align 4, !tbaa !14
  %20 = sext i32 %19 to i64
  %21 = getelementptr inbounds [8 x ptr], ptr %8, i64 0, i64 %20
  %22 = load ptr, ptr %21, align 8, !tbaa !15
  %23 = icmp eq ptr %22, null
  br i1 %23, label %.split.us, label %24

24:                                               ; preds = %.lr.ph.split.us.split.us
  %25 = getelementptr inbounds [4 x i32], ptr %14, i64 0, i64 %17
  %26 = load i32, ptr %25, align 4, !tbaa !14
  %27 = sext i32 %26 to i64
  %28 = getelementptr inbounds [8 x ptr], ptr %8, i64 0, i64 %27
  %29 = load ptr, ptr %28, align 8, !tbaa !15
  %30 = icmp eq ptr %29, null
  br i1 %30, label %.split15.us, label %31

31:                                               ; preds = %24
  %indvars.iv.next31 = add nuw nsw i64 %indvars.iv30, 1
  %exitcond34.not = icmp eq i64 %indvars.iv.next31, %wide.trip.count33
  br i1 %exitcond34.not, label %.preheader, label %.lr.ph.split.us.split.us, !llvm.loop !16

.lr.ph.split.us.split:                            ; preds = %.lr.ph.split.us, %41
  %indvars.iv25 = phi i64 [ %indvars.iv.next26, %41 ], [ 0, %.lr.ph.split.us ]
  %32 = getelementptr inbounds [4 x i32], ptr %10, i64 0, i64 %indvars.iv25
  %33 = load i32, ptr %32, align 4, !tbaa !14
  %34 = sext i32 %33 to i64
  %35 = getelementptr inbounds [4 x i32], ptr %9, i64 0, i64 %34
  %36 = load i32, ptr %35, align 4, !tbaa !14
  %37 = sext i32 %36 to i64
  %38 = getelementptr inbounds [8 x ptr], ptr %8, i64 0, i64 %37
  %39 = load ptr, ptr %38, align 8, !tbaa !15
  %40 = icmp eq ptr %39, null
  br i1 %40, label %.split.us, label %41

41:                                               ; preds = %.lr.ph.split.us.split
  %indvars.iv.next26 = add nuw nsw i64 %indvars.iv25, 1
  %exitcond29.not = icmp eq i64 %indvars.iv.next26, %wide.trip.count33
  br i1 %exitcond29.not, label %.preheader, label %.lr.ph.split.us.split, !llvm.loop !16

.lr.ph.split:                                     ; preds = %.lr.ph
  br i1 %13, label %.lr.ph.split.split.us.preheader, label %.preheader

.lr.ph.split.split.us.preheader:                  ; preds = %.lr.ph.split
  %wide.trip.count = zext nneg i32 %3 to i64
  br label %.lr.ph.split.split.us

.lr.ph.split.split.us:                            ; preds = %.lr.ph.split.split.us.preheader, %51
  %indvars.iv = phi i64 [ 0, %.lr.ph.split.split.us.preheader ], [ %indvars.iv.next, %51 ]
  %42 = getelementptr inbounds [4 x i32], ptr %10, i64 0, i64 %indvars.iv
  %43 = load i32, ptr %42, align 4, !tbaa !14
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds [4 x i32], ptr %14, i64 0, i64 %44
  %46 = load i32, ptr %45, align 4, !tbaa !14
  %47 = sext i32 %46 to i64
  %48 = getelementptr inbounds [8 x ptr], ptr %8, i64 0, i64 %47
  %49 = load ptr, ptr %48, align 8, !tbaa !15
  %50 = icmp eq ptr %49, null
  br i1 %50, label %.split15.us, label %51

51:                                               ; preds = %.lr.ph.split.split.us
  %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 %.preheader, label %.lr.ph.split.split.us, !llvm.loop !16

.preheader:                                       ; preds = %51, %41, %31, %.lr.ph.split, %1
  %52 = getelementptr inbounds i8, ptr %0, i64 248
  %53 = getelementptr inbounds i8, ptr %0, i64 672
  %54 = load ptr, ptr %52, align 8, !tbaa !15
  %.not = icmp eq ptr %54, null
  br i1 %.not, label %61, label %55

.split.us:                                        ; preds = %.lr.ph.split.us.split, %.lr.ph.split.us.split.us
  tail call void @_ZN4jpgd12jpeg_decoder13stop_decodingENS_11jpgd_statusE(ptr noundef nonnull align 8 dereferenceable(13523) %0, i32 noundef -234) #2
  unreachable

.split15.us:                                      ; preds = %.lr.ph.split.split.us, %24
  tail call void @_ZN4jpgd12jpeg_decoder13stop_decodingENS_11jpgd_statusE(ptr noundef nonnull align 8 dereferenceable(13523) %0, i32 noundef -234) #2
  unreachable

55:                                               ; preds = %.preheader
  %56 = load ptr, ptr %53, align 8, !tbaa !15
  %.not12 = icmp eq ptr %56, null
  br i1 %.not12, label %57, label %59

57:                                               ; preds = %55
  %58 = tail call noundef ptr @_ZN4jpgd12jpeg_decoder5allocEmb(ptr noundef nonnull align 8 dereferenceable(13523) %0, i64 noundef 4356, i1 noundef zeroext false)
  store ptr %58, ptr %53, align 8, !tbaa !15
  br label %59

59:                                               ; preds = %57, %55
  %60 = phi ptr [ %58, %57 ], [ %56, %55 ]
  tail call void @_ZN4jpgd12jpeg_decoder15make_huff_tableEiPNS0_11huff_tablesE(ptr noundef nonnull align 8 dereferenceable(13523) %0, i32 noundef 0, ptr noundef %60)
  br label %61

61:                                               ; preds = %.preheader, %59
  %62 = getelementptr inbounds i8, ptr %0, i64 256
  %63 = load ptr, ptr %62, align 8, !tbaa !15
  %.not.1 = icmp eq ptr %63, null
  br i1 %.not.1, label %71, label %64

64:                                               ; preds = %61
  %65 = getelementptr inbounds i8, ptr %0, i64 680
  %66 = load ptr, ptr %65, align 8, !tbaa !15
  %.not12.1 = icmp eq ptr %66, null
  br i1 %.not12.1, label %67, label %69

67:                                               ; preds = %64
  %68 = tail call noundef ptr @_ZN4jpgd12jpeg_decoder5allocEmb(ptr noundef nonnull align 8 dereferenceable(13523) %0, i64 noundef 4356, i1 noundef zeroext false)
  store ptr %68, ptr %65, align 8, !tbaa !15
  br label %69

69:                                               ; preds = %67, %64
  %70 = phi ptr [ %68, %67 ], [ %66, %64 ]
  tail call void @_ZN4jpgd12jpeg_decoder15make_huff_tableEiPNS0_11huff_tablesE(ptr noundef nonnull align 8 dereferenceable(13523) %0, i32 noundef 1, ptr noundef %70)
  br label %71

71:                                               ; preds = %69, %61
  %72 = getelementptr inbounds i8, ptr %0, i64 264
  %73 = load ptr, ptr %72, align 8, !tbaa !15
  %.not.2 = icmp eq ptr %73, null
  br i1 %.not.2, label %81, label %74

74:                                               ; preds = %71
  %75 = getelementptr inbounds i8, ptr %0, i64 688
  %76 = load ptr, ptr %75, align 8, !tbaa !15
  %.not12.2 = icmp eq ptr %76, null
  br i1 %.not12.2, label %77, label %79

77:                                               ; preds = %74
  %78 = tail call noundef ptr @_ZN4jpgd12jpeg_decoder5allocEmb(ptr noundef nonnull align 8 dereferenceable(13523) %0, i64 noundef 4356, i1 noundef zeroext false)
  store ptr %78, ptr %75, align 8, !tbaa !15
  br label %79

79:                                               ; preds = %77, %74
  %80 = phi ptr [ %78, %77 ], [ %76, %74 ]
  tail call void @_ZN4jpgd12jpeg_decoder15make_huff_tableEiPNS0_11huff_tablesE(ptr noundef nonnull align 8 dereferenceable(13523) %0, i32 noundef 2, ptr noundef %80)
  br label %81

81:                                               ; preds = %79, %71
  %82 = getelementptr inbounds i8, ptr %0, i64 272
  %83 = load ptr, ptr %82, align 8, !tbaa !15
  %.not.3 = icmp eq ptr %83, null
  br i1 %.not.3, label %91, label %84

84:                                               ; preds = %81
  %85 = getelementptr inbounds i8, ptr %0, i64 696
  %86 = load ptr, ptr %85, align 8, !tbaa !15
  %.not12.3 = icmp eq ptr %86, null
  br i1 %.not12.3, label %87, label %89

87:                                               ; preds = %84
  %88 = tail call noundef ptr @_ZN4jpgd12jpeg_decoder5allocEmb(ptr noundef nonnull align 8 dereferenceable(13523) %0, i64 noundef 4356, i1 noundef zeroext false)
  store ptr %88, ptr %85, align 8, !tbaa !15
  br label %89

89:                                               ; preds = %87, %84
  %90 = phi ptr [ %88, %87 ], [ %86, %84 ]
  tail call void @_ZN4jpgd12jpeg_decoder15make_huff_tableEiPNS0_11huff_tablesE(ptr noundef nonnull align 8 dereferenceable(13523) %0, i32 noundef 3, ptr noundef %90)
  br label %91

91:                                               ; preds = %89, %81
  %92 = getelementptr inbounds i8, ptr %0, i64 280
  %93 = load ptr, ptr %92, align 8, !tbaa !15
  %.not.4 = icmp eq ptr %93, null
  br i1 %.not.4, label %101, label %94

94:                                               ; preds = %91
  %95 = getelementptr inbounds i8, ptr %0, i64 704
  %96 = load ptr, ptr %95, align 8, !tbaa !15
  %.not12.4 = icmp eq ptr %96, null
  br i1 %.not12.4, label %97, label %99

97:                                               ; preds = %94
  %98 = tail call noundef ptr @_ZN4jpgd12jpeg_decoder5allocEmb(ptr noundef nonnull align 8 dereferenceable(13523) %0, i64 noundef 4356, i1 noundef zeroext false)
  store ptr %98, ptr %95, align 8, !tbaa !15
  br label %99

99:                                               ; preds = %97, %94
  %100 = phi ptr [ %98, %97 ], [ %96, %94 ]
  tail call void @_ZN4jpgd12jpeg_decoder15make_huff_tableEiPNS0_11huff_tablesE(ptr noundef nonnull align 8 dereferenceable(13523) %0, i32 noundef 4, ptr noundef %100)
  br label %101

101:                                              ; preds = %99, %91
  %102 = getelementptr inbounds i8, ptr %0, i64 288
  %103 = load ptr, ptr %102, align 8, !tbaa !15
  %.not.5 = icmp eq ptr %103, null
  br i1 %.not.5, label %111, label %104

104:                                              ; preds = %101
  %105 = getelementptr inbounds i8, ptr %0, i64 712
  %106 = load ptr, ptr %105, align 8, !tbaa !15
  %.not12.5 = icmp eq ptr %106, null
  br i1 %.not12.5, label %107, label %109

107:                                              ; preds = %104
  %108 = tail call noundef ptr @_ZN4jpgd12jpeg_decoder5allocEmb(ptr noundef nonnull align 8 dereferenceable(13523) %0, i64 noundef 4356, i1 noundef zeroext false)
  store ptr %108, ptr %105, align 8, !tbaa !15
  br label %109

109:                                              ; preds = %107, %104
  %110 = phi ptr [ %108, %107 ], [ %106, %104 ]
  tail call void @_ZN4jpgd12jpeg_decoder15make_huff_tableEiPNS0_11huff_tablesE(ptr noundef nonnull align 8 dereferenceable(13523) %0, i32 noundef 5, ptr noundef %110)
  br label %111

111:                                              ; preds = %109, %101
  %112 = getelementptr inbounds i8, ptr %0, i64 296
  %113 = load ptr, ptr %112, align 8, !tbaa !15
  %.not.6 = icmp eq ptr %113, null
  br i1 %.not.6, label %121, label %114

114:                                              ; preds = %111
  %115 = getelementptr inbounds i8, ptr %0, i64 720
  %116 = load ptr, ptr %115, align 8, !tbaa !15
  %.not12.6 = icmp eq ptr %116, null
  br i1 %.not12.6, label %117, label %119

117:                                              ; preds = %114
  %118 = tail call noundef ptr @_ZN4jpgd12jpeg_decoder5allocEmb(ptr noundef nonnull align 8 dereferenceable(13523) %0, i64 noundef 4356, i1 noundef zeroext false)
  store ptr %118, ptr %115, align 8, !tbaa !15
  br label %119

119:                                              ; preds = %117, %114
  %120 = phi ptr [ %118, %117 ], [ %116, %114 ]
  tail call void @_ZN4jpgd12jpeg_decoder15make_huff_tableEiPNS0_11huff_tablesE(ptr noundef nonnull align 8 dereferenceable(13523) %0, i32 noundef 6, ptr noundef %120)
  br label %121

121:                                              ; preds = %119, %111
  %122 = getelementptr inbounds i8, ptr %0, i64 304
  %123 = load ptr, ptr %122, align 8, !tbaa !15
  %.not.7 = icmp eq ptr %123, null
  br i1 %.not.7, label %131, label %124

124:                                              ; preds = %121
  %125 = getelementptr inbounds i8, ptr %0, i64 728
  %126 = load ptr, ptr %125, align 8, !tbaa !15
  %.not12.7 = icmp eq ptr %126, null
  br i1 %.not12.7, label %127, label %129

127:                                              ; preds = %124
  %128 = tail call noundef ptr @_ZN4jpgd12jpeg_decoder5allocEmb(ptr noundef nonnull align 8 dereferenceable(13523) %0, i64 noundef 4356, i1 noundef zeroext false)
  store ptr %128, ptr %125, align 8, !tbaa !15
  br label %129

129:                                              ; preds = %127, %124
  %130 = phi ptr [ %128, %127 ], [ %126, %124 ]
  tail call void @_ZN4jpgd12jpeg_decoder15make_huff_tableEiPNS0_11huff_tablesE(ptr noundef nonnull align 8 dereferenceable(13523) %0, i32 noundef 7, ptr noundef %130)
  br label %131

131:                                              ; preds = %129, %121
  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 = { 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 = { 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 = !{!6, !9, i64 564}
!14 = !{!9, !9, i64 0}
!15 = !{!10, !10, i64 0}
!16 = distinct !{!16, !17}
!17 = !{!"llvm.loop.mustprogress"}


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