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

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"class.jpgd::jpeg_decoder" = type <{ [1 x %struct.__jmp_buf_tag], i32, [4 x i8], ptr, i32, i32, ptr, i32, [8 x i8], [4 x i8], [8 x ptr], [8 x ptr], [4 x ptr], i32, i32, [4 x i32], [4 x i32], [4 x i32], [4 x i32], [4 x i32], [4 x i32], i32, [4 x i32], [4 x i32], [4 x i32], i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, [10 x i32], i32, i32, i32, i32, i32, i32, [4 x i8], [8 x ptr], [4 x ptr], [4 x ptr], i32, [4 x i32], [4 x i8], ptr, i32, i32, [64 x i8], [8320 x i8], [64 x i8], i32, i32, i32, i32, i32, i32, i32, i32, [4 x i32], ptr, [10 x i32], ptr, ptr, [256 x i32], [256 x i32], [256 x i32], [256 x i32], ptr, ptr, i32, i32, i8, i8, i8, [5 x i8] }>
%struct.__jmp_buf_tag = type { [8 x i64], i32, %struct.__sigset_t }
%struct.__sigset_t = type { [16 x i64] }

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN4jpgd12jpeg_decoder5allocEmb(ptr noundef nonnull align 8 dereferenceable(13523), i64 noundef, i1 noundef zeroext) #2 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4jpgd12jpeg_decoder10init_frameEv(ptr noundef nonnull align 8 dereferenceable(13523) %0) #2 align 2 {
  %2 = alloca ptr, align 8
  %3 = alloca i32, align 4
  store ptr %0, ptr %2, align 8, !tbaa !5
  %4 = load ptr, ptr %2, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #4
  %5 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %4, i32 0, i32 14
  %6 = load i32, ptr %5, align 4, !tbaa !9
  %7 = icmp eq i32 %6, 1
  br i1 %7, label %8, label %24

8:                                                ; preds = %1
  %9 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %4, i32 0, i32 15
  %10 = getelementptr inbounds [4 x i32], ptr %9, i64 0, i64 0
  %11 = load i32, ptr %10, align 8, !tbaa !14
  %12 = icmp ne i32 %11, 1
  br i1 %12, label %18, label %13

13:                                               ; preds = %8
  %14 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %4, i32 0, i32 16
  %15 = getelementptr inbounds [4 x i32], ptr %14, i64 0, i64 0
  %16 = load i32, ptr %15, align 8, !tbaa !14
  %17 = icmp ne i32 %16, 1
  br i1 %17, label %18, label %19

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

19:                                               ; preds = %13
  %20 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %4, i32 0, i32 13
  store i32 0, ptr %20, align 8, !tbaa !15
  %21 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %4, i32 0, i32 61
  store i32 1, ptr %21, align 8, !tbaa !16
  %22 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %4, i32 0, i32 29
  store i32 8, ptr %22, align 4, !tbaa !17
  %23 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %4, i32 0, i32 30
  store i32 8, ptr %23, align 8, !tbaa !18
  br label %116

24:                                               ; preds = %1
  %25 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %4, i32 0, i32 14
  %26 = load i32, ptr %25, align 4, !tbaa !9
  %27 = icmp eq i32 %26, 3
  br i1 %27, label %28, label %114

28:                                               ; preds = %24
  %29 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %4, i32 0, i32 15
  %30 = getelementptr inbounds [4 x i32], ptr %29, i64 0, i64 1
  %31 = load i32, ptr %30, align 4, !tbaa !14
  %32 = icmp ne i32 %31, 1
  br i1 %32, label %48, label %33

33:                                               ; preds = %28
  %34 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %4, i32 0, i32 16
  %35 = getelementptr inbounds [4 x i32], ptr %34, i64 0, i64 1
  %36 = load i32, ptr %35, align 4, !tbaa !14
  %37 = icmp ne i32 %36, 1
  br i1 %37, label %48, label %38

38:                                               ; preds = %33
  %39 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %4, i32 0, i32 15
  %40 = getelementptr inbounds [4 x i32], ptr %39, i64 0, i64 2
  %41 = load i32, ptr %40, align 8, !tbaa !14
  %42 = icmp ne i32 %41, 1
  br i1 %42, label %48, label %43

43:                                               ; preds = %38
  %44 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %4, i32 0, i32 16
  %45 = getelementptr inbounds [4 x i32], ptr %44, i64 0, i64 2
  %46 = load i32, ptr %45, align 8, !tbaa !14
  %47 = icmp ne i32 %46, 1
  br i1 %47, label %48, label %49

