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

; 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 uwtable
define dso_local void @_ZN4jpgd12jpeg_decoder11H1V1ConvertEv(ptr noundef nonnull align 8 dereferenceable(13523) %0) #1 align 2 {
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %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
  store ptr %0, ptr %2, align 8, !tbaa !5
  %12 = load ptr, ptr %2, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #3
  %13 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %12, i32 0, i32 30
  %14 = load i32, ptr %13, align 8, !tbaa !9
  %15 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %12, i32 0, i32 37
  %16 = load i32, ptr %15, align 8, !tbaa !14
  %17 = sub nsw i32 %14, %16
  store i32 %17, ptr %3, align 4, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #3
  %18 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %12, i32 0, i32 72
  %19 = load ptr, ptr %18, align 8, !tbaa !16
  store ptr %19, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #3
  %20 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %12, i32 0, i32 66
  %21 = load ptr, ptr %20, align 8, !tbaa !17
  %22 = load i32, ptr %3, align 4, !tbaa !15
  %23 = mul nsw i32 %22, 8
  %24 = sext i32 %23 to i64
  %25 = getelementptr inbounds i8, ptr %21, i64 %24
  store ptr %25, ptr %5, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #3
  %26 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %12, i32 0, i32 60
  %27 = load i32, ptr %26, align 4, !tbaa !18
  store i32 %27, ptr %6, align 4, !tbaa !15
  br label %28

28:                                               ; preds = %105, %1
  %29 = load i32, ptr %6, align 4, !tbaa !15
  %30 = icmp sgt i32 %29, 0
  br i1 %30, label %32, label %31

31:                                               ; preds = %28
  store i32 2, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #3
  br label %108

32:                                               ; preds = %28
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #3
  store i32 0, ptr %8, align 4, !tbaa !15
  br label %33

33:                                               ; preds = %99, %32
  %34 = load i32, ptr %8, align 4, !tbaa !15
  %35 = icmp slt i32 %34, 8
  br i1 %35, label %37, label %36

36:                                               ; preds = %33
  store i32 5, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #3
  br label %102

