; LLVM IR from EyalAr/lwip :: src/lib/jpeg (jdmaster)

; 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"

%struct.jpeg_decompress_struct = type { ptr, ptr, ptr, ptr, i32, i32, ptr, i32, i32, i32, i32, i32, i32, i32, double, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, ptr, i32, i32, i32, i32, i32, ptr, [4 x ptr], [4 x ptr], [4 x ptr], i32, ptr, i32, i32, i32, [16 x i8], [16 x i8], [16 x i8], i32, i32, i8, i8, i8, i16, i16, i32, i8, i32, i32, ptr, i32, i32, i32, i32, i32, ptr, i32, [4 x ptr], i32, i32, i32, [10 x i32], i32, i32, i32, i32, i32, ptr, i32, i32, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr }
%struct.jpeg_error_mgr = type { ptr, ptr, ptr, ptr, ptr, i32, %union.anon, i32, i64, ptr, i32, ptr, i32, i32 }
%union.anon = type { [8 x i32], [48 x i8] }
%struct.jpeg_component_info = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, ptr, ptr }

; Function Attrs: nounwind uwtable
define dso_local void @jpeg_calc_output_dimensions(ptr noundef %0) #0 {
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #3
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #3
  %6 = load ptr, ptr %2, align 8, !tbaa !5
  %7 = getelementptr inbounds %struct.jpeg_decompress_struct, ptr %6, i32 0, i32 5
  %8 = load i32, ptr %7, align 4, !tbaa !9
  %9 = icmp ne i32 %8, 202
  br i1 %9, label %10, label %29

10:                                               ; preds = %1
  %11 = load ptr, ptr %2, align 8, !tbaa !5
  %12 = getelementptr inbounds %struct.jpeg_decompress_struct, ptr %11, i32 0, i32 0
  %13 = load ptr, ptr %12, align 8, !tbaa !14
  %14 = getelementptr inbounds %struct.jpeg_error_mgr, ptr %13, i32 0, i32 5
  store i32 21, ptr %14, align 8, !tbaa !15
  %15 = load ptr, ptr %2, align 8, !tbaa !5
  %16 = getelementptr inbounds %struct.jpeg_decompress_struct, ptr %15, i32 0, i32 5
  %17 = load i32, ptr %16, align 4, !tbaa !9
  %18 = load ptr, ptr %2, align 8, !tbaa !5
  %19 = getelementptr inbounds %struct.jpeg_decompress_struct, ptr %18, i32 0, i32 0
  %20 = load ptr, ptr %19, align 8, !tbaa !14
  %21 = getelementptr inbounds %struct.jpeg_error_mgr, ptr %20, i32 0, i32 6
  %22 = getelementptr inbounds [8 x i32], ptr %21, i64 0, i64 0
  store i32 %17, ptr %22, align 4, !tbaa !18
  %23 = load ptr, ptr %2, align 8, !tbaa !5
  %24 = getelementptr inbounds %struct.jpeg_decompress_struct, ptr %23, i32 0, i32 0
  %25 = load ptr, ptr %24, align 8, !tbaa !14
  %26 = getelementptr inbounds %struct.jpeg_error_mgr, ptr %25, i32 0, i32 0
  %27 = load ptr, ptr %26, align 8, !tbaa !19
  %28 = load ptr, ptr %2, align 8, !tbaa !5
  call void %27(ptr noundef %28)
  br label %29

29:                                               ; preds = %10, %1
  %30 = load ptr, ptr %2, align 8, !tbaa !5
  call void @jpeg_core_output_dimensions(ptr noundef %30)
  store i32 0, ptr %3, align 4, !tbaa !20
  %31 = load ptr, ptr %2, align 8, !tbaa !5
  %32 = getelementptr inbounds %struct.jpeg_decompress_struct, ptr %31, i32 0, i32 44
  %33 = load ptr, ptr %32, align 8, !tbaa !21
  store ptr %33, ptr %4, align 8, !tbaa !5
  br label %34

34:                                               ; preds = %150, %29
  %35 = load i32, ptr %3, align 4, !tbaa !20
  %36 = load ptr, ptr %2, align 8, !tbaa !5
  %37 = getelementptr inbounds %struct.jpeg_decompress_struct, ptr %36, i32 0, i32 9
  %38 = load i32, ptr %37, align 8, !tbaa !22
  %39 = icmp slt i32 %35, %38
  br i1 %39, label %40, label %155

40:                                               ; preds = %34
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #3
  store i32 1, ptr %5, align 4, !tbaa !20
  br label %41

41:                                               ; preds = %68, %40
  %42 = load ptr, ptr %2, align 8, !tbaa !5
  %43 = getelementptr inbounds %struct.jpeg_decompress_struct, ptr %42, i32 0, i32 65
  %44 = load i32, ptr %43, align 8, !tbaa !23
  %45 = load i32, ptr %5, align 4, !tbaa !20
  %46 = mul nsw i32 %44, %45
  %47 = load ptr, ptr %2, align 8, !tbaa !5
  %48 = getelementptr inbounds %struct.jpeg_decompress_struct, ptr %47, i32 0, i32 18
  %49 = load i32, ptr %48, align 4, !tbaa !24
  %50 = icmp ne i32 %49, 0
  %51 = zext i1 %50 to i64
  %52 = select i1 %50, i32 8, i32 4
  %53 = icmp sle i32 %46, %52
  br i1 %53, label %54, label %66

54:                                               ; preds = %41
  %55 = load ptr, ptr %2, align 8, !tbaa !5
  %56 = getelementptr inbounds %struct.jpeg_decompress_struct, ptr %55, i32 0, i32 63
  %57 = load i32, ptr %56, align 8, !tbaa !25
  %58 = load ptr, ptr %4, align 8, !tbaa !5
  %59 = getelementptr inbounds %struct.jpeg_component_info, ptr %58, i32 0, i32 2
  %60 = load i32, ptr %59, align 8, !tbaa !26
  %61 = load i32, ptr %5, align 4, !tbaa !20
  %62 = mul nsw i32 %60, %61
  %63 = mul nsw i32 %62, 2
  %64 = srem i32 %57, %63
  %65 = icmp eq i32 %64, 0
  br label %66

66:                                               ; preds = %54, %41
  %67 = phi i1 [ false, %41 ], [ %65, %54 ]
  br i1 %67, label %68, label %71

68:                                               ; preds = %66
  %69 = load i32, ptr %5, align 4, !tbaa !20
  %70 = mul nsw i32 %69, 2
  store i32 %70, ptr %5, align 4, !tbaa !20
  br label %41, !llvm.loop !28

71:                                               ; preds = %66
  %72 = load ptr, ptr %2, align 8, !tbaa !5
  %73 = getelementptr inbounds %struct.jpeg_decompress_struct, ptr %72, i32 0, i32 65
  %74 = load i32, ptr %73, align 8, !tbaa !23
  %75 = load i32, ptr %5, align 4, !tbaa !20
  %76 = mul nsw i32 %74, %75
  %77 = load ptr, ptr %4, align 8, !tbaa !5
  %78 = getelementptr inbounds %struct.jpeg_component_info, ptr %77, i32 0, i32 9
  store i32 %76, ptr %78, align 4, !tbaa !30
  store i32 1, ptr %5, align 4, !tbaa !20
  br label %79

79:                                               ; preds = %106, %71
  %80 = load ptr, ptr %2, align 8, !tbaa !5
  %81 = getelementptr inbounds %struct.jpeg_decompress_struct, ptr %80, i32 0, i32 66
  %82 = load i32, ptr %81, align 4, !tbaa !31
  %83 = load i32, ptr %5, align 4, !tbaa !20
  %84 = mul nsw i32 %82, %83
  %85 = load ptr, ptr %2, align 8, !tbaa !5
  %86 = getelementptr inbounds %struct.jpeg_decompress_struct, ptr %85, i32 0, i32 18
  %87 = load i32, ptr %86, align 4, !tbaa !24
  %88 = icmp ne i32 %87, 0
  %89 = zext i1 %88 to i64
  %90 = select i1 %88, i32 8, i32 4
  %91 = icmp sle i32 %84, %90
  br i1 %91, label %92, label %104