48:                                               ; preds = %43, %38, %33, %28
  call void @_ZN4jpgd12jpeg_decoder13stop_decodingENS_11jpgd_statusE(ptr noundef nonnull align 8 dereferenceable(13523) %4, i32 noundef -231) #5
  unreachable

49:                                               ; preds = %43
  %50 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %4, i32 0, i32 15
  %51 = getelementptr inbounds [4 x i32], ptr %50, i64 0, i64 0
  %52 = load i32, ptr %51, align 8, !tbaa !14
  %53 = icmp eq i32 %52, 1
  br i1 %53, label %54, label %64

54:                                               ; preds = %49
  %55 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %4, i32 0, i32 16
  %56 = getelementptr inbounds [4 x i32], ptr %55, i64 0, i64 0
  %57 = load i32, ptr %56, align 8, !tbaa !14
  %58 = icmp eq i32 %57, 1
  br i1 %58, label %59, label %64

59:                                               ; preds = %54
  %60 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %4, i32 0, i32 13
  store i32 1, ptr %60, align 8, !tbaa !15
  %61 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %4, i32 0, i32 61
  store i32 3, ptr %61, align 8, !tbaa !16
  %62 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %4, i32 0, i32 29
  store i32 8, ptr %62, align 4, !tbaa !17
  %63 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %4, i32 0, i32 30
  store i32 8, ptr %63, align 8, !tbaa !18
  br label %113

64:                                               ; preds = %54, %49
  %65 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %4, i32 0, i32 15
  %66 = getelementptr inbounds [4 x i32], ptr %65, i64 0, i64 0
  %67 = load i32, ptr %66, align 8, !tbaa !14
  %68 = icmp eq i32 %67, 2
  br i1 %68, label %69, label %79

69:                                               ; preds = %64
  %70 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %4, i32 0, i32 16
  %71 = getelementptr inbounds [4 x i32], ptr %70, i64 0, i64 0
  %72 = load i32, ptr %71, align 8, !tbaa !14
  %73 = icmp eq i32 %72, 1
  br i1 %73, label %74, label %79

74:                                               ; preds = %69
  %75 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %4, i32 0, i32 13
  store i32 2, ptr %75, align 8, !tbaa !15
  %76 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %4, i32 0, i32 61
  store i32 4, ptr %76, align 8, !tbaa !16
  %77 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %4, i32 0, i32 29
  store i32 16, ptr %77, align 4, !tbaa !17
  %78 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %4, i32 0, i32 30
  store i32 8, ptr %78, align 8, !tbaa !18
  br label %112

79:                                               ; preds = %69, %64
  %80 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %4, i32 0, i32 15
  %81 = getelementptr inbounds [4 x i32], ptr %80, i64 0, i64 0
  %82 = load i32, ptr %81, align 8, !tbaa !14
  %83 = icmp eq i32 %82, 1
  br i1 %83, label %84, label %94

84:                                               ; preds = %79
  %85 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %4, i32 0, i32 16
  %86 = getelementptr inbounds [4 x i32], ptr %85, i64 0, i64 0
  %87 = load i32, ptr %86, align 8, !tbaa !14
  %88 = icmp eq i32 %87, 2
  br i1 %88, label %89, label %94

89:                                               ; preds = %84
  %90 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %4, i32 0, i32 13
  store i32 3, ptr %90, align 8, !tbaa !15
  %91 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %4, i32 0, i32 61
  store i32 4, ptr %91, align 8, !tbaa !16
  %92 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %4, i32 0, i32 29
  store i32 8, ptr %92, align 4, !tbaa !17
  %93 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %4, i32 0, i32 30
  store i32 16, ptr %93, align 8, !tbaa !18
  br label %111

94:                                               ; preds = %84, %79
  %95 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %4, i32 0, i32 15
  %96 = getelementptr inbounds [4 x i32], ptr %95, i64 0, i64 0
  %97 = load i32, ptr %96, align 8, !tbaa !14
  %98 = icmp eq i32 %97, 2
  br i1 %98, label %99, label %109

99:                                               ; preds = %94
  %100 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %4, i32 0, i32 16
  %101 = getelementptr inbounds [4 x i32], ptr %100, i64 0, i64 0
  %102 = load i32, ptr %101, align 8, !tbaa !14
  %103 = icmp eq i32 %102, 2
  br i1 %103, label %104, label %109

104:                                              ; preds = %99
  %105 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %4, i32 0, i32 13
  store i32 4, ptr %105, align 8, !tbaa !15
  %106 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %4, i32 0, i32 61
  store i32 6, ptr %106, align 8, !tbaa !16
  %107 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %4, i32 0, i32 29
  store i32 16, ptr %107, align 4, !tbaa !17
  %108 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %4, i32 0, i32 30
  store i32 16, ptr %108, align 8, !tbaa !18
  br label %110

