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

; 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: mustprogress uwtable
declare dso_local void @_ZN4jpgd12jpeg_decoder13transform_mcuEi(ptr noundef nonnull align 8 dereferenceable(13523), i32 noundef) #2 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4jpgd12jpeg_decoder15decode_next_rowEv(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
  %5 = alloca i32, align 4
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %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
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  %21 = load ptr, ptr %2, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #5
  store i32 0, ptr %3, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #5
  store i32 0, ptr %4, align 4, !tbaa !9
  br label %22

22:                                               ; preds = %340, %1
  %23 = load i32, ptr %4, align 4, !tbaa !9
  %24 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %21, i32 0, i32 33
  %25 = load i32, ptr %24, align 4, !tbaa !11
  %26 = icmp slt i32 %23, %25
  br i1 %26, label %28, label %27

27:                                               ; preds = %22
  store i32 2, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #5
  br label %343

28:                                               ; preds = %22
  %29 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %21, i32 0, i32 57
  %30 = load i32, ptr %29, align 8, !tbaa !15
  %31 = icmp ne i32 %30, 0
  br i1 %31, label %32, label %37

32:                                               ; preds = %28
  %33 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %21, i32 0, i32 58
  %34 = load i32, ptr %33, align 4, !tbaa !16
  %35 = icmp eq i32 %34, 0
  br i1 %35, label %36, label %37

36:                                               ; preds = %32
  call void @_ZN4jpgd12jpeg_decoder15process_restartEv(ptr noundef nonnull align 8 dereferenceable(13523) %21)
  br label %37

37:                                               ; preds = %36, %32, %28
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #5
  %38 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %21, i32 0, i32 64
  %39 = load ptr, ptr %38, align 8, !tbaa !17
  store ptr %39, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  store i32 0, ptr %7, align 4, !tbaa !9
  br label %40

40:                                               ; preds = %330, %37
  %41 = load i32, ptr %7, align 4, !tbaa !9
  %42 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %21, i32 0, i32 31
  %43 = load i32, ptr %42, align 4, !tbaa !18
  %44 = icmp slt i32 %41, %43
  br i1 %44, label %46, label %45

45:                                               ; preds = %40
  store i32 5, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  br label %335

46:                                               ; preds = %40
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  %47 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %21, i32 0, i32 35
  %48 = load i32, ptr %7, align 4, !tbaa !9
  %49 = sext i32 %48 to i64
  %50 = getelementptr inbounds [10 x i32], ptr %47, i64 0, i64 %49
  %51 = load i32, ptr %50, align 4, !tbaa !9
  store i32 %51, ptr %8, align 4, !tbaa !9
  %52 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %21, i32 0, i32 17
  %53 = load i32, ptr %8, align 4, !tbaa !9
  %54 = sext i32 %53 to i64
  %55 = getelementptr inbounds [4 x i32], ptr %52, i64 0, i64 %54
  %56 = load i32, ptr %55, align 4, !tbaa !9
  %57 = icmp sge i32 %56, 4
  br i1 %57, label %58, label %59

58:                                               ; preds = %46
  call void @_ZN4jpgd12jpeg_decoder13stop_decodingENS_11jpgd_statusE(ptr noundef nonnull align 8 dereferenceable(13523) %21, i32 noundef -230) #6
  unreachable

59:                                               ; preds = %46
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  %60 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %21, i32 0, i32 12
  %61 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %21, i32 0, i32 17
  %62 = load i32, ptr %8, align 4, !tbaa !9
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds [4 x i32], ptr %61, i64 0, i64 %63
  %65 = load i32, ptr %64, align 4, !tbaa !9
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds [4 x ptr], ptr %60, i64 0, i64 %66
  %68 = load ptr, ptr %67, align 8, !tbaa !5
  store ptr %68, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #5
  %69 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %21, i32 0, i32 43
  %70 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %21, i32 0, i32 23
  %71 = load i32, ptr %8, align 4, !tbaa !9
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds [4 x i32], ptr %70, i64 0, i64 %72
  %74 = load i32, ptr %73, align 4, !tbaa !9
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds [8 x ptr], ptr %69, i64 0, i64 %75
  %77 = load ptr, ptr %76, align 8, !tbaa !5
  %78 = call noundef i32 @_ZN4jpgd12jpeg_decoder11huff_decodeEPNS0_11huff_tablesERi(ptr noundef nonnull align 8 dereferenceable(13523) %21, ptr noundef %77, ptr noundef nonnull align 4 dereferenceable(4) %10)
  store i32 %78, ptr %11, align 4, !tbaa !9
  %79 = load i32, ptr %11, align 4, !tbaa !9
  %80 = icmp sge i32 %79, 16
  br i1 %80, label %81, label %82

81:                                               ; preds = %59
  call void @_ZN4jpgd12jpeg_decoder13stop_decodingENS_11jpgd_statusE(ptr noundef nonnull align 8 dereferenceable(13523) %21, i32 noundef -230) #6
  unreachable

82:                                               ; preds = %59
  %83 = load i32, ptr %10, align 4, !tbaa !9
  %84 = load i32, ptr %11, align 4, !tbaa !9
  %85 = and i32 %84, 15
  %86 = sext i32 %85 to i64
  %87 = getelementptr inbounds [16 x i32], ptr @_ZN4jpgdL13s_extend_testE, i64 0, i64 %86
  %88 = load i32, ptr %87, align 4, !tbaa !9
  %89 = icmp slt i32 %83, %88
  br i1 %89, label %90, label %98

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

98:                                               ; preds = %82
  %99 = load i32, ptr %10, align 4, !tbaa !9
  br label %100

