; LLVM IR from drohmer/cgp :: library/third_party/src/jpeg/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], ptr, i32, i32, ptr, i32, [8 x i8], [4 x i8], [8 x ptr], [8 x ptr], [4 x ptr], i32, i32, [4 x i32], [4 x i32], [4 x i32], [4 x i32], [4 x i32], [4 x i32], i32, [4 x i32], [4 x i32], [4 x i32], i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, [10 x i32], i32, i32, i32, i32, i32, [8 x ptr], [4 x ptr], [4 x ptr], i32, [4 x i32], [4 x i8], ptr, i32, i32, i8, [128 x i8], [8320 x i8], [128 x i8], [3 x i8], i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i8, [3 x i8], i32, [4 x i32], [4 x i8], ptr, [10 x i32], ptr, [256 x i32], [256 x i32], [256 x i32], [256 x i32], ptr, ptr, i32, i8, [3 x i8], i32, [4 x i8] }>
%struct.__jmp_buf_tag = type { [8 x i64], i32, %struct.__sigset_t }
%struct.__sigset_t = type { [16 x i64] }

@.str.1 = external hidden unnamed_addr constant [83 x i8], align 1
@_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
@.str.7 = external hidden unnamed_addr constant [7 x i8], align 1
@__PRETTY_FUNCTION__._ZN4jpgd12jpeg_decoder15decode_next_rowEv = external hidden unnamed_addr constant [43 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [17 x i8], align 1

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #0

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4jpgd12jpeg_decoder15decode_next_rowEv(ptr noundef nonnull align 8 dereferenceable(13652) %0) #3 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) #6
  store i32 0, ptr %3, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  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 31
  %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) #6
  br label %343

28:                                               ; preds = %22
  %29 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %21, i32 0, i32 55
  %30 = load i32, ptr %29, align 4, !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 56
  %34 = load i32, ptr %33, align 8, !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(13652) %21)
  br label %37

37:                                               ; preds = %36, %32, %28
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #6
  %38 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %21, i32 0, i32 68
  %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) #6
  store i32 0, ptr %7, align 4, !tbaa !9
  br label %40

40:                                               ; preds = %323, %37
  %41 = load i32, ptr %7, align 4, !tbaa !9
  %42 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %21, i32 0, i32 29
  %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) #6
  br label %328

46:                                               ; preds = %40
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #6
  %47 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %21, i32 0, i32 33
  %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
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #6
  %52 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %21, i32 0, i32 10
  %53 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %21, i32 0, i32 15
  %54 = load i32, ptr %8, align 4, !tbaa !9
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds [4 x i32], ptr %53, i64 0, i64 %55
  %57 = load i32, ptr %56, align 4, !tbaa !9
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds [4 x ptr], ptr %52, i64 0, i64 %58
  %60 = load ptr, ptr %59, align 8, !tbaa !5
  store ptr %60, ptr %9, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  %61 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %21, i32 0, i32 39
  %62 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %21, i32 0, i32 21
  %63 = load i32, ptr %8, align 4, !tbaa !9
  %64 = sext i32 %63 to i64
  %65 = getelementptr inbounds [4 x i32], ptr %62, i64 0, i64 %64
  %66 = load i32, ptr %65, align 4, !tbaa !9
  %67 = sext i32 %66 to i64
  %68 = getelementptr inbounds [8 x ptr], ptr %61, i64 0, i64 %67
  %69 = load ptr, ptr %68, align 8, !tbaa !5
  %70 = call noundef i32 @_ZN4jpgd12jpeg_decoder11huff_decodeEPNS0_11huff_tablesERi(ptr noundef nonnull align 8 dereferenceable(13652) %21, ptr noundef %69, ptr noundef nonnull align 4 dereferenceable(4) %10)
  store i32 %70, ptr %11, align 4, !tbaa !9
  %71 = load i32, ptr %10, align 4, !tbaa !9
  %72 = load i32, ptr %11, align 4, !tbaa !9
  %73 = and i32 %72, 15
  %74 = sext i32 %73 to i64
  %75 = getelementptr inbounds [16 x i32], ptr @_ZN4jpgdL13s_extend_testE, i64 0, i64 %74
  %76 = load i32, ptr %75, align 4, !tbaa !9
  %77 = icmp slt i32 %71, %76
  br i1 %77, label %78, label %86

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

86:                                               ; preds = %46
  %87 = load i32, ptr %10, align 4, !tbaa !9
  br label %88

88:                                               ; preds = %86, %78
  %89 = phi i32 [ %85, %78 ], [ %87, %86 ]
  store i32 %89, ptr %11, align 4, !tbaa !9
  %90 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %21, i32 0, i32 66
  %91 = load i32, ptr %8, align 4, !tbaa !9
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds [4 x i32], ptr %90, i64 0, i64 %92
  %94 = load i32, ptr %93, align 4, !tbaa !9
  %95 = load i32, ptr %11, align 4, !tbaa !9
  %96 = add i32 %95, %94
  store i32 %96, ptr %11, align 4, !tbaa !9
  %97 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %21, i32 0, i32 66
  %98 = load i32, ptr %8, align 4, !tbaa !9
  %99 = sext i32 %98 to i64
  %100 = getelementptr inbounds [4 x i32], ptr %97, i64 0, i64 %99
  store i32 %96, ptr %100, align 4, !tbaa !9
  %101 = load i32, ptr %11, align 4, !tbaa !9
  %102 = load ptr, ptr %9, align 8, !tbaa !5
  %103 = getelementptr inbounds i16, ptr %102, i64 0
  %104 = load i16, ptr %103, align 2, !tbaa !19
  %105 = sext i16 %104 to i32
  %106 = mul nsw i32 %101, %105
  %107 = trunc i32 %106 to i16
  %108 = load ptr, ptr %6, align 8, !tbaa !5
  %109 = getelementptr inbounds i16, ptr %108, i64 0
  store i16 %107, ptr %109, align 2, !tbaa !19
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  %110 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %21, i32 0, i32 69
  %111 = load i32, ptr %7, align 4, !tbaa !9
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds [10 x i32], ptr %110, i64 0, i64 %112
  %114 = load i32, ptr %113, align 4, !tbaa !9
  store i32 %114, ptr %12, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  %115 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %21, i32 0, i32 39
  %116 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %21, i32 0, i32 22
  %117 = load i32, ptr %8, align 4, !tbaa !9
  %118 = sext i32 %117 to i64
  %119 = getelementptr inbounds [4 x i32], ptr %116, i64 0, i64 %118
  %120 = load i32, ptr %119, align 4, !tbaa !9
  %121 = sext i32 %120 to i64
  %122 = getelementptr inbounds [8 x ptr], ptr %115, i64 0, i64 %121
  %123 = load ptr, ptr %122, align 8, !tbaa !5
  store ptr %123, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  store i32 1, ptr %14, align 4, !tbaa !9
  br label %124