109:                                              ; preds = %99, %94
  call void @_ZN4jpgd12jpeg_decoder13stop_decodingENS_11jpgd_statusE(ptr noundef nonnull align 8 dereferenceable(13523) %4, i32 noundef -231) #5
  unreachable

110:                                              ; preds = %104
  br label %111

111:                                              ; preds = %110, %89
  br label %112

112:                                              ; preds = %111, %74
  br label %113

113:                                              ; preds = %112, %59
  br label %115

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

115:                                              ; preds = %113
  br label %116

116:                                              ; preds = %115, %19
  %117 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %4, i32 0, i32 4
  %118 = load i32, ptr %117, align 8, !tbaa !19
  %119 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %4, i32 0, i32 29
  %120 = load i32, ptr %119, align 4, !tbaa !17
  %121 = sub nsw i32 %120, 1
  %122 = add nsw i32 %118, %121
  %123 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %4, i32 0, i32 29
  %124 = load i32, ptr %123, align 4, !tbaa !17
  %125 = sdiv i32 %122, %124
  %126 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %4, i32 0, i32 60
  store i32 %125, ptr %126, align 4, !tbaa !20
  %127 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %4, i32 0, i32 5
  %128 = load i32, ptr %127, align 4, !tbaa !21
  %129 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %4, i32 0, i32 30
  %130 = load i32, ptr %129, align 8, !tbaa !18
  %131 = sub nsw i32 %130, 1
  %132 = add nsw i32 %128, %131
  %133 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %4, i32 0, i32 30
  %134 = load i32, ptr %133, align 8, !tbaa !18
  %135 = sdiv i32 %132, %134
  %136 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %4, i32 0, i32 62
  store i32 %135, ptr %136, align 4, !tbaa !22
  %137 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %4, i32 0, i32 13
  %138 = load i32, ptr %137, align 8, !tbaa !15
  %139 = icmp eq i32 %138, 0
  br i1 %139, label %140, label %142

140:                                              ; preds = %116
  %141 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %4, i32 0, i32 41
  store i32 1, ptr %141, align 8, !tbaa !23
  br label %144

142:                                              ; preds = %116
  %143 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %4, i32 0, i32 41
  store i32 4, ptr %143, align 8, !tbaa !23
  br label %144

144:                                              ; preds = %142, %140
  %145 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %4, i32 0, i32 4
  %146 = load i32, ptr %145, align 8, !tbaa !19
  %147 = add nsw i32 %146, 15
  %148 = and i32 %147, 65520
  %149 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %4, i32 0, i32 41
  %150 = load i32, ptr %149, align 8, !tbaa !23
  %151 = mul nsw i32 %148, %150
  %152 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %4, i32 0, i32 40
  store i32 %151, ptr %152, align 4, !tbaa !24
  %153 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %4, i32 0, i32 4
  %154 = load i32, ptr %153, align 8, !tbaa !19
  %155 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %4, i32 0, i32 41
  %156 = load i32, ptr %155, align 8, !tbaa !23
  %157 = mul nsw i32 %154, %156
  %158 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %4, i32 0, i32 39
  store i32 %157, ptr %158, align 8, !tbaa !25
  %159 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %4, i32 0, i32 40
  %160 = load i32, ptr %159, align 4, !tbaa !24
  %161 = sext i32 %160 to i64
  %162 = call noundef ptr @_ZN4jpgd12jpeg_decoder5allocEmb(ptr noundef nonnull align 8 dereferenceable(13523) %4, i64 noundef %161, i1 noundef zeroext true)
  %163 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %4, i32 0, i32 72
  store ptr %162, ptr %163, align 8, !tbaa !26
  %164 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %4, i32 0, i32 13
  %165 = load i32, ptr %164, align 8, !tbaa !15
  %166 = icmp eq i32 %165, 3
  br i1 %166, label %171, label %167

167:                                              ; preds = %144
  %168 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %4, i32 0, i32 13
  %169 = load i32, ptr %168, align 8, !tbaa !15
  %170 = icmp eq i32 %169, 4
  br i1 %170, label %171, label %177

171:                                              ; preds = %167, %144
  %172 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %4, i32 0, i32 40
  %173 = load i32, ptr %172, align 4, !tbaa !24
  %174 = sext i32 %173 to i64
  %175 = call noundef ptr @_ZN4jpgd12jpeg_decoder5allocEmb(ptr noundef nonnull align 8 dereferenceable(13523) %4, i64 noundef %174, i1 noundef zeroext true)
  %176 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %4, i32 0, i32 73
  store ptr %175, ptr %176, align 8, !tbaa !27
  br label %177