92:                                               ; preds = %79
  %93 = load ptr, ptr %2, align 8, !tbaa !5
  %94 = getelementptr inbounds %struct.jpeg_decompress_struct, ptr %93, i32 0, i32 64
  %95 = load i32, ptr %94, align 4, !tbaa !32
  %96 = load ptr, ptr %4, align 8, !tbaa !5
  %97 = getelementptr inbounds %struct.jpeg_component_info, ptr %96, i32 0, i32 3
  %98 = load i32, ptr %97, align 4, !tbaa !33
  %99 = load i32, ptr %5, align 4, !tbaa !20
  %100 = mul nsw i32 %98, %99
  %101 = mul nsw i32 %100, 2
  %102 = srem i32 %95, %101
  %103 = icmp eq i32 %102, 0
  br label %104

104:                                              ; preds = %92, %79
  %105 = phi i1 [ false, %79 ], [ %103, %92 ]
  br i1 %105, label %106, label %109

106:                                              ; preds = %104
  %107 = load i32, ptr %5, align 4, !tbaa !20
  %108 = mul nsw i32 %107, 2
  store i32 %108, ptr %5, align 4, !tbaa !20
  br label %79, !llvm.loop !34

109:                                              ; preds = %104
  %110 = load ptr, ptr %2, align 8, !tbaa !5
  %111 = getelementptr inbounds %struct.jpeg_decompress_struct, ptr %110, i32 0, i32 66
  %112 = load i32, ptr %111, align 4, !tbaa !31
  %113 = load i32, ptr %5, align 4, !tbaa !20
  %114 = mul nsw i32 %112, %113
  %115 = load ptr, ptr %4, align 8, !tbaa !5
  %116 = getelementptr inbounds %struct.jpeg_component_info, ptr %115, i32 0, i32 10
  store i32 %114, ptr %116, align 8, !tbaa !35
  %117 = load ptr, ptr %4, align 8, !tbaa !5
  %118 = getelementptr inbounds %struct.jpeg_component_info, ptr %117, i32 0, i32 9
  %119 = load i32, ptr %118, align 4, !tbaa !30
  %120 = load ptr, ptr %4, align 8, !tbaa !5
  %121 = getelementptr inbounds %struct.jpeg_component_info, ptr %120, i32 0, i32 10
  %122 = load i32, ptr %121, align 8, !tbaa !35
  %123 = mul nsw i32 %122, 2
  %124 = icmp sgt i32 %119, %123
  br i1 %124, label %125, label %132

125:                                              ; preds = %109
  %126 = load ptr, ptr %4, align 8, !tbaa !5
  %127 = getelementptr inbounds %struct.jpeg_component_info, ptr %126, i32 0, i32 10
  %128 = load i32, ptr %127, align 8, !tbaa !35
  %129 = mul nsw i32 %128, 2
  %130 = load ptr, ptr %4, align 8, !tbaa !5
  %131 = getelementptr inbounds %struct.jpeg_component_info, ptr %130, i32 0, i32 9
  store i32 %129, ptr %131, align 4, !tbaa !30
  br label %149

132:                                              ; preds = %109
  %133 = load ptr, ptr %4, align 8, !tbaa !5
  %134 = getelementptr inbounds %struct.jpeg_component_info, ptr %133, i32 0, i32 10
  %135 = load i32, ptr %134, align 8, !tbaa !35
  %136 = load ptr, ptr %4, align 8, !tbaa !5
  %137 = getelementptr inbounds %struct.jpeg_component_info, ptr %136, i32 0, i32 9
  %138 = load i32, ptr %137, align 4, !tbaa !30
  %139 = mul nsw i32 %138, 2
  %140 = icmp sgt i32 %135, %139
  br i1 %140, label %141, label %148

141:                                              ; preds = %132
  %142 = load ptr, ptr %4, align 8, !tbaa !5
  %143 = getelementptr inbounds %struct.jpeg_component_info, ptr %142, i32 0, i32 9
  %144 = load i32, ptr %143, align 4, !tbaa !30
  %145 = mul nsw i32 %144, 2
  %146 = load ptr, ptr %4, align 8, !tbaa !5
  %147 = getelementptr inbounds %struct.jpeg_component_info, ptr %146, i32 0, i32 10
  store i32 %145, ptr %147, align 8, !tbaa !35
  br label %148

148:                                              ; preds = %141, %132
  br label %149

149:                                              ; preds = %148, %125
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #3
  br label %150

150:                                              ; preds = %149
  %151 = load i32, ptr %3, align 4, !tbaa !20
  %152 = add nsw i32 %151, 1
  store i32 %152, ptr %3, align 4, !tbaa !20
  %153 = load ptr, ptr %4, align 8, !tbaa !5
  %154 = getelementptr inbounds %struct.jpeg_component_info, ptr %153, i32 1
  store ptr %154, ptr %4, align 8, !tbaa !5
  br label %34, !llvm.loop !36

155:                                              ; preds = %34
  store i32 0, ptr %3, align 4, !tbaa !20
  %156 = load ptr, ptr %2, align 8, !tbaa !5
  %157 = getelementptr inbounds %struct.jpeg_decompress_struct, ptr %156, i32 0, i32 44
  %158 = load ptr, ptr %157, align 8, !tbaa !21
  store ptr %158, ptr %4, align 8, !tbaa !5
  br label %159

159:                                              ; preds = %216, %155
  %160 = load i32, ptr %3, align 4, !tbaa !20
  %161 = load ptr, ptr %2, align 8, !tbaa !5
  %162 = getelementptr inbounds %struct.jpeg_decompress_struct, ptr %161, i32 0, i32 9
  %163 = load i32, ptr %162, align 8, !tbaa !22
  %164 = icmp slt i32 %160, %163
  br i1 %164, label %165, label %221

165:                                              ; preds = %159
  %166 = load ptr, ptr %2, align 8, !tbaa !5
  %167 = getelementptr inbounds %struct.jpeg_decompress_struct, ptr %166, i32 0, i32 7
  %168 = load i32, ptr %167, align 8, !tbaa !37
  %169 = zext i32 %168 to i64
  %170 = load ptr, ptr %4, align 8, !tbaa !5
  %171 = getelementptr inbounds %struct.jpeg_component_info, ptr %170, i32 0, i32 2
  %172 = load i32, ptr %171, align 8, !tbaa !26
  %173 = load ptr, ptr %4, align 8, !tbaa !5
  %174 = getelementptr inbounds %struct.jpeg_component_info, ptr %173, i32 0, i32 9
  %175 = load i32, ptr %174, align 4, !tbaa !30
  %176 = mul nsw i32 %172, %175
  %177 = sext i32 %176 to i64
  %178 = mul nsw i64 %169, %177
  %179 = load ptr, ptr %2, align 8, !tbaa !5
  %180 = getelementptr inbounds %struct.jpeg_decompress_struct, ptr %179, i32 0, i32 63
  %181 = load i32, ptr %180, align 8, !tbaa !25
  %182 = load ptr, ptr %2, align 8, !tbaa !5
  %183 = getelementptr inbounds %struct.jpeg_decompress_struct, ptr %182, i32 0, i32 79
  %184 = load i32, ptr %183, align 4, !tbaa !38
  %185 = mul nsw i32 %181, %184
  %186 = sext i32 %185 to i64
  %187 = call i64 @jdiv_round_up(i64 noundef %178, i64 noundef %186)
  %188 = trunc i64 %187 to i32
  %189 = load ptr, ptr %4, align 8, !tbaa !5
  %190 = getelementptr inbounds %struct.jpeg_component_info, ptr %189, i32 0, i32 11
  store i32 %188, ptr %190, align 4, !tbaa !39
  %191 = load ptr, ptr %2, align 8, !tbaa !5
  %192 = getelementptr inbounds %struct.jpeg_decompress_struct, ptr %191, i32 0, i32 8
  %193 = load i32, ptr %192, align 4, !tbaa !40
  %194 = zext i32 %193 to i64
  %195 = load ptr, ptr %4, align 8, !tbaa !5
  %196 = getelementptr inbounds %struct.jpeg_component_info, ptr %195, i32 0, i32 3
  %197 = load i32, ptr %196, align 4, !tbaa !33
  %198 = load ptr, ptr %4, align 8, !tbaa !5
  %199 = getelementptr inbounds %struct.jpeg_component_info, ptr %198, i32 0, i32 10
  %200 = load i32, ptr %199, align 8, !tbaa !35
  %201 = mul nsw i32 %197, %200
  %202 = sext i32 %201 to i64
  %203 = mul nsw i64 %194, %202
  %204 = load ptr, ptr %2, align 8, !tbaa !5
  %205 = getelementptr inbounds %struct.jpeg_decompress_struct, ptr %204, i32 0, i32 64
  %206 = load i32, ptr %205, align 4, !tbaa !32
  %207 = load ptr, ptr %2, align 8, !tbaa !5
  %208 = getelementptr inbounds %struct.jpeg_decompress_struct, ptr %207, i32 0, i32 79
  %209 = load i32, ptr %208, align 4, !tbaa !38
  %210 = mul nsw i32 %206, %209
  %211 = sext i32 %210 to i64
  %212 = call i64 @jdiv_round_up(i64 noundef %203, i64 noundef %211)
  %213 = trunc i64 %212 to i32
  %214 = load ptr, ptr %4, align 8, !tbaa !5
  %215 = getelementptr inbounds %struct.jpeg_component_info, ptr %214, i32 0, i32 12
  store i32 %213, ptr %215, align 8, !tbaa !41
  br label %216