100:                                              ; preds = %98, %90
  %101 = phi i32 [ %97, %90 ], [ %99, %98 ]
  store i32 %101, ptr %11, align 4, !tbaa !9
  %102 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %21, i32 0, i32 63
  %103 = load i32, ptr %8, align 4, !tbaa !9
  %104 = sext i32 %103 to i64
  %105 = getelementptr inbounds [4 x i32], ptr %102, i64 0, i64 %104
  %106 = load i32, ptr %105, align 4, !tbaa !9
  %107 = load i32, ptr %11, align 4, !tbaa !9
  %108 = add i32 %107, %106
  store i32 %108, ptr %11, align 4, !tbaa !9
  %109 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %21, i32 0, i32 63
  %110 = load i32, ptr %8, align 4, !tbaa !9
  %111 = sext i32 %110 to i64
  %112 = getelementptr inbounds [4 x i32], ptr %109, i64 0, i64 %111
  store i32 %108, ptr %112, align 4, !tbaa !9
  %113 = load i32, ptr %11, align 4, !tbaa !9
  %114 = load ptr, ptr %9, align 8, !tbaa !5
  %115 = getelementptr inbounds i16, ptr %114, i64 0
  %116 = load i16, ptr %115, align 2, !tbaa !19
  %117 = sext i16 %116 to i32
  %118 = mul nsw i32 %113, %117
  %119 = trunc i32 %118 to i16
  %120 = load ptr, ptr %6, align 8, !tbaa !5
  %121 = getelementptr inbounds i16, ptr %120, i64 0
  store i16 %119, ptr %121, align 2, !tbaa !19
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  %122 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %21, i32 0, i32 65
  %123 = load i32, ptr %7, align 4, !tbaa !9
  %124 = sext i32 %123 to i64
  %125 = getelementptr inbounds [10 x i32], ptr %122, i64 0, i64 %124
  %126 = load i32, ptr %125, align 4, !tbaa !9
  store i32 %126, ptr %12, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #5
  %127 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %21, i32 0, i32 43
  %128 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %21, i32 0, i32 24
  %129 = load i32, ptr %8, align 4, !tbaa !9
  %130 = sext i32 %129 to i64
  %131 = getelementptr inbounds [4 x i32], ptr %128, i64 0, i64 %130
  %132 = load i32, ptr %131, align 4, !tbaa !9
  %133 = sext i32 %132 to i64
  %134 = getelementptr inbounds [8 x ptr], ptr %127, i64 0, i64 %133
  %135 = load ptr, ptr %134, align 8, !tbaa !5
  store ptr %135, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  store i32 1, ptr %14, align 4, !tbaa !9
  br label %136

136:                                              ; preds = %299, %100
  %137 = load i32, ptr %14, align 4, !tbaa !9
  %138 = icmp slt i32 %137, 64
  br i1 %138, label %139, label %302

139:                                              ; preds = %136
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #5
  %140 = load ptr, ptr %13, align 8, !tbaa !5
  %141 = call noundef i32 @_ZN4jpgd12jpeg_decoder11huff_decodeEPNS0_11huff_tablesERi(ptr noundef nonnull align 8 dereferenceable(13523) %21, ptr noundef %140, ptr noundef nonnull align 4 dereferenceable(4) %15)
  store i32 %141, ptr %11, align 4, !tbaa !9
  %142 = load i32, ptr %11, align 4, !tbaa !9
  %143 = ashr i32 %142, 4
  store i32 %143, ptr %10, align 4, !tbaa !9
  %144 = load i32, ptr %11, align 4, !tbaa !9
  %145 = and i32 %144, 15
  store i32 %145, ptr %11, align 4, !tbaa !9
  %146 = load i32, ptr %11, align 4, !tbaa !9
  %147 = icmp ne i32 %146, 0
  br i1 %147, label %148, label %234

148:                                              ; preds = %139
  %149 = load i32, ptr %10, align 4, !tbaa !9
  %150 = icmp ne i32 %149, 0
  br i1 %150, label %151, label %194

151:                                              ; preds = %148
  %152 = load i32, ptr %14, align 4, !tbaa !9
  %153 = load i32, ptr %10, align 4, !tbaa !9
  %154 = add nsw i32 %152, %153
  %155 = icmp sgt i32 %154, 63
  br i1 %155, label %156, label %157

156:                                              ; preds = %151
  call void @_ZN4jpgd12jpeg_decoder13stop_decodingENS_11jpgd_statusE(ptr noundef nonnull align 8 dereferenceable(13523) %21, i32 noundef -230) #6
  unreachable

157:                                              ; preds = %151
  %158 = load i32, ptr %14, align 4, !tbaa !9
  %159 = load i32, ptr %12, align 4, !tbaa !9
  %160 = icmp slt i32 %158, %159
  br i1 %160, label %161, label %190

161:                                              ; preds = %157
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #5
  %162 = load i32, ptr %10, align 4, !tbaa !9
  %163 = load i32, ptr %12, align 4, !tbaa !9
  %164 = load i32, ptr %14, align 4, !tbaa !9
  %165 = sub nsw i32 %163, %164
  %166 = icmp slt i32 %162, %165
  br i1 %166, label %167, label %169

167:                                              ; preds = %161
  %168 = load i32, ptr %10, align 4, !tbaa !9
  br label %173

169:                                              ; preds = %161
  %170 = load i32, ptr %12, align 4, !tbaa !9
  %171 = load i32, ptr %14, align 4, !tbaa !9
  %172 = sub nsw i32 %170, %171
  br label %173

173:                                              ; preds = %169, %167
  %174 = phi i32 [ %168, %167 ], [ %172, %169 ]
  store i32 %174, ptr %16, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #5
  %175 = load i32, ptr %14, align 4, !tbaa !9
  store i32 %175, ptr %17, align 4, !tbaa !9
  br label %176

176:                                              ; preds = %180, %173
  %177 = load i32, ptr %16, align 4, !tbaa !9
  %178 = add nsw i32 %177, -1
  store i32 %178, ptr %16, align 4, !tbaa !9
  %179 = icmp ne i32 %177, 0
  br i1 %179, label %180, label %189

180:                                              ; preds = %176
  %181 = load ptr, ptr %6, align 8, !tbaa !5
  %182 = load i32, ptr %17, align 4, !tbaa !9
  %183 = add nsw i32 %182, 1
  store i32 %183, ptr %17, align 4, !tbaa !9
  %184 = sext i32 %182 to i64
  %185 = getelementptr inbounds [64 x i32], ptr @_ZN4jpgdL5g_ZAGE, i64 0, i64 %184
  %186 = load i32, ptr %185, align 4, !tbaa !9
  %187 = sext i32 %186 to i64
  %188 = getelementptr inbounds i16, ptr %181, i64 %187
  store i16 0, ptr %188, align 2, !tbaa !19
  br label %176, !llvm.loop !21

189:                                              ; preds = %176
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  br label %190

190:                                              ; preds = %189, %157
  %191 = load i32, ptr %10, align 4, !tbaa !9
  %192 = load i32, ptr %14, align 4, !tbaa !9
  %193 = add nsw i32 %192, %191
  store i32 %193, ptr %14, align 4, !tbaa !9
  br label %194