177:                                              ; preds = %171, %167
  %178 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %4, i32 0, i32 60
  %179 = load i32, ptr %178, align 4, !tbaa !20
  %180 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %4, i32 0, i32 61
  %181 = load i32, ptr %180, align 8, !tbaa !16
  %182 = mul nsw i32 %179, %181
  %183 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %4, i32 0, i32 32
  store i32 %182, ptr %183, align 8, !tbaa !28
  %184 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %4, i32 0, i32 32
  %185 = load i32, ptr %184, align 8, !tbaa !28
  %186 = icmp sgt i32 %185, 16384
  br i1 %186, label %187, label %188

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

188:                                              ; preds = %177
  %189 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %4, i32 0, i32 61
  %190 = load i32, ptr %189, align 8, !tbaa !16
  %191 = mul nsw i32 %190, 64
  %192 = sext i32 %191 to i64
  %193 = mul i64 %192, 2
  %194 = call noundef ptr @_ZN4jpgd12jpeg_decoder5allocEmb(ptr noundef nonnull align 8 dereferenceable(13523) %4, i64 noundef %193, i1 noundef zeroext false)
  %195 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %4, i32 0, i32 64
  store ptr %194, ptr %195, align 8, !tbaa !29
  store i32 0, ptr %3, align 4, !tbaa !14
  br label %196

196:                                              ; preds = %206, %188
  %197 = load i32, ptr %3, align 4, !tbaa !14
  %198 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %4, i32 0, i32 61
  %199 = load i32, ptr %198, align 8, !tbaa !16
  %200 = icmp slt i32 %197, %199
  br i1 %200, label %201, label %209

201:                                              ; preds = %196
  %202 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %4, i32 0, i32 65
  %203 = load i32, ptr %3, align 4, !tbaa !14
  %204 = sext i32 %203 to i64
  %205 = getelementptr inbounds [10 x i32], ptr %202, i64 0, i64 %204
  store i32 64, ptr %205, align 4, !tbaa !14
  br label %206

206:                                              ; preds = %201
  %207 = load i32, ptr %3, align 4, !tbaa !14
  %208 = add nsw i32 %207, 1
  store i32 %208, ptr %3, align 4, !tbaa !14
  br label %196, !llvm.loop !30