37:                                               ; preds = %33
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #3
  %38 = load ptr, ptr %5, align 8, !tbaa !5
  %39 = load i32, ptr %8, align 4, !tbaa !15
  %40 = sext i32 %39 to i64
  %41 = getelementptr inbounds i8, ptr %38, i64 %40
  %42 = load i8, ptr %41, align 1, !tbaa !19
  %43 = zext i8 %42 to i32
  store i32 %43, ptr %9, align 4, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #3
  %44 = load ptr, ptr %5, align 8, !tbaa !5
  %45 = load i32, ptr %8, align 4, !tbaa !15
  %46 = add nsw i32 64, %45
  %47 = sext i32 %46 to i64
  %48 = getelementptr inbounds i8, ptr %44, i64 %47
  %49 = load i8, ptr %48, align 1, !tbaa !19
  %50 = zext i8 %49 to i32
  store i32 %50, ptr %10, align 4, !tbaa !15
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #3
  %51 = load ptr, ptr %5, align 8, !tbaa !5
  %52 = load i32, ptr %8, align 4, !tbaa !15
  %53 = add nsw i32 128, %52
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds i8, ptr %51, i64 %54
  %56 = load i8, ptr %55, align 1, !tbaa !19
  %57 = zext i8 %56 to i32
  store i32 %57, ptr %11, align 4, !tbaa !15
  %58 = load i32, ptr %9, align 4, !tbaa !15
  %59 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %12, i32 0, i32 68
  %60 = load i32, ptr %11, align 4, !tbaa !15
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds [256 x i32], ptr %59, i64 0, i64 %61
  %63 = load i32, ptr %62, align 4, !tbaa !15
  %64 = add nsw i32 %58, %63
  %65 = call noundef zeroext i8 @_ZN4jpgd12jpeg_decoder5clampEi(i32 noundef %64)
  %66 = load ptr, ptr %4, align 8, !tbaa !5
  %67 = getelementptr inbounds i8, ptr %66, i64 0
  store i8 %65, ptr %67, align 1, !tbaa !19
  %68 = load i32, ptr %9, align 4, !tbaa !15
  %69 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %12, i32 0, i32 70
  %70 = load i32, ptr %11, align 4, !tbaa !15
  %71 = sext i32 %70 to i64
  %72 = getelementptr inbounds [256 x i32], ptr %69, i64 0, i64 %71
  %73 = load i32, ptr %72, align 4, !tbaa !15
  %74 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %12, i32 0, i32 71
  %75 = load i32, ptr %10, align 4, !tbaa !15
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds [256 x i32], ptr %74, i64 0, i64 %76
  %78 = load i32, ptr %77, align 4, !tbaa !15
  %79 = add nsw i32 %73, %78
  %80 = ashr i32 %79, 16
  %81 = add nsw i32 %68, %80
  %82 = call noundef zeroext i8 @_ZN4jpgd12jpeg_decoder5clampEi(i32 noundef %81)
  %83 = load ptr, ptr %4, align 8, !tbaa !5
  %84 = getelementptr inbounds i8, ptr %83, i64 1
  store i8 %82, ptr %84, align 1, !tbaa !19
  %85 = load i32, ptr %9, align 4, !tbaa !15
  %86 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %12, i32 0, i32 69
  %87 = load i32, ptr %10, align 4, !tbaa !15
  %88 = sext i32 %87 to i64
  %89 = getelementptr inbounds [256 x i32], ptr %86, i64 0, i64 %88
  %90 = load i32, ptr %89, align 4, !tbaa !15
  %91 = add nsw i32 %85, %90
  %92 = call noundef zeroext i8 @_ZN4jpgd12jpeg_decoder5clampEi(i32 noundef %91)
  %93 = load ptr, ptr %4, align 8, !tbaa !5
  %94 = getelementptr inbounds i8, ptr %93, i64 2
  store i8 %92, ptr %94, align 1, !tbaa !19
  %95 = load ptr, ptr %4, align 8, !tbaa !5
  %96 = getelementptr inbounds i8, ptr %95, i64 3
  store i8 -1, ptr %96, align 1, !tbaa !19
  %97 = load ptr, ptr %4, align 8, !tbaa !5
  %98 = getelementptr inbounds i8, ptr %97, i64 4
  store ptr %98, ptr %4, align 8, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #3
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #3
  br label %99

99:                                               ; preds = %37
  %100 = load i32, ptr %8, align 4, !tbaa !15
  %101 = add nsw i32 %100, 1
  store i32 %101, ptr %8, align 4, !tbaa !15
  br label %33, !llvm.loop !20

102:                                              ; preds = %36
  %103 = load ptr, ptr %5, align 8, !tbaa !5
  %104 = getelementptr inbounds i8, ptr %103, i64 192
  store ptr %104, ptr %5, align 8, !tbaa !5
  br label %105

105:                                              ; preds = %102
  %106 = load i32, ptr %6, align 4, !tbaa !15
  %107 = add nsw i32 %106, -1
  store i32 %107, ptr %6, align 4, !tbaa !15
  br label %28, !llvm.loop !22

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i8 @_ZN4jpgd12jpeg_decoder5clampEi(i32 noundef) #2 align 2

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