194:                                              ; preds = %190, %148
  %195 = load i32, ptr %15, align 4, !tbaa !9
  %196 = load i32, ptr %11, align 4, !tbaa !9
  %197 = and i32 %196, 15
  %198 = sext i32 %197 to i64
  %199 = getelementptr inbounds [16 x i32], ptr @_ZN4jpgdL13s_extend_testE, i64 0, i64 %198
  %200 = load i32, ptr %199, align 4, !tbaa !9
  %201 = icmp slt i32 %195, %200
  br i1 %201, label %202, label %210

202:                                              ; preds = %194
  %203 = load i32, ptr %15, align 4, !tbaa !9
  %204 = load i32, ptr %11, align 4, !tbaa !9
  %205 = and i32 %204, 15
  %206 = sext i32 %205 to i64
  %207 = getelementptr inbounds [16 x i32], ptr @_ZN4jpgdL15s_extend_offsetE, i64 0, i64 %206
  %208 = load i32, ptr %207, align 4, !tbaa !9
  %209 = add nsw i32 %203, %208
  br label %212

210:                                              ; preds = %194
  %211 = load i32, ptr %15, align 4, !tbaa !9
  br label %212

212:                                              ; preds = %210, %202
  %213 = phi i32 [ %209, %202 ], [ %211, %210 ]
  store i32 %213, ptr %11, align 4, !tbaa !9
  %214 = load i32, ptr %14, align 4, !tbaa !9
  %215 = icmp sge i32 %214, 64
  br i1 %215, label %216, label %217

216:                                              ; preds = %212
  call void @_ZN4jpgd12jpeg_decoder13stop_decodingENS_11jpgd_statusE(ptr noundef nonnull align 8 dereferenceable(13523) %21, i32 noundef -230) #6
  unreachable

217:                                              ; preds = %212
  %218 = load i32, ptr %11, align 4, !tbaa !9
  %219 = load ptr, ptr %9, align 8, !tbaa !5
  %220 = load i32, ptr %14, align 4, !tbaa !9
  %221 = sext i32 %220 to i64
  %222 = getelementptr inbounds i16, ptr %219, i64 %221
  %223 = load i16, ptr %222, align 2, !tbaa !19
  %224 = sext i16 %223 to i32
  %225 = call noundef i32 @_ZN4jpgdL13dequantize_acEii(i32 noundef %218, i32 noundef %224)
  %226 = trunc i32 %225 to i16
  %227 = load ptr, ptr %6, align 8, !tbaa !5
  %228 = load i32, ptr %14, align 4, !tbaa !9
  %229 = sext i32 %228 to i64
  %230 = getelementptr inbounds [64 x i32], ptr @_ZN4jpgdL5g_ZAGE, i64 0, i64 %229
  %231 = load i32, ptr %230, align 4, !tbaa !9
  %232 = sext i32 %231 to i64
  %233 = getelementptr inbounds i16, ptr %227, i64 %232
  store i16 %226, ptr %233, align 2, !tbaa !19
  br label %295

234:                                              ; preds = %139
  %235 = load i32, ptr %10, align 4, !tbaa !9
  %236 = icmp eq i32 %235, 15
  br i1 %236, label %237, label %293

237:                                              ; preds = %234
  %238 = load i32, ptr %14, align 4, !tbaa !9
  %239 = add nsw i32 %238, 16
  %240 = icmp sgt i32 %239, 64
  br i1 %240, label %241, label %242

241:                                              ; preds = %237
  call void @_ZN4jpgd12jpeg_decoder13stop_decodingENS_11jpgd_statusE(ptr noundef nonnull align 8 dereferenceable(13523) %21, i32 noundef -230) #6
  unreachable

242:                                              ; preds = %237
  %243 = load i32, ptr %14, align 4, !tbaa !9
  %244 = load i32, ptr %12, align 4, !tbaa !9
  %245 = icmp slt i32 %243, %244
  br i1 %245, label %246, label %277

246:                                              ; preds = %242
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #5
  %247 = load i32, ptr %12, align 4, !tbaa !9
  %248 = load i32, ptr %14, align 4, !tbaa !9
  %249 = sub nsw i32 %247, %248
  %250 = icmp slt i32 16, %249
  br i1 %250, label %251, label %252

251:                                              ; preds = %246
  br label %256

252:                                              ; preds = %246
  %253 = load i32, ptr %12, align 4, !tbaa !9
  %254 = load i32, ptr %14, align 4, !tbaa !9
  %255 = sub nsw i32 %253, %254
  br label %256

256:                                              ; preds = %252, %251
  %257 = phi i32 [ 16, %251 ], [ %255, %252 ]
  store i32 %257, ptr %18, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #5
  %258 = load i32, ptr %14, align 4, !tbaa !9
  store i32 %258, ptr %19, align 4, !tbaa !9
  br label %259

259:                                              ; preds = %267, %256
  %260 = load i32, ptr %18, align 4, !tbaa !9
  %261 = add nsw i32 %260, -1
  store i32 %261, ptr %18, align 4, !tbaa !9
  %262 = icmp ne i32 %260, 0
  br i1 %262, label %263, label %276

263:                                              ; preds = %259
  %264 = load i32, ptr %19, align 4, !tbaa !9
  %265 = icmp sgt i32 %264, 63
  br i1 %265, label %266, label %267

266:                                              ; preds = %263
  call void @_ZN4jpgd12jpeg_decoder13stop_decodingENS_11jpgd_statusE(ptr noundef nonnull align 8 dereferenceable(13523) %21, i32 noundef -230) #6
  unreachable

267:                                              ; preds = %263
  %268 = load ptr, ptr %6, align 8, !tbaa !5
  %269 = load i32, ptr %19, align 4, !tbaa !9
  %270 = add nsw i32 %269, 1
  store i32 %270, ptr %19, align 4, !tbaa !9
  %271 = sext i32 %269 to i64
  %272 = getelementptr inbounds [64 x i32], ptr @_ZN4jpgdL5g_ZAGE, i64 0, i64 %271
  %273 = load i32, ptr %272, align 4, !tbaa !9
  %274 = sext i32 %273 to i64
  %275 = getelementptr inbounds i16, ptr %268, i64 %274
  store i16 0, ptr %275, align 2, !tbaa !19
  br label %259, !llvm.loop !23

