; LLVM IR from corentinartaud/graphics :: ThirdParty/FreeImage-3170/Source/LibJXR/jxrgluelib (JXRGlue)

; 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._GUID = type { i32, i16, i16, [8 x i8] }
%struct.tagPKPixelInfo = type { ptr, i64, i32, i32, i32, i64, i32, i32, i32, i32 }
%struct.tagCWMTranscodingParam = type { i64, i64, i64, i64, i32, i8, i32, i32, i32 }
%struct.tagPKFormatConverter = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, %struct._GUID }
%struct.tagPKImageEncode = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i64, %struct._GUID, i32, i32, i32, float, float, i32, i32, i64, i64, ptr, i32, ptr, i32, ptr, i32, ptr, i32, ptr, i32, ptr, i32, %struct.DESCRIPTIVEMETADATA, i32, %struct.anon.0 }
%struct.DESCRIPTIVEMETADATA = type { %struct.DPKPROPVARIANT, %struct.DPKPROPVARIANT, %struct.DPKPROPVARIANT, %struct.DPKPROPVARIANT, %struct.DPKPROPVARIANT, %struct.DPKPROPVARIANT, %struct.DPKPROPVARIANT, %struct.DPKPROPVARIANT, %struct.DPKPROPVARIANT, %struct.DPKPROPVARIANT, %struct.DPKPROPVARIANT, %struct.DPKPROPVARIANT, %struct.DPKPROPVARIANT, %struct.DPKPROPVARIANT }
%struct.DPKPROPVARIANT = type { i32, %union.anon }
%union.anon = type { ptr }
%struct.anon.0 = type { %struct.tagWmpDEMisc, %struct.tagCWMImageInfo, %struct.tagCWMIStrCodecParam, ptr, %struct.tagCWMImageInfo, %struct.tagCWMIStrCodecParam, ptr, i32, i64, i64, i64, i64, i32, i32, ptr }
%struct.tagWmpDEMisc = type { i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32, i32 }
%struct.tagCWMImageInfo = type { i64, i64, i32, i32, i64, i64, i32, i8, i8, i64, i64, i64, i64, i32, i64, i64, i32, i8, i32 }
%struct.tagCWMIStrCodecParam = type { i32, i8, i8, i8, i8, i8, i8, i8, i8, i8, i8, i32, i32, i32, i32, i64, i8, i32, i8, ptr, i64, i32, [4096 x i32], i32, [4096 x i32], i8, i8, i32, i32, i32, i32, i32, i32 }
%struct.tagPKRect = type { i32, i32, i32, i32 }
%struct.tagPKImageDecode = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, ptr, i32, i64, %struct._GUID, i32, i32, i32, float, float, i32, %struct.anon }
%struct.anon = type { %struct.tagWmpDEMisc, %struct.tagCWMImageInfo, %struct.tagCWMIStrCodecParam, ptr, %struct.tagCWMImageInfo, %struct.tagCWMIStrCodecParam, ptr, i32, i64, i64, i64, i64, i32, i64, i64, i64, i64, i64, i32, i32, i32, %struct.DESCRIPTIVEMETADATA }

@GUID_PKPixelFormat12bppYCC420 = external dso_local constant %struct._GUID, align 4
@GUID_PKPixelFormat16bppYCC422 = external dso_local constant %struct._GUID, align 4
@__const.PKImageEncode_Transcode.enPFFrom = external hidden unnamed_addr constant %struct._GUID, align 4
@__const.PKImageEncode_Transcode.enPFTo = external hidden unnamed_addr constant %struct._GUID, align 4

; Function Attrs: nounwind uwtable
declare dso_local i64 @PKAllocAligned(ptr noundef, i64 noundef, i64 noundef) #0

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

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

; Function Attrs: nounwind uwtable
declare dso_local i64 @PKFreeAligned(ptr noundef) #0

; Function Attrs: nounwind uwtable
declare dso_local i64 @PixelFormatLookup(ptr noundef, i8 noundef zeroext) #0

; Function Attrs: nounwind willreturn memory(read)
declare i32 @memcmp(ptr noundef, ptr noundef, i64 noundef) #2

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #3

; Function Attrs: nounwind uwtable
define dso_local i64 @PKImageEncode_Transcode(ptr noundef %0, ptr noundef %1, ptr noundef %2) #0 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i64, align 8
  %8 = alloca %struct._GUID, align 4
  %9 = alloca %struct._GUID, align 4
  %10 = alloca %struct.tagPKPixelInfo, align 8
  %11 = alloca %struct.tagPKPixelInfo, align 8
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca ptr, align 8
  %16 = alloca %struct.tagCWMTranscodingParam, align 8
  store ptr %0, ptr %4, align 8, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !5
  store ptr %2, ptr %6, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #5
  store i64 0, ptr %7, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 16, ptr %8) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %8, ptr align 4 @__const.PKImageEncode_Transcode.enPFFrom, i64 16, i1 false)
  call void @llvm.lifetime.start.p0(i64 16, ptr %9) #5
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %9, ptr align 4 @__const.PKImageEncode_Transcode.enPFTo, i64 16, i1 false)
  call void @llvm.lifetime.start.p0(i64 56, ptr %10) #5
  call void @llvm.lifetime.start.p0(i64 56, ptr %11) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  store i32 0, ptr %12, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  store i32 0, ptr %13, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  store i32 0, ptr %14, align 4, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #5
  store ptr null, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 56, ptr %16) #5
  call void @llvm.memset.p0.i64(ptr align 8 %16, i8 0, i64 56, i1 false)
  %17 = load ptr, ptr %5, align 8, !tbaa !5
  %18 = getelementptr inbounds %struct.tagPKFormatConverter, ptr %17, i32 0, i32 3
  %19 = load ptr, ptr %18, align 8, !tbaa !13
  %20 = load ptr, ptr %5, align 8, !tbaa !5
  %21 = call i64 %19(ptr noundef %20, ptr noundef %8)
  store i64 %21, ptr %7, align 8, !tbaa !9
  %22 = icmp slt i64 %21, 0
  br i1 %22, label %23, label %25

23:                                               ; preds = %3
  %24 = load i64, ptr %7, align 8, !tbaa !9
  store i64 %24, ptr %7, align 8, !tbaa !9
  br label %270

25:                                               ; preds = %3
  %26 = load i64, ptr %7, align 8, !tbaa !9
  store i64 %26, ptr %7, align 8, !tbaa !9
  br label %27