124:                                              ; preds = %292, %88
  %125 = load i32, ptr %14, align 4, !tbaa !9
  %126 = icmp slt i32 %125, 64
  br i1 %126, label %127, label %295

127:                                              ; preds = %124
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  %128 = load ptr, ptr %13, align 8, !tbaa !5
  %129 = call noundef i32 @_ZN4jpgd12jpeg_decoder11huff_decodeEPNS0_11huff_tablesERi(ptr noundef nonnull align 8 dereferenceable(13652) %21, ptr noundef %128, ptr noundef nonnull align 4 dereferenceable(4) %15)
  store i32 %129, ptr %11, align 4, !tbaa !9
  %130 = load i32, ptr %11, align 4, !tbaa !9
  %131 = ashr i32 %130, 4
  store i32 %131, ptr %10, align 4, !tbaa !9
  %132 = load i32, ptr %11, align 4, !tbaa !9
  %133 = and i32 %132, 15
  store i32 %133, ptr %11, align 4, !tbaa !9
  %134 = load i32, ptr %11, align 4, !tbaa !9
  %135 = icmp ne i32 %134, 0
  br i1 %135, label %136, label %224

136:                                              ; preds = %127
  %137 = load i32, ptr %10, align 4, !tbaa !9
  %138 = icmp ne i32 %137, 0
  br i1 %138, label %139, label %182

139:                                              ; preds = %136
  %140 = load i32, ptr %14, align 4, !tbaa !9
  %141 = load i32, ptr %10, align 4, !tbaa !9
  %142 = add nsw i32 %140, %141
  %143 = icmp sgt i32 %142, 63
  br i1 %143, label %144, label %145

144:                                              ; preds = %139
  call void @_ZN4jpgd12jpeg_decoder13stop_decodingENS_11jpgd_statusE(ptr noundef nonnull align 8 dereferenceable(13652) %21, i32 noundef -230) #7
  unreachable

145:                                              ; preds = %139
  %146 = load i32, ptr %14, align 4, !tbaa !9
  %147 = load i32, ptr %12, align 4, !tbaa !9
  %148 = icmp slt i32 %146, %147
  br i1 %148, label %149, label %178

149:                                              ; preds = %145
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #6
  %150 = load i32, ptr %10, align 4, !tbaa !9
  %151 = load i32, ptr %12, align 4, !tbaa !9
  %152 = load i32, ptr %14, align 4, !tbaa !9
  %153 = sub nsw i32 %151, %152
  %154 = icmp slt i32 %150, %153
  br i1 %154, label %155, label %157

155:                                              ; preds = %149
  %156 = load i32, ptr %10, align 4, !tbaa !9
  br label %161

157:                                              ; preds = %149
  %158 = load i32, ptr %12, align 4, !tbaa !9
  %159 = load i32, ptr %14, align 4, !tbaa !9
  %160 = sub nsw i32 %158, %159
  br label %161

161:                                              ; preds = %157, %155
  %162 = phi i32 [ %156, %155 ], [ %160, %157 ]
  store i32 %162, ptr %16, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #6
  %163 = load i32, ptr %14, align 4, !tbaa !9
  store i32 %163, ptr %17, align 4, !tbaa !9
  br label %164

164:                                              ; preds = %168, %161
  %165 = load i32, ptr %16, align 4, !tbaa !9
  %166 = add nsw i32 %165, -1
  store i32 %166, ptr %16, align 4, !tbaa !9
  %167 = icmp ne i32 %165, 0
  br i1 %167, label %168, label %177

168:                                              ; preds = %164
  %169 = load ptr, ptr %6, align 8, !tbaa !5
  %170 = load i32, ptr %17, align 4, !tbaa !9
  %171 = add nsw i32 %170, 1
  store i32 %171, ptr %17, align 4, !tbaa !9
  %172 = sext i32 %170 to i64
  %173 = getelementptr inbounds [64 x i32], ptr @_ZN4jpgdL5g_ZAGE, i64 0, i64 %172
  %174 = load i32, ptr %173, align 4, !tbaa !9
  %175 = sext i32 %174 to i64
  %176 = getelementptr inbounds i16, ptr %169, i64 %175
  store i16 0, ptr %176, align 2, !tbaa !19
  br label %164, !llvm.loop !21

177:                                              ; preds = %164
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  br label %178

178:                                              ; preds = %177, %145
  %179 = load i32, ptr %10, align 4, !tbaa !9
  %180 = load i32, ptr %14, align 4, !tbaa !9
  %181 = add nsw i32 %180, %179
  store i32 %181, ptr %14, align 4, !tbaa !9
  br label %182

182:                                              ; preds = %178, %136
  %183 = load i32, ptr %15, align 4, !tbaa !9
  %184 = load i32, ptr %11, align 4, !tbaa !9
  %185 = and i32 %184, 15
  %186 = sext i32 %185 to i64
  %187 = getelementptr inbounds [16 x i32], ptr @_ZN4jpgdL13s_extend_testE, i64 0, i64 %186
  %188 = load i32, ptr %187, align 4, !tbaa !9
  %189 = icmp slt i32 %183, %188
  br i1 %189, label %190, label %198

190:                                              ; preds = %182
  %191 = load i32, ptr %15, align 4, !tbaa !9
  %192 = load i32, ptr %11, align 4, !tbaa !9
  %193 = and i32 %192, 15
  %194 = sext i32 %193 to i64
  %195 = getelementptr inbounds [16 x i32], ptr @_ZN4jpgdL15s_extend_offsetE, i64 0, i64 %194
  %196 = load i32, ptr %195, align 4, !tbaa !9
  %197 = add nsw i32 %191, %196
  br label %200

198:                                              ; preds = %182
  %199 = load i32, ptr %15, align 4, !tbaa !9
  br label %200

200:                                              ; preds = %198, %190
  %201 = phi i32 [ %197, %190 ], [ %199, %198 ]
  store i32 %201, ptr %11, align 4, !tbaa !9
  %202 = load i32, ptr %14, align 4, !tbaa !9
  %203 = icmp slt i32 %202, 64
  br i1 %203, label %204, label %205

204:                                              ; preds = %200
  br label %207