!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, !11, i64 584}
!10 = !{!"_ZTSN4jpgd12jpeg_decoderE", !7, i64 0, !11, i64 200, !6, i64 208, !11, i64 216, !11, i64 220, !6, i64 224, !11, i64 232, !7, i64 236, !7, i64 248, !7, i64 312, !7, i64 376, !11, i64 408, !11, i64 412, !7, i64 416, !7, i64 432, !7, i64 448, !7, i64 464, !7, i64 480, !7, i64 496, !11, i64 512, !7, i64 516, !7, i64 532, !7, i64 548, !11, i64 564, !11, i64 568, !11, i64 572, !11, i64 576, !11, i64 580, !11, i64 584, !11, i64 588, !11, i64 592, !11, i64 596, !11, i64 600, !7, i64 604, !11, i64 644, !11, i64 648, !11, i64 652, !11, i64 656, !11, i64 660, !11, i64 664, !7, i64 672, !7, i64 736, !7, i64 768, !11, i64 800, !7, i64 804, !6, i64 824, !11, i64 832, !11, i64 836, !7, i64 840, !7, i64 904, !7, i64 9224, !11, i64 9288, !11, i64 9292, !11, i64 9296, !11, i64 9300, !11, i64 9304, !11, i64 9308, !11, i64 9312, !11, 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, !12, i64 13512, !11, i64 13516, !13, i64 13520, !13, i64 13521, !13, i64 13522}
!11 = !{!"int", !7, i64 0}
!12 = !{!"_ZTSN4jpgd11jpgd_statusE", !7, i64 0}
!13 = !{!"bool", !7, i64 0}
!14 = !{!10, !11, i64 648}
!15 = !{!11, !11, i64 0}
!16 = !{!10, !6, i64 13496}
!17 = !{!10, !6, i64 9384}
!18 = !{!10, !11, i64 9308}
!19 = !{!7, !7, i64 0}
!20 = distinct !{!20, !21}
!21 = !{!"llvm.loop.mustprogress"}
!22 = distinct !{!22, !21}


; 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 nounwind uwtable
define dso_local void @_ZN4jpgd12jpeg_decoder11H1V1ConvertEv(ptr nocapture noundef nonnull readonly align 8 dereferenceable(13523) %0) local_unnamed_addr #0 align 2 {
  %2 = getelementptr inbounds i8, ptr %0, i64 9308
  %3 = load i32, ptr %2, align 4, !tbaa !5
  %4 = icmp sgt i32 %3, 0
  br i1 %4, label %.preheader.lr.ph, label %._crit_edge

.preheader.lr.ph:                                 ; preds = %1
  %5 = getelementptr inbounds i8, ptr %0, i64 9384
  %6 = load ptr, ptr %5, align 8, !tbaa !13
  %7 = getelementptr inbounds i8, ptr %0, i64 584
  %8 = load i32, ptr %7, align 8, !tbaa !14
  %9 = getelementptr inbounds i8, ptr %0, i64 648
  %10 = load i32, ptr %9, align 8, !tbaa !15
  %11 = sub nsw i32 %8, %10
  %12 = shl nsw i32 %11, 3
  %13 = sext i32 %12 to i64
  %14 = getelementptr inbounds i8, ptr %6, i64 %13
  %15 = getelementptr inbounds i8, ptr %0, i64 13496
  %16 = load ptr, ptr %15, align 8, !tbaa !16
  %17 = getelementptr inbounds i8, ptr %0, i64 9400
  %18 = getelementptr inbounds i8, ptr %0, i64 11448
  %19 = getelementptr inbounds i8, ptr %0, i64 12472
  %20 = getelementptr inbounds i8, ptr %0, i64 10424
  br label %.preheader