276:                                              ; preds = %259
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #5
  br label %277

277:                                              ; preds = %276, %242
  %278 = load i32, ptr %14, align 4, !tbaa !9
  %279 = add nsw i32 %278, 15
  store i32 %279, ptr %14, align 4, !tbaa !9
  %280 = load ptr, ptr %6, align 8, !tbaa !5
  %281 = load i32, ptr %14, align 4, !tbaa !9
  %282 = and i32 %281, 63
  %283 = sext i32 %282 to i64
  %284 = getelementptr inbounds [64 x i32], ptr @_ZN4jpgdL5g_ZAGE, i64 0, i64 %283
  %285 = load i32, ptr %284, align 4, !tbaa !9
  %286 = sext i32 %285 to i64
  %287 = getelementptr inbounds i16, ptr %280, i64 %286
  %288 = load i16, ptr %287, align 2, !tbaa !19
  %289 = sext i16 %288 to i32
  %290 = icmp ne i32 %289, 0
  br i1 %290, label %291, label %292

291:                                              ; preds = %277
  call void @_ZN4jpgd12jpeg_decoder13stop_decodingENS_11jpgd_statusE(ptr noundef nonnull align 8 dereferenceable(13523) %21, i32 noundef -230) #6
  unreachable

292:                                              ; preds = %277
  br label %294

293:                                              ; preds = %234
  store i32 8, ptr %5, align 4
  br label %296

294:                                              ; preds = %292
  br label %295

295:                                              ; preds = %294, %217
  store i32 0, ptr %5, align 4
  br label %296

296:                                              ; preds = %295, %293
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  %297 = load i32, ptr %5, align 4
  switch i32 %297, label %344 [
    i32 0, label %298
    i32 8, label %302
  ]

298:                                              ; preds = %296
  br label %299

299:                                              ; preds = %298
  %300 = load i32, ptr %14, align 4, !tbaa !9
  %301 = add nsw i32 %300, 1
  store i32 %301, ptr %14, align 4, !tbaa !9
  br label %136, !llvm.loop !24

302:                                              ; preds = %296, %136
  %303 = load i32, ptr %14, align 4, !tbaa !9
  %304 = load i32, ptr %12, align 4, !tbaa !9
  %305 = icmp slt i32 %303, %304
  br i1 %305, label %306, label %322

306:                                              ; preds = %302
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #5
  %307 = load i32, ptr %14, align 4, !tbaa !9
  store i32 %307, ptr %20, align 4, !tbaa !9
  br label %308

308:                                              ; preds = %312, %306
  %309 = load i32, ptr %20, align 4, !tbaa !9
  %310 = load i32, ptr %12, align 4, !tbaa !9
  %311 = icmp slt i32 %309, %310
  br i1 %311, label %312, label %321

312:                                              ; preds = %308
  %313 = load ptr, ptr %6, align 8, !tbaa !5
  %314 = load i32, ptr %20, align 4, !tbaa !9
  %315 = add nsw i32 %314, 1
  store i32 %315, ptr %20, align 4, !tbaa !9
  %316 = sext i32 %314 to i64
  %317 = getelementptr inbounds [64 x i32], ptr @_ZN4jpgdL5g_ZAGE, i64 0, i64 %316
  %318 = load i32, ptr %317, align 4, !tbaa !9
  %319 = sext i32 %318 to i64
  %320 = getelementptr inbounds i16, ptr %313, i64 %319
  store i16 0, ptr %320, align 2, !tbaa !19
  br label %308, !llvm.loop !25

321:                                              ; preds = %308
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #5
  br label %322

322:                                              ; preds = %321, %302
  %323 = load i32, ptr %14, align 4, !tbaa !9
  %324 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %21, i32 0, i32 65
  %325 = load i32, ptr %7, align 4, !tbaa !9
  %326 = sext i32 %325 to i64
  %327 = getelementptr inbounds [10 x i32], ptr %324, i64 0, i64 %326
  store i32 %323, ptr %327, align 4, !tbaa !9
  %328 = load i32, ptr %3, align 4, !tbaa !9
  %329 = add nsw i32 %328, 1
  store i32 %329, ptr %3, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  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 8, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  br label %330

330:                                              ; preds = %322
  %331 = load i32, ptr %7, align 4, !tbaa !9
  %332 = add nsw i32 %331, 1
  store i32 %332, ptr %7, align 4, !tbaa !9
  %333 = load ptr, ptr %6, align 8, !tbaa !5
  %334 = getelementptr inbounds i16, ptr %333, i64 64
  store ptr %334, ptr %6, align 8, !tbaa !5
  br label %40, !llvm.loop !26

335:                                              ; preds = %45
  %336 = load i32, ptr %4, align 4, !tbaa !9
  call void @_ZN4jpgd12jpeg_decoder13transform_mcuEi(ptr noundef nonnull align 8 dereferenceable(13523) %21, i32 noundef %336)
  %337 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %21, i32 0, i32 58
  %338 = load i32, ptr %337, align 4, !tbaa !16
  %339 = add nsw i32 %338, -1
  store i32 %339, ptr %337, align 4, !tbaa !16
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #5
  br label %340

340:                                              ; preds = %335
  %341 = load i32, ptr %4, align 4, !tbaa !9
  %342 = add nsw i32 %341, 1
  store i32 %342, ptr %4, align 4, !tbaa !9
  br label %22, !llvm.loop !27

343:                                              ; preds = %27
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #5
  ret void

344:                                              ; preds = %296
  unreachable
}

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef i32 @_ZN4jpgdL13dequantize_acEii(i32 noundef, i32 noundef) #4

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 = { 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 #4 = { 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 #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 596}
!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 9296}
!16 = !{!12, !10, i64 9300}
!17 = !{!12, !6, i64 9336}
!18 = !{!12, !10, i64 588}
!19 = !{!20, !20, i64 0}
!20 = !{!"short", !7, i64 0}
!21 = distinct !{!21, !22}
!22 = !{!"llvm.loop.mustprogress"}
!23 = distinct !{!23, !22}
!24 = distinct !{!24, !22}
!25 = distinct !{!25, !22}
!26 = distinct !{!26, !22}
!27 = distinct !{!27, !22}


; 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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #0

; Function Attrs: mustprogress 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) local_unnamed_addr #1 align 2

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

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

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