27:                                               ; preds = %25
  %28 = load ptr, ptr %5, align 8, !tbaa !5
  %29 = getelementptr inbounds %struct.tagPKFormatConverter, ptr %28, i32 0, i32 2
  %30 = load ptr, ptr %29, align 8, !tbaa !17
  %31 = load ptr, ptr %5, align 8, !tbaa !5
  %32 = call i64 %30(ptr noundef %31, ptr noundef %9)
  store i64 %32, ptr %7, align 8, !tbaa !9
  %33 = icmp slt i64 %32, 0
  br i1 %33, label %34, label %36

34:                                               ; preds = %27
  %35 = load i64, ptr %7, align 8, !tbaa !9
  store i64 %35, ptr %7, align 8, !tbaa !9
  br label %270

36:                                               ; preds = %27
  %37 = load i64, ptr %7, align 8, !tbaa !9
  store i64 %37, ptr %7, align 8, !tbaa !9
  br label %38

38:                                               ; preds = %36
  %39 = load ptr, ptr %4, align 8, !tbaa !5
  %40 = getelementptr inbounds %struct.tagPKImageEncode, ptr %39, i32 0, i32 17
  %41 = call i32 @memcmp(ptr noundef %40, ptr noundef %9, i64 noundef 16) #6
  %42 = icmp ne i32 %41, 0
  %43 = xor i1 %42, true
  %44 = xor i1 %43, true
  %45 = zext i1 %44 to i64
  %46 = select i1 %44, i32 -106, i32 0
  %47 = sext i32 %46 to i64
  store i64 %47, ptr %7, align 8, !tbaa !9
  %48 = icmp slt i64 %47, 0
  br i1 %48, label %49, label %51

49:                                               ; preds = %38
  %50 = load i64, ptr %7, align 8, !tbaa !9
  store i64 %50, ptr %7, align 8, !tbaa !9
  br label %270

51:                                               ; preds = %38
  %52 = load i64, ptr %7, align 8, !tbaa !9
  store i64 %52, ptr %7, align 8, !tbaa !9
  br label %53

53:                                               ; preds = %51
  %54 = getelementptr inbounds %struct.tagPKPixelInfo, ptr %10, i32 0, i32 0
  store ptr %8, ptr %54, align 8, !tbaa !18
  %55 = call i64 @PixelFormatLookup(ptr noundef %10, i8 noundef zeroext 0)
  %56 = getelementptr inbounds %struct.tagPKPixelInfo, ptr %11, i32 0, i32 0
  store ptr %9, ptr %56, align 8, !tbaa !18
  %57 = call i64 @PixelFormatLookup(ptr noundef %11, i8 noundef zeroext 0)
  %58 = getelementptr inbounds %struct.tagPKPixelInfo, ptr %10, i32 0, i32 3
  %59 = load i32, ptr %58, align 4, !tbaa !20
  %60 = icmp eq i32 0, %59
  br i1 %60, label %61, label %70

61:                                               ; preds = %53
  %62 = getelementptr inbounds %struct.tagPKPixelInfo, ptr %10, i32 0, i32 4
  %63 = load i32, ptr %62, align 8, !tbaa !21
  %64 = load ptr, ptr %6, align 8, !tbaa !5
  %65 = getelementptr inbounds %struct.tagPKRect, ptr %64, i32 0, i32 2
  %66 = load i32, ptr %65, align 4, !tbaa !22
  %67 = mul i32 %63, %66
  %68 = add i32 %67, 7
  %69 = lshr i32 %68, 3
  br label %79

70:                                               ; preds = %53
  %71 = getelementptr inbounds %struct.tagPKPixelInfo, ptr %10, i32 0, i32 4
  %72 = load i32, ptr %71, align 8, !tbaa !21
  %73 = add i32 %72, 7
  %74 = lshr i32 %73, 3
  %75 = load ptr, ptr %6, align 8, !tbaa !5
  %76 = getelementptr inbounds %struct.tagPKRect, ptr %75, i32 0, i32 2
  %77 = load i32, ptr %76, align 4, !tbaa !22
  %78 = mul i32 %74, %77
  br label %79

79:                                               ; preds = %70, %61
  %80 = phi i32 [ %69, %61 ], [ %78, %70 ]
  store i32 %80, ptr %13, align 4, !tbaa !11
  %81 = getelementptr inbounds %struct.tagPKPixelInfo, ptr %10, i32 0, i32 0
  %82 = load ptr, ptr %81, align 8, !tbaa !18
  %83 = icmp eq ptr @GUID_PKPixelFormat12bppYCC420, %82
  br i1 %83, label %88, label %84

84:                                               ; preds = %79
  %85 = getelementptr inbounds %struct.tagPKPixelInfo, ptr %10, i32 0, i32 0
  %86 = load ptr, ptr %85, align 8, !tbaa !18
  %87 = icmp eq ptr @GUID_PKPixelFormat16bppYCC422, %86
  br i1 %87, label %88, label %91

88:                                               ; preds = %84, %79
  %89 = load i32, ptr %13, align 4, !tbaa !11
  %90 = lshr i32 %89, 1
  store i32 %90, ptr %13, align 4, !tbaa !11
  br label %91

91:                                               ; preds = %88, %84
  %92 = getelementptr inbounds %struct.tagPKPixelInfo, ptr %11, i32 0, i32 3
  %93 = load i32, ptr %92, align 4, !tbaa !20
  %94 = icmp eq i32 0, %93
  br i1 %94, label %95, label %104

95:                                               ; preds = %91
  %96 = getelementptr inbounds %struct.tagPKPixelInfo, ptr %11, i32 0, i32 4
  %97 = load i32, ptr %96, align 8, !tbaa !21
  %98 = load ptr, ptr %4, align 8, !tbaa !5
  %99 = getelementptr inbounds %struct.tagPKImageEncode, ptr %98, i32 0, i32 18
  %100 = load i32, ptr %99, align 8, !tbaa !24
  %101 = mul i32 %97, %100
  %102 = add i32 %101, 7
  %103 = lshr i32 %102, 3
  br label %113

104:                                              ; preds = %91
  %105 = getelementptr inbounds %struct.tagPKPixelInfo, ptr %11, i32 0, i32 4
  %106 = load i32, ptr %105, align 8, !tbaa !21
  %107 = add i32 %106, 7
  %108 = lshr i32 %107, 3
  %109 = load ptr, ptr %4, align 8, !tbaa !5
  %110 = getelementptr inbounds %struct.tagPKImageEncode, ptr %109, i32 0, i32 18
  %111 = load i32, ptr %110, align 8, !tbaa !24
  %112 = mul i32 %108, %111
  br label %113