216:                                              ; preds = %165
  %217 = load i32, ptr %3, align 4, !tbaa !20
  %218 = add nsw i32 %217, 1
  store i32 %218, ptr %3, align 4, !tbaa !20
  %219 = load ptr, ptr %4, align 8, !tbaa !5
  %220 = getelementptr inbounds %struct.jpeg_component_info, ptr %219, i32 1
  store ptr %220, ptr %4, align 8, !tbaa !5
  br label %159, !llvm.loop !42

221:                                              ; preds = %159
  %222 = load ptr, ptr %2, align 8, !tbaa !5
  %223 = getelementptr inbounds %struct.jpeg_decompress_struct, ptr %222, i32 0, i32 11
  %224 = load i32, ptr %223, align 8, !tbaa !43
  switch i32 %224, label %237 [
    i32 1, label %225
    i32 2, label %228
    i32 6, label %228
    i32 3, label %231
    i32 7, label %231
    i32 4, label %234
    i32 5, label %234
  ]

225:                                              ; preds = %221
  %226 = load ptr, ptr %2, align 8, !tbaa !5
  %227 = getelementptr inbounds %struct.jpeg_decompress_struct, ptr %226, i32 0, i32 29
  store i32 1, ptr %227, align 8, !tbaa !44
  br label %243

228:                                              ; preds = %221, %221
  %229 = load ptr, ptr %2, align 8, !tbaa !5
  %230 = getelementptr inbounds %struct.jpeg_decompress_struct, ptr %229, i32 0, i32 29
  store i32 3, ptr %230, align 8, !tbaa !44
  br label %243

231:                                              ; preds = %221, %221
  %232 = load ptr, ptr %2, align 8, !tbaa !5
  %233 = getelementptr inbounds %struct.jpeg_decompress_struct, ptr %232, i32 0, i32 29
  store i32 3, ptr %233, align 8, !tbaa !44
  br label %243

234:                                              ; preds = %221, %221
  %235 = load ptr, ptr %2, align 8, !tbaa !5
  %236 = getelementptr inbounds %struct.jpeg_decompress_struct, ptr %235, i32 0, i32 29
  store i32 4, ptr %236, align 8, !tbaa !44
  br label %243

237:                                              ; preds = %221
  %238 = load ptr, ptr %2, align 8, !tbaa !5
  %239 = getelementptr inbounds %struct.jpeg_decompress_struct, ptr %238, i32 0, i32 9
  %240 = load i32, ptr %239, align 8, !tbaa !22
  %241 = load ptr, ptr %2, align 8, !tbaa !5
  %242 = getelementptr inbounds %struct.jpeg_decompress_struct, ptr %241, i32 0, i32 29
  store i32 %240, ptr %242, align 8, !tbaa !44
  br label %243

243:                                              ; preds = %237, %234, %231, %228, %225
  %244 = load ptr, ptr %2, align 8, !tbaa !5
  %245 = getelementptr inbounds %struct.jpeg_decompress_struct, ptr %244, i32 0, i32 20
  %246 = load i32, ptr %245, align 4, !tbaa !45
  %247 = icmp ne i32 %246, 0
  br i1 %247, label %248, label %249

248:                                              ; preds = %243
  br label %253

249:                                              ; preds = %243
  %250 = load ptr, ptr %2, align 8, !tbaa !5
  %251 = getelementptr inbounds %struct.jpeg_decompress_struct, ptr %250, i32 0, i32 29
  %252 = load i32, ptr %251, align 8, !tbaa !44
  br label %253

253:                                              ; preds = %249, %248
  %254 = phi i32 [ 1, %248 ], [ %252, %249 ]
  %255 = load ptr, ptr %2, align 8, !tbaa !5
  %256 = getelementptr inbounds %struct.jpeg_decompress_struct, ptr %255, i32 0, i32 30
  store i32 %254, ptr %256, align 4, !tbaa !46
  %257 = load ptr, ptr %2, align 8, !tbaa !5
  %258 = call i32 @use_merged_upsample(ptr noundef %257)
  %259 = icmp ne i32 %258, 0
  br i1 %259, label %260, label %266

260:                                              ; preds = %253
  %261 = load ptr, ptr %2, align 8, !tbaa !5
  %262 = getelementptr inbounds %struct.jpeg_decompress_struct, ptr %261, i32 0, i32 64
  %263 = load i32, ptr %262, align 4, !tbaa !32
  %264 = load ptr, ptr %2, align 8, !tbaa !5
  %265 = getelementptr inbounds %struct.jpeg_decompress_struct, ptr %264, i32 0, i32 31
  store i32 %263, ptr %265, align 8, !tbaa !47
  br label %269

266:                                              ; preds = %253
  %267 = load ptr, ptr %2, align 8, !tbaa !5
  %268 = getelementptr inbounds %struct.jpeg_decompress_struct, ptr %267, i32 0, i32 31
  store i32 1, ptr %268, align 8, !tbaa !47
  br label %269

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

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

declare void @jpeg_core_output_dimensions(ptr noundef) #2

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

declare i64 @jdiv_round_up(i64 noundef, i64 noundef) #2

; Function Attrs: nounwind uwtable
declare hidden i32 @use_merged_upsample(ptr noundef) #0

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C/C++ TBAA"}
!9 = !{!10, !11, i64 36}
!10 = !{!"jpeg_decompress_struct", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !11, i64 32, !11, i64 36, !6, i64 40, !11, i64 48, !11, i64 52, !11, i64 56, !11, i64 60, !11, i64 64, !11, i64 68, !11, i64 72, !12, i64 80, !11, i64 88, !11, i64 92, !11, i64 96, !11, i64 100, !11, i64 104, !11, i64 108, !11, i64 112, !11, i64 116, !11, i64 120, !11, i64 124, !11, i64 128, !11, i64 132, !11, i64 136, !11, i64 140, !11, i64 144, !11, i64 148, !11, i64 152, !11, i64 156, !6, i64 160, !11, i64 168, !11, i64 172, !11, i64 176, !11, i64 180, !11, i64 184, !6, i64 192, !7, i64 200, !7, i64 232, !7, i64 264, !11, i64 296, !6, i64 304, !11, i64 312, !11, i64 316, !11, i64 320, !7, i64 324, !7, i64 340, !7, i64 356, !11, i64 372, !11, i64 376, !7, i64 380, !7, i64 381, !7, i64 382, !13, i64 384, !13, i64 386, !11, i64 388, !7, i64 392, !11, i64 396, !11, i64 400, !6, i64 408, !11, i64 416, !11, i64 420, !11, i64 424, !11, i64 428, !11, i64 432, !6, i64 440, !11, i64 448, !7, i64 456, !11, i64 488, !11, i64 492, !11, i64 496, !7, i64 500, !11, i64 540, !11, i64 544, !11, i64 548, !11, i64 552, !11, i64 556, !6, i64 560, !11, i64 568, !11, i64 572, !6, i64 576, !6, i64 584, !6, i64 592, !6, i64 600, !6, i64 608, !6, i64 616, !6, i64 624, !6, i64 632, !6, i64 640, !6, i64 648, !6, i64 656}
!11 = !{!"int", !7, i64 0}
!12 = !{!"double", !7, i64 0}
!13 = !{!"short", !7, i64 0}
!14 = !{!10, !6, i64 0}
!15 = !{!16, !11, i64 40}
!16 = !{!"jpeg_error_mgr", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !11, i64 40, !7, i64 44, !11, i64 124, !17, i64 128, !6, i64 136, !11, i64 144, !6, i64 152, !11, i64 160, !11, i64 164}
!17 = !{!"long", !7, i64 0}
!18 = !{!7, !7, i64 0}
!19 = !{!16, !6, i64 0}
!20 = !{!11, !11, i64 0}
!21 = !{!10, !6, i64 304}
!22 = !{!10, !11, i64 56}
!23 = !{!10, !11, i64 424}
!24 = !{!10, !11, i64 100}
!25 = !{!10, !11, i64 416}
!26 = !{!27, !11, i64 8}
!27 = !{!"", !11, i64 0, !11, i64 4, !11, i64 8, !11, i64 12, !11, i64 16, !11, i64 20, !11, i64 24, !11, i64 28, !11, i64 32, !11, i64 36, !11, i64 40, !11, i64 44, !11, i64 48, !11, i64 52, !11, i64 56, !11, i64 60, !11, i64 64, !11, i64 68, !11, i64 72, !11, i64 76, !6, i64 80, !6, i64 88}
!28 = distinct !{!28, !29}
!29 = !{!"llvm.loop.mustprogress"}
!30 = !{!27, !11, i64 36}
!31 = !{!10, !11, i64 428}
!32 = !{!10, !11, i64 420}
!33 = !{!27, !11, i64 12}
!34 = distinct !{!34, !29}
!35 = !{!27, !11, i64 40}
!36 = distinct !{!36, !29}
!37 = !{!10, !11, i64 48}
!38 = !{!10, !11, i64 556}
!39 = !{!27, !11, i64 44}
!40 = !{!10, !11, i64 52}
!41 = !{!27, !11, i64 48}
!42 = distinct !{!42, !29}
!43 = !{!10, !11, i64 64}
!44 = !{!10, !11, i64 144}
!45 = !{!10, !11, i64 108}
!46 = !{!10, !11, i64 148}
!47 = !{!10, !11, i64 152}