.lr.ph139:                                        ; preds = %1
  %7 = getelementptr inbounds i8, ptr %0, i64 9296
  %8 = getelementptr inbounds i8, ptr %0, i64 9300
  %9 = getelementptr inbounds i8, ptr %0, i64 9336
  %10 = getelementptr inbounds i8, ptr %0, i64 588
  %11 = getelementptr inbounds i8, ptr %0, i64 604
  %12 = getelementptr inbounds i8, ptr %0, i64 448
  %13 = getelementptr inbounds i8, ptr %0, i64 376
  %14 = getelementptr inbounds i8, ptr %0, i64 672
  %15 = getelementptr inbounds i8, ptr %0, i64 532
  %16 = getelementptr inbounds i8, ptr %0, i64 9320
  %17 = getelementptr inbounds i8, ptr %0, i64 9344
  %18 = getelementptr inbounds i8, ptr %0, i64 548
  %.pre = load i32, ptr %8, align 4
  br label %19

._crit_edge140:                                   ; preds = %._crit_edge, %1
  ret void

19:                                               ; preds = %.lr.ph139, %._crit_edge
  %20 = phi i32 [ %.pre, %.lr.ph139 ], [ %29, %._crit_edge ]
  %.080136 = phi i32 [ 0, %.lr.ph139 ], [ %30, %._crit_edge ]
  %21 = load i32, ptr %7, align 8, !tbaa !13
  %.not = icmp ne i32 %21, 0
  %22 = icmp eq i32 %20, 0
  %or.cond = select i1 %.not, i1 %22, i1 false
  br i1 %or.cond, label %23, label %24

23:                                               ; preds = %19
  call void @_ZN4jpgd12jpeg_decoder15process_restartEv(ptr noundef nonnull align 8 dereferenceable(13523) %0)
  br label %24

24:                                               ; preds = %23, %19
  %25 = load i32, ptr %10, align 4, !tbaa !14
  %26 = icmp sgt i32 %25, 0
  br i1 %26, label %.lr.ph135.preheader, label %._crit_edge

.lr.ph135.preheader:                              ; preds = %24
  %27 = load ptr, ptr %9, align 8, !tbaa !15
  br label %.lr.ph135

._crit_edge:                                      ; preds = %.loopexit107, %24
  call void @_ZN4jpgd12jpeg_decoder13transform_mcuEi(ptr noundef nonnull align 8 dereferenceable(13523) %0, i32 noundef %.080136)
  %28 = load i32, ptr %8, align 4, !tbaa !16
  %29 = add nsw i32 %28, -1
  store i32 %29, ptr %8, align 4, !tbaa !16
  %30 = add nuw nsw i32 %.080136, 1
  %31 = load i32, ptr %4, align 4, !tbaa !5
  %32 = icmp slt i32 %30, %31
  br i1 %32, label %19, label %._crit_edge140, !llvm.loop !17

.lr.ph135:                                        ; preds = %.lr.ph135.preheader, %.loopexit107
  %indvars.iv156 = phi i64 [ 0, %.lr.ph135.preheader ], [ %indvars.iv.next157, %.loopexit107 ]
  %.082133 = phi ptr [ %27, %.lr.ph135.preheader ], [ %195, %.loopexit107 ]
  %33 = getelementptr inbounds [10 x i32], ptr %11, i64 0, i64 %indvars.iv156
  %34 = load i32, ptr %33, align 4, !tbaa !19
  %35 = sext i32 %34 to i64
  %36 = getelementptr inbounds [4 x i32], ptr %12, i64 0, i64 %35
  %37 = load i32, ptr %36, align 4, !tbaa !19
  %38 = icmp sgt i32 %37, 3
  br i1 %38, label %39, label %40

39:                                               ; preds = %.lr.ph135
  call void @_ZN4jpgd12jpeg_decoder13stop_decodingENS_11jpgd_statusE(ptr noundef nonnull align 8 dereferenceable(13523) %0, i32 noundef -230) #6
  unreachable