113:                                              ; preds = %104, %95
  %114 = phi i32 [ %103, %95 ], [ %112, %104 ]
  store i32 %114, ptr %12, align 4, !tbaa !11
  %115 = getelementptr inbounds %struct.tagPKPixelInfo, ptr %11, i32 0, i32 0
  %116 = load ptr, ptr %115, align 8, !tbaa !18
  %117 = icmp eq ptr @GUID_PKPixelFormat12bppYCC420, %116
  br i1 %117, label %122, label %118

118:                                              ; preds = %113
  %119 = getelementptr inbounds %struct.tagPKPixelInfo, ptr %11, i32 0, i32 0
  %120 = load ptr, ptr %119, align 8, !tbaa !18
  %121 = icmp eq ptr @GUID_PKPixelFormat16bppYCC422, %120
  br i1 %121, label %122, label %125

122:                                              ; preds = %118, %113
  %123 = load i32, ptr %12, align 4, !tbaa !11
  %124 = lshr i32 %123, 1
  store i32 %124, ptr %12, align 4, !tbaa !11
  br label %125

125:                                              ; preds = %122, %118
  %126 = load i32, ptr %13, align 4, !tbaa !11
  %127 = load i32, ptr %12, align 4, !tbaa !11
  %128 = icmp ugt i32 %126, %127
  br i1 %128, label %129, label %131

129:                                              ; preds = %125
  %130 = load i32, ptr %13, align 4, !tbaa !11
  br label %133

131:                                              ; preds = %125
  %132 = load i32, ptr %12, align 4, !tbaa !11
  br label %133

133:                                              ; preds = %131, %129
  %134 = phi i32 [ %130, %129 ], [ %132, %131 ]
  store i32 %134, ptr %14, align 4, !tbaa !11
  %135 = load ptr, ptr %4, align 8, !tbaa !5
  %136 = getelementptr inbounds %struct.tagPKImageEncode, ptr %135, i32 0, i32 40
  %137 = load i32, ptr %136, align 8, !tbaa !33
  %138 = icmp ne i32 %137, 0
  br i1 %138, label %139, label %225

139:                                              ; preds = %133
  %140 = load ptr, ptr %5, align 8, !tbaa !5
  %141 = getelementptr inbounds %struct.tagPKFormatConverter, ptr %140, i32 0, i32 9
  %142 = load ptr, ptr %141, align 8, !tbaa !34
  %143 = getelementptr inbounds %struct.tagPKImageDecode, ptr %142, i32 0, i32 21
  %144 = getelementptr inbounds %struct.anon, ptr %143, i32 0, i32 1
  %145 = getelementptr inbounds %struct.tagCWMImageInfo, ptr %144, i32 0, i32 9
  %146 = load i64, ptr %145, align 8, !tbaa !35
  %147 = getelementptr inbounds %struct.tagCWMTranscodingParam, ptr %16, i32 0, i32 0
  store i64 %146, ptr %147, align 8, !tbaa !38
  %148 = load ptr, ptr %5, align 8, !tbaa !5
  %149 = getelementptr inbounds %struct.tagPKFormatConverter, ptr %148, i32 0, i32 9
  %150 = load ptr, ptr %149, align 8, !tbaa !34
  %151 = getelementptr inbounds %struct.tagPKImageDecode, ptr %150, i32 0, i32 21
  %152 = getelementptr inbounds %struct.anon, ptr %151, i32 0, i32 1
  %153 = getelementptr inbounds %struct.tagCWMImageInfo, ptr %152, i32 0, i32 11
  %154 = load i64, ptr %153, align 8, !tbaa !40
  %155 = getelementptr inbounds %struct.tagCWMTranscodingParam, ptr %16, i32 0, i32 2
  store i64 %154, ptr %155, align 8, !tbaa !41
  %156 = load ptr, ptr %5, align 8, !tbaa !5
  %157 = getelementptr inbounds %struct.tagPKFormatConverter, ptr %156, i32 0, i32 9
  %158 = load ptr, ptr %157, align 8, !tbaa !34
  %159 = getelementptr inbounds %struct.tagPKImageDecode, ptr %158, i32 0, i32 21
  %160 = getelementptr inbounds %struct.anon, ptr %159, i32 0, i32 1
  %161 = getelementptr inbounds %struct.tagCWMImageInfo, ptr %160, i32 0, i32 10
  %162 = load i64, ptr %161, align 8, !tbaa !42
  %163 = getelementptr inbounds %struct.tagCWMTranscodingParam, ptr %16, i32 0, i32 1
  store i64 %162, ptr %163, align 8, !tbaa !43
  %164 = load ptr, ptr %5, align 8, !tbaa !5
  %165 = getelementptr inbounds %struct.tagPKFormatConverter, ptr %164, i32 0, i32 9
  %166 = load ptr, ptr %165, align 8, !tbaa !34
  %167 = getelementptr inbounds %struct.tagPKImageDecode, ptr %166, i32 0, i32 21
  %168 = getelementptr inbounds %struct.anon, ptr %167, i32 0, i32 1
  %169 = getelementptr inbounds %struct.tagCWMImageInfo, ptr %168, i32 0, i32 12
  %170 = load i64, ptr %169, align 8, !tbaa !44
  %171 = getelementptr inbounds %struct.tagCWMTranscodingParam, ptr %16, i32 0, i32 3
  store i64 %170, ptr %171, align 8, !tbaa !45
  %172 = load ptr, ptr %5, align 8, !tbaa !5
  %173 = getelementptr inbounds %struct.tagPKFormatConverter, ptr %172, i32 0, i32 9
  %174 = load ptr, ptr %173, align 8, !tbaa !34
  %175 = getelementptr inbounds %struct.tagPKImageDecode, ptr %174, i32 0, i32 21
  %176 = getelementptr inbounds %struct.anon, ptr %175, i32 0, i32 1
  %177 = getelementptr inbounds %struct.tagCWMImageInfo, ptr %176, i32 0, i32 16
  %178 = load i32, ptr %177, align 8, !tbaa !46
  %179 = getelementptr inbounds %struct.tagCWMTranscodingParam, ptr %16, i32 0, i32 7
  store i32 %178, ptr %179, align 4, !tbaa !47
  %180 = load ptr, ptr %5, align 8, !tbaa !5
  %181 = getelementptr inbounds %struct.tagPKFormatConverter, ptr %180, i32 0, i32 9
  %182 = load ptr, ptr %181, align 8, !tbaa !34
  %183 = getelementptr inbounds %struct.tagPKImageDecode, ptr %182, i32 0, i32 21
  %184 = getelementptr inbounds %struct.anon, ptr %183, i32 0, i32 2
  %185 = getelementptr inbounds %struct.tagCWMIStrCodecParam, ptr %184, i32 0, i32 16
  %186 = load i8, ptr %185, align 8, !tbaa !48
  %187 = getelementptr inbounds %struct.tagCWMTranscodingParam, ptr %16, i32 0, i32 5
  store i8 %186, ptr %187, align 4, !tbaa !49
  %188 = load ptr, ptr %5, align 8, !tbaa !5
  %189 = getelementptr inbounds %struct.tagPKFormatConverter, ptr %188, i32 0, i32 9
  %190 = load ptr, ptr %189, align 8, !tbaa !34
  %191 = getelementptr inbounds %struct.tagPKImageDecode, ptr %190, i32 0, i32 21
  %192 = getelementptr inbounds %struct.anon, ptr %191, i32 0, i32 2
  %193 = getelementptr inbounds %struct.tagCWMIStrCodecParam, ptr %192, i32 0, i32 14
  %194 = load i32, ptr %193, align 4, !tbaa !50
  %195 = getelementptr inbounds %struct.tagCWMTranscodingParam, ptr %16, i32 0, i32 4
  store i32 %194, ptr %195, align 8, !tbaa !51
  %196 = load ptr, ptr %5, align 8, !tbaa !5
  %197 = getelementptr inbounds %struct.tagPKFormatConverter, ptr %196, i32 0, i32 9
  %198 = load ptr, ptr %197, align 8, !tbaa !34
  %199 = getelementptr inbounds %struct.tagPKImageDecode, ptr %198, i32 0, i32 21
  %200 = getelementptr inbounds %struct.anon, ptr %199, i32 0, i32 2
  %201 = getelementptr inbounds %struct.tagCWMIStrCodecParam, ptr %200, i32 0, i32 17
  %202 = load i32, ptr %201, align 4, !tbaa !52
  %203 = getelementptr inbounds %struct.tagCWMTranscodingParam, ptr %16, i32 0, i32 6
  store i32 %202, ptr %203, align 8, !tbaa !53
  %204 = load ptr, ptr %5, align 8, !tbaa !5
  %205 = getelementptr inbounds %struct.tagPKFormatConverter, ptr %204, i32 0, i32 9
  %206 = load ptr, ptr %205, align 8, !tbaa !34
  %207 = getelementptr inbounds %struct.tagPKImageDecode, ptr %206, i32 0, i32 21
  %208 = getelementptr inbounds %struct.anon, ptr %207, i32 0, i32 12
  %209 = load i32, ptr %208, align 8, !tbaa !54
  %210 = getelementptr inbounds %struct.tagCWMTranscodingParam, ptr %16, i32 0, i32 8
  store i32 %209, ptr %210, align 8, !tbaa !55
  %211 = load ptr, ptr %4, align 8, !tbaa !5
  %212 = getelementptr inbounds %struct.tagPKImageEncode, ptr %211, i32 0, i32 12
  %213 = load ptr, ptr %212, align 8, !tbaa !56
  %214 = load ptr, ptr %4, align 8, !tbaa !5
  %215 = load ptr, ptr %5, align 8, !tbaa !5
  %216 = getelementptr inbounds %struct.tagPKFormatConverter, ptr %215, i32 0, i32 9
  %217 = load ptr, ptr %216, align 8, !tbaa !34
  %218 = call i64 %213(ptr noundef %214, ptr noundef %217, ptr noundef %16)
  store i64 %218, ptr %7, align 8, !tbaa !9
  %219 = icmp slt i64 %218, 0
  br i1 %219, label %220, label %222