209:                                              ; preds = %196
  %210 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %4, i32 0, i32 32
  %211 = load i32, ptr %210, align 8, !tbaa !28
  %212 = mul nsw i32 %211, 64
  %213 = sext i32 %212 to i64
  %214 = call noundef ptr @_ZN4jpgd12jpeg_decoder5allocEmb(ptr noundef nonnull align 8 dereferenceable(13523) %4, i64 noundef %213, i1 noundef zeroext false)
  %215 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %4, i32 0, i32 66
  store ptr %214, ptr %215, align 8, !tbaa !32
  %216 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %4, i32 0, i32 32
  %217 = load i32, ptr %216, align 8, !tbaa !28
  %218 = mul nsw i32 %217, 64
  %219 = sext i32 %218 to i64
  %220 = call noundef ptr @_ZN4jpgd12jpeg_decoder5allocEmb(ptr noundef nonnull align 8 dereferenceable(13523) %4, i64 noundef %219, i1 noundef zeroext false)
  %221 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %4, i32 0, i32 67
  store ptr %220, ptr %221, align 8, !tbaa !33
  %222 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %4, i32 0, i32 5
  %223 = load i32, ptr %222, align 4, !tbaa !21
  %224 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %4, i32 0, i32 36
  store i32 %223, ptr %224, align 4, !tbaa !34
  %225 = getelementptr inbounds %"class.jpgd::jpeg_decoder", ptr %4, i32 0, i32 37
  store i32 0, ptr %225, align 8, !tbaa !35
  call void @_ZN4jpgd12jpeg_decoder15create_look_upsEv(ptr noundef nonnull align 8 dereferenceable(13523) %4)
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #4
  ret void
}

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"any pointer", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!10, !11, i64 412}
!10 = !{!"_ZTSN4jpgd12jpeg_decoderE", !7, i64 0, !11, i64 200, !6, i64 208, !11, i64 216, !11, i64 220, !6, i64 224, !11, i64 232, !7, i64 236, !7, i64 248, !7, i64 312, !7, i64 376, !11, i64 408, !11, i64 412, !7, i64 416, !7, i64 432, !7, i64 448, !7, i64 464, !7, i64 480, !7, i64 496, !11, i64 512, !7, i64 516, !7, i64 532, !7, i64 548, !11, i64 564, !11, i64 568, !11, i64 572, !11, i64 576, !11, i64 580, !11, i64 584, !11, i64 588, !11, i64 592, !11, i64 596, !11, i64 600, !7, i64 604, !11, i64 644, !11, i64 648, !11, i64 652, !11, i64 656, !11, i64 660, !11, i64 664, !7, i64 672, !7, i64 736, !7, i64 768, !11, i64 800, !7, i64 804, !6, i64 824, !11, i64 832, !11, i64 836, !7, i64 840, !7, i64 904, !7, i64 9224, !11, i64 9288, !11, i64 9292, !11, i64 9296, !11, i64 9300, !11, i64 9304, !11, i64 9308, !11, i64 9312, !11, i64 9316, !7, i64 9320, !6, i64 9336, !7, i64 9344, !6, i64 9384, !6, i64 9392, !7, i64 9400, !7, i64 10424, !7, i64 11448, !7, i64 12472, !6, i64 13496, !6, i64 13504, !12, i64 13512, !11, i64 13516, !13, i64 13520, !13, i64 13521, !13, i64 13522}
!11 = !{!"int", !7, i64 0}
!12 = !{!"_ZTSN4jpgd11jpgd_statusE", !7, i64 0}
!13 = !{!"bool", !7, i64 0}
!14 = !{!11, !11, i64 0}
!15 = !{!10, !11, i64 408}
!16 = !{!10, !11, i64 9312}
!17 = !{!10, !11, i64 580}
!18 = !{!10, !11, i64 584}
!19 = !{!10, !11, i64 216}
!20 = !{!10, !11, i64 9308}
!21 = !{!10, !11, i64 220}
!22 = !{!10, !11, i64 9316}
!23 = !{!10, !11, i64 664}
!24 = !{!10, !11, i64 660}
!25 = !{!10, !11, i64 656}
!26 = !{!10, !6, i64 13496}
!27 = !{!10, !6, i64 13504}
!28 = !{!10, !11, i64 592}
!29 = !{!10, !6, i64 9336}
!30 = distinct !{!30, !31}
!31 = !{!"llvm.loop.mustprogress"}
!32 = !{!10, !6, i64 9384}
!33 = !{!10, !6, i64 9392}
!34 = !{!10, !11, i64 644}
!35 = !{!10, !11, i64 648}


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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef ptr @_ZN4jpgd12jpeg_decoder5allocEmb(ptr noundef nonnull align 8 dereferenceable(13523), i64 noundef, i1 noundef zeroext) local_unnamed_addr #1 align 2

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN4jpgd12jpeg_decoder10init_frameEv(ptr noundef nonnull align 8 dereferenceable(13523) %0) local_unnamed_addr #1 align 2 {
  %2 = getelementptr inbounds i8, ptr %0, i64 412
  %3 = load i32, ptr %2, align 4, !tbaa !5
  switch i32 %3, label %34 [
    i32 1, label %4
    i32 3, label %10
  ]

4:                                                ; preds = %1
  %5 = getelementptr inbounds i8, ptr %0, i64 416
  %6 = load i32, ptr %5, align 8, !tbaa !13
  %.not8 = icmp eq i32 %6, 1
  %7 = getelementptr inbounds i8, ptr %0, i64 432
  %8 = load i32, ptr %7, align 8
  %.not9 = icmp eq i32 %8, 1
  %or.cond = select i1 %.not8, i1 %.not9, i1 false
  br i1 %or.cond, label %35, label %9

9:                                                ; preds = %4
  tail call void @_ZN4jpgd12jpeg_decoder13stop_decodingENS_11jpgd_statusE(ptr noundef nonnull align 8 dereferenceable(13523) %0, i32 noundef -231) #3
  unreachable

10:                                               ; preds = %1
  %11 = getelementptr inbounds i8, ptr %0, i64 416
  %12 = getelementptr inbounds i8, ptr %0, i64 420
  %13 = load i32, ptr %12, align 4, !tbaa !13
  %.not = icmp eq i32 %13, 1
  br i1 %.not, label %14, label %21

14:                                               ; preds = %10
  %15 = getelementptr inbounds i8, ptr %0, i64 436
  %16 = load i32, ptr %15, align 4, !tbaa !13
  %.not5 = icmp eq i32 %16, 1
  %17 = getelementptr inbounds i8, ptr %0, i64 424
  %18 = load i32, ptr %17, align 8
  %.not6 = icmp eq i32 %18, 1
  %or.cond12 = select i1 %.not5, i1 %.not6, i1 false
  %19 = getelementptr inbounds i8, ptr %0, i64 440
  %20 = load i32, ptr %19, align 8
  %.not7 = icmp eq i32 %20, 1
  %or.cond14 = select i1 %or.cond12, i1 %.not7, i1 false
  br i1 %or.cond14, label %22, label %21