40:                                               ; preds = %.lr.ph135
  %41 = sext i32 %37 to i64
  %42 = getelementptr inbounds [4 x ptr], ptr %13, i64 0, i64 %41
  %43 = load ptr, ptr %42, align 8, !tbaa !20
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #7
  %44 = getelementptr inbounds [4 x i32], ptr %15, i64 0, i64 %35
  %45 = load i32, ptr %44, align 4, !tbaa !19
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds [8 x ptr], ptr %14, i64 0, i64 %46
  %48 = load ptr, ptr %47, align 8, !tbaa !20
  %49 = call noundef i32 @_ZN4jpgd12jpeg_decoder11huff_decodeEPNS0_11huff_tablesERi(ptr noundef nonnull align 8 dereferenceable(13523) %0, ptr noundef %48, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %50 = icmp sgt i32 %49, 15
  br i1 %50, label %51, label %52

51:                                               ; preds = %40
  call void @_ZN4jpgd12jpeg_decoder13stop_decodingENS_11jpgd_statusE(ptr noundef nonnull align 8 dereferenceable(13523) %0, i32 noundef -230) #6
  unreachable

52:                                               ; preds = %40
  %53 = load i32, ptr %2, align 4, !tbaa !19
  %54 = and i32 %49, 15
  %55 = zext nneg i32 %54 to i64
  %56 = getelementptr inbounds [16 x i32], ptr @_ZN4jpgdL13s_extend_testE, i64 0, i64 %55
  %57 = load i32, ptr %56, align 4, !tbaa !19
  %58 = icmp slt i32 %53, %57
  br i1 %58, label %59, label %63

59:                                               ; preds = %52
  %60 = getelementptr inbounds [16 x i32], ptr @_ZN4jpgdL15s_extend_offsetE, i64 0, i64 %55
  %61 = load i32, ptr %60, align 4, !tbaa !19
  %62 = add nsw i32 %61, %53
  br label %63

63:                                               ; preds = %52, %59
  %64 = phi i32 [ %62, %59 ], [ %53, %52 ]
  %65 = getelementptr inbounds [4 x i32], ptr %16, i64 0, i64 %35
  %66 = load i32, ptr %65, align 4, !tbaa !19
  %67 = add i32 %66, %64
  store i32 %67, ptr %65, align 4, !tbaa !19
  %68 = load i16, ptr %43, align 2, !tbaa !21
  %69 = trunc i32 %67 to i16
  %70 = mul i16 %68, %69
  store i16 %70, ptr %.082133, align 2, !tbaa !21
  %71 = getelementptr inbounds [10 x i32], ptr %17, i64 0, i64 %indvars.iv156
  %72 = load i32, ptr %71, align 4, !tbaa !19
  %73 = getelementptr inbounds [4 x i32], ptr %18, i64 0, i64 %35
  %74 = load i32, ptr %73, align 4, !tbaa !19
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds [8 x ptr], ptr %14, i64 0, i64 %75
  %77 = load ptr, ptr %76, align 8, !tbaa !20
  br label %78

78:                                               ; preds = %63, %167
  %.077129 = phi i32 [ 1, %63 ], [ %168, %167 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #7
  %79 = call noundef i32 @_ZN4jpgd12jpeg_decoder11huff_decodeEPNS0_11huff_tablesERi(ptr noundef nonnull align 8 dereferenceable(13523) %0, ptr noundef %77, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %80 = ashr i32 %79, 4
  store i32 %80, ptr %2, align 4, !tbaa !19
  %81 = and i32 %79, 15
  %.not95 = icmp eq i32 %81, 0
  br i1 %.not95, label %140, label %82

82:                                               ; preds = %78
  %.not98 = icmp ult i32 %79, 16
  br i1 %.not98, label %.loopexit106, label %83

83:                                               ; preds = %82
  %84 = add nsw i32 %80, %.077129
  %85 = icmp sgt i32 %84, 63
  br i1 %85, label %86, label %87

86:                                               ; preds = %83
  call void @_ZN4jpgd12jpeg_decoder13stop_decodingENS_11jpgd_statusE(ptr noundef nonnull align 8 dereferenceable(13523) %0, i32 noundef -230) #6
  unreachable

87:                                               ; preds = %83
  %88 = icmp slt i32 %.077129, %72
  br i1 %88, label %89, label %.loopexit106

89:                                               ; preds = %87
  %90 = sub nsw i32 %72, %.077129
  %91 = call i32 @llvm.smin.i32(i32 %80, i32 %90)
  %.not99123 = icmp eq i32 %91, 0
  br i1 %.not99123, label %.loopexit106, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %89
  %92 = sext i32 %.077129 to i64
  %xtraiter = and i32 %91, 3
  %lcmp.mod.not = icmp eq i32 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.lr.ph.prol.loopexit, label %.lr.ph.prol

.lr.ph.prol:                                      ; preds = %.lr.ph.preheader, %.lr.ph.prol
  %indvars.iv.prol = phi i64 [ %indvars.iv.next.prol, %.lr.ph.prol ], [ %92, %.lr.ph.preheader ]
  %.076124.prol = phi i32 [ %93, %.lr.ph.prol ], [ %91, %.lr.ph.preheader ]
  %prol.iter = phi i32 [ %prol.iter.next, %.lr.ph.prol ], [ 0, %.lr.ph.preheader ]
  %93 = add nsw i32 %.076124.prol, -1
  %indvars.iv.next.prol = add nsw i64 %indvars.iv.prol, 1
  %94 = getelementptr inbounds [64 x i32], ptr @_ZN4jpgdL5g_ZAGE, i64 0, i64 %indvars.iv.prol
  %95 = load i32, ptr %94, align 4, !tbaa !19
  %96 = sext i32 %95 to i64
  %97 = getelementptr inbounds i16, ptr %.082133, i64 %96
  store i16 0, ptr %97, align 2, !tbaa !21
  %prol.iter.next = add i32 %prol.iter, 1
  %prol.iter.cmp.not = icmp eq i32 %prol.iter.next, %xtraiter
  br i1 %prol.iter.cmp.not, label %.lr.ph.prol.loopexit, label %.lr.ph.prol, !llvm.loop !23

.lr.ph.prol.loopexit:                             ; preds = %.lr.ph.prol, %.lr.ph.preheader
  %indvars.iv.unr = phi i64 [ %92, %.lr.ph.preheader ], [ %indvars.iv.next.prol, %.lr.ph.prol ]
  %.076124.unr = phi i32 [ %91, %.lr.ph.preheader ], [ %93, %.lr.ph.prol ]
  %98 = icmp ult i32 %91, 4
  br i1 %98, label %.loopexit106, label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.prol.loopexit, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next.3, %.lr.ph ], [ %indvars.iv.unr, %.lr.ph.prol.loopexit ]
  %.076124 = phi i32 [ %111, %.lr.ph ], [ %.076124.unr, %.lr.ph.prol.loopexit ]
  %indvars.iv.next = add nsw i64 %indvars.iv, 1
  %99 = getelementptr inbounds [64 x i32], ptr @_ZN4jpgdL5g_ZAGE, i64 0, i64 %indvars.iv
  %100 = load i32, ptr %99, align 4, !tbaa !19
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds i16, ptr %.082133, i64 %101
  store i16 0, ptr %102, align 2, !tbaa !21
  %indvars.iv.next.1 = add nsw i64 %indvars.iv, 2
  %103 = getelementptr inbounds [64 x i32], ptr @_ZN4jpgdL5g_ZAGE, i64 0, i64 %indvars.iv.next
  %104 = load i32, ptr %103, align 4, !tbaa !19
  %105 = sext i32 %104 to i64
  %106 = getelementptr inbounds i16, ptr %.082133, i64 %105
  store i16 0, ptr %106, align 2, !tbaa !21
  %indvars.iv.next.2 = add nsw i64 %indvars.iv, 3
  %107 = getelementptr inbounds [64 x i32], ptr @_ZN4jpgdL5g_ZAGE, i64 0, i64 %indvars.iv.next.1
  %108 = load i32, ptr %107, align 4, !tbaa !19
  %109 = sext i32 %108 to i64
  %110 = getelementptr inbounds i16, ptr %.082133, i64 %109
  store i16 0, ptr %110, align 2, !tbaa !21
  %111 = add nsw i32 %.076124, -4
  %indvars.iv.next.3 = add nsw i64 %indvars.iv, 4
  %112 = getelementptr inbounds [64 x i32], ptr @_ZN4jpgdL5g_ZAGE, i64 0, i64 %indvars.iv.next.2
  %113 = load i32, ptr %112, align 4, !tbaa !19
  %114 = sext i32 %113 to i64
  %115 = getelementptr inbounds i16, ptr %.082133, i64 %114
  store i16 0, ptr %115, align 2, !tbaa !21
  %.not99.3 = icmp eq i32 %111, 0
  br i1 %.not99.3, label %.loopexit106, label %.lr.ph, !llvm.loop !25

.loopexit106:                                     ; preds = %.lr.ph.prol.loopexit, %.lr.ph, %89, %87, %82
  %.1 = phi i32 [ %.077129, %82 ], [ %84, %87 ], [ %84, %89 ], [ %84, %.lr.ph ], [ %84, %.lr.ph.prol.loopexit ]
  %116 = load i32, ptr %3, align 4, !tbaa !19
  %117 = zext nneg i32 %81 to i64
  %118 = getelementptr inbounds [16 x i32], ptr @_ZN4jpgdL13s_extend_testE, i64 0, i64 %117
  %119 = load i32, ptr %118, align 4, !tbaa !19
  %120 = icmp slt i32 %116, %119
  br i1 %120, label %121, label %125

121:                                              ; preds = %.loopexit106
  %122 = getelementptr inbounds [16 x i32], ptr @_ZN4jpgdL15s_extend_offsetE, i64 0, i64 %117
  %123 = load i32, ptr %122, align 4, !tbaa !19
  %124 = add nsw i32 %123, %116
  br label %125

125:                                              ; preds = %.loopexit106, %121
  %126 = phi i32 [ %124, %121 ], [ %116, %.loopexit106 ]
  %127 = icmp sgt i32 %.1, 63
  br i1 %127, label %128, label %129

128:                                              ; preds = %125
  call void @_ZN4jpgd12jpeg_decoder13stop_decodingENS_11jpgd_statusE(ptr noundef nonnull align 8 dereferenceable(13523) %0, i32 noundef -230) #6
  unreachable

129:                                              ; preds = %125
  %130 = sext i32 %.1 to i64
  %131 = getelementptr inbounds i16, ptr %43, i64 %130
  %132 = load i16, ptr %131, align 2, !tbaa !21
  %133 = sext i16 %132 to i32
  %134 = call noundef i32 @_ZN4jpgdL13dequantize_acEii(i32 noundef %126, i32 noundef %133)
  %135 = trunc i32 %134 to i16
  %136 = getelementptr inbounds [64 x i32], ptr @_ZN4jpgdL5g_ZAGE, i64 0, i64 %130
  %137 = load i32, ptr %136, align 4, !tbaa !19
  %138 = sext i32 %137 to i64
  %139 = getelementptr inbounds i16, ptr %.082133, i64 %138
  store i16 %135, ptr %139, align 2, !tbaa !21
  br label %167

140:                                              ; preds = %78
  %141 = icmp eq i32 %80, 15
  br i1 %141, label %142, label %166

142:                                              ; preds = %140
  %143 = icmp sgt i32 %.077129, 48
  br i1 %143, label %144, label %145

144:                                              ; preds = %142
  call void @_ZN4jpgd12jpeg_decoder13stop_decodingENS_11jpgd_statusE(ptr noundef nonnull align 8 dereferenceable(13523) %0, i32 noundef -230) #6
  unreachable

145:                                              ; preds = %142
  %146 = icmp slt i32 %.077129, %72
  br i1 %146, label %.lr.ph128.preheader, label %.loopexit

.lr.ph128.preheader:                              ; preds = %145
  %147 = sub nsw i32 %72, %.077129
  %148 = call i32 @llvm.smin.i32(i32 %147, i32 16)
  %149 = sext i32 %.077129 to i64
  br label %.lr.ph128

.lr.ph128:                                        ; preds = %.lr.ph128.preheader, %151
  %indvars.iv149 = phi i64 [ %149, %.lr.ph128.preheader ], [ %indvars.iv.next150, %151 ]
  %.in = phi i32 [ %148, %.lr.ph128.preheader ], [ %152, %151 ]
  %exitcond = icmp eq i64 %indvars.iv149, 64
  br i1 %exitcond, label %150, label %151

150:                                              ; preds = %.lr.ph128
  call void @_ZN4jpgd12jpeg_decoder13stop_decodingENS_11jpgd_statusE(ptr noundef nonnull align 8 dereferenceable(13523) %0, i32 noundef -230) #6
  unreachable

151:                                              ; preds = %.lr.ph128
  %152 = add nsw i32 %.in, -1
  %indvars.iv.next150 = add nsw i64 %indvars.iv149, 1
  %153 = getelementptr inbounds [64 x i32], ptr @_ZN4jpgdL5g_ZAGE, i64 0, i64 %indvars.iv149
  %154 = load i32, ptr %153, align 4, !tbaa !19
  %155 = sext i32 %154 to i64
  %156 = getelementptr inbounds i16, ptr %.082133, i64 %155
  store i16 0, ptr %156, align 2, !tbaa !21
  %.not96 = icmp eq i32 %152, 0
  br i1 %.not96, label %.loopexit, label %.lr.ph128, !llvm.loop !26

.loopexit:                                        ; preds = %151, %145
  %157 = add nsw i32 %.077129, 15
  %158 = and i32 %157, 63
  %159 = zext nneg i32 %158 to i64
  %160 = getelementptr inbounds [64 x i32], ptr @_ZN4jpgdL5g_ZAGE, i64 0, i64 %159
  %161 = load i32, ptr %160, align 4, !tbaa !19
  %162 = sext i32 %161 to i64
  %163 = getelementptr inbounds i16, ptr %.082133, i64 %162
  %164 = load i16, ptr %163, align 2, !tbaa !21
  %.not97 = icmp eq i16 %164, 0
  br i1 %.not97, label %167, label %165

165:                                              ; preds = %.loopexit
  call void @_ZN4jpgd12jpeg_decoder13stop_decodingENS_11jpgd_statusE(ptr noundef nonnull align 8 dereferenceable(13523) %0, i32 noundef -230) #6
  unreachable

166:                                              ; preds = %140
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #7
  br label %.loopexit108

167:                                              ; preds = %.loopexit, %129
  %.3.ph = phi i32 [ %157, %.loopexit ], [ %.1, %129 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #7
  %168 = add nsw i32 %.3.ph, 1
  %169 = icmp slt i32 %.3.ph, 63
  br i1 %169, label %78, label %.loopexit108, !llvm.loop !27

.loopexit108:                                     ; preds = %167, %166
  %.077115 = phi i32 [ %.077129, %166 ], [ %168, %167 ]
  %170 = icmp slt i32 %.077115, %72
  br i1 %170, label %.preheader.preheader, label %.loopexit107

.preheader.preheader:                             ; preds = %.loopexit108
  %171 = sext i32 %.077115 to i64
  %wide.trip.count = sext i32 %72 to i64
  %172 = sub nsw i64 %wide.trip.count, %171
  %xtraiter177 = and i64 %172, 3
  %lcmp.mod178.not = icmp eq i64 %xtraiter177, 0
  br i1 %lcmp.mod178.not, label %.preheader.prol.loopexit, label %.preheader.prol

.preheader.prol:                                  ; preds = %.preheader.preheader, %.preheader.prol
  %indvars.iv152.prol = phi i64 [ %indvars.iv.next153.prol, %.preheader.prol ], [ %171, %.preheader.preheader ]
  %prol.iter179 = phi i64 [ %prol.iter179.next, %.preheader.prol ], [ 0, %.preheader.preheader ]
  %indvars.iv.next153.prol = add nsw i64 %indvars.iv152.prol, 1
  %173 = getelementptr inbounds [64 x i32], ptr @_ZN4jpgdL5g_ZAGE, i64 0, i64 %indvars.iv152.prol
  %174 = load i32, ptr %173, align 4, !tbaa !19
  %175 = sext i32 %174 to i64
  %176 = getelementptr inbounds i16, ptr %.082133, i64 %175
  store i16 0, ptr %176, align 2, !tbaa !21
  %prol.iter179.next = add i64 %prol.iter179, 1
  %prol.iter179.cmp.not = icmp eq i64 %prol.iter179.next, %xtraiter177
  br i1 %prol.iter179.cmp.not, label %.preheader.prol.loopexit, label %.preheader.prol, !llvm.loop !28

.preheader.prol.loopexit:                         ; preds = %.preheader.prol, %.preheader.preheader
  %indvars.iv152.unr = phi i64 [ %171, %.preheader.preheader ], [ %indvars.iv.next153.prol, %.preheader.prol ]
  %177 = sub nsw i64 %171, %wide.trip.count
  %178 = icmp ugt i64 %177, -4
  br i1 %178, label %.loopexit107, label %.preheader

.preheader:                                       ; preds = %.preheader.prol.loopexit, %.preheader
  %indvars.iv152 = phi i64 [ %indvars.iv.next153.3, %.preheader ], [ %indvars.iv152.unr, %.preheader.prol.loopexit ]
  %indvars.iv.next153 = add nsw i64 %indvars.iv152, 1
  %179 = getelementptr inbounds [64 x i32], ptr @_ZN4jpgdL5g_ZAGE, i64 0, i64 %indvars.iv152
  %180 = load i32, ptr %179, align 4, !tbaa !19
  %181 = sext i32 %180 to i64
  %182 = getelementptr inbounds i16, ptr %.082133, i64 %181
  store i16 0, ptr %182, align 2, !tbaa !21
  %indvars.iv.next153.1 = add nsw i64 %indvars.iv152, 2
  %183 = getelementptr inbounds [64 x i32], ptr @_ZN4jpgdL5g_ZAGE, i64 0, i64 %indvars.iv.next153
  %184 = load i32, ptr %183, align 4, !tbaa !19
  %185 = sext i32 %184 to i64
  %186 = getelementptr inbounds i16, ptr %.082133, i64 %185
  store i16 0, ptr %186, align 2, !tbaa !21
  %indvars.iv.next153.2 = add nsw i64 %indvars.iv152, 3
  %187 = getelementptr inbounds [64 x i32], ptr @_ZN4jpgdL5g_ZAGE, i64 0, i64 %indvars.iv.next153.1
  %188 = load i32, ptr %187, align 4, !tbaa !19
  %189 = sext i32 %188 to i64
  %190 = getelementptr inbounds i16, ptr %.082133, i64 %189
  store i16 0, ptr %190, align 2, !tbaa !21
  %indvars.iv.next153.3 = add nsw i64 %indvars.iv152, 4
  %191 = getelementptr inbounds [64 x i32], ptr @_ZN4jpgdL5g_ZAGE, i64 0, i64 %indvars.iv.next153.2
  %192 = load i32, ptr %191, align 4, !tbaa !19
  %193 = sext i32 %192 to i64
  %194 = getelementptr inbounds i16, ptr %.082133, i64 %193
  store i16 0, ptr %194, align 2, !tbaa !21
  %exitcond155.not.3 = icmp eq i64 %indvars.iv.next153.3, %wide.trip.count
  br i1 %exitcond155.not.3, label %.loopexit107, label %.preheader, !llvm.loop !29

.loopexit107:                                     ; preds = %.preheader.prol.loopexit, %.preheader, %.loopexit108
  store i32 %.077115, ptr %71, align 4, !tbaa !19
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #7
  %indvars.iv.next157 = add nuw nsw i64 %indvars.iv156, 1
  %195 = getelementptr inbounds i8, ptr %.082133, i64 128
  %196 = load i32, ptr %10, align 4, !tbaa !14
  %197 = sext i32 %196 to i64
  %198 = icmp slt i64 %indvars.iv.next157, %197
  br i1 %198, label %.lr.ph135, label %._crit_edge, !llvm.loop !30
}

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef i32 @_ZN4jpgdL13dequantize_acEii(i32 noundef, i32 noundef) local_unnamed_addr #4

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.smin.i32(i32, i32) #5

attributes #0 = { mustprogress 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 = { 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 #4 = { 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 #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { noreturn }
attributes #7 = { 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, !9, i64 596}
!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 9296}
!14 = !{!6, !9, i64 588}
!15 = !{!6, !10, i64 9336}
!16 = !{!6, !9, i64 9300}
!17 = distinct !{!17, !18}
!18 = !{!"llvm.loop.mustprogress"}
!19 = !{!9, !9, i64 0}
!20 = !{!10, !10, i64 0}
!21 = !{!22, !22, i64 0}
!22 = !{!"short", !7, i64 0}
!23 = distinct !{!23, !24}
!24 = !{!"llvm.loop.unroll.disable"}
!25 = distinct !{!25, !18}
!26 = distinct !{!26, !18}
!27 = distinct !{!27, !18}
!28 = distinct !{!28, !24}
!29 = distinct !{!29, !18}
!30 = distinct !{!30, !18}


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