220:                                              ; preds = %139
  %221 = load i64, ptr %7, align 8, !tbaa !9
  store i64 %221, ptr %7, align 8, !tbaa !9
  br label %270

222:                                              ; preds = %139
  %223 = load i64, ptr %7, align 8, !tbaa !9
  store i64 %223, ptr %7, align 8, !tbaa !9
  br label %224

224:                                              ; preds = %222
  br label %269

225:                                              ; preds = %133
  %226 = load i32, ptr %14, align 4, !tbaa !11
  %227 = load ptr, ptr %6, align 8, !tbaa !5
  %228 = getelementptr inbounds %struct.tagPKRect, ptr %227, i32 0, i32 3
  %229 = load i32, ptr %228, align 4, !tbaa !57
  %230 = mul i32 %226, %229
  %231 = zext i32 %230 to i64
  %232 = call i64 @PKAllocAligned(ptr noundef %15, i64 noundef %231, i64 noundef 128)
  store i64 %232, ptr %7, align 8, !tbaa !9
  %233 = icmp slt i64 %232, 0
  br i1 %233, label %234, label %236

234:                                              ; preds = %225
  %235 = load i64, ptr %7, align 8, !tbaa !9
  store i64 %235, ptr %7, align 8, !tbaa !9
  br label %270

236:                                              ; preds = %225
  %237 = load i64, ptr %7, align 8, !tbaa !9
  store i64 %237, ptr %7, align 8, !tbaa !9
  br label %238

238:                                              ; preds = %236
  %239 = load ptr, ptr %5, align 8, !tbaa !5
  %240 = getelementptr inbounds %struct.tagPKFormatConverter, ptr %239, i32 0, i32 6
  %241 = load ptr, ptr %240, align 8, !tbaa !58
  %242 = load ptr, ptr %5, align 8, !tbaa !5
  %243 = load ptr, ptr %6, align 8, !tbaa !5
  %244 = load ptr, ptr %15, align 8, !tbaa !5
  %245 = load i32, ptr %14, align 4, !tbaa !11
  %246 = call i64 %241(ptr noundef %242, ptr noundef %243, ptr noundef %244, i32 noundef %245)
  store i64 %246, ptr %7, align 8, !tbaa !9
  %247 = icmp slt i64 %246, 0
  br i1 %247, label %248, label %250

248:                                              ; preds = %238
  %249 = load i64, ptr %7, align 8, !tbaa !9
  store i64 %249, ptr %7, align 8, !tbaa !9
  br label %270

250:                                              ; preds = %238
  %251 = load i64, ptr %7, align 8, !tbaa !9
  store i64 %251, ptr %7, align 8, !tbaa !9
  br label %252