205:                                              ; preds = %200
  call void @__assert_fail(ptr noundef @.str.7, ptr noundef @.str.1, i32 noundef 1825, ptr noundef @__PRETTY_FUNCTION__._ZN4jpgd12jpeg_decoder15decode_next_rowEv) #8
  unreachable

206:                                              ; No predecessors!
  br label %207

207:                                              ; preds = %206, %204
  %208 = load i32, ptr %11, align 4, !tbaa !9
  %209 = load ptr, ptr %9, align 8, !tbaa !5
  %210 = load i32, ptr %14, align 4, !tbaa !9
  %211 = sext i32 %210 to i64
  %212 = getelementptr inbounds i16, ptr %209, i64 %211
  %213 = load i16, ptr %212, align 2, !tbaa !19
  %214 = sext i16 %213 to i32
  %215 = call noundef i32 @_ZN4jpgdL13dequantize_acEii(i32 noundef %208, i32 noundef %214)
  %216 = trunc i32 %215 to i16
  %217 = load ptr, ptr %6, align 8, !tbaa !5
  %218 = load i32, ptr %14, align 4, !tbaa !9
  %219 = sext i32 %218 to i64
  %220 = getelementptr inbounds [64 x i32], ptr @_ZN4jpgdL5g_ZAGE, i64 0, i64 %219
  %221 = load i32, ptr %220, align 4, !tbaa !9
  %222 = sext i32 %221 to i64
  %223 = getelementptr inbounds i16, ptr %217, i64 %222
  store i16 %216, ptr %223, align 2, !tbaa !19
  br label %288

224:                                              ; preds = %127
  %225 = load i32, ptr %10, align 4, !tbaa !9
  %226 = icmp eq i32 %225, 15
  br i1 %226, label %227, label %286

227:                                              ; preds = %224
  %228 = load i32, ptr %14, align 4, !tbaa !9
  %229 = add nsw i32 %228, 16
  %230 = icmp sgt i32 %229, 64
  br i1 %230, label %231, label %232

231:                                              ; preds = %227
  call void @_ZN4jpgd12jpeg_decoder13stop_decodingENS_11jpgd_statusE(ptr noundef nonnull align 8 dereferenceable(13652) %21, i32 noundef -230) #7
  unreachable

232:                                              ; preds = %227
  %233 = load i32, ptr %14, align 4, !tbaa !9
  %234 = load i32, ptr %12, align 4, !tbaa !9
  %235 = icmp slt i32 %233, %234
  br i1 %235, label %236, label %269

236:                                              ; preds = %232
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #6
  %237 = load i32, ptr %12, align 4, !tbaa !9
  %238 = load i32, ptr %14, align 4, !tbaa !9
  %239 = sub nsw i32 %237, %238
  %240 = icmp slt i32 16, %239
  br i1 %240, label %241, label %242

241:                                              ; preds = %236
  br label %246

242:                                              ; preds = %236
  %243 = load i32, ptr %12, align 4, !tbaa !9
  %244 = load i32, ptr %14, align 4, !tbaa !9
  %245 = sub nsw i32 %243, %244
  br label %246

246:                                              ; preds = %242, %241
  %247 = phi i32 [ 16, %241 ], [ %245, %242 ]
  store i32 %247, ptr %18, align 4, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #6
  %248 = load i32, ptr %14, align 4, !tbaa !9
  store i32 %248, ptr %19, align 4, !tbaa !9
  br label %249

249:                                              ; preds = %259, %246
  %250 = load i32, ptr %18, align 4, !tbaa !9
  %251 = add nsw i32 %250, -1
  store i32 %251, ptr %18, align 4, !tbaa !9
  %252 = icmp ne i32 %250, 0
  br i1 %252, label %253, label %268

253:                                              ; preds = %249
  %254 = load i32, ptr %19, align 4, !tbaa !9
  %255 = icmp sle i32 %254, 63
  br i1 %255, label %256, label %257

256:                                              ; preds = %253
  br label %259

257:                                              ; preds = %253
  call void @__assert_fail(ptr noundef @.str.8, ptr noundef @.str.1, i32 noundef 1842, ptr noundef @__PRETTY_FUNCTION__._ZN4jpgd12jpeg_decoder15decode_next_rowEv) #8
  unreachable

258:                                              ; No predecessors!
  br label %259

259:                                              ; preds = %258, %256
  %260 = load ptr, ptr %6, align 8, !tbaa !5
  %261 = load i32, ptr %19, align 4, !tbaa !9
  %262 = add nsw i32 %261, 1
  store i32 %262, ptr %19, align 4, !tbaa !9
  %263 = sext i32 %261 to i64
  %264 = getelementptr inbounds [64 x i32], ptr @_ZN4jpgdL5g_ZAGE, i64 0, i64 %263
  %265 = load i32, ptr %264, align 4, !tbaa !9
  %266 = sext i32 %265 to i64
  %267 = getelementptr inbounds i16, ptr %260, i64 %266
  store i16 0, ptr %267, align 2, !tbaa !19
  br label %249, !llvm.loop !23

268:                                              ; preds = %249
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #6
  br label %269

269:                                              ; preds = %268, %232
  %270 = load i32, ptr %14, align 4, !tbaa !9
  %271 = add nsw i32 %270, 15
  store i32 %271, ptr %14, align 4, !tbaa !9
  %272 = load ptr, ptr %6, align 8, !tbaa !5
  %273 = load i32, ptr %14, align 4, !tbaa !9
  %274 = sext i32 %273 to i64
  %275 = getelementptr inbounds [64 x i32], ptr @_ZN4jpgdL5g_ZAGE, i64 0, i64 %274
  %276 = load i32, ptr %275, align 4, !tbaa !9
  %277 = sext i32 %276 to i64
  %278 = getelementptr inbounds i16, ptr %272, i64 %277
  %279 = load i16, ptr %278, align 2, !tbaa !19
  %280 = sext i16 %279 to i32
  %281 = icmp eq i32 %280, 0
  br i1 %281, label %282, label %283

282:                                              ; preds = %269
  br label %285

283:                                              ; preds = %269
  call void @__assert_fail(ptr noundef @.str.9, ptr noundef @.str.1, i32 noundef 1848, ptr noundef @__PRETTY_FUNCTION__._ZN4jpgd12jpeg_decoder15decode_next_rowEv) #8
  unreachable

284:                                              ; No predecessors!
  br label %285

285:                                              ; preds = %284, %282
  br label %287

286:                                              ; preds = %224
  store i32 8, ptr %5, align 4
  br label %289

287:                                              ; preds = %285
  br label %288