.preheader:                                       ; preds = %.preheader.lr.ph, %.preheader
  %.031 = phi ptr [ %16, %.preheader.lr.ph ], [ %251, %.preheader ]
  %.02430 = phi ptr [ %14, %.preheader.lr.ph ], [ %252, %.preheader ]
  %.02529 = phi i32 [ %3, %.preheader.lr.ph ], [ %253, %.preheader ]
  %21 = load i8, ptr %.02430, align 1, !tbaa !17
  %22 = zext i8 %21 to i32
  %23 = getelementptr inbounds i8, ptr %.02430, i64 64
  %24 = load i8, ptr %23, align 1, !tbaa !17
  %25 = getelementptr inbounds i8, ptr %.02430, i64 128
  %26 = load i8, ptr %25, align 1, !tbaa !17
  %27 = zext i8 %26 to i64
  %28 = getelementptr inbounds [256 x i32], ptr %17, i64 0, i64 %27
  %29 = load i32, ptr %28, align 4, !tbaa !18
  %30 = add nsw i32 %29, %22
  %31 = tail call noundef zeroext i8 @_ZN4jpgd12jpeg_decoder5clampEi(i32 noundef %30)
  store i8 %31, ptr %.031, align 1, !tbaa !17
  %32 = getelementptr inbounds [256 x i32], ptr %18, i64 0, i64 %27
  %33 = load i32, ptr %32, align 4, !tbaa !18
  %34 = zext i8 %24 to i64
  %35 = getelementptr inbounds [256 x i32], ptr %19, i64 0, i64 %34
  %36 = load i32, ptr %35, align 4, !tbaa !18
  %37 = add nsw i32 %36, %33
  %38 = ashr i32 %37, 16
  %39 = add nsw i32 %38, %22
  %40 = tail call noundef zeroext i8 @_ZN4jpgd12jpeg_decoder5clampEi(i32 noundef %39)
  %41 = getelementptr inbounds i8, ptr %.031, i64 1
  store i8 %40, ptr %41, align 1, !tbaa !17
  %42 = getelementptr inbounds [256 x i32], ptr %20, i64 0, i64 %34
  %43 = load i32, ptr %42, align 4, !tbaa !18
  %44 = add nsw i32 %43, %22
  %45 = tail call noundef zeroext i8 @_ZN4jpgd12jpeg_decoder5clampEi(i32 noundef %44)
  %46 = getelementptr inbounds i8, ptr %.031, i64 2
  store i8 %45, ptr %46, align 1, !tbaa !17
  %47 = getelementptr inbounds i8, ptr %.031, i64 3
  store i8 -1, ptr %47, align 1, !tbaa !17
  %48 = getelementptr inbounds i8, ptr %.031, i64 4
  %49 = getelementptr inbounds i8, ptr %.02430, i64 1
  %50 = load i8, ptr %49, align 1, !tbaa !17
  %51 = zext i8 %50 to i32
  %52 = getelementptr inbounds i8, ptr %.02430, i64 65
  %53 = load i8, ptr %52, align 1, !tbaa !17
  %54 = getelementptr inbounds i8, ptr %.02430, i64 129
  %55 = load i8, ptr %54, align 1, !tbaa !17
  %56 = zext i8 %55 to i64
  %57 = getelementptr inbounds [256 x i32], ptr %17, i64 0, i64 %56
  %58 = load i32, ptr %57, align 4, !tbaa !18
  %59 = add nsw i32 %58, %51
  %60 = tail call noundef zeroext i8 @_ZN4jpgd12jpeg_decoder5clampEi(i32 noundef %59)
  store i8 %60, ptr %48, align 1, !tbaa !17
  %61 = getelementptr inbounds [256 x i32], ptr %18, i64 0, i64 %56
  %62 = load i32, ptr %61, align 4, !tbaa !18
  %63 = zext i8 %53 to i64
  %64 = getelementptr inbounds [256 x i32], ptr %19, i64 0, i64 %63
  %65 = load i32, ptr %64, align 4, !tbaa !18
  %66 = add nsw i32 %65, %62
  %67 = ashr i32 %66, 16
  %68 = add nsw i32 %67, %51
  %69 = tail call noundef zeroext i8 @_ZN4jpgd12jpeg_decoder5clampEi(i32 noundef %68)
  %70 = getelementptr inbounds i8, ptr %.031, i64 5
  store i8 %69, ptr %70, align 1, !tbaa !17
  %71 = getelementptr inbounds [256 x i32], ptr %20, i64 0, i64 %63
  %72 = load i32, ptr %71, align 4, !tbaa !18
  %73 = add nsw i32 %72, %51
  %74 = tail call noundef zeroext i8 @_ZN4jpgd12jpeg_decoder5clampEi(i32 noundef %73)
  %75 = getelementptr inbounds i8, ptr %.031, i64 6
  store i8 %74, ptr %75, align 1, !tbaa !17
  %76 = getelementptr inbounds i8, ptr %.031, i64 7
  store i8 -1, ptr %76, align 1, !tbaa !17
  %77 = getelementptr inbounds i8, ptr %.031, i64 8
  %78 = getelementptr inbounds i8, ptr %.02430, i64 2
  %79 = load i8, ptr %78, align 1, !tbaa !17
  %80 = zext i8 %79 to i32
  %81 = getelementptr inbounds i8, ptr %.02430, i64 66
  %82 = load i8, ptr %81, align 1, !tbaa !17
  %83 = getelementptr inbounds i8, ptr %.02430, i64 130
  %84 = load i8, ptr %83, align 1, !tbaa !17
  %85 = zext i8 %84 to i64
  %86 = getelementptr inbounds [256 x i32], ptr %17, i64 0, i64 %85
  %87 = load i32, ptr %86, align 4, !tbaa !18
  %88 = add nsw i32 %87, %80
  %89 = tail call noundef zeroext i8 @_ZN4jpgd12jpeg_decoder5clampEi(i32 noundef %88)
  store i8 %89, ptr %77, align 1, !tbaa !17
  %90 = getelementptr inbounds [256 x i32], ptr %18, i64 0, i64 %85
  %91 = load i32, ptr %90, align 4, !tbaa !18
  %92 = zext i8 %82 to i64
  %93 = getelementptr inbounds [256 x i32], ptr %19, i64 0, i64 %92
  %94 = load i32, ptr %93, align 4, !tbaa !18
  %95 = add nsw i32 %94, %91
  %96 = ashr i32 %95, 16
  %97 = add nsw i32 %96, %80
  %98 = tail call noundef zeroext i8 @_ZN4jpgd12jpeg_decoder5clampEi(i32 noundef %97)
  %99 = getelementptr inbounds i8, ptr %.031, i64 9
  store i8 %98, ptr %99, align 1, !tbaa !17
  %100 = getelementptr inbounds [256 x i32], ptr %20, i64 0, i64 %92
  %101 = load i32, ptr %100, align 4, !tbaa !18
  %102 = add nsw i32 %101, %80
  %103 = tail call noundef zeroext i8 @_ZN4jpgd12jpeg_decoder5clampEi(i32 noundef %102)
  %104 = getelementptr inbounds i8, ptr %.031, i64 10
  store i8 %103, ptr %104, align 1, !tbaa !17
  %105 = getelementptr inbounds i8, ptr %.031, i64 11
  store i8 -1, ptr %105, align 1, !tbaa !17
  %106 = getelementptr inbounds i8, ptr %.031, i64 12
  %107 = getelementptr inbounds i8, ptr %.02430, i64 3
  %108 = load i8, ptr %107, align 1, !tbaa !17
  %109 = zext i8 %108 to i32
  %110 = getelementptr inbounds i8, ptr %.02430, i64 67
  %111 = load i8, ptr %110, align 1, !tbaa !17
  %112 = getelementptr inbounds i8, ptr %.02430, i64 131
  %113 = load i8, ptr %112, align 1, !tbaa !17
  %114 = zext i8 %113 to i64
  %115 = getelementptr inbounds [256 x i32], ptr %17, i64 0, i64 %114
  %116 = load i32, ptr %115, align 4, !tbaa !18
  %117 = add nsw i32 %116, %109
  %118 = tail call noundef zeroext i8 @_ZN4jpgd12jpeg_decoder5clampEi(i32 noundef %117)
  store i8 %118, ptr %106, align 1, !tbaa !17
  %119 = getelementptr inbounds [256 x i32], ptr %18, i64 0, i64 %114
  %120 = load i32, ptr %119, align 4, !tbaa !18
  %121 = zext i8 %111 to i64
  %122 = getelementptr inbounds [256 x i32], ptr %19, i64 0, i64 %121
  %123 = load i32, ptr %122, align 4, !tbaa !18
  %124 = add nsw i32 %123, %120
  %125 = ashr i32 %124, 16
  %126 = add nsw i32 %125, %109
  %127 = tail call noundef zeroext i8 @_ZN4jpgd12jpeg_decoder5clampEi(i32 noundef %126)
  %128 = getelementptr inbounds i8, ptr %.031, i64 13
  store i8 %127, ptr %128, align 1, !tbaa !17
  %129 = getelementptr inbounds [256 x i32], ptr %20, i64 0, i64 %121
  %130 = load i32, ptr %129, align 4, !tbaa !18
  %131 = add nsw i32 %130, %109
  %132 = tail call noundef zeroext i8 @_ZN4jpgd12jpeg_decoder5clampEi(i32 noundef %131)
  %133 = getelementptr inbounds i8, ptr %.031, i64 14
  store i8 %132, ptr %133, align 1, !tbaa !17
  %134 = getelementptr inbounds i8, ptr %.031, i64 15
  store i8 -1, ptr %134, align 1, !tbaa !17
  %135 = getelementptr inbounds i8, ptr %.031, i64 16
  %136 = getelementptr inbounds i8, ptr %.02430, i64 4
  %137 = load i8, ptr %136, align 1, !tbaa !17
  %138 = zext i8 %137 to i32
  %139 = getelementptr inbounds i8, ptr %.02430, i64 68
  %140 = load i8, ptr %139, align 1, !tbaa !17
  %141 = getelementptr inbounds i8, ptr %.02430, i64 132
  %142 = load i8, ptr %141, align 1, !tbaa !17
  %143 = zext i8 %142 to i64
  %144 = getelementptr inbounds [256 x i32], ptr %17, i64 0, i64 %143
  %145 = load i32, ptr %144, align 4, !tbaa !18
  %146 = add nsw i32 %145, %138
  %147 = tail call noundef zeroext i8 @_ZN4jpgd12jpeg_decoder5clampEi(i32 noundef %146)
  store i8 %147, ptr %135, align 1, !tbaa !17
  %148 = getelementptr inbounds [256 x i32], ptr %18, i64 0, i64 %143
  %149 = load i32, ptr %148, align 4, !tbaa !18
  %150 = zext i8 %140 to i64
  %151 = getelementptr inbounds [256 x i32], ptr %19, i64 0, i64 %150
  %152 = load i32, ptr %151, align 4, !tbaa !18
  %153 = add nsw i32 %152, %149
  %154 = ashr i32 %153, 16
  %155 = add nsw i32 %154, %138
  %156 = tail call noundef zeroext i8 @_ZN4jpgd12jpeg_decoder5clampEi(i32 noundef %155)
  %157 = getelementptr inbounds i8, ptr %.031, i64 17
  store i8 %156, ptr %157, align 1, !tbaa !17
  %158 = getelementptr inbounds [256 x i32], ptr %20, i64 0, i64 %150
  %159 = load i32, ptr %158, align 4, !tbaa !18
  %160 = add nsw i32 %159, %138
  %161 = tail call noundef zeroext i8 @_ZN4jpgd12jpeg_decoder5clampEi(i32 noundef %160)
  %162 = getelementptr inbounds i8, ptr %.031, i64 18
  store i8 %161, ptr %162, align 1, !tbaa !17
  %163 = getelementptr inbounds i8, ptr %.031, i64 19
  store i8 -1, ptr %163, align 1, !tbaa !17
  %164 = getelementptr inbounds i8, ptr %.031, i64 20
  %165 = getelementptr inbounds i8, ptr %.02430, i64 5
  %166 = load i8, ptr %165, align 1, !tbaa !17
  %167 = zext i8 %166 to i32
  %168 = getelementptr inbounds i8, ptr %.02430, i64 69
  %169 = load i8, ptr %168, align 1, !tbaa !17
  %170 = getelementptr inbounds i8, ptr %.02430, i64 133
  %171 = load i8, ptr %170, align 1, !tbaa !17
  %172 = zext i8 %171 to i64
  %173 = getelementptr inbounds [256 x i32], ptr %17, i64 0, i64 %172
  %174 = load i32, ptr %173, align 4, !tbaa !18
  %175 = add nsw i32 %174, %167
  %176 = tail call noundef zeroext i8 @_ZN4jpgd12jpeg_decoder5clampEi(i32 noundef %175)
  store i8 %176, ptr %164, align 1, !tbaa !17
  %177 = getelementptr inbounds [256 x i32], ptr %18, i64 0, i64 %172
  %178 = load i32, ptr %177, align 4, !tbaa !18
  %179 = zext i8 %169 to i64
  %180 = getelementptr inbounds [256 x i32], ptr %19, i64 0, i64 %179
  %181 = load i32, ptr %180, align 4, !tbaa !18
  %182 = add nsw i32 %181, %178
  %183 = ashr i32 %182, 16
  %184 = add nsw i32 %183, %167
  %185 = tail call noundef zeroext i8 @_ZN4jpgd12jpeg_decoder5clampEi(i32 noundef %184)
  %186 = getelementptr inbounds i8, ptr %.031, i64 21
  store i8 %185, ptr %186, align 1, !tbaa !17
  %187 = getelementptr inbounds [256 x i32], ptr %20, i64 0, i64 %179
  %188 = load i32, ptr %187, align 4, !tbaa !18
  %189 = add nsw i32 %188, %167
  %190 = tail call noundef zeroext i8 @_ZN4jpgd12jpeg_decoder5clampEi(i32 noundef %189)
  %191 = getelementptr inbounds i8, ptr %.031, i64 22
  store i8 %190, ptr %191, align 1, !tbaa !17
  %192 = getelementptr inbounds i8, ptr %.031, i64 23
  store i8 -1, ptr %192, align 1, !tbaa !17
  %193 = getelementptr inbounds i8, ptr %.031, i64 24
  %194 = getelementptr inbounds i8, ptr %.02430, i64 6
  %195 = load i8, ptr %194, align 1, !tbaa !17
  %196 = zext i8 %195 to i32
  %197 = getelementptr inbounds i8, ptr %.02430, i64 70
  %198 = load i8, ptr %197, align 1, !tbaa !17
  %199 = getelementptr inbounds i8, ptr %.02430, i64 134
  %200 = load i8, ptr %199, align 1, !tbaa !17
  %201 = zext i8 %200 to i64
  %202 = getelementptr inbounds [256 x i32], ptr %17, i64 0, i64 %201
  %203 = load i32, ptr %202, align 4, !tbaa !18
  %204 = add nsw i32 %203, %196
  %205 = tail call noundef zeroext i8 @_ZN4jpgd12jpeg_decoder5clampEi(i32 noundef %204)
  store i8 %205, ptr %193, align 1, !tbaa !17
  %206 = getelementptr inbounds [256 x i32], ptr %18, i64 0, i64 %201
  %207 = load i32, ptr %206, align 4, !tbaa !18
  %208 = zext i8 %198 to i64
  %209 = getelementptr inbounds [256 x i32], ptr %19, i64 0, i64 %208
  %210 = load i32, ptr %209, align 4, !tbaa !18
  %211 = add nsw i32 %210, %207
  %212 = ashr i32 %211, 16
  %213 = add nsw i32 %212, %196
  %214 = tail call noundef zeroext i8 @_ZN4jpgd12jpeg_decoder5clampEi(i32 noundef %213)
  %215 = getelementptr inbounds i8, ptr %.031, i64 25
  store i8 %214, ptr %215, align 1, !tbaa !17
  %216 = getelementptr inbounds [256 x i32], ptr %20, i64 0, i64 %208
  %217 = load i32, ptr %216, align 4, !tbaa !18
  %218 = add nsw i32 %217, %196
  %219 = tail call noundef zeroext i8 @_ZN4jpgd12jpeg_decoder5clampEi(i32 noundef %218)
  %220 = getelementptr inbounds i8, ptr %.031, i64 26
  store i8 %219, ptr %220, align 1, !tbaa !17
  %221 = getelementptr inbounds i8, ptr %.031, i64 27
  store i8 -1, ptr %221, align 1, !tbaa !17
  %222 = getelementptr inbounds i8, ptr %.031, i64 28
  %223 = getelementptr inbounds i8, ptr %.02430, i64 7
  %224 = load i8, ptr %223, align 1, !tbaa !17
  %225 = zext i8 %224 to i32
  %226 = getelementptr inbounds i8, ptr %.02430, i64 71
  %227 = load i8, ptr %226, align 1, !tbaa !17
  %228 = getelementptr inbounds i8, ptr %.02430, i64 135
  %229 = load i8, ptr %228, align 1, !tbaa !17
  %230 = zext i8 %229 to i64
  %231 = getelementptr inbounds [256 x i32], ptr %17, i64 0, i64 %230
  %232 = load i32, ptr %231, align 4, !tbaa !18
  %233 = add nsw i32 %232, %225
  %234 = tail call noundef zeroext i8 @_ZN4jpgd12jpeg_decoder5clampEi(i32 noundef %233)
  store i8 %234, ptr %222, align 1, !tbaa !17
  %235 = getelementptr inbounds [256 x i32], ptr %18, i64 0, i64 %230
  %236 = load i32, ptr %235, align 4, !tbaa !18
  %237 = zext i8 %227 to i64
  %238 = getelementptr inbounds [256 x i32], ptr %19, i64 0, i64 %237
  %239 = load i32, ptr %238, align 4, !tbaa !18
  %240 = add nsw i32 %239, %236
  %241 = ashr i32 %240, 16
  %242 = add nsw i32 %241, %225
  %243 = tail call noundef zeroext i8 @_ZN4jpgd12jpeg_decoder5clampEi(i32 noundef %242)
  %244 = getelementptr inbounds i8, ptr %.031, i64 29
  store i8 %243, ptr %244, align 1, !tbaa !17
  %245 = getelementptr inbounds [256 x i32], ptr %20, i64 0, i64 %237
  %246 = load i32, ptr %245, align 4, !tbaa !18
  %247 = add nsw i32 %246, %225
  %248 = tail call noundef zeroext i8 @_ZN4jpgd12jpeg_decoder5clampEi(i32 noundef %247)
  %249 = getelementptr inbounds i8, ptr %.031, i64 30
  store i8 %248, ptr %249, align 1, !tbaa !17
  %250 = getelementptr inbounds i8, ptr %.031, i64 31
  store i8 -1, ptr %250, align 1, !tbaa !17
  %251 = getelementptr inbounds i8, ptr %.031, i64 32
  %252 = getelementptr inbounds i8, ptr %.02430, i64 192
  %253 = add nsw i32 %.02529, -1
  %254 = icmp ugt i32 %.02529, 1
  br i1 %254, label %.preheader, label %._crit_edge, !llvm.loop !19

._crit_edge:                                      ; preds = %.preheader, %1
  ret void
}

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef zeroext i8 @_ZN4jpgd12jpeg_decoder5clampEi(i32 noundef) local_unnamed_addr #1 align 2

attributes #0 = { 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 #1 = { 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" }

!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 9308}
!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, !10, i64 9384}
!14 = !{!6, !9, i64 584}
!15 = !{!6, !9, i64 648}
!16 = !{!6, !10, i64 13496}
!17 = !{!7, !7, i64 0}
!18 = !{!9, !9, i64 0}
!19 = distinct !{!19, !20}
!20 = !{!"llvm.loop.mustprogress"}


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