252:                                              ; preds = %250
  %253 = load ptr, ptr %4, align 8, !tbaa !5
  %254 = getelementptr inbounds %struct.tagPKImageEncode, ptr %253, i32 0, i32 7
  %255 = load ptr, ptr %254, align 8, !tbaa !59
  %256 = load ptr, ptr %4, align 8, !tbaa !5
  %257 = load ptr, ptr %6, align 8, !tbaa !5
  %258 = getelementptr inbounds %struct.tagPKRect, ptr %257, i32 0, i32 3
  %259 = load i32, ptr %258, align 4, !tbaa !57
  %260 = load ptr, ptr %15, align 8, !tbaa !5
  %261 = load i32, ptr %14, align 4, !tbaa !11
  %262 = call i64 %255(ptr noundef %256, i32 noundef %259, ptr noundef %260, i32 noundef %261)
  store i64 %262, ptr %7, align 8, !tbaa !9
  %263 = icmp slt i64 %262, 0
  br i1 %263, label %264, label %266

264:                                              ; preds = %252
  %265 = load i64, ptr %7, align 8, !tbaa !9
  store i64 %265, ptr %7, align 8, !tbaa !9
  br label %270

266:                                              ; preds = %252
  %267 = load i64, ptr %7, align 8, !tbaa !9
  store i64 %267, ptr %7, align 8, !tbaa !9
  br label %268

268:                                              ; preds = %266
  br label %269

269:                                              ; preds = %268, %224
  br label %270

270:                                              ; preds = %269, %264, %248, %234, %220, %49, %34, %23
  %271 = call i64 @PKFreeAligned(ptr noundef %15)
  %272 = load i64, ptr %7, align 8, !tbaa !9
  call void @llvm.lifetime.end.p0(i64 56, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  call void @llvm.lifetime.end.p0(i64 56, ptr %11) #5
  call void @llvm.lifetime.end.p0(i64 56, ptr %10) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %9) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #5
  ret i64 %272
}

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #4

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 = { nounwind willreturn memory(read) "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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #5 = { nounwind }
attributes #6 = { nounwind willreturn memory(read) }

!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, !10, i64 0}
!10 = !{!"long", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"int", !7, i64 0}
!13 = !{!14, !6, i64 24}
!14 = !{!"tagPKFormatConverter", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !15, i64 80}
!15 = !{!"_GUID", !12, i64 0, !16, i64 4, !16, i64 6, !7, i64 8}
!16 = !{!"short", !7, i64 0}
!17 = !{!14, !6, i64 16}
!18 = !{!19, !6, i64 0}
!19 = !{!"tagPKPixelInfo", !6, i64 0, !10, i64 8, !12, i64 16, !12, i64 20, !12, i64 24, !10, i64 32, !12, i64 40, !12, i64 44, !12, i64 48, !12, i64 52}
!20 = !{!19, !12, i64 20}
!21 = !{!19, !12, i64 24}
!22 = !{!23, !12, i64 8}
!23 = !{!"tagPKRect", !12, i64 0, !12, i64 4, !12, i64 8, !12, i64 12}
!24 = !{!25, !12, i64 152}
!25 = !{!"tagPKImageEncode", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !6, i64 120, !10, i64 128, !15, i64 136, !12, i64 152, !12, i64 156, !12, i64 160, !26, i64 164, !26, i64 168, !12, i64 172, !12, i64 176, !10, i64 184, !10, i64 192, !6, i64 200, !12, i64 208, !6, i64 216, !12, i64 224, !6, i64 232, !12, i64 240, !6, i64 248, !12, i64 256, !6, i64 264, !12, i64 272, !6, i64 280, !12, i64 288, !27, i64 296, !12, i64 520, !29, i64 528}
!26 = !{!"float", !7, i64 0}
!27 = !{!"DESCRIPTIVEMETADATA", !28, i64 0, !28, i64 16, !28, i64 32, !28, i64 48, !28, i64 64, !28, i64 80, !28, i64 96, !28, i64 112, !28, i64 128, !28, i64 144, !28, i64 160, !28, i64 176, !28, i64 192, !28, i64 208}
!28 = !{!"DPKPROPVARIANT", !12, i64 0, !7, i64 8}
!29 = !{!"", !30, i64 0, !31, i64 88, !32, i64 208, !6, i64 33088, !31, i64 33096, !32, i64 33216, !6, i64 66096, !12, i64 66104, !10, i64 66112, !10, i64 66120, !10, i64 66128, !10, i64 66136, !12, i64 66144, !12, i64 66148, !6, i64 66152}
!30 = !{!"tagWmpDEMisc", !12, i64 0, !12, i64 4, !12, i64 8, !12, i64 12, !12, i64 16, !12, i64 20, !12, i64 24, !12, i64 28, !12, i64 32, !12, i64 36, !12, i64 40, !12, i64 44, !12, i64 48, !12, i64 52, !12, i64 56, !12, i64 60, !12, i64 64, !12, i64 68, !12, i64 72, !12, i64 76, !12, i64 80, !12, i64 84}
!31 = !{!"tagCWMImageInfo", !10, i64 0, !10, i64 8, !12, i64 16, !12, i64 20, !10, i64 24, !10, i64 32, !12, i64 40, !7, i64 44, !7, i64 45, !10, i64 48, !10, i64 56, !10, i64 64, !10, i64 72, !12, i64 80, !10, i64 88, !10, i64 96, !12, i64 104, !7, i64 108, !12, i64 112}
!32 = !{!"tagCWMIStrCodecParam", !12, i64 0, !7, i64 4, !7, i64 5, !7, i64 6, !7, i64 7, !7, i64 8, !7, i64 9, !7, i64 10, !7, i64 11, !7, i64 12, !7, i64 13, !12, i64 16, !12, i64 20, !12, i64 24, !12, i64 28, !10, i64 32, !7, i64 40, !12, i64 44, !7, i64 48, !6, i64 56, !10, i64 64, !12, i64 72, !7, i64 76, !12, i64 16460, !7, i64 16464, !7, i64 32848, !7, i64 32849, !12, i64 32852, !12, i64 32856, !12, i64 32860, !12, i64 32864, !12, i64 32868, !12, i64 32872}
!33 = !{!25, !12, i64 520}
!34 = !{!14, !6, i64 72}
!35 = !{!36, !10, i64 288}
!36 = !{!"tagPKImageDecode", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !12, i64 96, !10, i64 104, !15, i64 112, !12, i64 128, !12, i64 132, !12, i64 136, !26, i64 140, !26, i64 144, !12, i64 148, !37, i64 152}
!37 = !{!"", !30, i64 0, !31, i64 88, !32, i64 208, !6, i64 33088, !31, i64 33096, !32, i64 33216, !6, i64 66096, !12, i64 66104, !10, i64 66112, !10, i64 66120, !10, i64 66128, !10, i64 66136, !12, i64 66144, !10, i64 66152, !10, i64 66160, !10, i64 66168, !10, i64 66176, !10, i64 66184, !12, i64 66192, !12, i64 66196, !12, i64 66200, !27, i64 66208}
!38 = !{!39, !10, i64 0}
!39 = !{!"tagCWMTranscodingParam", !10, i64 0, !10, i64 8, !10, i64 16, !10, i64 24, !12, i64 32, !7, i64 36, !12, i64 40, !12, i64 44, !12, i64 48}
!40 = !{!36, !10, i64 304}
!41 = !{!39, !10, i64 16}
!42 = !{!36, !10, i64 296}
!43 = !{!39, !10, i64 8}
!44 = !{!36, !10, i64 312}
!45 = !{!39, !10, i64 24}
!46 = !{!36, !12, i64 344}
!47 = !{!39, !12, i64 44}
!48 = !{!36, !7, i64 400}
!49 = !{!39, !7, i64 36}
!50 = !{!36, !12, i64 388}
!51 = !{!39, !12, i64 32}
!52 = !{!36, !12, i64 404}
!53 = !{!39, !12, i64 40}
!54 = !{!36, !12, i64 66296}
!55 = !{!39, !12, i64 48}
!56 = !{!25, !6, i64 96}
!57 = !{!23, !12, i64 12}
!58 = !{!14, !6, i64 48}
!59 = !{!25, !6, i64 56}


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