; 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"

@switch.table.jpeg_calc_output_dimensions = private unnamed_addr constant [7 x i32] [i32 1, i32 3, i32 3, i32 4, i32 4, i32 3, i32 3], align 4

; Function Attrs: nounwind uwtable
define dso_local void @jpeg_calc_output_dimensions(ptr noundef %0) local_unnamed_addr #0 {
  %2 = getelementptr inbounds i8, ptr %0, i64 36
  %3 = load i32, ptr %2, align 4, !tbaa !5
  %.not = icmp eq i32 %3, 202
  br i1 %.not, label %10, label %4

4:                                                ; preds = %1
  %5 = load ptr, ptr %0, align 8, !tbaa !13
  %6 = getelementptr inbounds i8, ptr %5, i64 40
  store i32 21, ptr %6, align 8, !tbaa !14
  %7 = getelementptr inbounds i8, ptr %5, i64 44
  store i32 %3, ptr %7, align 4, !tbaa !17
  %8 = load ptr, ptr %0, align 8, !tbaa !13
  %9 = load ptr, ptr %8, align 8, !tbaa !18
  tail call void %9(ptr noundef nonnull %0) #2
  br label %10

10:                                               ; preds = %4, %1
  tail call void @jpeg_core_output_dimensions(ptr noundef nonnull %0) #2
  %11 = getelementptr inbounds i8, ptr %0, i64 304
  %12 = load ptr, ptr %11, align 8, !tbaa !19
  %13 = getelementptr inbounds i8, ptr %0, i64 56
  %14 = load i32, ptr %13, align 8, !tbaa !20
  %15 = icmp sgt i32 %14, 0
  br i1 %15, label %.preheader86.lr.ph, label %._crit_edge

.preheader86.lr.ph:                               ; preds = %10
  %16 = getelementptr inbounds i8, ptr %0, i64 424
  %17 = load i32, ptr %16, align 8, !tbaa !21
  %18 = getelementptr inbounds i8, ptr %0, i64 100
  %19 = load i32, ptr %18, align 4, !tbaa !22
  %.not82 = icmp eq i32 %19, 0
  %20 = select i1 %.not82, i32 4, i32 8
  %.not8391 = icmp sgt i32 %17, %20
  %21 = getelementptr inbounds i8, ptr %0, i64 420
  %22 = getelementptr inbounds i8, ptr %0, i64 428
  %23 = load i32, ptr %22, align 4, !tbaa !23
  %.not8597 = icmp sgt i32 %23, %20
  br i1 %.not8391, label %.preheader86.lr.ph.split.us, label %.preheader86.lr.ph.split

.preheader86.lr.ph.split.us:                      ; preds = %.preheader86.lr.ph
  %24 = shl nuw nsw i32 %17, 1
  br i1 %.not8597, label %.preheader86.lr.ph.split.us.split.us, label %.preheader86.lr.ph.split.us.split

.preheader86.lr.ph.split.us.split.us:             ; preds = %.preheader86.lr.ph.split.us
  %25 = shl nuw nsw i32 %23, 1
  %26 = icmp sgt i32 %17, %25
  br i1 %26, label %.preheader86.us.us.us.preheader, label %.preheader86.lr.ph.split.us.split.us.split

.preheader86.us.us.us.preheader:                  ; preds = %.preheader86.lr.ph.split.us.split.us
  %xtraiter179 = and i32 %14, 7
  %27 = icmp ult i32 %14, 8
  br i1 %27, label %.preheader.loopexit.unr-lcssa, label %.preheader86.us.us.us.preheader.new

.preheader86.us.us.us.preheader.new:              ; preds = %.preheader86.us.us.us.preheader
  %unroll_iter182 = and i32 %14, 2147483640
  br label %.preheader86.us.us.us

.preheader86.us.us.us:                            ; preds = %.preheader86.us.us.us, %.preheader86.us.us.us.preheader.new
  %.072106.us.us.us = phi ptr [ %12, %.preheader86.us.us.us.preheader.new ], [ %44, %.preheader86.us.us.us ]
  %niter183 = phi i32 [ 0, %.preheader86.us.us.us.preheader.new ], [ %niter183.next.7, %.preheader86.us.us.us ]
  %28 = getelementptr inbounds i8, ptr %.072106.us.us.us, i64 36
  %29 = getelementptr inbounds i8, ptr %.072106.us.us.us, i64 40
  store i32 %23, ptr %29, align 8, !tbaa !24
  store i32 %25, ptr %28, align 4, !tbaa !26
  %30 = getelementptr inbounds i8, ptr %.072106.us.us.us, i64 132
  %31 = getelementptr inbounds i8, ptr %.072106.us.us.us, i64 136
  store i32 %23, ptr %31, align 8, !tbaa !24
  store i32 %25, ptr %30, align 4, !tbaa !26
  %32 = getelementptr inbounds i8, ptr %.072106.us.us.us, i64 228
  %33 = getelementptr inbounds i8, ptr %.072106.us.us.us, i64 232
  store i32 %23, ptr %33, align 8, !tbaa !24
  store i32 %25, ptr %32, align 4, !tbaa !26
  %34 = getelementptr inbounds i8, ptr %.072106.us.us.us, i64 324
  %35 = getelementptr inbounds i8, ptr %.072106.us.us.us, i64 328
  store i32 %23, ptr %35, align 8, !tbaa !24
  store i32 %25, ptr %34, align 4, !tbaa !26
  %36 = getelementptr inbounds i8, ptr %.072106.us.us.us, i64 420
  %37 = getelementptr inbounds i8, ptr %.072106.us.us.us, i64 424
  store i32 %23, ptr %37, align 8, !tbaa !24
  store i32 %25, ptr %36, align 4, !tbaa !26
  %38 = getelementptr inbounds i8, ptr %.072106.us.us.us, i64 516
  %39 = getelementptr inbounds i8, ptr %.072106.us.us.us, i64 520
  store i32 %23, ptr %39, align 8, !tbaa !24
  store i32 %25, ptr %38, align 4, !tbaa !26
  %40 = getelementptr inbounds i8, ptr %.072106.us.us.us, i64 612
  %41 = getelementptr inbounds i8, ptr %.072106.us.us.us, i64 616
  store i32 %23, ptr %41, align 8, !tbaa !24
  store i32 %25, ptr %40, align 4, !tbaa !26
  %42 = getelementptr inbounds i8, ptr %.072106.us.us.us, i64 708
  %43 = getelementptr inbounds i8, ptr %.072106.us.us.us, i64 712
  store i32 %23, ptr %43, align 8, !tbaa !24
  store i32 %25, ptr %42, align 4, !tbaa !26
  %44 = getelementptr inbounds i8, ptr %.072106.us.us.us, i64 768
  %niter183.next.7 = add i32 %niter183, 8
  %niter183.ncmp.7 = icmp eq i32 %niter183.next.7, %unroll_iter182
  br i1 %niter183.ncmp.7, label %.preheader.loopexit.unr-lcssa, label %.preheader86.us.us.us, !llvm.loop !27