288:                                              ; preds = %287, %207
  store i32 0, ptr %5, align 4
  br label %289

289:                                              ; preds = %288, %286
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  %290 = load i32, ptr %5, align 4
  switch i32 %290, label %344 [
    i32 0, label %291
    i32 8, label %295
  ]

291:                                              ; preds = %289
  br label %292

292:                                              ; preds = %291
  %293 = load i32, ptr %14, align 4, !tbaa !9
  %294 = add nsw i32 %293, 1
  store i32 %294, ptr %14, align 4, !tbaa !9
  br label %124, !llvm.loop !24

295:                                              ; preds = %289, %124
  %296 = load i32, ptr %14, align 4, !tbaa !9
  %297 = load i32, ptr %12, align 4, !tbaa !9
  %298 = icmp slt i32 %296, %297
  br i1 %298, label %299, label %315

299:                                              ; preds = %295
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #6
  %300 = load i32, ptr %14, align 4, !tbaa !9
  store i32 %300, ptr %20, align 4, !tbaa !9
  br label %301

301:                                              ; preds = %305, %299
  %302 = load i32, ptr %20, align 4, !tbaa !9
  %303 = load i32, ptr %12, align 4, !tbaa !9
  %304 = icmp slt i32 %302, %303
  br i1 %304, label %305, label %314

305:                                              ; preds = %301
  %306 = load ptr, ptr %6, align 8, !tbaa !5
  %307 = load i32, ptr %20, align 4, !tbaa !9
  %308 = add nsw i32 %307, 1
  store i32 %308, ptr %20, align 4, !tbaa !9
  %309 = sext i32 %307 to i64
  %310 = getelementptr inbounds [64 x i32], ptr @_ZN4jpgdL5g_ZAGE, i64 0, i64 %309
  %311 = load i32, ptr %310, align 4, !tbaa !9
  %312 = sext i32 %311 to i64
  %313 = getelementptr inbounds i16, ptr %306, i64 %312
  store i16 0, ptr %313, align 2, !tbaa !19
  br label %301, !llvm.loop !25

314:                                              ; preds = %301
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #6
  br label %315

315:                                              ; preds = %314, %295
  %316 = load i32, ptr %14, align 4, !tbaa !9
  %317 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %21, i32 0, i32 69
  %318 = load i32, ptr %7, align 4, !tbaa !9
  %319 = sext i32 %318 to i64
  %320 = getelementptr inbounds [10 x i32], ptr %317, i64 0, i64 %319
  store i32 %316, ptr %320, align 4, !tbaa !9
  %321 = load i32, ptr %3, align 4, !tbaa !9
  %322 = add nsw i32 %321, 1
  store i32 %322, ptr %3, align 4, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #6
  br label %323

323:                                              ; preds = %315
  %324 = load i32, ptr %7, align 4, !tbaa !9
  %325 = add nsw i32 %324, 1
  store i32 %325, ptr %7, align 4, !tbaa !9
  %326 = load ptr, ptr %6, align 8, !tbaa !5
  %327 = getelementptr inbounds i16, ptr %326, i64 64
  store ptr %327, ptr %6, align 8, !tbaa !5
  br label %40, !llvm.loop !26

328:                                              ; preds = %45
  %329 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %21, i32 0, i32 63
  %330 = load i8, ptr %329, align 4, !tbaa !27, !range !28, !noundef !29
  %331 = trunc i8 %330 to i1
  br i1 %331, label %332, label %334

332:                                              ; preds = %328
  %333 = load i32, ptr %4, align 4, !tbaa !9
  call void @_ZN4jpgd12jpeg_decoder20transform_mcu_expandEi(ptr noundef nonnull align 8 dereferenceable(13652) %21, i32 noundef %333)
  br label %336

334:                                              ; preds = %328
  %335 = load i32, ptr %4, align 4, !tbaa !9
  call void @_ZN4jpgd12jpeg_decoder13transform_mcuEi(ptr noundef nonnull align 8 dereferenceable(13652) %21, i32 noundef %335)
  br label %336

336:                                              ; preds = %334, %332
  %337 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %21, i32 0, i32 56
  %338 = load i32, ptr %337, align 8, !tbaa !16
  %339 = add nsw i32 %338, -1
  store i32 %339, ptr %337, align 8, !tbaa !16
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #6
  br label %340

340:                                              ; preds = %336
  %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 !30

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

344:                                              ; preds = %289
  unreachable
}

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

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