%struct._GUID = type { i32, i16, i16, [8 x i8] }
%struct.tagPKPixelInfo = type { ptr, i64, i32, i32, i32, i64, i32, i32, i32, i32 }
%struct.tagCWMTranscodingParam = type { i64, i64, i64, i64, i32, i8, i32, i32, i32 }

@GUID_PKPixelFormat12bppYCC420 = external dso_local constant %struct._GUID, align 4
@GUID_PKPixelFormat16bppYCC422 = external dso_local constant %struct._GUID, align 4
@__const.PKImageEncode_Transcode.enPFFrom = external hidden unnamed_addr constant %struct._GUID, align 4
@__const.PKImageEncode_Transcode.enPFTo = external hidden unnamed_addr constant %struct._GUID, align 4

; Function Attrs: nounwind uwtable
declare dso_local i64 @PKAllocAligned(ptr noundef, i64 noundef, i64 noundef) local_unnamed_addr #0

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

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

; Function Attrs: nounwind uwtable
declare dso_local i64 @PKFreeAligned(ptr noundef) local_unnamed_addr #0

; Function Attrs: nounwind uwtable
declare dso_local i64 @PixelFormatLookup(ptr noundef, i8 noundef zeroext) local_unnamed_addr #0

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #2

; Function Attrs: nounwind uwtable
define dso_local i64 @PKImageEncode_Transcode(ptr noundef %0, ptr noundef %1, ptr noundef %2) local_unnamed_addr #0 {
  %4 = alloca %struct._GUID, align 4
  %5 = alloca %struct._GUID, align 4
  %6 = alloca %struct.tagPKPixelInfo, align 8
  %7 = alloca %struct.tagPKPixelInfo, align 8
  %8 = alloca ptr, align 8
  %9 = alloca %struct.tagCWMTranscodingParam, align 16
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #6
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(16) %4, ptr noundef nonnull align 4 dereferenceable(16) @__const.PKImageEncode_Transcode.enPFFrom, i64 16, i1 false)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %5) #6
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(16) %5, ptr noundef nonnull align 4 dereferenceable(16) @__const.PKImageEncode_Transcode.enPFTo, i64 16, i1 false)
  call void @llvm.lifetime.start.p0(i64 56, ptr nonnull %6) #6
  call void @llvm.lifetime.start.p0(i64 56, ptr nonnull %7) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #6
  store ptr null, ptr %8, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 56, ptr nonnull %9) #6
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(56) %9, i8 0, i64 56, i1 false)
  %10 = getelementptr inbounds i8, ptr %1, i64 24
  %11 = load ptr, ptr %10, align 8, !tbaa !9
  %12 = call i64 %11(ptr noundef %1, ptr noundef nonnull %4) #6
  %13 = icmp slt i64 %12, 0
  br i1 %13, label %118, label %14

14:                                               ; preds = %3
  %15 = getelementptr inbounds i8, ptr %1, i64 16
  %16 = load ptr, ptr %15, align 8, !tbaa !14
  %17 = call i64 %16(ptr noundef nonnull %1, ptr noundef nonnull %5) #6
  %18 = icmp slt i64 %17, 0
  br i1 %18, label %118, label %19

19:                                               ; preds = %14
  %20 = getelementptr inbounds i8, ptr %0, i64 136
  %bcmp = call i32 @bcmp(ptr noundef nonnull dereferenceable(16) %20, ptr noundef nonnull dereferenceable(16) %5, i64 16)
  %.not = icmp eq i32 %bcmp, 0
  br i1 %.not, label %21, label %118

21:                                               ; preds = %19
  store ptr %4, ptr %6, align 8, !tbaa !15
  %22 = call i64 @PixelFormatLookup(ptr noundef nonnull %6, i8 noundef zeroext 0)
  store ptr %5, ptr %7, align 8, !tbaa !15
  %23 = call i64 @PixelFormatLookup(ptr noundef nonnull %7, i8 noundef zeroext 0)
  %24 = getelementptr inbounds i8, ptr %6, i64 20
  %25 = load i32, ptr %24, align 4, !tbaa !18
  %26 = icmp eq i32 %25, 0
  %27 = getelementptr inbounds i8, ptr %6, i64 24
  %28 = load i32, ptr %27, align 8, !tbaa !19
  br i1 %26, label %29, label %35

29:                                               ; preds = %21
  %30 = getelementptr inbounds i8, ptr %2, i64 8
  %31 = load i32, ptr %30, align 4, !tbaa !20
  %32 = mul i32 %31, %28
  %33 = add i32 %32, 7
  %34 = lshr i32 %33, 3
  br label %41

35:                                               ; preds = %21
  %36 = add i32 %28, 7
  %37 = lshr i32 %36, 3
  %38 = getelementptr inbounds i8, ptr %2, i64 8
  %39 = load i32, ptr %38, align 4, !tbaa !20
  %40 = mul i32 %37, %39
  br label %41