.preheader86.lr.ph.split.us.split.us.split:       ; preds = %.preheader86.lr.ph.split.us.split.us
  %45 = icmp sgt i32 %23, %24
  br i1 %45, label %.preheader86.us.us.us117.preheader, label %.preheader86.us.us.preheader

.preheader86.us.us.preheader:                     ; preds = %.preheader86.lr.ph.split.us.split.us.split
  %xtraiter = and i32 %14, 7
  %46 = icmp ult i32 %14, 8
  br i1 %46, label %.preheader.loopexit164.unr-lcssa, label %.preheader86.us.us.preheader.new

.preheader86.us.us.preheader.new:                 ; preds = %.preheader86.us.us.preheader
  %unroll_iter = and i32 %14, 2147483640
  br label %.preheader86.us.us

.preheader86.us.us.us117.preheader:               ; preds = %.preheader86.lr.ph.split.us.split.us.split
  %xtraiter174 = and i32 %14, 7
  %47 = icmp ult i32 %14, 8
  br i1 %47, label %.preheader.loopexit163.unr-lcssa, label %.preheader86.us.us.us117.preheader.new

.preheader86.us.us.us117.preheader.new:           ; preds = %.preheader86.us.us.us117.preheader
  %unroll_iter177 = and i32 %14, 2147483640
  br label %.preheader86.us.us.us117

.preheader86.us.us.us117:                         ; preds = %.preheader86.us.us.us117, %.preheader86.us.us.us117.preheader.new
  %.072106.us.us.us118 = phi ptr [ %12, %.preheader86.us.us.us117.preheader.new ], [ %64, %.preheader86.us.us.us117 ]
  %niter178 = phi i32 [ 0, %.preheader86.us.us.us117.preheader.new ], [ %niter178.next.7, %.preheader86.us.us.us117 ]
  %48 = getelementptr inbounds i8, ptr %.072106.us.us.us118, i64 36
  store i32 %17, ptr %48, align 4, !tbaa !26
  %49 = getelementptr inbounds i8, ptr %.072106.us.us.us118, i64 40
  store i32 %24, ptr %49, align 8, !tbaa !24
  %50 = getelementptr inbounds i8, ptr %.072106.us.us.us118, i64 132
  store i32 %17, ptr %50, align 4, !tbaa !26
  %51 = getelementptr inbounds i8, ptr %.072106.us.us.us118, i64 136
  store i32 %24, ptr %51, align 8, !tbaa !24
  %52 = getelementptr inbounds i8, ptr %.072106.us.us.us118, i64 228
  store i32 %17, ptr %52, align 4, !tbaa !26
  %53 = getelementptr inbounds i8, ptr %.072106.us.us.us118, i64 232
  store i32 %24, ptr %53, align 8, !tbaa !24
  %54 = getelementptr inbounds i8, ptr %.072106.us.us.us118, i64 324
  store i32 %17, ptr %54, align 4, !tbaa !26
  %55 = getelementptr inbounds i8, ptr %.072106.us.us.us118, i64 328
  store i32 %24, ptr %55, align 8, !tbaa !24
  %56 = getelementptr inbounds i8, ptr %.072106.us.us.us118, i64 420
  store i32 %17, ptr %56, align 4, !tbaa !26
  %57 = getelementptr inbounds i8, ptr %.072106.us.us.us118, i64 424
  store i32 %24, ptr %57, align 8, !tbaa !24
  %58 = getelementptr inbounds i8, ptr %.072106.us.us.us118, i64 516
  store i32 %17, ptr %58, align 4, !tbaa !26
  %59 = getelementptr inbounds i8, ptr %.072106.us.us.us118, i64 520
  store i32 %24, ptr %59, align 8, !tbaa !24
  %60 = getelementptr inbounds i8, ptr %.072106.us.us.us118, i64 612
  store i32 %17, ptr %60, align 4, !tbaa !26
  %61 = getelementptr inbounds i8, ptr %.072106.us.us.us118, i64 616
  store i32 %24, ptr %61, align 8, !tbaa !24
  %62 = getelementptr inbounds i8, ptr %.072106.us.us.us118, i64 708
  store i32 %17, ptr %62, align 4, !tbaa !26
  %63 = getelementptr inbounds i8, ptr %.072106.us.us.us118, i64 712
  store i32 %24, ptr %63, align 8, !tbaa !24
  %64 = getelementptr inbounds i8, ptr %.072106.us.us.us118, i64 768
  %niter178.next.7 = add i32 %niter178, 8
  %niter178.ncmp.7 = icmp eq i32 %niter178.next.7, %unroll_iter177
  br i1 %niter178.ncmp.7, label %.preheader.loopexit163.unr-lcssa, label %.preheader86.us.us.us117, !llvm.loop !27

.preheader86.us.us:                               ; preds = %.preheader86.us.us, %.preheader86.us.us.preheader.new
  %.072106.us.us = phi ptr [ %12, %.preheader86.us.us.preheader.new ], [ %81, %.preheader86.us.us ]
  %niter = phi i32 [ 0, %.preheader86.us.us.preheader.new ], [ %niter.next.7, %.preheader86.us.us ]
  %65 = getelementptr inbounds i8, ptr %.072106.us.us, i64 36
  store i32 %17, ptr %65, align 4, !tbaa !26
  %66 = getelementptr inbounds i8, ptr %.072106.us.us, i64 40
  store i32 %23, ptr %66, align 8, !tbaa !24
  %67 = getelementptr inbounds i8, ptr %.072106.us.us, i64 132
  store i32 %17, ptr %67, align 4, !tbaa !26
  %68 = getelementptr inbounds i8, ptr %.072106.us.us, i64 136
  store i32 %23, ptr %68, align 8, !tbaa !24
  %69 = getelementptr inbounds i8, ptr %.072106.us.us, i64 228
  store i32 %17, ptr %69, align 4, !tbaa !26
  %70 = getelementptr inbounds i8, ptr %.072106.us.us, i64 232
  store i32 %23, ptr %70, align 8, !tbaa !24
  %71 = getelementptr inbounds i8, ptr %.072106.us.us, i64 324
  store i32 %17, ptr %71, align 4, !tbaa !26
  %72 = getelementptr inbounds i8, ptr %.072106.us.us, i64 328
  store i32 %23, ptr %72, align 8, !tbaa !24
  %73 = getelementptr inbounds i8, ptr %.072106.us.us, i64 420
  store i32 %17, ptr %73, align 4, !tbaa !26
  %74 = getelementptr inbounds i8, ptr %.072106.us.us, i64 424
  store i32 %23, ptr %74, align 8, !tbaa !24
  %75 = getelementptr inbounds i8, ptr %.072106.us.us, i64 516
  store i32 %17, ptr %75, align 4, !tbaa !26
  %76 = getelementptr inbounds i8, ptr %.072106.us.us, i64 520
  store i32 %23, ptr %76, align 8, !tbaa !24
  %77 = getelementptr inbounds i8, ptr %.072106.us.us, i64 612
  store i32 %17, ptr %77, align 4, !tbaa !26
  %78 = getelementptr inbounds i8, ptr %.072106.us.us, i64 616
  store i32 %23, ptr %78, align 8, !tbaa !24
  %79 = getelementptr inbounds i8, ptr %.072106.us.us, i64 708
  store i32 %17, ptr %79, align 4, !tbaa !26
  %80 = getelementptr inbounds i8, ptr %.072106.us.us, i64 712
  store i32 %23, ptr %80, align 8, !tbaa !24
  %81 = getelementptr inbounds i8, ptr %.072106.us.us, i64 768
  %niter.next.7 = add i32 %niter, 8
  %niter.ncmp.7 = icmp eq i32 %niter.next.7, %unroll_iter
  br i1 %niter.ncmp.7, label %.preheader.loopexit164.unr-lcssa, label %.preheader86.us.us, !llvm.loop !27

.preheader86.lr.ph.split.us.split:                ; preds = %.preheader86.lr.ph.split.us
  %82 = load i32, ptr %21, align 4, !tbaa !29
  br label %.preheader86.us