21:                                               ; preds = %14, %10
  tail call void @_ZN4jpgd12jpeg_decoder13stop_decodingENS_11jpgd_statusE(ptr noundef nonnull align 8 dereferenceable(13523) %0, i32 noundef -231) #3
  unreachable

22:                                               ; preds = %14
  %23 = getelementptr inbounds i8, ptr %0, i64 432
  %24 = load i32, ptr %11, align 8, !tbaa !13
  %25 = icmp eq i32 %24, 1
  %26 = load i32, ptr %23, align 8
  %27 = icmp eq i32 %26, 1
  %or.cond16 = select i1 %25, i1 %27, i1 false
  br i1 %or.cond16, label %35, label %28

28:                                               ; preds = %22
  %29 = icmp eq i32 %24, 2
  %or.cond18 = select i1 %29, i1 %27, i1 false
  br i1 %or.cond18, label %35, label %30

30:                                               ; preds = %28
  %31 = icmp eq i32 %26, 2
  %or.cond20 = select i1 %25, i1 %31, i1 false
  br i1 %or.cond20, label %35, label %32

32:                                               ; preds = %30
  %or.cond22 = select i1 %29, i1 %31, i1 false
  br i1 %or.cond22, label %35, label %33

33:                                               ; preds = %32
  tail call void @_ZN4jpgd12jpeg_decoder13stop_decodingENS_11jpgd_statusE(ptr noundef nonnull align 8 dereferenceable(13523) %0, i32 noundef -231) #3
  unreachable

34:                                               ; preds = %1
  tail call void @_ZN4jpgd12jpeg_decoder13stop_decodingENS_11jpgd_statusE(ptr noundef nonnull align 8 dereferenceable(13523) %0, i32 noundef -232) #3
  unreachable

35:                                               ; preds = %32, %30, %28, %22, %4
  %.sink31 = phi i32 [ 0, %4 ], [ 1, %22 ], [ 2, %28 ], [ 3, %30 ], [ 4, %32 ]
  %.sink29 = phi i32 [ 1, %4 ], [ 3, %22 ], [ 4, %28 ], [ 4, %30 ], [ 6, %32 ]
  %.sink27 = phi i32 [ 8, %4 ], [ 8, %22 ], [ 16, %28 ], [ 8, %30 ], [ 16, %32 ]
  %.sink25 = phi i32 [ 8, %4 ], [ 8, %22 ], [ 8, %28 ], [ 16, %30 ], [ 16, %32 ]
  %.sink = phi i32 [ 1, %4 ], [ 4, %22 ], [ 4, %28 ], [ 4, %30 ], [ 4, %32 ]
  %36 = getelementptr inbounds i8, ptr %0, i64 408
  store i32 %.sink31, ptr %36, align 8, !tbaa !14
  %37 = getelementptr inbounds i8, ptr %0, i64 9312
  store i32 %.sink29, ptr %37, align 8, !tbaa !15
  %38 = getelementptr inbounds i8, ptr %0, i64 580
  store i32 %.sink27, ptr %38, align 4, !tbaa !16
  %39 = getelementptr inbounds i8, ptr %0, i64 584
  store i32 %.sink25, ptr %39, align 8, !tbaa !17
  %40 = getelementptr inbounds i8, ptr %0, i64 216
  %41 = load i32, ptr %40, align 8, !tbaa !18
  %42 = add i32 %41, -1
  %43 = add i32 %42, %.sink27
  %44 = sdiv i32 %43, %.sink27
  %45 = getelementptr inbounds i8, ptr %0, i64 9308
  store i32 %44, ptr %45, align 4, !tbaa !19
  %46 = getelementptr inbounds i8, ptr %0, i64 220
  %47 = load i32, ptr %46, align 4, !tbaa !20
  %48 = add i32 %47, -1
  %49 = add i32 %48, %.sink25
  %50 = sdiv i32 %49, %.sink25
  %51 = getelementptr inbounds i8, ptr %0, i64 9316
  store i32 %50, ptr %51, align 4, !tbaa !21
  %52 = getelementptr inbounds i8, ptr %0, i64 408
  %53 = getelementptr inbounds i8, ptr %0, i64 664
  store i32 %.sink, ptr %53, align 8
  %54 = add nsw i32 %41, 15
  %55 = and i32 %54, 65520
  %56 = mul nuw nsw i32 %.sink, %55
  %57 = getelementptr inbounds i8, ptr %0, i64 660
  store i32 %56, ptr %57, align 4, !tbaa !22
  %58 = mul nsw i32 %.sink, %41
  %59 = getelementptr inbounds i8, ptr %0, i64 656
  store i32 %58, ptr %59, align 8, !tbaa !23
  %60 = zext nneg i32 %56 to i64
  %61 = tail call noundef ptr @_ZN4jpgd12jpeg_decoder5allocEmb(ptr noundef nonnull align 8 dereferenceable(13523) %0, i64 noundef %60, i1 noundef zeroext true)
  %62 = getelementptr inbounds i8, ptr %0, i64 13496
  store ptr %61, ptr %62, align 8, !tbaa !24
  %63 = load i32, ptr %52, align 8, !tbaa !14
  %.off = add i32 %63, -3
  %switch = icmp ult i32 %.off, 2
  br i1 %switch, label %64, label %69