41:                                               ; preds = %35, %29
  %42 = phi i32 [ %34, %29 ], [ %40, %35 ]
  %43 = load ptr, ptr %6, align 8
  %44 = icmp eq ptr %43, @GUID_PKPixelFormat12bppYCC420
  %45 = icmp eq ptr %43, @GUID_PKPixelFormat16bppYCC422
  %or.cond = or i1 %44, %45
  %46 = zext i1 %or.cond to i32
  %spec.select = lshr i32 %42, %46
  %47 = getelementptr inbounds i8, ptr %7, i64 20
  %48 = load i32, ptr %47, align 4, !tbaa !18
  %49 = icmp eq i32 %48, 0
  %50 = getelementptr inbounds i8, ptr %7, i64 24
  %51 = load i32, ptr %50, align 8, !tbaa !19
  br i1 %49, label %52, label %58

52:                                               ; preds = %41
  %53 = getelementptr inbounds i8, ptr %0, i64 152
  %54 = load i32, ptr %53, align 8, !tbaa !22
  %55 = mul i32 %54, %51
  %56 = add i32 %55, 7
  %57 = lshr i32 %56, 3
  br label %64

58:                                               ; preds = %41
  %59 = add i32 %51, 7
  %60 = lshr i32 %59, 3
  %61 = getelementptr inbounds i8, ptr %0, i64 152
  %62 = load i32, ptr %61, align 8, !tbaa !22
  %63 = mul i32 %60, %62
  br label %64

64:                                               ; preds = %58, %52
  %65 = phi i32 [ %57, %52 ], [ %63, %58 ]
  %66 = load ptr, ptr %7, align 8
  %67 = icmp eq ptr %66, @GUID_PKPixelFormat12bppYCC420
  %68 = icmp eq ptr %66, @GUID_PKPixelFormat16bppYCC422
  %or.cond5 = or i1 %67, %68
  %69 = zext i1 %or.cond5 to i32
  %spec.select67 = lshr i32 %65, %69
  %70 = call i32 @llvm.umax.i32(i32 %spec.select, i32 %spec.select67)
  %71 = getelementptr inbounds i8, ptr %0, i64 520
  %72 = load i32, ptr %71, align 8, !tbaa !31
  %.not66 = icmp eq i32 %72, 0
  br i1 %.not66, label %99, label %73

73:                                               ; preds = %64
  %74 = getelementptr inbounds i8, ptr %1, i64 72
  %75 = load ptr, ptr %74, align 8, !tbaa !32
  %76 = getelementptr inbounds i8, ptr %75, i64 288
  %77 = getelementptr inbounds i8, ptr %75, i64 304
  %78 = getelementptr inbounds i8, ptr %9, i64 16
  %79 = load <2 x i64>, ptr %76, align 8, !tbaa !33
  store <2 x i64> %79, ptr %9, align 16, !tbaa !33
  %80 = load <2 x i64>, ptr %77, align 8, !tbaa !33
  store <2 x i64> %80, ptr %78, align 16, !tbaa !33
  %81 = getelementptr inbounds i8, ptr %75, i64 344
  %82 = load i32, ptr %81, align 8, !tbaa !34
  %83 = getelementptr inbounds i8, ptr %9, i64 44
  store i32 %82, ptr %83, align 4, !tbaa !37
  %84 = getelementptr inbounds i8, ptr %75, i64 400
  %85 = load i8, ptr %84, align 8, !tbaa !39
  %86 = getelementptr inbounds i8, ptr %9, i64 36
  store i8 %85, ptr %86, align 4, !tbaa !40
  %87 = getelementptr inbounds i8, ptr %75, i64 388
  %88 = load i32, ptr %87, align 4, !tbaa !41
  %89 = getelementptr inbounds i8, ptr %9, i64 32
  store i32 %88, ptr %89, align 16, !tbaa !42
  %90 = getelementptr inbounds i8, ptr %75, i64 404
  %91 = load i32, ptr %90, align 4, !tbaa !43
  %92 = getelementptr inbounds i8, ptr %9, i64 40
  store i32 %91, ptr %92, align 8, !tbaa !44
  %93 = getelementptr inbounds i8, ptr %75, i64 66296
  %94 = load i32, ptr %93, align 8, !tbaa !45
  %95 = getelementptr inbounds i8, ptr %9, i64 48
  store i32 %94, ptr %95, align 16, !tbaa !46
  %96 = getelementptr inbounds i8, ptr %0, i64 96
  %97 = load ptr, ptr %96, align 8, !tbaa !47
  %98 = call i64 %97(ptr noundef nonnull %0, ptr noundef %75, ptr noundef nonnull %9) #6
  br label %118

99:                                               ; preds = %64
  %100 = getelementptr inbounds i8, ptr %2, i64 12
  %101 = load i32, ptr %100, align 4, !tbaa !48
  %102 = mul i32 %101, %70
  %103 = zext i32 %102 to i64
  %104 = call i64 @PKAllocAligned(ptr noundef nonnull %8, i64 noundef %103, i64 noundef 128)
  %105 = icmp slt i64 %104, 0
  br i1 %105, label %118, label %106

106:                                              ; preds = %99
  %107 = getelementptr inbounds i8, ptr %1, i64 48
  %108 = load ptr, ptr %107, align 8, !tbaa !49
  %109 = load ptr, ptr %8, align 8, !tbaa !5
  %110 = call i64 %108(ptr noundef nonnull %1, ptr noundef nonnull %2, ptr noundef %109, i32 noundef %70) #6
  %111 = icmp slt i64 %110, 0
  br i1 %111, label %118, label %112

112:                                              ; preds = %106
  %113 = getelementptr inbounds i8, ptr %0, i64 56
  %114 = load ptr, ptr %113, align 8, !tbaa !50
  %115 = load i32, ptr %100, align 4, !tbaa !48
  %116 = load ptr, ptr %8, align 8, !tbaa !5
  %117 = call i64 %114(ptr noundef nonnull %0, i32 noundef %115, ptr noundef %116, i32 noundef %70) #6
  br label %118

118:                                              ; preds = %112, %106, %99, %73, %19, %14, %3
  %.058 = phi i64 [ %12, %3 ], [ %17, %14 ], [ -106, %19 ], [ %98, %73 ], [ %104, %99 ], [ %110, %106 ], [ %117, %112 ]
  %119 = call i64 @PKFreeAligned(ptr noundef nonnull %8)
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #6
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %7) #6
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %5) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #6
  ret i64 %.058
}

; Function Attrs: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #3