attributes #0 = { noreturn nounwind "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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 #5 = { 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 #6 = { nounwind }
attributes #7 = { noreturn }
attributes #8 = { noreturn 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, !10, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!12, !10, i64 588}
!12 = !{!"_ZTSN4jpgd12jpeg_decoderE", !7, i64 0, !6, i64 200, !10, i64 208, !10, i64 212, !6, i64 216, !10, i64 224, !7, i64 228, !7, i64 240, !7, i64 304, !7, i64 368, !10, i64 400, !10, i64 404, !7, i64 408, !7, i64 424, !7, i64 440, !7, i64 456, !7, i64 472, !7, i64 488, !10, i64 504, !7, i64 508, !7, i64 524, !7, i64 540, !10, i64 556, !10, i64 560, !10, i64 564, !10, i64 568, !10, i64 572, !10, i64 576, !10, i64 580, !10, i64 584, !10, i64 588, !10, i64 592, !7, i64 596, !10, i64 636, !10, i64 640, !10, i64 644, !10, i64 648, !10, i64 652, !7, i64 656, !7, i64 720, !7, i64 752, !10, i64 784, !7, i64 788, !6, i64 808, !10, i64 816, !10, i64 820, !13, i64 824, !7, i64 825, !7, i64 953, !7, i64 9273, !10, i64 9404, !10, i64 9408, !10, i64 9412, !10, i64 9416, !10, i64 9420, !10, i64 9424, !10, i64 9428, !10, i64 9432, !10, i64 9436, !10, i64 9440, !13, i64 9444, !10, i64 9448, !7, i64 9452, !6, i64 9472, !7, i64 9480, !6, i64 9520, !7, i64 9528, !7, i64 10552, !7, i64 11576, !7, i64 12600, !6, i64 13624, !6, i64 13632, !14, i64 13640, !13, i64 13644, !10, i64 13648}
!13 = !{!"bool", !7, i64 0}
!14 = !{!"_ZTSN4jpgd11jpgd_statusE", !7, i64 0}
!15 = !{!12, !10, i64 9412}
!16 = !{!12, !10, i64 9416}
!17 = !{!12, !6, i64 9472}
!18 = !{!12, !10, i64 580}
!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 = !{!12, !13, i64 9444}
!28 = !{i8 0, i8 2}
!29 = !{}
!30 = distinct !{!30, !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"

@.str.1 = external hidden unnamed_addr constant [83 x i8], align 1
@_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
@.str.7 = external hidden unnamed_addr constant [7 x i8], align 1
@__PRETTY_FUNCTION__._ZN4jpgd12jpeg_decoder15decode_next_rowEv = external hidden unnamed_addr constant [43 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [9 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [17 x i8], align 1

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #0

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.start.p0(i64 immarg, ptr nocapture) #1

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #1

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

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

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

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

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

.lr.ph133:                                        ; preds = %1
  %7 = getelementptr inbounds i8, ptr %0, i64 9412
  %8 = getelementptr inbounds i8, ptr %0, i64 9416
  %9 = getelementptr inbounds i8, ptr %0, i64 9472
  %10 = getelementptr inbounds i8, ptr %0, i64 580
  %11 = getelementptr inbounds i8, ptr %0, i64 596
  %12 = getelementptr inbounds i8, ptr %0, i64 368
  %13 = getelementptr inbounds i8, ptr %0, i64 440
  %14 = getelementptr inbounds i8, ptr %0, i64 656
  %15 = getelementptr inbounds i8, ptr %0, i64 524
  %16 = getelementptr inbounds i8, ptr %0, i64 9452
  %17 = getelementptr inbounds i8, ptr %0, i64 9480
  %18 = getelementptr inbounds i8, ptr %0, i64 540
  %19 = getelementptr inbounds i8, ptr %0, i64 9444
  %.pre = load i32, ptr %8, align 8
  br label %20

._crit_edge134:                                   ; preds = %193, %1
  ret void

20:                                               ; preds = %.lr.ph133, %193
  %21 = phi i32 [ %.pre, %.lr.ph133 ], [ %195, %193 ]
  %.079130 = phi i32 [ 0, %.lr.ph133 ], [ %196, %193 ]
  %22 = load i32, ptr %7, align 4, !tbaa !13
  %.not = icmp ne i32 %22, 0
  %23 = icmp eq i32 %21, 0
  %or.cond = select i1 %.not, i1 %23, i1 false
  br i1 %or.cond, label %24, label %25

24:                                               ; preds = %20
  call void @_ZN4jpgd12jpeg_decoder15process_restartEv(ptr noundef nonnull align 8 dereferenceable(13652) %0)
  br label %25

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

.lr.ph129.preheader:                              ; preds = %25
  %28 = load ptr, ptr %9, align 8, !tbaa !15
  br label %.lr.ph129

._crit_edge:                                      ; preds = %.loopexit103, %25
  %29 = load i8, ptr %19, align 4, !tbaa !16, !range !17, !noundef !18
  %30 = trunc nuw i8 %29 to i1
  br i1 %30, label %191, label %192

.lr.ph129:                                        ; preds = %.lr.ph129.preheader, %.loopexit103
  %indvars.iv150 = phi i64 [ 0, %.lr.ph129.preheader ], [ %indvars.iv.next151, %.loopexit103 ]
  %.081127 = phi ptr [ %28, %.lr.ph129.preheader ], [ %187, %.loopexit103 ]
  %31 = getelementptr inbounds [10 x i32], ptr %11, i64 0, i64 %indvars.iv150
  %32 = load i32, ptr %31, align 4, !tbaa !19
  %33 = sext i32 %32 to i64
  %34 = getelementptr inbounds [4 x i32], ptr %13, i64 0, i64 %33
  %35 = load i32, ptr %34, align 4, !tbaa !19
  %36 = sext i32 %35 to i64
  %37 = getelementptr inbounds [4 x ptr], ptr %12, i64 0, i64 %36
  %38 = load ptr, ptr %37, align 8, !tbaa !20
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #7
  %39 = getelementptr inbounds [4 x i32], ptr %15, i64 0, i64 %33
  %40 = load i32, ptr %39, align 4, !tbaa !19
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds [8 x ptr], ptr %14, i64 0, i64 %41
  %43 = load ptr, ptr %42, align 8, !tbaa !20
  %44 = call noundef i32 @_ZN4jpgd12jpeg_decoder11huff_decodeEPNS0_11huff_tablesERi(ptr noundef nonnull align 8 dereferenceable(13652) %0, ptr noundef %43, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %45 = load i32, ptr %2, align 4, !tbaa !19
  %46 = and i32 %44, 15
  %47 = zext nneg i32 %46 to i64
  %48 = getelementptr inbounds [16 x i32], ptr @_ZN4jpgdL13s_extend_testE, i64 0, i64 %47
  %49 = load i32, ptr %48, align 4, !tbaa !19
  %50 = icmp slt i32 %45, %49
  br i1 %50, label %51, label %55

51:                                               ; preds = %.lr.ph129
  %52 = getelementptr inbounds [16 x i32], ptr @_ZN4jpgdL15s_extend_offsetE, i64 0, i64 %47
  %53 = load i32, ptr %52, align 4, !tbaa !19
  %54 = add nsw i32 %53, %45
  br label %55

55:                                               ; preds = %.lr.ph129, %51
  %56 = phi i32 [ %54, %51 ], [ %45, %.lr.ph129 ]
  %57 = getelementptr inbounds [4 x i32], ptr %16, i64 0, i64 %33
  %58 = load i32, ptr %57, align 4, !tbaa !19
  %59 = add i32 %58, %56
  store i32 %59, ptr %57, align 4, !tbaa !19
  %60 = load i16, ptr %38, align 2, !tbaa !21
  %61 = trunc i32 %59 to i16
  %62 = mul i16 %60, %61
  store i16 %62, ptr %.081127, align 2, !tbaa !21
  %63 = getelementptr inbounds [10 x i32], ptr %17, i64 0, i64 %indvars.iv150
  %64 = load i32, ptr %63, align 4, !tbaa !19
  %65 = getelementptr inbounds [4 x i32], ptr %18, i64 0, i64 %33
  %66 = load i32, ptr %65, align 4, !tbaa !19
  %67 = sext i32 %66 to i64
  %68 = getelementptr inbounds [8 x ptr], ptr %14, i64 0, i64 %67
  %69 = load ptr, ptr %68, align 8, !tbaa !20
  br label %70

70:                                               ; preds = %55, %159
  %.076123 = phi i32 [ 1, %55 ], [ %160, %159 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #7
  %71 = call noundef i32 @_ZN4jpgd12jpeg_decoder11huff_decodeEPNS0_11huff_tablesERi(ptr noundef nonnull align 8 dereferenceable(13652) %0, ptr noundef %69, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %72 = ashr i32 %71, 4
  store i32 %72, ptr %2, align 4, !tbaa !19
  %73 = and i32 %71, 15
  %.not92 = icmp eq i32 %73, 0
  br i1 %.not92, label %132, label %74

74:                                               ; preds = %70
  %.not94 = icmp ult i32 %71, 16
  br i1 %.not94, label %.loopexit102, label %75

75:                                               ; preds = %74
  %76 = add nsw i32 %72, %.076123
  %77 = icmp sgt i32 %76, 63
  br i1 %77, label %78, label %79

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

79:                                               ; preds = %75
  %80 = icmp slt i32 %.076123, %64
  br i1 %80, label %81, label %.loopexit102

81:                                               ; preds = %79
  %82 = sub nsw i32 %64, %.076123
  %83 = call i32 @llvm.smin.i32(i32 %72, i32 %82)
  %.not95117 = icmp eq i32 %83, 0
  br i1 %.not95117, label %.loopexit102, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %81
  %84 = sext i32 %.076123 to i64
  %xtraiter = and i32 %83, 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 ], [ %84, %.lr.ph.preheader ]
  %.075118.prol = phi i32 [ %85, %.lr.ph.prol ], [ %83, %.lr.ph.preheader ]
  %prol.iter = phi i32 [ %prol.iter.next, %.lr.ph.prol ], [ 0, %.lr.ph.preheader ]
  %85 = add nsw i32 %.075118.prol, -1
  %indvars.iv.next.prol = add nsw i64 %indvars.iv.prol, 1
  %86 = getelementptr inbounds [64 x i32], ptr @_ZN4jpgdL5g_ZAGE, i64 0, i64 %indvars.iv.prol
  %87 = load i32, ptr %86, align 4, !tbaa !19
  %88 = sext i32 %87 to i64
  %89 = getelementptr inbounds i16, ptr %.081127, i64 %88
  store i16 0, ptr %89, 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 [ %84, %.lr.ph.preheader ], [ %indvars.iv.next.prol, %.lr.ph.prol ]
  %.075118.unr = phi i32 [ %83, %.lr.ph.preheader ], [ %85, %.lr.ph.prol ]
  %90 = icmp ult i32 %83, 4
  br i1 %90, label %.loopexit102, 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 ]
  %.075118 = phi i32 [ %103, %.lr.ph ], [ %.075118.unr, %.lr.ph.prol.loopexit ]
  %indvars.iv.next = add nsw i64 %indvars.iv, 1
  %91 = getelementptr inbounds [64 x i32], ptr @_ZN4jpgdL5g_ZAGE, i64 0, i64 %indvars.iv
  %92 = load i32, ptr %91, align 4, !tbaa !19
  %93 = sext i32 %92 to i64
  %94 = getelementptr inbounds i16, ptr %.081127, i64 %93
  store i16 0, ptr %94, align 2, !tbaa !21
  %indvars.iv.next.1 = add nsw i64 %indvars.iv, 2
  %95 = getelementptr inbounds [64 x i32], ptr @_ZN4jpgdL5g_ZAGE, i64 0, i64 %indvars.iv.next
  %96 = load i32, ptr %95, align 4, !tbaa !19
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds i16, ptr %.081127, i64 %97
  store i16 0, ptr %98, align 2, !tbaa !21
  %indvars.iv.next.2 = add nsw i64 %indvars.iv, 3
  %99 = getelementptr inbounds [64 x i32], ptr @_ZN4jpgdL5g_ZAGE, i64 0, i64 %indvars.iv.next.1
  %100 = load i32, ptr %99, align 4, !tbaa !19
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds i16, ptr %.081127, i64 %101
  store i16 0, ptr %102, align 2, !tbaa !21
  %103 = add nsw i32 %.075118, -4
  %indvars.iv.next.3 = add nsw i64 %indvars.iv, 4
  %104 = getelementptr inbounds [64 x i32], ptr @_ZN4jpgdL5g_ZAGE, i64 0, i64 %indvars.iv.next.2
  %105 = load i32, ptr %104, align 4, !tbaa !19
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds i16, ptr %.081127, i64 %106
  store i16 0, ptr %107, align 2, !tbaa !21
  %.not95.3 = icmp eq i32 %103, 0
  br i1 %.not95.3, label %.loopexit102, label %.lr.ph, !llvm.loop !25

.loopexit102:                                     ; preds = %.lr.ph.prol.loopexit, %.lr.ph, %81, %79, %74
  %.1 = phi i32 [ %.076123, %74 ], [ %76, %79 ], [ %76, %81 ], [ %76, %.lr.ph ], [ %76, %.lr.ph.prol.loopexit ]
  %108 = load i32, ptr %3, align 4, !tbaa !19
  %109 = zext nneg i32 %73 to i64
  %110 = getelementptr inbounds [16 x i32], ptr @_ZN4jpgdL13s_extend_testE, i64 0, i64 %109
  %111 = load i32, ptr %110, align 4, !tbaa !19
  %112 = icmp slt i32 %108, %111
  br i1 %112, label %113, label %117

113:                                              ; preds = %.loopexit102
  %114 = getelementptr inbounds [16 x i32], ptr @_ZN4jpgdL15s_extend_offsetE, i64 0, i64 %109
  %115 = load i32, ptr %114, align 4, !tbaa !19
  %116 = add nsw i32 %115, %108
  br label %117

117:                                              ; preds = %.loopexit102, %113
  %118 = phi i32 [ %116, %113 ], [ %108, %.loopexit102 ]
  %119 = icmp slt i32 %.1, 64
  br i1 %119, label %121, label %120

120:                                              ; preds = %117
  call void @__assert_fail(ptr noundef nonnull @.str.7, ptr noundef nonnull @.str.1, i32 noundef 1825, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN4jpgd12jpeg_decoder15decode_next_rowEv) #9
  unreachable

121:                                              ; preds = %117
  %122 = sext i32 %.1 to i64
  %123 = getelementptr inbounds i16, ptr %38, i64 %122
  %124 = load i16, ptr %123, align 2, !tbaa !21
  %125 = sext i16 %124 to i32
  %126 = call noundef i32 @_ZN4jpgdL13dequantize_acEii(i32 noundef %118, i32 noundef %125)
  %127 = trunc i32 %126 to i16
  %128 = getelementptr inbounds [64 x i32], ptr @_ZN4jpgdL5g_ZAGE, i64 0, i64 %122
  %129 = load i32, ptr %128, align 4, !tbaa !19
  %130 = sext i32 %129 to i64
  %131 = getelementptr inbounds i16, ptr %.081127, i64 %130
  store i16 %127, ptr %131, align 2, !tbaa !21
  br label %159

132:                                              ; preds = %70
  %133 = icmp eq i32 %72, 15
  br i1 %133, label %134, label %158

134:                                              ; preds = %132
  %135 = icmp sgt i32 %.076123, 48
  br i1 %135, label %136, label %137

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

137:                                              ; preds = %134
  %138 = icmp slt i32 %.076123, %64
  br i1 %138, label %.lr.ph122.preheader, label %.loopexit

.lr.ph122.preheader:                              ; preds = %137
  %139 = sub nsw i32 %64, %.076123
  %140 = call i32 @llvm.smin.i32(i32 %139, i32 16)
  %141 = sext i32 %.076123 to i64
  br label %.lr.ph122

.lr.ph122:                                        ; preds = %.lr.ph122.preheader, %143
  %indvars.iv143 = phi i64 [ %141, %.lr.ph122.preheader ], [ %indvars.iv.next144, %143 ]
  %.in = phi i32 [ %140, %.lr.ph122.preheader ], [ %144, %143 ]
  %exitcond.not = icmp eq i64 %indvars.iv143, 64
  br i1 %exitcond.not, label %142, label %143

142:                                              ; preds = %.lr.ph122
  call void @__assert_fail(ptr noundef nonnull @.str.8, ptr noundef nonnull @.str.1, i32 noundef 1842, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN4jpgd12jpeg_decoder15decode_next_rowEv) #9
  unreachable

143:                                              ; preds = %.lr.ph122
  %144 = add nsw i32 %.in, -1
  %indvars.iv.next144 = add nsw i64 %indvars.iv143, 1
  %145 = getelementptr inbounds [64 x i32], ptr @_ZN4jpgdL5g_ZAGE, i64 0, i64 %indvars.iv143
  %146 = load i32, ptr %145, align 4, !tbaa !19
  %147 = sext i32 %146 to i64
  %148 = getelementptr inbounds i16, ptr %.081127, i64 %147
  store i16 0, ptr %148, align 2, !tbaa !21
  %.not93 = icmp eq i32 %144, 0
  br i1 %.not93, label %.loopexit, label %.lr.ph122, !llvm.loop !27

.loopexit:                                        ; preds = %143, %137
  %149 = add nsw i32 %.076123, 15
  %150 = sext i32 %149 to i64
  %151 = getelementptr inbounds [64 x i32], ptr @_ZN4jpgdL5g_ZAGE, i64 0, i64 %150
  %152 = load i32, ptr %151, align 4, !tbaa !19
  %153 = sext i32 %152 to i64
  %154 = getelementptr inbounds i16, ptr %.081127, i64 %153
  %155 = load i16, ptr %154, align 2, !tbaa !21
  %156 = icmp eq i16 %155, 0
  br i1 %156, label %159, label %157

157:                                              ; preds = %.loopexit
  call void @__assert_fail(ptr noundef nonnull @.str.9, ptr noundef nonnull @.str.1, i32 noundef 1848, ptr noundef nonnull @__PRETTY_FUNCTION__._ZN4jpgd12jpeg_decoder15decode_next_rowEv) #9
  unreachable

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

159:                                              ; preds = %.loopexit, %121
  %.3.ph = phi i32 [ %149, %.loopexit ], [ %.1, %121 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #7
  %160 = add nsw i32 %.3.ph, 1
  %161 = icmp slt i32 %.3.ph, 63
  br i1 %161, label %70, label %.loopexit104, !llvm.loop !28

.loopexit104:                                     ; preds = %159, %158
  %.076111 = phi i32 [ %.076123, %158 ], [ %160, %159 ]
  %162 = icmp slt i32 %.076111, %64
  br i1 %162, label %.preheader.preheader, label %.loopexit103

.preheader.preheader:                             ; preds = %.loopexit104
  %163 = sext i32 %.076111 to i64
  %wide.trip.count = sext i32 %64 to i64
  %164 = sub nsw i64 %wide.trip.count, %163
  %xtraiter171 = and i64 %164, 3
  %lcmp.mod172.not = icmp eq i64 %xtraiter171, 0
  br i1 %lcmp.mod172.not, label %.preheader.prol.loopexit, label %.preheader.prol

.preheader.prol:                                  ; preds = %.preheader.preheader, %.preheader.prol
  %indvars.iv146.prol = phi i64 [ %indvars.iv.next147.prol, %.preheader.prol ], [ %163, %.preheader.preheader ]
  %prol.iter173 = phi i64 [ %prol.iter173.next, %.preheader.prol ], [ 0, %.preheader.preheader ]
  %indvars.iv.next147.prol = add nsw i64 %indvars.iv146.prol, 1
  %165 = getelementptr inbounds [64 x i32], ptr @_ZN4jpgdL5g_ZAGE, i64 0, i64 %indvars.iv146.prol
  %166 = load i32, ptr %165, align 4, !tbaa !19
  %167 = sext i32 %166 to i64
  %168 = getelementptr inbounds i16, ptr %.081127, i64 %167
  store i16 0, ptr %168, align 2, !tbaa !21
  %prol.iter173.next = add i64 %prol.iter173, 1
  %prol.iter173.cmp.not = icmp eq i64 %prol.iter173.next, %xtraiter171
  br i1 %prol.iter173.cmp.not, label %.preheader.prol.loopexit, label %.preheader.prol, !llvm.loop !29

.preheader.prol.loopexit:                         ; preds = %.preheader.prol, %.preheader.preheader
  %indvars.iv146.unr = phi i64 [ %163, %.preheader.preheader ], [ %indvars.iv.next147.prol, %.preheader.prol ]
  %169 = sub nsw i64 %163, %wide.trip.count
  %170 = icmp ugt i64 %169, -4
  br i1 %170, label %.loopexit103, label %.preheader

.preheader:                                       ; preds = %.preheader.prol.loopexit, %.preheader
  %indvars.iv146 = phi i64 [ %indvars.iv.next147.3, %.preheader ], [ %indvars.iv146.unr, %.preheader.prol.loopexit ]
  %indvars.iv.next147 = add nsw i64 %indvars.iv146, 1
  %171 = getelementptr inbounds [64 x i32], ptr @_ZN4jpgdL5g_ZAGE, i64 0, i64 %indvars.iv146
  %172 = load i32, ptr %171, align 4, !tbaa !19
  %173 = sext i32 %172 to i64
  %174 = getelementptr inbounds i16, ptr %.081127, i64 %173
  store i16 0, ptr %174, align 2, !tbaa !21
  %indvars.iv.next147.1 = add nsw i64 %indvars.iv146, 2
  %175 = getelementptr inbounds [64 x i32], ptr @_ZN4jpgdL5g_ZAGE, i64 0, i64 %indvars.iv.next147
  %176 = load i32, ptr %175, align 4, !tbaa !19
  %177 = sext i32 %176 to i64
  %178 = getelementptr inbounds i16, ptr %.081127, i64 %177
  store i16 0, ptr %178, align 2, !tbaa !21
  %indvars.iv.next147.2 = add nsw i64 %indvars.iv146, 3
  %179 = getelementptr inbounds [64 x i32], ptr @_ZN4jpgdL5g_ZAGE, i64 0, i64 %indvars.iv.next147.1
  %180 = load i32, ptr %179, align 4, !tbaa !19
  %181 = sext i32 %180 to i64
  %182 = getelementptr inbounds i16, ptr %.081127, i64 %181
  store i16 0, ptr %182, align 2, !tbaa !21
  %indvars.iv.next147.3 = add nsw i64 %indvars.iv146, 4
  %183 = getelementptr inbounds [64 x i32], ptr @_ZN4jpgdL5g_ZAGE, i64 0, i64 %indvars.iv.next147.2
  %184 = load i32, ptr %183, align 4, !tbaa !19
  %185 = sext i32 %184 to i64
  %186 = getelementptr inbounds i16, ptr %.081127, i64 %185
  store i16 0, ptr %186, align 2, !tbaa !21
  %exitcond149.not.3 = icmp eq i64 %indvars.iv.next147.3, %wide.trip.count
  br i1 %exitcond149.not.3, label %.loopexit103, label %.preheader, !llvm.loop !30

.loopexit103:                                     ; preds = %.preheader.prol.loopexit, %.preheader, %.loopexit104
  store i32 %.076111, ptr %63, align 4, !tbaa !19
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #7
  %indvars.iv.next151 = add nuw nsw i64 %indvars.iv150, 1
  %187 = getelementptr inbounds i8, ptr %.081127, i64 128
  %188 = load i32, ptr %10, align 4, !tbaa !14
  %189 = sext i32 %188 to i64
  %190 = icmp slt i64 %indvars.iv.next151, %189
  br i1 %190, label %.lr.ph129, label %._crit_edge, !llvm.loop !31

191:                                              ; preds = %._crit_edge
  call void @_ZN4jpgd12jpeg_decoder20transform_mcu_expandEi(ptr noundef nonnull align 8 dereferenceable(13652) %0, i32 noundef %.079130)
  br label %193

192:                                              ; preds = %._crit_edge
  call void @_ZN4jpgd12jpeg_decoder13transform_mcuEi(ptr noundef nonnull align 8 dereferenceable(13652) %0, i32 noundef %.079130)
  br label %193

193:                                              ; preds = %192, %191
  %194 = load i32, ptr %8, align 8, !tbaa !32
  %195 = add nsw i32 %194, -1
  store i32 %195, ptr %8, align 8, !tbaa !32
  %196 = add nuw nsw i32 %.079130, 1
  %197 = load i32, ptr %4, align 4, !tbaa !5
  %198 = icmp slt i32 %196, %197
  br i1 %198, label %20, label %._crit_edge134, !llvm.loop !33
}

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

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

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

attributes #0 = { noreturn nounwind "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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { 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 #5 = { 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 #6 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #7 = { nounwind }
attributes #8 = { noreturn }
attributes #9 = { noreturn 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, !10, i64 588}
!6 = !{!"_ZTSN4jpgd12jpeg_decoderE", !7, i64 0, !9, i64 200, !10, i64 208, !10, i64 212, !9, i64 216, !10, i64 224, !7, i64 228, !7, i64 240, !7, i64 304, !7, i64 368, !10, i64 400, !10, i64 404, !7, i64 408, !7, i64 424, !7, i64 440, !7, i64 456, !7, i64 472, !7, i64 488, !10, i64 504, !7, i64 508, !7, i64 524, !7, i64 540, !10, i64 556, !10, i64 560, !10, i64 564, !10, i64 568, !10, i64 572, !10, i64 576, !10, i64 580, !10, i64 584, !10, i64 588, !10, i64 592, !7, i64 596, !10, i64 636, !10, i64 640, !10, i64 644, !10, i64 648, !10, i64 652, !7, i64 656, !7, i64 720, !7, i64 752, !10, i64 784, !7, i64 788, !9, i64 808, !10, i64 816, !10, i64 820, !11, i64 824, !7, i64 825, !7, i64 953, !7, i64 9273, !10, i64 9404, !10, i64 9408, !10, i64 9412, !10, i64 9416, !10, i64 9420, !10, i64 9424, !10, i64 9428, !10, i64 9432, !10, i64 9436, !10, i64 9440, !11, i64 9444, !10, i64 9448, !7, i64 9452, !9, i64 9472, !7, i64 9480, !9, i64 9520, !7, i64 9528, !7, i64 10552, !7, i64 11576, !7, i64 12600, !9, i64 13624, !9, i64 13632, !12, i64 13640, !11, i64 13644, !10, i64 13648}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!"any pointer", !7, i64 0}
!10 = !{!"int", !7, i64 0}
!11 = !{!"bool", !7, i64 0}
!12 = !{!"_ZTSN4jpgd11jpgd_statusE", !7, i64 0}
!13 = !{!6, !10, i64 9412}
!14 = !{!6, !10, i64 580}
!15 = !{!6, !9, i64 9472}
!16 = !{!6, !11, i64 9444}
!17 = !{i8 0, i8 2}
!18 = !{}
!19 = !{!10, !10, i64 0}
!20 = !{!9, !9, i64 0}
!21 = !{!22, !22, i64 0}
!22 = !{!"short", !7, i64 0}
!23 = distinct !{!23, !24}
!24 = !{!"llvm.loop.unroll.disable"}
!25 = distinct !{!25, !26}
!26 = !{!"llvm.loop.mustprogress"}
!27 = distinct !{!27, !26}
!28 = distinct !{!28, !26}
!29 = distinct !{!29, !24}
!30 = distinct !{!30, !26}
!31 = distinct !{!31, !26}
!32 = !{!6, !10, i64 9416}
!33 = distinct !{!33, !26}


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