.preheader86.us:                                  ; preds = %101, %.preheader86.lr.ph.split.us.split
  %.072106.us = phi ptr [ %12, %.preheader86.lr.ph.split.us.split ], [ %103, %101 ]
  %.074105.us = phi i32 [ 0, %.preheader86.lr.ph.split.us.split ], [ %102, %101 ]
  %83 = getelementptr inbounds i8, ptr %.072106.us, i64 36
  store i32 %17, ptr %83, align 4, !tbaa !26
  %84 = getelementptr inbounds i8, ptr %.072106.us, i64 12
  %85 = load i32, ptr %84, align 4, !tbaa !30
  %factor.op.mul103.us = shl i32 %85, 1
  %86 = srem i32 %82, %factor.op.mul103.us
  %87 = icmp eq i32 %86, 0
  br i1 %87, label %.lr.ph115, label %.critedge2.us

.lr.ph115:                                        ; preds = %.preheader86.us, %90
  %88 = phi i32 [ %93, %90 ], [ 2, %.preheader86.us ]
  %89 = mul nsw i32 %23, %88
  %.not85.us = icmp sgt i32 %89, %20
  br i1 %.not85.us, label %.critedge2.us, label %90, !llvm.loop !31

90:                                               ; preds = %.lr.ph115
  %.reass104.us = mul i32 %88, %factor.op.mul103.us
  %91 = srem i32 %82, %.reass104.us
  %92 = icmp eq i32 %91, 0
  %93 = shl nsw i32 %88, 1
  br i1 %92, label %.lr.ph115, label %.critedge2.us, !llvm.loop !31

.critedge2.us:                                    ; preds = %90, %.lr.ph115, %.preheader86.us
  %.lcssa89.us = phi i32 [ %23, %.preheader86.us ], [ %89, %.lr.ph115 ], [ %89, %90 ]
  %94 = getelementptr inbounds i8, ptr %.072106.us, i64 40
  store i32 %.lcssa89.us, ptr %94, align 8, !tbaa !24
  %95 = shl nsw i32 %.lcssa89.us, 1
  %96 = icmp sgt i32 %17, %95
  br i1 %96, label %100, label %97

97:                                               ; preds = %.critedge2.us
  %98 = icmp sgt i32 %.lcssa89.us, %24
  br i1 %98, label %99, label %101

99:                                               ; preds = %97
  store i32 %24, ptr %94, align 8, !tbaa !24
  br label %101

100:                                              ; preds = %.critedge2.us
  store i32 %95, ptr %83, align 4, !tbaa !26
  br label %101

101:                                              ; preds = %100, %99, %97
  %102 = add nuw nsw i32 %.074105.us, 1
  %103 = getelementptr inbounds i8, ptr %.072106.us, i64 96
  %exitcond133.not = icmp eq i32 %102, %14
  br i1 %exitcond133.not, label %.preheader, label %.preheader86.us, !llvm.loop !27

.preheader86.lr.ph.split:                         ; preds = %.preheader86.lr.ph
  %104 = getelementptr inbounds i8, ptr %0, i64 416
  %105 = load i32, ptr %104, align 8, !tbaa !32
  br i1 %.not8597, label %.preheader86.lr.ph.split.split.us, label %.preheader86.lr.ph.split.split

.preheader86.lr.ph.split.split.us:                ; preds = %.preheader86.lr.ph.split
  %106 = shl nuw nsw i32 %23, 1
  br label %.preheader86.us107

.preheader86.us107:                               ; preds = %125, %.preheader86.lr.ph.split.split.us
  %.072106.us108 = phi ptr [ %12, %.preheader86.lr.ph.split.split.us ], [ %127, %125 ]
  %.074105.us109 = phi i32 [ 0, %.preheader86.lr.ph.split.split.us ], [ %126, %125 ]
  %107 = getelementptr inbounds i8, ptr %.072106.us108, i64 8
  %108 = load i32, ptr %107, align 8, !tbaa !33
  %factor.op.mul.us = shl i32 %108, 1
  %109 = srem i32 %105, %factor.op.mul.us
  %110 = icmp eq i32 %109, 0
  br i1 %110, label %.lr.ph, label %.critedge.us110

.lr.ph:                                           ; preds = %.preheader86.us107, %113
  %111 = phi i32 [ %116, %113 ], [ 2, %.preheader86.us107 ]
  %112 = mul nsw i32 %17, %111
  %.not83.us = icmp sgt i32 %112, %20
  br i1 %.not83.us, label %.critedge.us110, label %113, !llvm.loop !34

113:                                              ; preds = %.lr.ph
  %.reass.us = mul i32 %111, %factor.op.mul.us
  %114 = srem i32 %105, %.reass.us
  %115 = icmp eq i32 %114, 0
  %116 = shl nsw i32 %111, 1
  br i1 %115, label %.lr.ph, label %.critedge.us110, !llvm.loop !34

.critedge.us110:                                  ; preds = %113, %.lr.ph, %.preheader86.us107
  %.lcssa88.us111 = phi i32 [ %17, %.preheader86.us107 ], [ %112, %.lr.ph ], [ %112, %113 ]
  %117 = getelementptr inbounds i8, ptr %.072106.us108, i64 36
  store i32 %.lcssa88.us111, ptr %117, align 4, !tbaa !26
  %118 = getelementptr inbounds i8, ptr %.072106.us108, i64 40
  store i32 %23, ptr %118, align 8, !tbaa !24
  %119 = icmp sgt i32 %.lcssa88.us111, %106
  br i1 %119, label %124, label %120

120:                                              ; preds = %.critedge.us110
  %121 = shl nsw i32 %.lcssa88.us111, 1
  %122 = icmp sgt i32 %23, %121
  br i1 %122, label %123, label %125

123:                                              ; preds = %120
  store i32 %121, ptr %118, align 8, !tbaa !24
  br label %125

124:                                              ; preds = %.critedge.us110
  store i32 %106, ptr %117, align 4, !tbaa !26
  br label %125

125:                                              ; preds = %124, %123, %120
  %126 = add nuw nsw i32 %.074105.us109, 1
  %127 = getelementptr inbounds i8, ptr %.072106.us108, i64 96
  %exitcond132.not = icmp eq i32 %126, %14
  br i1 %exitcond132.not, label %.preheader, label %.preheader86.us107, !llvm.loop !27

.preheader86.lr.ph.split.split:                   ; preds = %.preheader86.lr.ph.split
  %128 = load i32, ptr %21, align 4, !tbaa !29
  br label %.preheader86

.preheader86:                                     ; preds = %.preheader86.lr.ph.split.split, %170
  %.072106 = phi ptr [ %12, %.preheader86.lr.ph.split.split ], [ %172, %170 ]
  %.074105 = phi i32 [ 0, %.preheader86.lr.ph.split.split ], [ %171, %170 ]
  %129 = getelementptr inbounds i8, ptr %.072106, i64 8
  %130 = load i32, ptr %129, align 8, !tbaa !33
  %factor.op.mul = shl i32 %130, 1
  br label %148

.preheader.loopexit.unr-lcssa:                    ; preds = %.preheader86.us.us.us, %.preheader86.us.us.us.preheader
  %.072106.us.us.us.unr = phi ptr [ %12, %.preheader86.us.us.us.preheader ], [ %44, %.preheader86.us.us.us ]
  %lcmp.mod181.not = icmp eq i32 %xtraiter179, 0
  br i1 %lcmp.mod181.not, label %.preheader, label %.preheader86.us.us.us.epil

.preheader86.us.us.us.epil:                       ; preds = %.preheader.loopexit.unr-lcssa, %.preheader86.us.us.us.epil
  %.072106.us.us.us.epil = phi ptr [ %133, %.preheader86.us.us.us.epil ], [ %.072106.us.us.us.unr, %.preheader.loopexit.unr-lcssa ]
  %epil.iter180 = phi i32 [ %epil.iter180.next, %.preheader86.us.us.us.epil ], [ 0, %.preheader.loopexit.unr-lcssa ]
  %131 = getelementptr inbounds i8, ptr %.072106.us.us.us.epil, i64 36
  %132 = getelementptr inbounds i8, ptr %.072106.us.us.us.epil, i64 40
  store i32 %23, ptr %132, align 8, !tbaa !24
  store i32 %25, ptr %131, align 4, !tbaa !26
  %133 = getelementptr inbounds i8, ptr %.072106.us.us.us.epil, i64 96
  %epil.iter180.next = add i32 %epil.iter180, 1
  %epil.iter180.cmp.not = icmp eq i32 %epil.iter180.next, %xtraiter179
  br i1 %epil.iter180.cmp.not, label %.preheader, label %.preheader86.us.us.us.epil, !llvm.loop !35