; Function Attrs: nofree nounwind willreturn memory(argmem: read)
declare i32 @bcmp(ptr nocapture, ptr nocapture, i64) local_unnamed_addr #4

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

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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #3 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #4 = { nofree nounwind willreturn memory(argmem: read) }
attributes #5 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #6 = { 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, !6, i64 24}
!10 = !{!"tagPKFormatConverter", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !11, i64 80}
!11 = !{!"_GUID", !12, i64 0, !13, i64 4, !13, i64 6, !7, i64 8}
!12 = !{!"int", !7, i64 0}
!13 = !{!"short", !7, i64 0}
!14 = !{!10, !6, i64 16}
!15 = !{!16, !6, i64 0}
!16 = !{!"tagPKPixelInfo", !6, i64 0, !17, i64 8, !12, i64 16, !12, i64 20, !12, i64 24, !17, i64 32, !12, i64 40, !12, i64 44, !12, i64 48, !12, i64 52}
!17 = !{!"long", !7, i64 0}
!18 = !{!16, !12, i64 20}
!19 = !{!16, !12, i64 24}
!20 = !{!21, !12, i64 8}
!21 = !{!"tagPKRect", !12, i64 0, !12, i64 4, !12, i64 8, !12, i64 12}
!22 = !{!23, !12, i64 152}
!23 = !{!"tagPKImageEncode", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !6, i64 96, !6, i64 104, !6, i64 112, !6, i64 120, !17, i64 128, !11, i64 136, !12, i64 152, !12, i64 156, !12, i64 160, !24, i64 164, !24, i64 168, !12, i64 172, !12, i64 176, !17, i64 184, !17, i64 192, !6, i64 200, !12, i64 208, !6, i64 216, !12, i64 224, !6, i64 232, !12, i64 240, !6, i64 248, !12, i64 256, !6, i64 264, !12, i64 272, !6, i64 280, !12, i64 288, !25, i64 296, !12, i64 520, !27, i64 528}
!24 = !{!"float", !7, i64 0}
!25 = !{!"DESCRIPTIVEMETADATA", !26, i64 0, !26, i64 16, !26, i64 32, !26, i64 48, !26, i64 64, !26, i64 80, !26, i64 96, !26, i64 112, !26, i64 128, !26, i64 144, !26, i64 160, !26, i64 176, !26, i64 192, !26, i64 208}
!26 = !{!"DPKPROPVARIANT", !12, i64 0, !7, i64 8}
!27 = !{!"", !28, i64 0, !29, i64 88, !30, i64 208, !6, i64 33088, !29, i64 33096, !30, i64 33216, !6, i64 66096, !12, i64 66104, !17, i64 66112, !17, i64 66120, !17, i64 66128, !17, i64 66136, !12, i64 66144, !12, i64 66148, !6, i64 66152}
!28 = !{!"tagWmpDEMisc", !12, i64 0, !12, i64 4, !12, i64 8, !12, i64 12, !12, i64 16, !12, i64 20, !12, i64 24, !12, i64 28, !12, i64 32, !12, i64 36, !12, i64 40, !12, i64 44, !12, i64 48, !12, i64 52, !12, i64 56, !12, i64 60, !12, i64 64, !12, i64 68, !12, i64 72, !12, i64 76, !12, i64 80, !12, i64 84}
!29 = !{!"tagCWMImageInfo", !17, i64 0, !17, i64 8, !12, i64 16, !12, i64 20, !17, i64 24, !17, i64 32, !12, i64 40, !7, i64 44, !7, i64 45, !17, i64 48, !17, i64 56, !17, i64 64, !17, i64 72, !12, i64 80, !17, i64 88, !17, i64 96, !12, i64 104, !7, i64 108, !12, i64 112}
!30 = !{!"tagCWMIStrCodecParam", !12, i64 0, !7, i64 4, !7, i64 5, !7, i64 6, !7, i64 7, !7, i64 8, !7, i64 9, !7, i64 10, !7, i64 11, !7, i64 12, !7, i64 13, !12, i64 16, !12, i64 20, !12, i64 24, !12, i64 28, !17, i64 32, !7, i64 40, !12, i64 44, !7, i64 48, !6, i64 56, !17, i64 64, !12, i64 72, !7, i64 76, !12, i64 16460, !7, i64 16464, !7, i64 32848, !7, i64 32849, !12, i64 32852, !12, i64 32856, !12, i64 32860, !12, i64 32864, !12, i64 32868, !12, i64 32872}
!31 = !{!23, !12, i64 520}
!32 = !{!10, !6, i64 72}
!33 = !{!17, !17, i64 0}
!34 = !{!35, !12, i64 344}
!35 = !{!"tagPKImageDecode", !6, i64 0, !6, i64 8, !6, i64 16, !6, i64 24, !6, i64 32, !6, i64 40, !6, i64 48, !6, i64 56, !6, i64 64, !6, i64 72, !6, i64 80, !6, i64 88, !12, i64 96, !17, i64 104, !11, i64 112, !12, i64 128, !12, i64 132, !12, i64 136, !24, i64 140, !24, i64 144, !12, i64 148, !36, i64 152}
!36 = !{!"", !28, i64 0, !29, i64 88, !30, i64 208, !6, i64 33088, !29, i64 33096, !30, i64 33216, !6, i64 66096, !12, i64 66104, !17, i64 66112, !17, i64 66120, !17, i64 66128, !17, i64 66136, !12, i64 66144, !17, i64 66152, !17, i64 66160, !17, i64 66168, !17, i64 66176, !17, i64 66184, !12, i64 66192, !12, i64 66196, !12, i64 66200, !25, i64 66208}
!37 = !{!38, !12, i64 44}
!38 = !{!"tagCWMTranscodingParam", !17, i64 0, !17, i64 8, !17, i64 16, !17, i64 24, !12, i64 32, !7, i64 36, !12, i64 40, !12, i64 44, !12, i64 48}
!39 = !{!35, !7, i64 400}
!40 = !{!38, !7, i64 36}
!41 = !{!35, !12, i64 388}
!42 = !{!38, !12, i64 32}
!43 = !{!35, !12, i64 404}
!44 = !{!38, !12, i64 40}
!45 = !{!35, !12, i64 66296}
!46 = !{!38, !12, i64 48}
!47 = !{!23, !6, i64 96}
!48 = !{!21, !12, i64 12}
!49 = !{!10, !6, i64 48}
!50 = !{!23, !6, i64 56}


; Effective O3 passes: CorrelatedValuePropagationPass,EarlyCSEPass,GlobalOptPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,ReassociatePass,SLPVectorizerPass,SROAPass,SimplifyCFGPass