64:                                               ; preds = %35
  %65 = load i32, ptr %57, align 4, !tbaa !22
  %66 = sext i32 %65 to i64
  %67 = tail call noundef ptr @_ZN4jpgd12jpeg_decoder5allocEmb(ptr noundef nonnull align 8 dereferenceable(13523) %0, i64 noundef %66, i1 noundef zeroext true)
  %68 = getelementptr inbounds i8, ptr %0, i64 13504
  store ptr %67, ptr %68, align 8, !tbaa !25
  br label %69

69:                                               ; preds = %35, %64
  %70 = load i32, ptr %45, align 4, !tbaa !19
  %71 = getelementptr inbounds i8, ptr %0, i64 9312
  %72 = load i32, ptr %71, align 8, !tbaa !15
  %73 = mul nsw i32 %72, %70
  %74 = getelementptr inbounds i8, ptr %0, i64 592
  store i32 %73, ptr %74, align 8, !tbaa !26
  %75 = icmp sgt i32 %73, 16384
  br i1 %75, label %76, label %77

76:                                               ; preds = %69
  tail call void @_ZN4jpgd12jpeg_decoder13stop_decodingENS_11jpgd_statusE(ptr noundef nonnull align 8 dereferenceable(13523) %0, i32 noundef -230) #3
  unreachable

77:                                               ; preds = %69
  %78 = shl nsw i32 %72, 6
  %79 = sext i32 %78 to i64
  %80 = shl nsw i64 %79, 1
  %81 = tail call noundef ptr @_ZN4jpgd12jpeg_decoder5allocEmb(ptr noundef nonnull align 8 dereferenceable(13523) %0, i64 noundef %80, i1 noundef zeroext false)
  %82 = getelementptr inbounds i8, ptr %0, i64 9336
  store ptr %81, ptr %82, align 8, !tbaa !27
  %83 = load i32, ptr %71, align 8, !tbaa !15
  %84 = icmp sgt i32 %83, 0
  br i1 %84, label %.lr.ph, label %._crit_edge

.lr.ph:                                           ; preds = %77
  %85 = getelementptr inbounds i8, ptr %0, i64 9344
  %wide.trip.count = zext nneg i32 %83 to i64
  %min.iters.check = icmp ult i32 %83, 8
  br i1 %min.iters.check, label %scalar.ph.preheader, label %vector.ph

vector.ph:                                        ; preds = %.lr.ph
  %n.vec = and i64 %wide.trip.count, 2147483640
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %86 = getelementptr inbounds [10 x i32], ptr %85, i64 0, i64 %index
  %87 = getelementptr inbounds i8, ptr %86, i64 16
  store <4 x i32> <i32 64, i32 64, i32 64, i32 64>, ptr %86, align 8, !tbaa !13
  store <4 x i32> <i32 64, i32 64, i32 64, i32 64>, ptr %87, align 8, !tbaa !13
  %index.next = add nuw i64 %index, 8
  %88 = icmp eq i64 %index.next, %n.vec
  br i1 %88, label %middle.block, label %vector.body, !llvm.loop !28

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %n.vec, %wide.trip.count
  br i1 %cmp.n, label %._crit_edge, label %scalar.ph.preheader

scalar.ph.preheader:                              ; preds = %middle.block, %.lr.ph
  %indvars.iv.ph = phi i64 [ 0, %.lr.ph ], [ %n.vec, %middle.block ]
  br label %scalar.ph

scalar.ph:                                        ; preds = %scalar.ph.preheader, %scalar.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %scalar.ph ], [ %indvars.iv.ph, %scalar.ph.preheader ]
  %89 = getelementptr inbounds [10 x i32], ptr %85, i64 0, i64 %indvars.iv
  store i32 64, ptr %89, align 4, !tbaa !13
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge, label %scalar.ph, !llvm.loop !32