.preheader.loopexit163.unr-lcssa:                 ; preds = %.preheader86.us.us.us117, %.preheader86.us.us.us117.preheader
  %.072106.us.us.us118.unr = phi ptr [ %12, %.preheader86.us.us.us117.preheader ], [ %64, %.preheader86.us.us.us117 ]
  %lcmp.mod176.not = icmp eq i32 %xtraiter174, 0
  br i1 %lcmp.mod176.not, label %.preheader, label %.preheader86.us.us.us117.epil

.preheader86.us.us.us117.epil:                    ; preds = %.preheader.loopexit163.unr-lcssa, %.preheader86.us.us.us117.epil
  %.072106.us.us.us118.epil = phi ptr [ %136, %.preheader86.us.us.us117.epil ], [ %.072106.us.us.us118.unr, %.preheader.loopexit163.unr-lcssa ]
  %epil.iter175 = phi i32 [ %epil.iter175.next, %.preheader86.us.us.us117.epil ], [ 0, %.preheader.loopexit163.unr-lcssa ]
  %134 = getelementptr inbounds i8, ptr %.072106.us.us.us118.epil, i64 36
  store i32 %17, ptr %134, align 4, !tbaa !26
  %135 = getelementptr inbounds i8, ptr %.072106.us.us.us118.epil, i64 40
  store i32 %24, ptr %135, align 8, !tbaa !24
  %136 = getelementptr inbounds i8, ptr %.072106.us.us.us118.epil, i64 96
  %epil.iter175.next = add i32 %epil.iter175, 1
  %epil.iter175.cmp.not = icmp eq i32 %epil.iter175.next, %xtraiter174
  br i1 %epil.iter175.cmp.not, label %.preheader, label %.preheader86.us.us.us117.epil, !llvm.loop !37

.preheader.loopexit164.unr-lcssa:                 ; preds = %.preheader86.us.us, %.preheader86.us.us.preheader
  %.072106.us.us.unr = phi ptr [ %12, %.preheader86.us.us.preheader ], [ %81, %.preheader86.us.us ]
  %lcmp.mod.not = icmp eq i32 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.preheader, label %.preheader86.us.us.epil

.preheader86.us.us.epil:                          ; preds = %.preheader.loopexit164.unr-lcssa, %.preheader86.us.us.epil
  %.072106.us.us.epil = phi ptr [ %139, %.preheader86.us.us.epil ], [ %.072106.us.us.unr, %.preheader.loopexit164.unr-lcssa ]
  %epil.iter = phi i32 [ %epil.iter.next, %.preheader86.us.us.epil ], [ 0, %.preheader.loopexit164.unr-lcssa ]
  %137 = getelementptr inbounds i8, ptr %.072106.us.us.epil, i64 36
  store i32 %17, ptr %137, align 4, !tbaa !26
  %138 = getelementptr inbounds i8, ptr %.072106.us.us.epil, i64 40
  store i32 %23, ptr %138, align 8, !tbaa !24
  %139 = getelementptr inbounds i8, ptr %.072106.us.us.epil, i64 96
  %epil.iter.next = add i32 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i32 %epil.iter.next, %xtraiter
  br i1 %epil.iter.cmp.not, label %.preheader, label %.preheader86.us.us.epil, !llvm.loop !38

.preheader:                                       ; preds = %170, %125, %101, %.preheader.loopexit164.unr-lcssa, %.preheader86.us.us.epil, %.preheader.loopexit163.unr-lcssa, %.preheader86.us.us.us117.epil, %.preheader.loopexit.unr-lcssa, %.preheader86.us.us.us.epil
  br i1 %15, label %.lr.ph122, label %._crit_edge

.lr.ph122:                                        ; preds = %.preheader
  %140 = getelementptr inbounds i8, ptr %0, i64 48
  %141 = getelementptr inbounds i8, ptr %0, i64 416
  %142 = getelementptr inbounds i8, ptr %0, i64 556
  %143 = getelementptr inbounds i8, ptr %0, i64 52
  %144 = getelementptr inbounds i8, ptr %0, i64 420
  br label %173

145:                                              ; preds = %148
  %146 = shl nsw i32 %.092, 1
  %147 = mul nsw i32 %17, %146
  %.not83 = icmp sgt i32 %147, %20
  br i1 %.not83, label %.critedge, label %148, !llvm.loop !34

148:                                              ; preds = %.preheader86, %145
  %.092 = phi i32 [ 1, %.preheader86 ], [ %146, %145 ]
  %.reass = mul i32 %.092, %factor.op.mul
  %149 = srem i32 %105, %.reass
  %150 = icmp eq i32 %149, 0
  br i1 %150, label %145, label %.critedge.split.loop.exit

.critedge.split.loop.exit:                        ; preds = %148
  %151 = mul nsw i32 %.092, %17
  br label %.critedge

.critedge:                                        ; preds = %145, %.critedge.split.loop.exit
  %.lcssa88 = phi i32 [ %151, %.critedge.split.loop.exit ], [ %147, %145 ]
  %152 = getelementptr inbounds i8, ptr %.072106, i64 36
  store i32 %.lcssa88, ptr %152, align 4, !tbaa !26
  %153 = getelementptr inbounds i8, ptr %.072106, i64 12
  %154 = load i32, ptr %153, align 4, !tbaa !30
  %factor.op.mul103 = shl i32 %154, 1
  br label %158

155:                                              ; preds = %158
  %156 = shl nsw i32 %.198, 1
  %157 = mul nsw i32 %23, %156
  %.not85 = icmp sgt i32 %157, %20
  br i1 %.not85, label %.critedge2, label %158, !llvm.loop !31

158:                                              ; preds = %.critedge, %155
  %.198 = phi i32 [ 1, %.critedge ], [ %156, %155 ]
  %.reass104 = mul i32 %.198, %factor.op.mul103
  %159 = srem i32 %128, %.reass104
  %160 = icmp eq i32 %159, 0
  br i1 %160, label %155, label %.critedge2.split.loop.exit

.critedge2.split.loop.exit:                       ; preds = %158
  %161 = mul nsw i32 %.198, %23
  br label %.critedge2

.critedge2:                                       ; preds = %155, %.critedge2.split.loop.exit
  %.lcssa89 = phi i32 [ %161, %.critedge2.split.loop.exit ], [ %157, %155 ]
  %162 = getelementptr inbounds i8, ptr %.072106, i64 40
  store i32 %.lcssa89, ptr %162, align 8, !tbaa !24
  %163 = shl nsw i32 %.lcssa89, 1
  %164 = icmp sgt i32 %.lcssa88, %163
  br i1 %164, label %165, label %166

165:                                              ; preds = %.critedge2
  store i32 %163, ptr %152, align 4, !tbaa !26
  br label %170

166:                                              ; preds = %.critedge2
  %167 = shl nsw i32 %.lcssa88, 1
  %168 = icmp sgt i32 %.lcssa89, %167
  br i1 %168, label %169, label %170

169:                                              ; preds = %166
  store i32 %167, ptr %162, align 8, !tbaa !24
  br label %170

170:                                              ; preds = %166, %169, %165
  %171 = add nuw nsw i32 %.074105, 1
  %172 = getelementptr inbounds i8, ptr %.072106, i64 96
  %exitcond.not = icmp eq i32 %171, %14
  br i1 %exitcond.not, label %.preheader, label %.preheader86, !llvm.loop !27