._crit_edge:                                      ; preds = %scalar.ph, %middle.block, %77
  %90 = load i32, ptr %74, align 8, !tbaa !26
  %91 = shl nsw i32 %90, 6
  %92 = sext i32 %91 to i64
  %93 = tail call noundef ptr @_ZN4jpgd12jpeg_decoder5allocEmb(ptr noundef nonnull align 8 dereferenceable(13523) %0, i64 noundef %92, i1 noundef zeroext false)
  %94 = getelementptr inbounds i8, ptr %0, i64 9384
  store ptr %93, ptr %94, align 8, !tbaa !33
  %95 = load i32, ptr %74, align 8, !tbaa !26
  %96 = shl nsw i32 %95, 6
  %97 = sext i32 %96 to i64
  %98 = tail call noundef ptr @_ZN4jpgd12jpeg_decoder5allocEmb(ptr noundef nonnull align 8 dereferenceable(13523) %0, i64 noundef %97, i1 noundef zeroext false)
  %99 = getelementptr inbounds i8, ptr %0, i64 9392
  store ptr %98, ptr %99, align 8, !tbaa !34
  %100 = load i32, ptr %46, align 4, !tbaa !20
  %101 = getelementptr inbounds i8, ptr %0, i64 644
  store i32 %100, ptr %101, align 4, !tbaa !35
  %102 = getelementptr inbounds i8, ptr %0, i64 648
  store i32 0, ptr %102, align 8, !tbaa !36
  tail call void @_ZN4jpgd12jpeg_decoder15create_look_upsEv(ptr noundef nonnull align 8 dereferenceable(13523) %0)
  ret void
}

attributes #0 = { mustprogress noreturn uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #2 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { noreturn }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !9, i64 412}
!6 = !{!"_ZTSN4jpgd12jpeg_decoderE", !7, i64 0, !9, i64 200, !10, i64 208, !9, i64 216, !9, i64 220, !10, i64 224, !9, i64 232, !7, i64 236, !7, i64 248, !7, i64 312, !7, i64 376, !9, i64 408, !9, i64 412, !7, i64 416, !7, i64 432, !7, i64 448, !7, i64 464, !7, i64 480, !7, i64 496, !9, i64 512, !7, i64 516, !7, i64 532, !7, i64 548, !9, i64 564, !9, i64 568, !9, i64 572, !9, i64 576, !9, i64 580, !9, i64 584, !9, i64 588, !9, i64 592, !9, i64 596, !9, i64 600, !7, i64 604, !9, i64 644, !9, i64 648, !9, i64 652, !9, i64 656, !9, i64 660, !9, i64 664, !7, i64 672, !7, i64 736, !7, i64 768, !9, i64 800, !7, i64 804, !10, i64 824, !9, i64 832, !9, i64 836, !7, i64 840, !7, i64 904, !7, i64 9224, !9, i64 9288, !9, i64 9292, !9, i64 9296, !9, i64 9300, !9, i64 9304, !9, i64 9308, !9, i64 9312, !9, i64 9316, !7, i64 9320, !10, i64 9336, !7, i64 9344, !10, i64 9384, !10, i64 9392, !7, i64 9400, !7, i64 10424, !7, i64 11448, !7, i64 12472, !10, i64 13496, !10, i64 13504, !11, i64 13512, !9, i64 13516, !12, i64 13520, !12, i64 13521, !12, i64 13522}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = !{!"int", !7, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!"_ZTSN4jpgd11jpgd_statusE", !7, i64 0}
!12 = !{!"bool", !7, i64 0}
!13 = !{!9, !9, i64 0}
!14 = !{!6, !9, i64 408}
!15 = !{!6, !9, i64 9312}
!16 = !{!6, !9, i64 580}
!17 = !{!6, !9, i64 584}
!18 = !{!6, !9, i64 216}
!19 = !{!6, !9, i64 9308}
!20 = !{!6, !9, i64 220}
!21 = !{!6, !9, i64 9316}
!22 = !{!6, !9, i64 660}
!23 = !{!6, !9, i64 656}
!24 = !{!6, !10, i64 13496}
!25 = !{!6, !10, i64 13504}
!26 = !{!6, !9, i64 592}
!27 = !{!6, !10, i64 9336}
!28 = distinct !{!28, !29, !30, !31}
!29 = !{!"llvm.loop.mustprogress"}
!30 = !{!"llvm.loop.isvectorized", i32 1}
!31 = !{!"llvm.loop.unroll.runtime.disable"}
!32 = distinct !{!32, !29, !31, !30}
!33 = !{!6, !10, i64 9384}
!34 = !{!6, !10, i64 9392}
!35 = !{!6, !9, i64 644}
!36 = !{!6, !9, i64 648}


; Effective O3 passes: BDCEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopLoadEliminationPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,LoopVectorizePass,MergedLoadStoreMotionPass,ReassociatePass,SCCPPass,SROAPass,SimplifyCFGPass,TailCallElimPass