173:                                              ; preds = %.lr.ph122, %173
  %.173121 = phi ptr [ %12, %.lr.ph122 ], [ %207, %173 ]
  %.175120 = phi i32 [ 0, %.lr.ph122 ], [ %206, %173 ]
  %174 = load i32, ptr %140, align 8, !tbaa !39
  %175 = zext i32 %174 to i64
  %176 = getelementptr inbounds i8, ptr %.173121, i64 8
  %177 = load i32, ptr %176, align 8, !tbaa !33
  %178 = getelementptr inbounds i8, ptr %.173121, i64 36
  %179 = load i32, ptr %178, align 4, !tbaa !26
  %180 = mul nsw i32 %179, %177
  %181 = sext i32 %180 to i64
  %182 = mul nsw i64 %181, %175
  %183 = load i32, ptr %141, align 8, !tbaa !32
  %184 = load i32, ptr %142, align 4, !tbaa !40
  %185 = mul nsw i32 %184, %183
  %186 = sext i32 %185 to i64
  %187 = tail call i64 @jdiv_round_up(i64 noundef %182, i64 noundef %186) #2
  %188 = trunc i64 %187 to i32
  %189 = getelementptr inbounds i8, ptr %.173121, i64 44
  store i32 %188, ptr %189, align 4, !tbaa !41
  %190 = load i32, ptr %143, align 4, !tbaa !42
  %191 = zext i32 %190 to i64
  %192 = getelementptr inbounds i8, ptr %.173121, i64 12
  %193 = load i32, ptr %192, align 4, !tbaa !30
  %194 = getelementptr inbounds i8, ptr %.173121, i64 40
  %195 = load i32, ptr %194, align 8, !tbaa !24
  %196 = mul nsw i32 %195, %193
  %197 = sext i32 %196 to i64
  %198 = mul nsw i64 %197, %191
  %199 = load i32, ptr %144, align 4, !tbaa !29
  %200 = load i32, ptr %142, align 4, !tbaa !40
  %201 = mul nsw i32 %200, %199
  %202 = sext i32 %201 to i64
  %203 = tail call i64 @jdiv_round_up(i64 noundef %198, i64 noundef %202) #2
  %204 = trunc i64 %203 to i32
  %205 = getelementptr inbounds i8, ptr %.173121, i64 48
  store i32 %204, ptr %205, align 8, !tbaa !43
  %206 = add nuw nsw i32 %.175120, 1
  %207 = getelementptr inbounds i8, ptr %.173121, i64 96
  %208 = load i32, ptr %13, align 8, !tbaa !20
  %209 = icmp slt i32 %206, %208
  br i1 %209, label %173, label %._crit_edge, !llvm.loop !44

._crit_edge:                                      ; preds = %173, %10, %.preheader
  %.lcssa = phi i32 [ %14, %.preheader ], [ %14, %10 ], [ %208, %173 ]
  %210 = getelementptr inbounds i8, ptr %0, i64 64
  %211 = load i32, ptr %210, align 8, !tbaa !45
  %switch.tableidx = add i32 %211, -1
  %212 = icmp ult i32 %switch.tableidx, 7
  br i1 %212, label %switch.lookup, label %214

switch.lookup:                                    ; preds = %._crit_edge
  %213 = zext nneg i32 %switch.tableidx to i64
  %switch.gep = getelementptr inbounds [7 x i32], ptr @switch.table.jpeg_calc_output_dimensions, i64 0, i64 %213
  %switch.load = load i32, ptr %switch.gep, align 4
  br label %214

214:                                              ; preds = %._crit_edge, %switch.lookup
  %.lcssa.sink = phi i32 [ %switch.load, %switch.lookup ], [ %.lcssa, %._crit_edge ]
  %215 = getelementptr inbounds i8, ptr %0, i64 144
  store i32 %.lcssa.sink, ptr %215, align 8, !tbaa !46
  %216 = getelementptr inbounds i8, ptr %0, i64 108
  %217 = load i32, ptr %216, align 4, !tbaa !47
  %.not80 = icmp eq i32 %217, 0
  %218 = select i1 %.not80, i32 %.lcssa.sink, i32 1
  %219 = getelementptr inbounds i8, ptr %0, i64 148
  store i32 %218, ptr %219, align 4, !tbaa !48
  %220 = tail call i32 @use_merged_upsample(ptr noundef nonnull %0)
  %.not81 = icmp eq i32 %220, 0
  br i1 %.not81, label %224, label %221

221:                                              ; preds = %214
  %222 = getelementptr inbounds i8, ptr %0, i64 420
  %223 = load i32, ptr %222, align 4, !tbaa !29
  br label %224

224:                                              ; preds = %214, %221
  %.sink = phi i32 [ %223, %221 ], [ 1, %214 ]
  %225 = getelementptr inbounds i8, ptr %0, i64 152
  store i32 %.sink, ptr %225, align 8
  ret void
}

declare void @jpeg_core_output_dimensions(ptr noundef) local_unnamed_addr #1

declare i64 @jdiv_round_up(i64 noundef, i64 noundef) local_unnamed_addr #1

; Function Attrs: nounwind uwtable
declare hidden i32 @use_merged_upsample(ptr noundef) local_unnamed_addr #0

attributes #0 = { nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { "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 = { 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 36}
!6 = !{!"jpeg_decompress_struct", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !10, i64 32, !10, i64 36, !7, i64 40, !10, i64 48, !10, i64 52, !10, i64 56, !10, i64 60, !10, i64 64, !10, i64 68, !10, i64 72, !11, i64 80, !10, i64 88, !10, i64 92, !10, i64 96, !10, i64 100, !10, i64 104, !10, i64 108, !10, i64 112, !10, i64 116, !10, i64 120, !10, i64 124, !10, i64 128, !10, i64 132, !10, i64 136, !10, i64 140, !10, i64 144, !10, i64 148, !10, i64 152, !10, i64 156, !7, i64 160, !10, i64 168, !10, i64 172, !10, i64 176, !10, i64 180, !10, i64 184, !7, i64 192, !8, i64 200, !8, i64 232, !8, i64 264, !10, i64 296, !7, i64 304, !10, i64 312, !10, i64 316, !10, i64 320, !8, i64 324, !8, i64 340, !8, i64 356, !10, i64 372, !10, i64 376, !8, i64 380, !8, i64 381, !8, i64 382, !12, i64 384, !12, i64 386, !10, i64 388, !8, i64 392, !10, i64 396, !10, i64 400, !7, i64 408, !10, i64 416, !10, i64 420, !10, i64 424, !10, i64 428, !10, i64 432, !7, i64 440, !10, i64 448, !8, i64 456, !10, i64 488, !10, i64 492, !10, i64 496, !8, i64 500, !10, i64 540, !10, i64 544, !10, i64 548, !10, i64 552, !10, i64 556, !7, i64 560, !10, i64 568, !10, i64 572, !7, i64 576, !7, i64 584, !7, i64 592, !7, i64 600, !7, i64 608, !7, i64 616, !7, i64 624, !7, i64 632, !7, i64 640, !7, i64 648, !7, i64 656}
!7 = !{!"any pointer", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C/C++ TBAA"}
!10 = !{!"int", !8, i64 0}
!11 = !{!"double", !8, i64 0}
!12 = !{!"short", !8, i64 0}
!13 = !{!6, !7, i64 0}
!14 = !{!15, !10, i64 40}
!15 = !{!"jpeg_error_mgr", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24, !7, i64 32, !10, i64 40, !8, i64 44, !10, i64 124, !16, i64 128, !7, i64 136, !10, i64 144, !7, i64 152, !10, i64 160, !10, i64 164}
!16 = !{!"long", !8, i64 0}
!17 = !{!8, !8, i64 0}
!18 = !{!15, !7, i64 0}
!19 = !{!6, !7, i64 304}
!20 = !{!6, !10, i64 56}
!21 = !{!6, !10, i64 424}
!22 = !{!6, !10, i64 100}
!23 = !{!6, !10, i64 428}
!24 = !{!25, !10, i64 40}
!25 = !{!"", !10, i64 0, !10, i64 4, !10, i64 8, !10, i64 12, !10, i64 16, !10, i64 20, !10, i64 24, !10, i64 28, !10, i64 32, !10, i64 36, !10, i64 40, !10, i64 44, !10, i64 48, !10, i64 52, !10, i64 56, !10, i64 60, !10, i64 64, !10, i64 68, !10, i64 72, !10, i64 76, !7, i64 80, !7, i64 88}
!26 = !{!25, !10, i64 36}
!27 = distinct !{!27, !28}
!28 = !{!"llvm.loop.mustprogress"}
!29 = !{!6, !10, i64 420}
!30 = !{!25, !10, i64 12}
!31 = distinct !{!31, !28}
!32 = !{!6, !10, i64 416}
!33 = !{!25, !10, i64 8}
!34 = distinct !{!34, !28}
!35 = distinct !{!35, !36}
!36 = !{!"llvm.loop.unroll.disable"}
!37 = distinct !{!37, !36}
!38 = distinct !{!38, !36}
!39 = !{!6, !10, i64 48}
!40 = !{!6, !10, i64 556}
!41 = !{!25, !10, i64 44}
!42 = !{!6, !10, i64 52}
!43 = !{!25, !10, i64 48}
!44 = distinct !{!44, !28}
!45 = !{!6, !10, i64 64}
!46 = !{!6, !10, i64 144}
!47 = !{!6, !10, i64 108}
!48 = !{!6, !10, i64 148}


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